R_PPC64_ENTRY
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
7ef8ae7c
VR
12015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
2
3 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
4 Local_got_entry_key for searching in local_got_offsets_.
5 * object.h (class Local_got_entry_key): New class.
6 (Relobj::local_has_got_offset): New overloaded method.
7 (Relobj::local_got_offset): Likewise.
8 (Relobj::set_local_got_offset): Likewise.
9 (Relobj::do_local_has_got_offset): Add addend argument.
10 (Relobj::do_local_got_offset): Likewise.
11 (Relobj::do_set_local_got_offset): Likewise.
12 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
13 Local_got_entry_key for searching through local_got_offsets_.
14 (Sized_relobj::do_local_got_offset): Likewise.
15 (Sized_relobj::do_set_local_got_offset): Likewise.
16 (Sized_relobj::Local_got_offsets): Change type of the key from
17 unsigned int to Local_got_entry_key, and add hash and equal_to.
18 * output.cc (Got_entry::write): Take addend into account for
19 calculating value of the local symbol for GOT.
20 (Output_data_got::add_local): New definition of overloaded method.
21 (Output_data_got::add_local_with_rel): Likewise.
22 (Output_data_got::add_local_pair_with_rel): Likewise.
23 * output.h (Output_data_got::add_local): New declaration of overloaded
24 method.
25
74b03b91
CC
262015-11-25 Cary Coutant <ccoutant@gmail.com>
27
28 PR gold/19291
29 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
30 subtract section address from symbol value.
31
751e4d66
AM
322015-11-25 Alan Modra <amodra@gmail.com>
33
34 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
35 to 256 byte boundary.
36
32d849b3
AM
372015-11-19 Alan Modra <amodra@gmail.com>
38
39 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
40 GOT16 and TOC16 relocs to RELATIVE_REF.
41
db1ff028
CC
422015-11-14 Cary Coutant <ccoutant@gmail.com>
43
44 PR gold/19244
45 PR gold/18548
46 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
47 local symbols only for predefined symbols.
48
a680de9a
PB
492015-11-11 Alan Modra <amodra@gmail.com>
50 Peter Bergner <bergner@vnet.ibm.com>
51
52 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
53 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
54 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
55 (Target_powerpc::Scan::global): Likewise.
56 (Target_powerpc::Relocate::relocate): Likewise.
57
cc203475
VR
582015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
59
60 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
61 sections.
62
859d7987
CC
632015-11-09 Cary Coutant <ccoutant@gmail.com>
64 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
65
66 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
67 with type, offset, addend.
68 (Copy_relocs::save): Likewise.
69 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
70 (Copy_relocs::save): Likewise.
71 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
72 and r_addend to Copy_relocs::copy_reloc.
73 * arm.cc (Target_arm::copy_reloc): Likewise.
74 * i386.cc (Target_i386::copy_reloc): Likewise.
75 * mips.cc (Target_mips::copy_reloc): Likewise.
76 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
77 * s390.cc (Target_s390::copy_reloc): Likewise.
78 * sparc.cc (Target_sparc::copy_reloc): Likewise.
79 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
80 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
81
96f9814d
CC
822015-11-05 Cary Coutant <ccoutant@gmail.com>
83
84 PR gold/19119
85 PR gold/19172
86 PR gold/19197
87 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
88 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
89 * options.h (General_options): Remove "obsolete" from -m.
90 * parameters.cc (set_parameters_target): Check if input target
91 is compatible with output emulation set by "-m emulation".
92
0eccf19f
CC
932015-11-05 Cary Coutant <ccoutant@gmail.com>
94
95 PR gold/19163
96 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
97 certain relocations if --no-apply-dynamic-relocs is set.
98 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
99
c1e7d6a8
AM
1002015-11-03 Alan Modra <amodra@gmail.com>
101
102 * po/POTFILES.in: Regenerate.
103
26f187cd
NC
1042015-10-30 Nick Clifton <nickc@redhat.com>
105
106 * po/zh_CN.po: New (simplified) Chinese translation.
107
41e83f2b
L
1082015-10-29 H.J. Lu <hongjiu.lu@intel.com>
109
110 PR gold/19184
111 * incremental.cc (Got_plt_view_info): Add got_entry_size.
112 (Local_got_offset_visitor::visit): Replace got_entry_size_
113 with info_.got_entry_size.
114 (Local_got_offset_visitor::got_entry_size_): Removed.
115 (Global_got_offset_visitor::visit): Replace got_entry_size_
116 with info_.got_entry_size.
117 (Global_got_offset_visitor::got_entry_size_): Removed.
118 (Output_section_incremental_inputs::write_got_plt): Initialize
119 view_info.got_entry_size.
120 * target.h (Sized_target::got_entry_size): New virtual function.
121 * x86_64.cc (Target_x86_64::got_entry_size): New function.
122
238830c6
MK
1232015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
124
125 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
126 * testsuite/script_test_12a.c: Likewise.
127 * testsuite/script_test_1a.cc: Likewise.
128 * testsuite/script_test_2.cc: Likewise.
129
bd890911
MK
1302015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
131
132 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
133
a817ff49
MK
1342015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
135
136 PR gold/18959
137 * stringpool.cc (Stringpool_template::new_key_offset): Align all
138 strings, even zero-length.
139 (Stringpool_template::set_string_offsets): Likewise.
140
e79a4bad
MK
1412015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
142
143 * s390.cc: New file.
144 * Makefile.am (TARGETSOURCES): Add s390.cc.
145 (ALL_TARGETOBJS): Add s390.o.
146 * Makefile.in: Regenerate.
147 * configure.ac: Add s390 support.
148 * configure: Regenerate.
149 * configure.tgt: Add s390-*-* and s390x-*-*.
150 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
151 support.
152
6f97897d
MK
1532015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
154
155 * archive.cc (Archive::sym64name): New const.
156 (Archive::setup): Add support for SYM64 armap.
157 (Archive::read_armap): Likewise.
158 (Archive::interpret_header): Likewise.
159 (Archive::const_iterator::read_next_header): Likewise.
160 * archive.h (Archive::sym64name): New const.
161 (Archive::read_armap): Add mapsize template parameter.
162
8d9743bd
MK
1632015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
164
165 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
166 target-specific entry size.
167 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
168 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
169 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
170 hash_entry_size.
171 * target.h (Target::hash_entry_size): New method.
172 (Target::Target_info::hash_entry_size): New data member.
173
174 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
175 * arm.cc (Target_arm::arm_info): Likewise.
176 (Target_arm_nacl::arm_nacl_info): Likewise.
177 * i386.cc (Target_i386::i386_info): Likewise.
178 (Target_i386_nacl::i386_nacl_info): Likewise.
179 (Target_iamcu::iamcu_info): Likewise.
180 * mips.cc (Target_mips::mips_info): Likewise.
181 (Target_mips_nacl::mips_nacl_info): Likewise.
182 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
183 * sparc.cc (Target_sparc::sparc_info): Likewise.
184 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
185 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
186 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
187 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
188
3043c1ab
L
1892015-10-28 H.J. Lu <hongjiu.lu@intel.com>
190
191 PR gold/19177
192 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
193 and R_386_GOT32X relocations without base register.
194
4d2f5d58
HS
1952015-10.27 Han Shen <shenhan@google.com>
196
197 PR gold/19042 - unsupported reloc 311/312.
198
199 * aarch64.cc (Target_aarch64::Scan::local): Add support for
200 reloc 311/312.
201
2891b491
L
2022015-10-22 H.J. Lu <hongjiu.lu@intel.com>
203
204 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
205 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
206 as R_X86_64_GOTPCREL.
207 (Target_x86_64<size>::Scan::local): Likewise.
208 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
209 Likewise.
210 (Target_x86_64<size>::Scan::global): Likewise.
211 (Target_x86_64<size>::Relocate::relocate): Likewise.
212 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
213 Likewise.
214
493d4b48
L
2152015-10-22 H.J. Lu <hongjiu.lu@intel.com>
216
217 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
218 R_386_GOT32X the same as R_386_GOT32.
219 (Target_i386::Scan::local): Likewise.
220 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
221 (Target_i386::Scan::global): Likewise.
222 (Target_i386::Relocate::relocate): Likewise.
223 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
224 Likewise.
225
0fd15345
L
2262015-10-20 H.J. Lu <hongjiu.lu@intel.com>
227
228 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
229 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
230 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
231 x86_64_mov_to_lea1.o.
232 * testsuite/Makefile.in: Regenerated.
233
64571972
L
2342015-10-16 H.J. Lu <hongjiu.lu@intel.com>
235
236 PR gold/19119
237 * options.h (General_options): Remove "obsolete" from -m.
238 * parameters.cc (set_parameters_target): Check if input target
239 is compatible with output emulation set by "-m emulation".
240
01f573ad
L
2412015-10-13 H.J. Lu <hongjiu.lu@intel.com>
242
243 PR gold/19118
244 * i386.cc (Target_iamcu): New class.
245 (Target_selector_iamcu): Likewise.
246 (Target_iamcu::iamcu_info): New variable.
247 (target_selector_iamcu): Likewise.
248
3b0357da
AS
2492015-10-07 Andreas Schwab <schwab@suse.de>
250
251 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
252
9eacb935
CC
2532015-10-06 Cary Coutant <ccoutant@gmail.com>
254
255 PR gold/18855
256 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
257 parameter.
258 (Sparc_relocate_functions::gdop_lox10): Likewise.
259 (Target_sparc::Relocate::relocate): Use addend when computing
260 symbol value for R_SPARC_GOTDATA_OP*.
261
3d4fde69
CC
2622015-09-07 Cary Coutant <ccoutant@gmail.com>
263
264 PR gold/18930
265 PR gold/18886
266 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
267 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
268
358de988
L
2692015-09-02 H.J. Lu <hongjiu.lu@intel.com>
270
271 PR gold/18886
272 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
273 shared libraries into normal FUNC symbols.
274 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
275 symbols aren't from shared libraries.
276
d49044c7
AM
2772015-09-02 Alan Modra <amodra@gmail.com>
278
279 PR 18878
280 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
281 (Target_powerpc::Branch_info::make_stub): Determine whether long
282 branch stub is for save/restore function.
283 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
284 (Stub_table): Add need_save_res_.
285 (Stub_table:clear_stubs): Clear need_save_res_.
286 (Stub_table:set_address_and_size): Add save/restore section size.
287 (Stub_table::add_long_branch_entry): Add save_res param. Set
288 need_save_res_, but don't add space for save/restore stubs.
289 (Stub_table::find_long_branch_entry): Return offset to local copy
290 of save/restore func.
291 (Stub_table::do_write): Don't output save/restore stubs. Instead
292 copy the save/restore functions.
293 (Output_data_save_res:contents): New accessor.
294 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
295
7c61d651
CC
2962015-08-25 Cary Coutant <ccoutant@gmail.com>
297
298 PR gold/18847
299 * script-sections.cc (Memory_region::set_address): New method.
300 (Script_sections::find_memory_region): Add explicit_only parameter.
301 (Output_section_definition::set_section_addresses): Handle case where
302 script specifies both address and vma region.
303 * script-sections.h (Script_sections::find_memory_region): Add
304 explicit_only parameter.
305
4bfacfd3
CC
3062015-08-25 Cary Coutant <ccoutant@gmail.com>
307
308 PR gold/18859
309 * object.cc (Input_objects::add_object): Store objects in a map,
310 indexed by soname; update as-needed flag when necessary.
311 * object.h (Object::clear_as_needed): New method.
312 (Input_objects::so_names_): Change from set to map.
313
1757d35c
CC
3142015-08-25 Cary Coutant <ccoutant@gmail.com>
315
316 PR gold/14746
317 * expression.cc (Expression::Expression_eval_info): Add
318 is_valid_pointer field.
319 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
320 Adjust all callers.
321 (Addr_expression::value_from_output_section): Check whether address
322 is valid.
323 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
324 if evaluation failed due to address that is not yet valid.
325 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
326 parameter.
327
3ac0a36c
CC
3282015-08-25 Cary Coutant <ccoutant@gmail.com>
329
330 PR gold/18866
331 PR gold/18703
332 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
333
9215b98b
AM
3342015-08-20 Alan Modra <amodra@gmail.com>
335
336 PR gold/18846
337 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
338 Subtract os->address() from addend.
339 * powerpc.cc (relocate_relocs): Likewise.
340
40fc1451
SD
3412015-08-12 Simon Dardis <simon.dardis@imgtec.com>
342
343 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
344 lazy_stub_normal_1, lazy_stub_normal_1_n64,
345 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
346 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
347 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
348 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
349 of 'addu/daddu'.
350
37a42ee9
L
3512015-07-27 H.J. Lu <hongjiu.lu@intel.com>
352
353 * configure: Regenerated.
354
ab3b14b0
DK
3552015-07-26 Doug Kwan <dougkwan@google.com>
356
357 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
358 disassembler output format.
359
cdb06167
HS
3602015-07-23 Ian Coolidge <icoolidge@google.com>
361 Plumb --pic-veneer option for gold.
362
363 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
364 generation.
365 * options.h (General_options): Add --pic-veneer option.
366
5b2af7dd
L
3672015-07-22 H.J. Lu <hongjiu.lu@intel.com>
368
369 PR gold/18663
370 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
371 script_test_1a.cc script_test_1b.cc.
372 (script_test_11_r.o): Replace script_test_11.o with
373 script_test_11a.o script_test_11b.o.
374 (script_test_11.o): Removed.
375 (script_test_11a.o): New.
376 (script_test_11b.o): Likewise.
377 * testsuite/Makefile.in: Regenerated.
378 * testsuite/script_test_1.h: New file.
379 * testsuite/script_test_1b.cc: Likewise.
380 * testsuite/script_test_11.h: Likewise.
381 * testsuite/script_test_11b.c: Likewise.
382 * testsuite/script_test_1.cc: Renamed to ...
383 * testsuite/script_test_1a.cc: This.
384 Include "script_test_1.h".
385 (main): Call check_int and check_ptr.
386 * testsuite/script_test_11.c: Renamed to ...
387 * testsuite/script_test_11a.c: This.
388 Include "script_test_11.h".
389 (main): Call ptr_equal.
390
cd78ea77
L
3912015-07-22 H.J. Lu <hongjiu.lu@intel.com>
392
393 PR gold/18628
394 * testsuite/ifuncdep2.c (global): Change protected to hidden.
395 * testsuite/ifuncmod1.c (global): Likewise.
396 * testsuite/ifuncmod5.c (global): Likewise.
397
f945ba50
AM
3982015-07-22 Alan Modra <amodra@gmail.com>
399
400 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
401
5417c94d
CC
4022015-07-21 Cary Coutant <ccoutant@gmail.com>
403
404 PR gold/18548
405 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
406 forced local symbol even when oldsym != NULL.
407 (Symbol_table::do_define_in_output_segment): Likewise.
408 (Symbol_table::do_define_as_constant): Likewise.
409
cb5cf5e2
CC
4102015-07-21 Cary Coutant <ccoutant@gmail.com>
411
b8c6c5ef 412 PR gold/18698
cb5cf5e2
CC
413 * archive.cc (Library_base::should_include_member): Don't use entry
414 point for relocatable links, or if target is not yet valid.
415 * parameters.cc (Parameters::entry): Check target_valid().
416
0ef3814f
HS
4172015-07-20 Han Shen <shenhan@google.com>
418
419 Optimize erratum 843419 fix.
420
421 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
422 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
423 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
424 (E843419_stub): New sub-class of Erratum_stub.
425 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
426 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
427 (AArch64_relobj::create_erratum_stub): Add 1 argument.
428 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
429
2bca0377
HS
4302015-07-20 Han Shen <shenhan@google.com>
431
432 Fix arm elf header flags wrt hardfp bit.
433
434 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
435
f54f5e31
L
4362015-07-20 H.J. Lu <hongjiu.lu@intel.com>
437
438 PR gold/18689
439 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
440 from input group section for relocatable link.
441 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
442 (check_DATA): Add pr18689.stdout.
443 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
444 (pr18689.stdout): New rule.
445 (pr18689a.o): Likewise.
446 (pr18689b.o): Likewise.
447 (pr18689.o): Likewise.
448 * testsuite/pr18689.c: New file.
449 * testsuite/pr18689.sh: Likewise.
450 * testsuite/Makefile.in: Regenerated.
451
c20ceeb2
YW
4522015-07-20 Yiran Wang <yiran@google.com>
453 Cary Coutant <ccoutant@gmail.com>
454
455 PR gold/15574
456 * resolve.cc (Symbol_table): Remove warning about references
457 from shared objects to hidden symbols.
458 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
459 * testsuite/Makefile.in: Regenerate.
460 * testsuite/hidden_test.sh: Check dynamic symbol table; update
461 expected error messages.
462
19a7fe52
L
4632015-07-14 H.J. Lu <hongjiu.lu@intel.com>
464
465 * compressed_output.cc (Output_compressed_section::set_final_data_size):
466 Make --compress-debug-sections=zlib the same as
467 --compress-debug-sections=zlib-gabi.
468 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
469 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
470 ".zdebug_".
471 * testsuite/Makefile.in: Regenerated.
472
fb8b9dbc
L
4732015-07-12 H.J. Lu <hongjiu.lu@intel.com>
474
475 PR gold/18322
476 * compressed_output.cc (zlib_compress): Add argument for
477 compression header size. Set header size to compression header
478 size if it isn't 0. Don't write out the zlib header here.
479 (Output_compressed_section::set_final_data_size): Support
480 zlib-gnu and zlib-gabi compressions. Pass compression header
481 size to zlib_compress and write out compression header. Set
482 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
483 clear the SHF_COMPRESSED bit
484 * options.h (compress_debug_sections): Add zlib-gnu and
485 zlib-gabi.
486 * output.h (Output_section::set_flags): New.
487 * testsuite/Makefile.am (check_PROGRAMS): Add
488 flagstest_compress_debug_sections_none,
489 flagstest_compress_debug_sections_gnu and
490 flagstest_compress_debug_sections_gabi.
491 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
492 flagstest_compress_debug_sections.stdout,
493 flagstest_compress_debug_sections.cmp,
494 flagstest_compress_debug_sections.check,
495 flagstest_compress_debug_sections_gnu.stdout,
496 flagstest_compress_debug_sections_gnu.cmp,
497 flagstest_compress_debug_sections_gnu.check,
498 flagstest_compress_debug_sections_gabi.stdout,
499 flagstest_compress_debug_sections_gabi.cmp and
500 flagstest_compress_debug_sections_gabi.check.
501 (flagstest_compress_debug_sections_none): New.
502 (flagstest_compress_debug_sections_none.stdout): Likewise.
503 (flagstest_compress_debug_sections.stdout): Likewise.
504 (flagstest_compress_debug_sections.check): Likewise.
505 (flagstest_compress_debug_sections.cmp): Likewise.
506 (flagstest_compress_debug_sections_gnu): Likewise.
507 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
508 (flagstest_compress_debug_sections_gnu.check): Likewise.
509 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
510 (flagstest_compress_debug_sections_gabi): Likewise.
511 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
512 (flagstest_compress_debug_sections_gnu.check): Likewise.
513 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
514 * testsuite/Makefile.in: Regenerated.
515
48058663
L
5162015-07-12 H.J. Lu <hongjiu.lu@intel.com>
517
518 PR gold/18321
519 * compressed_output.h (decompress_input_section): Add arguments
520 for ELF class, big endian and sh_flags.
521 * compressed_output.cc (decompress_input_section): Likewise.
522 Support the SHF_COMPRESSED section.
523 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
524 functions.
525 * plugin.h (Pluginobj): Likewise.
526 * layout.cc (Layout::get_output_section_flags): Also clear the
527 SHF_COMPRESSED bit.
528 * object.h (Compressed_section_info): Add flag to store sh_flags.
529 (Object): Add pure virtual elfsize and is_big_endian member
530 functions.
531 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
532 prefix here.
533 (build_compressed_section_map): Check SHF_COMPRESSED for
534 uncompressed size. Store sh_flags in Compressed_section_info.
535 Pass size, big_endian and sh_flags to decompress_input_section.
536 Skip the ".debug"/".zdebug" prefix when passing section name to
537 need_decompressed_section.
538 (Sized_relobj_file<size, big_endian>::do_find_special_section):
539 Don't check ".zdebug_*" sections.
540 (Object::decompressed_section_contents): Pass ELF class, big
541 endian and sh_flags to decompress_input_section.
542 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
543 Likewise.
544 * testsuite/Makefile.am (check_DATA): Add
545 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
546 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
547 gdb_index_test_2_gabi.stdout.
548 (debug_msg_cdebug_gabi.o): New.
549 (odr_violation1_cdebug_gabi.o): Likewise.
550 (odr_violation2_cdebug_gabi.o): Likewise.
551 (debug_msg_cdebug_gabi.err): Likewise.
552 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
553 (gdb_index_test_cdebug_gabi.o): Likewise.
554 (gdb_index_test_2_gabi): Likewise.
555 (gdb_index_test_2_gabi.stdout): Likewise.
556 * testsuite/gdb_index_test_2_gabi.sh: New file.
557 * testsuite/Makefile.in: Regenerated.
558
73854cdd
HS
5592015-07-09 Han Shen <shenhan@google.com>
560
561 Use "gold_info" instead of "gold_warning" for erratum fix.
562
563 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
564 'gold_info'.
565 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
566
61163dfa
HS
5672015-07-09 Han Shen <shenhan@google.com>
568
569 Drop missing symbol warning for arm/aarch64.
570
571 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
572 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
573 symbol warning.
574
b91deca9
HS
5752015-07-07 Han Shen <shenhan@google.com>
576
577 Make gold aarch64 accept long form of mapping symbols.
578
579 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
580 of mapping symbols.
581
15162bef
DK
5822015-06-29 Doug Kwan <dougkwan@google.com>
583
584 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
585 at address expected by test.
586 * testsuite/arm_cortex_a8_b.s: Ditto.
587 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
588 * testsuite/arm_cortex_a8_bl.s: Ditto.
589 * testsuite/arm_cortex_a8_blx.s: Ditto.
590 * testsuite/arm_cortex_a8_local.s: Ditto.
591 * testsuite/arm_fix_v4bx.s: Ditto.
592 * testsuite/arm_unaligned_reloc.s: Ditto.
593 * testsuite/thumb_bl_out_of_range.s: Ditto.
594 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
595 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 596
56b06706
HS
5972015-06-29 Han Shen <shenhan@google.com>
598
599 Patch for erratum 843419 internal error.
600
72f4393d
L
601 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
602 (Erratum_stub::update_erratum_insn): New method.
603 (Stub_table::relocate_stubs): Modified to place relocated insn.
604 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 605
2f0c79aa
HS
6062015-06-12 Han Shen <shenhan@google.com>
607
608 Fix erratum 835769.
609
72f4393d
L
610 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
611 defintion outside class definition.
612 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
613 (AArch64_insn_utilities::aarch64_op31): New member.
614 (AArch64_insn_utilities::aarch64_ra): New member.
615 (AArch64_insn_utilities::aarch64_mac): New member.
616 (AArch64_insn_utilities::aarch64_mlxl): New member.
617 (ST_E_835769): New global enum member.
618 (Stub_table::relocate_stubs): Add 835769 handler.
619 (Stub_template_repertoire::Stub_template_repertoire): Install new
620 stub type.
621 (AArch64_relobj::scan_errata): This func is renamed from
622 scan_erratum_843419.
623 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
624 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
625 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
626 (Target_aarch64::scan_erratum_835769_span): New method.
627 (Target_aarch64::create_erratum_stub): New method.
628 (Target_aarch64::is_erratum_835769_sequence): New method.
629 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
630 code into create_erratum_stub.
631 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 632
5d7908e0
CC
6332015-06-11 Cary Coutant <ccoutant@gmail.com>
634
635 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
636 outside class body.
637 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
638
dd68f8fa
CC
6392015-06-11 Cary Coutant <ccoutant@gmail.com>
640
641 PR gold/17731
642 * layout.cc (corresponding_uncompressed_section_name): New function.
643 (Layout::choose_output_section): Call it.
644 * layout.h (corresponding_uncompressed_section_name): New function.
645 * script-sections.cc (Input_section_info::set_section_name): Check
646 for compressed debug section (.zdebug style).
647
a3a0c391
JY
6482015-06-11 Jing Yu <jingyu@google.com>
649
650 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
651 * testsuite/Makefile.in: Regenerate.
652
970cdef2
DI
6532015-06-11 Davide Italiano <dccitaliano@gmail.com>
654
655 * gold.h (is_cident): Correct typo.
656
a48d0c12
HS
6572015-06-10 Han Shen <shenhan@google.com>
658 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
659
660 Now fixing for 843419 is fully functional.
661
662 The first part of the erratum fix CL is here -
663 https://sourceware.org/ml/binutils/2015-04/msg00229.html
664
665 * aarch64.cc(global enum): New constants representing stub types.
666 (Stub_template): New POD struct.
667 (Stub_template_repertoire): New class.
668 (Stub_base): New class.
669 (Erratum_stub): New class.
670 (Reloc_stub): Refactored to be a subclass of Stub_base.
671 (Reloc_stub::Stub_type): Removed.
672 (Reloc_stub::offset): Moved to Stub_base.
673 (Reloc_stub::set_offset): Moved to Stub_base.
674 (Reloc_stub::destination_address): Moved to Stub_base.
675 (Reloc_stub::set_destination_address): Moved to Stub_base.
676 (Reloc_stub::reset_destination_address): Moved to Stub_base.
677 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
678 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
679 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
680 (Reloc_stub::write): Moved to Stub_base.
681 (Reloc_stub::invalid_offset): Moved to Stub_base.
682 (Reloc_stub::invalid_address): Moved to Stub_base.
683 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
684 (Reloc_stub::stub_insns_): Moved to Stub_base.
685 (Reloc_stub::offset_): Moved to Stub_base.
686 (Reloc_stub::destination_address_): Moved to Stub_base.
687 (Stub_table::The_aarch64_relobj): New typedef.
688 (Stub_table::The_erratum_stub): New typedef.
689 (Stub_table::The_erratum_stub_less): New typedef.
690 (Stub_table::The_erratum_stub_set): New typedef.
691 (Stub_table::The_erratum_stub_set_iter): New typedef.
692 (Stub_table::empty): Added emptiness testing for erratum stubs.
693 (Stub_table::add_erratum_stub): New method to add an erratum stub.
694 (Stub_table::find_erratum_stub): New method.
695 (Stub_table::find_erratum_stubs_for_input_section): New method.
696 (Stub_table::erratum_stub_address): New method.
697 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
698 (Stub_table::do_addralign): Modified to handle erratum stubs.
699 (Stub_table::erratum_stubs_): New member.
700 (Stub_table::erratum_stub_size_): New member.
701 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
702 (Stub_table::do_write): Modified to handle erratum stubs.
703 (AArch64_relobj::The_erratum_stub): New typedef.
704 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
705 (AArch64_relobj::fix_errata): New method.
706 (Target_aarch64::The_reloc_stub_type): Removed.
707 (Target_aarch64::The_erratum_stub): New typede.
708 (AArch64_relocate_functions::construct_b): New method.
709
1e1b2efc
NC
7102015-06-08 Nick Clifton <nickc@redhat.com>
711
712 * po/fr.po: New French Translation.
713
b8cf5075
CC
7142015-06-07 Cary Coutant <ccoutant@gmail.com>
715
716 PR gold/18288
717 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
718 callers. Don't use STT_COMMON to check for common symbols.
719 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
720 symbol that's not in a common section.
721 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
722 common symbols.
723
bdd2d2b7
CC
7242015-06-04 Cary Coutant <ccoutant@gmail.com>
725
726 PR gold/18200
727 * Makefile.am (diststuff): Add target.
728 * Makefile.in: Regenerate.
729
cd3c333f
CC
7302015-06-04 Cary Coutant <ccoutant@gmail.com>
731
732 PR gold/17498
733 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
734 temporary locals in merge sections.
735 * options.cc (General_options::parse_discard_all): New method.
736 (General_options::parse_discard_locals): New method.
737 (General_options::parse_discard_none): New method.
738 (General_options::General_options): Initialize discard_locals_.
739 * options.h (--discard-all): Convert to special option.
740 (--discard-locals): Likewise.
741 (--discard-none): New option.
742 (General_options::discard_all): New method.
743 (General_options::discard_locals): New method.
744 (General_options::discard_sec_merge): New method.
745 (General_options::Discard_locals): New enum.
746 (General_options::discard_locals_): New data member.
747
8086551f
CC
7482015-06-03 Cary Coutant <cary@google.com>
749
750 * script-sections.cc (Script_sections::Script_sections): Initialize
751 segments_created_.
752 (Script_sections::create_note_and_tls_segments): Set flag when
753 segments are created.
754 (Script_sections::expected_segment_count): Count PT_INTERP.
755 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
756 segments are created.
757 * script-sections.h (Script_sections::segments_created_): New data
758 member.
759
374082df
CC
7602015-06-03 Cary Coutant <ccoutant@gmail.com>
761
762 PR gold/15370
763 * script-sections.cc
764 (Output_section_element_input::set_section_addresses): When there
765 are several patterns with no sort spec, put all sections in the same
766 bin.
767 * testsuite/Makefile.am (script_test_12): New testcase.
768 (script_test_12i): New testcase.
769 * testsuite/Makefile.in: Regenerate.
770 * testsuite/script_test_12.t: New test linker script.
771 * testsuite/script_test_12i.t: New test linker script.
772 * testsuite/script_test_12a.c: New test source file.
773 * testsuite/script_test_12b.c: New test source file.
774
775ed62e
CC
7752015-06-02 Cary Coutant <ccoutant@gmail.com>
776
777 * nacl.h (Sniff_file): Switch parameters to get_view to get an
778 aligned view.
779
9c7fe3c5
CC
7802015-06-03 Cary Coutant <ccoutant@gmail.com>
781
72f4393d
L
782 PR gold/17819
783 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
784 separate task to schedule the build id computation.
785 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
786 add Output_file and offset.
787 (Hash_task::run): Get and release the input views.
788 (Hash_task::is_runnable): Always return NULL (always runnable).
789 (Layout::queue_build_id_tasks): Remove.
790 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
791 parameters; use them instead of class members.
792 (Build_id_task_runner::run): New function.
793 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
794 to write_build_id.
795 * layout.h (Layout::queue_build_id_tasks): Remove.
796 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
797 parameters.
798 (Layout::array_of_hashes_): Remove.
799 (Layout::size_of_array_of_hashes_): Remove.
800 (Layout::input_view_): Remove.
801 (Build_id_task_runner): New class.
802 (Close_task_runner::Close_task_runner): Add array_of_hashes and
803 size_of_hashes parameters.
804 (Close_task_runner::array_of_hashes_): New data member.
805 (Close_task_runner::size_of_hashes_): New data member.
806 * testsuite/Makefile.am
807 (flagstest_compress_debug_sections_and_build_id_tree): New test.
808 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 809
400f8944
RÁE
8102015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
811
812 * merge.cc (get_input_merge_map): Update for data structure change.
813 (get_or_make_input_merge_map): Update for data structure change.
814 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
815 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
816
bbec1a5d
AM
8172015-05-16 Alan Modra <amodra@gmail.com>
818
819 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
820 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
821 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
822 (lis_0): Rename from lis_0_0.
823
efc6fa12
CC
8242015-04-29 Cary Coutant <cary@google.com>
825 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
826
827 * gc.h (Garbage_collection::is_section_garbage): Change Object*
828 to Relobj*.
829 (Garbage_collection::add_reference): Likewise.
830 (Garbage_collection::gc_process_relocs): Likewise. Don't push
831 object/shndx pair onto *secvec for dynamic objects. Don't follow
832 relocations pointing to dynamic objects for GC.
833 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
834 (Icf::unfold_section): Likewise.
835 (Icf::is_section_folded): Likewise.
836 (Icf::get_folded_section): Likewise.
837 * icf.h: (Icf::get_folded_section): Likewise.
838 (Icf::unfold_section): Likewise.
839 (Icf::is_section_folded): Likewise.
840 (Icf::section_has_function_pointers): Likewise.
841 (Icf::set_section_has_function_pointers): Likewise.
842 * object.h (Section_id): Likewise.
843 (Const_section_id): Likewise.
844 * output.cc (Output_section::update_section_layout): Likewise.
845 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
846 Likewise.
847 * plugin.cc (update_section_order): Likewise.
848 (unique_segment_for_sections): Likewise.
849 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
850 (Target_powerpc::do_gc_add_reference): Likewise.
851 (Target_powerpc::gc_process_relocs): Likewise.
852 (Target_powerpc::do_gc_add_reference): Likewise.
853 * symtab.cc (Symbol_table::is_section_folded): Likewise.
854 (Symbol_table::gc_mark_symbol): Likewise.
855 * symtab.h: (Symbol_table::is_section_folded): Likewise.
856 * target.h: (Sized_target::gc_add_reference): Likewise.
857 (Sized_target::do_gc_add_reference): Likewise.
858
f9d3ecaa
NC
8592015-04-29 Nick Clifton <nickc@redhat.com>
860
861 * po/fi.po: Updated Finnish translation.
862
faa2211d
AM
8632015-04-28 Alan Modra <amodra@gmail.com>
864
865 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
866 than unsigned int for find_global_entry result temp. Compare
867 against invalid_address.
868 (Target_powerpc::do_plt_address_for_global): Likewise.
869 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
870 on plt call stub existence for debug info. Do assert for plt
871 and global entry stub existence if an alloc section.
872
6ec65f28
AM
8732015-04-28 Alan Modra <amodra@gmail.com>
874
875 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
876 on missing global entry stub due to bogus debug info.
877
7a2a1c79
HS
8782015-04-27 Han Shen <shenhan@google.com>
879
880 * options.h (--fix-cortex-a53-843419): Rename option.
881 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
882 option.
883 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
884
cfbf0e3c
RÁE
8852015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
886
887 PR gold/18327
888 * output.cc (Output_section::is_input_address_mapped): Assume a missing
889 entry is mapped.
890 * testsuite/Makefile.am: Add the eh_test test.
891 * testsuite/Makefile.in: Regenerate.
892 * testsuite/eh_test_a.cc: New test.
893 * testsuite/eh_test_b.cc: New test.
894
6ec65f28
AM
8952015-04-23 Sriraman Tallam <tmsriram@google.com>
896
a100d66f
ST
897 * options.h (--weak-unresolved-symbols): New option.
898 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
899 binding to weak with new option.
900 * symtab.h (is_weak_undefined): Check for new option.
901 (is_strong_undefined): Check for new option.
902 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
903 * testsuite/Makefile.in: Regenerate.
904 * testsuite/weak_unresolved_symbols_test.cc: New file.
905
4b889c30
IC
9062015-04-20 Ian Coolidge <icoolidge@google.com>
907
908 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
909 GNU_UNIQUE.
910
4277535c
RÁE
9112015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
912
913 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
914 push_back.
915 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
916 * object.cc (Sized_relobj_file::do_layout): Use push_back.
917 * powerpc.cc (process_gc_mark): Use push_back.
918 (Target_powerpc::do_gc_mark_symbol): Use push_back.
919 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
920
7a2a1c79 9212015-04-16 Han Shen <shenhan@google.com>
5019d64a 922
6ec65f28
AM
923 * aarch64.cc (AArch64_insn_utilities): New utility class.
924 (AArch64_relobj::Mapping_symbol_position): New struct.
925 (AArch64_relobj::Mapping_symbol_info): New typedef.
926 (AArch64_relobj::do_count_local_symbols): New function overriding
927 parent's implementation.
928 (AArch64_relobj::mapping_symbol_info_): New member
929 (AArch64_relobj::scan_erratum_843419): New method.
930 (Target_aarch64::scan_erratum_843419_span): New method.
931 (Target_aarch64::is_erratum_843419_sequence): New method.
932 * options.h (fix_cortex_a53): New option.
5019d64a 933
a6a17750
CC
9342015-04-09 Cary Coutant <ccoutant@google.com>
935
936 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
937 in a PIE link.
938 * testsuite/Makefile.am (tls_pie_test.sh): New test.
939 * testsuite/Makefile.in: Regenerate.
940 * testsuite/tls_pie_test.sh: New.
941
437ddf0c
CC
9422015-04-09 Cary Coutant <ccoutant@google.com>
943
944 * debug.h (DEBUG_LOCATION): New.
945 (DEBUG_ALL): Include DEBUG_LOCATION.
946 (debug_string_to_enum): Add DEBUG_LOCATION.
947 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
948 output to print correct context.
949 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
950 up to 4 more locations at the beginning of the function.
951 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
952 result before sorting list of line numbers.
953 * testsuite/debug_msg.sh: Allow range of line numbers for
954 canonical results on optimized code.
955
24491327
HS
9562015-04-07 HC Yen <hc.yen@mediatek.com>
957
958 Add AArch32 support for gold linker.
959 gold/
960 * arm.cc: Add V8 arch combine table.
961
7fa5525f
RÁE
9622015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
963
964 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
965
5368dcf2
RÁE
9662015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
967
968 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
969 to find by using the return value of insert.
970
9dbb4b02
RÁE
9712015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
972
973 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
974 constructor call.
975
1fa29f10
IT
9762015-04-06 Ilya Tocar <ilya.tocar@intel.com>
977
978 PR gold/17641
979 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
980 (Target_x86_64::Scan::local): Don't create GOT entry, when we
981 can convert mov to lea.
982 (Target_x86_64::Scan::global): Ditto.
983 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
984 %reg to lea foo(%rip), %reg if possible.
985 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
986 * testsuite/x86_64_mov_to_lea1.s: New.
987 * testsuite/x86_64_mov_to_lea2.s: Ditto.
988 * testsuite/x86_64_mov_to_lea3.s: Ditto.
989 * testsuite/x86_64_mov_to_lea4.s: Ditto.
990 * testsuite/x86_64_mov_to_lea.sh: Ditto.
991
39f3de7c
L
9922015-04-02 H.J. Lu <hongjiu.lu@intel.com>
993
994 * configure: Regenerated.
995
c4fc4724
IT
9962015-04-01 Ilya Tocar <ilya.tocar@intel.com>
997
998 PR gold/17640
999 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1000 (Target_i386::Scan::local): Don't create GOT entry, when we
1001 can convert GOT to GOTOFF.
1002 (Target_i386::Scan::global): Ditto.
1003 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1004 lea foo@GOTOFF(%reg), %reg if possible.
1005 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1006 * testsuite/i386_mov_to_lea1.s: New.
1007 * testsuite/i386_mov_to_lea2.s: Ditto.
1008 * testsuite/i386_mov_to_lea3.s: Ditto.
1009 * testsuite/i386_mov_to_lea4.s: Ditto.
1010 * testsuite/i386_mov_to_lea5.s: Ditto.
1011 * testsuite/i386_mov_to_lea.sh: Ditto.
1012
918357b9
L
10132015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1014
1015 * Makefile.am (ZLIB): New.
1016 (ZLIBINC): Likewise.
1017 (AM_CFLAGS): Add $(ZLIBINC).
1018 (AM_CXXFLAGS): Likewise.
1019 (ldadd_varldadd_var): Add $(ZLIB).
1020 (incremental_dump_LDADD): Likewise.
1021 (dwp_LDADD): Likewise.
1022 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1023 <zlib.h>.
1024 (zlib_compress): Don't check HAVE_ZLIB_H.
1025 (zlib_decompress): Likewise.
1026 * options.h (compress_debug_sections): Likewise.
1027 * configure.ac (AM_CONDITIONAL): Removed.
1028 * testsuite/Makefile.am (ZLIB): New.
1029 (LDADD): Add $(ZLIB).
1030 Don't check HAVE_ZLIB.
1031 * Makefile.in: Regenerated.
1032 * config.in: Likewise.
1033 * configure: Likewise.
1034 * testsuite/Makefile.in: Likewise.
1035
6b0ad2eb
JY
10362015-03-30 Jing Yu <jingyu@google.com>
1037
1038 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1039 TLSLD_ADD_DTPREL_LO12_NC.
1040 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1041 _TLS_MODULE_BASE_ point to the start of tls segment.
1042 (Target_aarch64::optimize_tls_reloc): Add cases for
1043 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1044 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1045 (Target_aarch64::Scan::local): Likewise.
1046 (Target_aarch64::Scan::global): Likewise.
1047 (Target_aarch64::Relocate::relocate): Likewise.
1048 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1049 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1050 relocations.
1051
0916f9e7
RÁE
10522015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1053
1054 * merge.cc (Object_merge_map::add_mapping): call
1055 Object_merge_map::Input_merge_map::add_mapping.
1056 (Object_merge_map::Input_merge_map::add_mapping): New.
1057 (Output_merge_data::do_add_input_section): Call
1058 get_or_make_input_merge_map before a loop.
1059 (Output_merge_string<Char_type>::finalize_merged_data): Call
1060 get_or_make_input_merge_map before a loop.
1061 * merge.h (Object_merge_map): Make Input_merge_map public.
1062 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1063 (Relobj::get_or_create_merge_map): New.
1064 * object.h (Relobj::get_or_create_merge_map): New.
1065
282c9750
AM
10662015-03-24 Alan Modra <amodra@gmail.com>
1067
1068 PR 18147
1069 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1070 relocation errors for branches to strong undefined symbols.
1071
67f95b96
RÁE
10722015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1073
1074 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1075 (Object_merge_map::is_merge_section_for): Remove.
1076 (Object_merge_map::find_merge_section): New.
1077 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1078 (Object_merge_map::find_merge_section): New.
1079 (Object_merge_map::get_input_merge_map): Add a const version.
1080 * object.cc (Relobj::is_merge_section_for): Remove.
1081 (Relobj::find_merge_section): New.
1082 * object.h (Relobj::is_merge_section_for): Remove.
1083 (Relobj::find_merge_section): New.
1084 * output.cc
1085 (Output_section::Input_section::is_merge_section_for): Remove.
1086 (Output_section::add_merge_input_section): Don't call
1087 add_merge_input_section.
1088 (Output_section::find_merge_section): Return const. Use
1089 object->find_merge_section.
1090 (Output_section::build_lookup_maps): Don't build a map for
1091 merge sections.
1092 (Output_section::is_input_address_mapped): Return false if
1093 section is not found.
1094 (Output_section::find_starting_output_address): Use
1095 find_merge_section instead of is_merge_section_for.
1096 (Output_section::add_script_input_section): Don't build a map for
1097 merge sections.
1098 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1099 (Output_section_lookup_maps::find_merge_section): Remove.
1100 (Output_section_lookup_maps::add_merge_input_section) Remove.
1101 (Output_section::find_merge_section): Return const.
1102
152f7024
CC
11032015-03-22 Cary Coutant <cary@google.com>
1104
1105 PR gold/18106
1106 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1107 non-SIB form of lea, with nop after the call.
1108
bccffdfd
CC
11092015-03-21 Cary Coutant <cary@google.com>
1110
1111 PR gold/14217
1112 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1113 .tdata section.
1114 (Output_segment::set_section_addresses): Don't align size of relro
1115 segment for .tbss.
1116
1c582fe7
CC
11172015-03-21 Cary Coutant <cary@google.com>
1118
1119 PR gold/18010
1120 * stringpool.cc (Stringpool_template): Don't optimize if section
1121 alignment is greater than sizeof(char).
1122
410da591
CC
11232015-03-21 Cary Coutant <cary@google.com>
1124
1125 PR gold/18048
1126 * script-c.h (script_include_directive): Add first_token parameter.
1127 * script.cc (script_include_directive): Add first_token parameter, and
1128 pass it to read_script_file.
1129 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1130 (PARSING_MEMORY_DEF): New tokens.
1131 (top): Add new productions for INCLUDE files.
1132 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1133 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1134 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1135 (section_cmd): Pass PARSING_SECTION_CMDS.
1136 (file_or_sections_cmd): Remove.
1137 (memory_def): Pass PARSING_MEMORY_DEF.
1138 * testsuite/Makefile.am (memory_test_2): New test.
1139 * testsuite/Makefile.in: Regenerate.
1140 * testsuite/memory_test_inc.t: New script file.
1141 * testsuite/memory_test_inc_1.t.src: New script file.
1142 * testsuite/memory_test_inc_2.t.src: New script file.
1143 * testsuite/memory_test_inc_3.t.src: New script file.
1144
0d5bbdb0
CC
11452015-03-21 Cary Coutant <cary@google.com>
1146
1147 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1148 (Sized_relobj_dwo::setup): Build compressed section map.
1149 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1150 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1151 section map.
1152 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1153 compressed_sections_ field.
1154 (build_compressed_section_map): Take Object instead of
1155 Sized_relobj_file parameter; add decompress_if_needed parameter.
1156 (Sized_relobj_file::do_find_special_sections): Store compressed
1157 section map in parent Object.
1158 (Sized_relobj_file::do_decompressed_section_contents): Move
1159 implementation to Object::decompressed_section_contents.
1160 (Sized_relobj_file::do_discard_decompressed_sections): Move
1161 implementation to Object::discard_decompressed_sections.
1162 * object.h (build_compressed_section_map): Declare.
1163 (Object::Object): Add compressed_sections_ field.
1164 (Object::section_is_compressed): Move implementation here.
1165 (Object::decompressed_section_contents): De-virtualize.
1166 (Object::discard_decompressed_sections): De-virtualize.
1167 (Object::do_section_is_compressed): Delete.
1168 (Object::do_decompressed_section_contents): Delete.
1169 (Object::set_compressed_sections): New method.
1170 (Object::compressed_sections): New method.
1171 (Object::compressed_sections_): New data member.
1172 (Compressed_section_info, Compressed_section_map): Move to top of file.
1173 (Sized_relobj_file::do_section_is_compressed): Delete.
1174 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1175 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1176 (Sized_relobj_file::compressed_sections_): Move to Object class.
1177
bd9e0d46
CC
11782015-03-21 Cary Coutant <ccoutant@google.com>
1179
1180 PR gold/18152
1181 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1182 deferred objects.
1183
943c8b43
CC
11842015-03-11 Cary Coutant <ccoutant@google.com>
1185
1186 * options.cc (General_options::finalize): Don't allow -z relro
1187 with incremental linking.
1188 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1189 (incremental_test_2): Likewise.
1190 (incremental_test_3): Likewise.
1191 (incremental_test_4): Likewise.
1192 (incremental_test_5): Likewise.
1193 (incremental_test_6): Likewise.
1194 (incremental_copy_test): Likewise.
1195 (incremental_common_test_1): Likewise.
1196 (incremental_comdat_test_1): Likewise.
1197 * testsuite/Makefile.in: Regenerate.
1198
e1663197
CC
11992015-03-09 Cary Coutant <ccoutant@google.com>
1200
1201 PR gold/14675
1202 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1203 return enum indicating whether .eh_frame section is empty, optimizable,
1204 unrecognized, or an end marker. Adjust explicit instantiations.
1205 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1206 (Eh_frame::add_ehframe_input_section): Change return type.
1207 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1208 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1209 to the .eh_frame output section until we see the end marker.
1210 (Layout::finalize_eh_frame_section): New.
1211 * layout.h: (Layout::finalize_eh_frame_section): New.
1212
beb8418f
L
12132015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1214
1215 * output.cc (Relobj::initialize_input_to_output_map<size>):
1216 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1217
48c73428
CC
12182015-03-04 Cary Coutant <ccoutant@google.com>
1219
1220 * parameters.cc (Parameters::set_target_once): Call
1221 Target::select_as_default_target just once from here...
1222 (set_parameters_target): ...instead of from here.
1223
12242015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1225
1226 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1227 Output_section_data instead of a Merge_map.
1228 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1229 (Eh_frame::read_cie): Use add_merge_mapping instead of
1230 Merge_map::add_mapping.
1231 (Eh_frame::read_fde): Ditto.
1232 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1233 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1234 merge_map_->get_output_offset.
1235 (Eh_frame::do_is_merge_section_for): Delete.
1236 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1237 instead of a Merge_map.
1238 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1239 Merge_map.
1240 (Eh_frame::do_is_merge_section_for): Delete.
1241 (Eh_frame::merge_map_): Delete.
1242 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1243 and use a Output_section_data instead of a Merge_map.
1244 (Object_merge_map::add_mapping): Ditto.
1245 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1246 (Object_merge_map::is_merge_section_for): Pass in and use a
1247 Output_section_data instead of a Merge_map.
1248 (Merge_map): Delete.
1249 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1250 of merge_map_.get_output_offset.
1251 (Output_merge_base::do_is_merge_section_for): Delete.
1252 (Output_merge_data::do_add_input_section): Use
1253 object->add_merge_mapping instead of add_mapping.
1254 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1255 * merge.h (Merge_map): Delete forward declaration.
1256 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1257 instead of a Merge_map.
1258 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1259 (Object_merge_map::is_merge_section_for): Pass in and use a
1260 Output_section_data instead of a Merge_map.
1261 (Input_merge_map::Object_merge_map::merge_map): Replace with
1262 output_data.
1263 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1264 Output_section_data instead of a Merge_map.
1265 (Merge_map): Delete.
1266 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1267 (Output_merge_base::do_is_merge_section_for): Delete.
1268 (Output_merge_base::add_mapping): Delete.
1269 (Output_merge_base::merge_map_): Delete.
1270 * object.cc (Relobj::initialize_input_to_output_map): New.
1271 (Relobj::initialize_input_to_output_map): New.
1272 (Relobj::merge_output_offset): New.
1273 (Relobj::is_merge_section_for): New.
1274 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1275 bits.
1276 * object.h (Relobj::merge_map): Delete.
1277 (initialize_input_to_output_map): New.
1278 (set_merge_map): Delete.
1279 (add_merge_mapping): New.
1280 (merge_output_offset): New.
1281 (is_merge_section_for): New.
1282 * output.cc (Output_section::Input_section::is_merge_section_for):
1283 Use object->is_merge_section_for.
1284 * output.h (Output_section_data::is_merge_section_for): Delete.
1285 (Output_section_data::do_is_merge_section_for): Delete.
1286 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1287 Use object->initialize_input_to_output_map.
1288 (Merged_symbol_value<size>::value_from_output_section): Use
1289 object->merge_output_offset.
1290
48c73428 12912015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1292 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1293
1294 * output.cc (Output_section::add_merge_input_section): Do not
1295 attempt to merge sections with an entsize of 0.
1296
48c73428 12972015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1298
1299 * attributes.h (class Output_attributes_section_data ): Add
1300 do_print_to_mapfile function.
1301
ec86f434
AM
13022015-02-24 Alan Modra <amodra@gmail.com>
1303
1304 PR 18010
1305 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1306 complain if value is not a multiple of four.
1307 (Target_powerpc::Relocate::relocate): Correct handling of
1308 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1309
be66981e
L
13102015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1311
1312 * configure.ac (default_size): Set to 32 for x32.
1313 * configure: Regenerated.
1314
e3ee8ed4
AM
13152015-02-18 Alan Modra <amodra@gmail.com>
1316
1317 PR 17954
1318 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1319 visibility.
1320
3a935c6c
RÁE
13212015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1322
1323 * gc.h (Garbage_collection::add_reference): Don't use find.
1324
e0a1e121
RÁE
13252015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1326
1327 * object.cc (write_local_symbols): avoid std::vector copy.
1328
45a4fb1a
RÁE
13292015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1330
1331 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1332
2d9afefe
MW
13332015-02-09 Mark Wielaard <mjw@redhat.com>
1334
1335 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1336 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1337
e9c1bdad
CC
13382015-02-16 Cary Coutant <ccoutant@google.com>
1339
1340 PR gold/13577
1341 PR gold/16992
1342 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1343 DF_SYMBOLIC if --dynamic-list option is used.
1344 * options.cc (General_options::finalize): --dynamic-list is not
1345 mutually exclusive with -Bsymbolic.
1346 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1347 listed in --dynamic-list.
1348 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1349 -Bsymbolic-functions.
1350 * testsuite/Makefile.in: Regenerate.
1351
0ed4b0bf
CC
13522015-02-16 Cary Coutant <ccoutant@google.com>
1353
1354 PR gold/17971
1355 * incremental.cc: Remove redundant include of "output.h".
1356
1a920511
JY
13572015-02-12 Jing Yu <jingyu@google.com>
1358
1359 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1360 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1361 New relocation.
1362 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1363 TLSLE_MOVW_* relocations.
1364 (Target_aarch64::Scan::global): Likewise.
1365 (Target_aarch64::Relocate::relocate): Likewise.
1366 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1367 for new TLSLE_MOVW_* relocations.
1368
07f107f3
WN
13692015-02-11 Will Newton <will.newton@linaro.org>
1370
1371 PR gold/13321
1372 * arm.cc (Target_arm::make_plt_section): Create an ARM
1373 state mapping symbol at the start of the PLT.
1374
e051a5b5
L
13752015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1376
1377 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1378 Replace two_file_shared_2.so with two_file_shared_1.so.
1379 * testsuite/Makefile.in: Regenerated.
1380
dddcc5b9
AM
13812015-02-09 Alan Modra <amodra@gmail.com>
1382
1383 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1384 plugin_test_thin.a and defsym_test.
1385 * testsuite/Makefile.in: Regenerate.
1386
b39b8b9d
RÁE
13872015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1388
1389 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1390 body.
1391
b66d1c52
CC
13922015-02-04 Peter Collingbourne <pcc@google.com>
1393
1394 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1395 forwarding symbols when computing symbol resolution info for plugins.
1396 * plugin.h (Plugin_manager::symtab): New method.
1397 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1398
23081de0
CC
13992015-02-03 Cary Coutant <ccoutant@google.com>
1400 Peter Collingbourne <pcc@google.com>
1401
1402 PR gold/15660
1403 * archive.cc (Thin_archive_object_unlocker): New class.
1404 (Archive::include_member): Unlock external members of thin archives.
1405 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1406 (plugin_test_2): Likewise.
1407 (plugin_test_3): Likewise.
1408 (plugin_test_4): Likewise.
1409 (plugin_test_5): Likewise.
1410 (plugin_test_6): Likewise.
1411 (plugin_test_7): Likewise.
1412 (plugin_test_8): Likewise.
1413 (plugin_test_9): Likewise.
1414 (plugin_test_10): Likewise.
1415 (plugin_test_11): New test case.
1416 * testsuite/Makefile.in: Regenerate.
1417 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1418 file to decide whether to claim file.
1419 (all_symbols_read_hook): Likewise.
1420 * testsuite/plugin_test_1.sh: Adjust expected output.
1421 * testsuite/plugin_test_2.sh: Likewise.
1422 * testsuite/plugin_test_3.sh: Likewise.
1423 * testsuite/plugin_test_6.sh: Likewise.
1424 * testsuite/plugin_test_tls.sh: Likewise.
1425 * testsuite/plugin_test_11.sh: New testcase.
1426
14272015-02-03 Cary Coutant <ccoutant@google.com>
1428
1429 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1430 file descriptors when debugging enabled. Add debug output.
1431 (Descriptors::release): Add debug output.
1432 (Descriptors::close_some_descriptor): Likewise.
1433 (Descriptors::close_all): Likewise.
1434 * fileread.cc (File_read::lock): Likewise.
1435 (File_read::unlock): Likewise.
1436
24dd5808
CC
14372015-02-02 Cary Coutant <ccoutant@google.com>
1438
1439 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1440 executable output file.
1441
fa89cc82
HS
14422015-01-22 Han Shen <shenhan@google.com>
1443
1444 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1445 (Target_arm::do_plt_address_for_global): New method.
1446 (Target_arm::do_plt_address_for_local): New method.
1447 (Target_arm::rel_irelative_section): New method.
1448 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1449 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1450 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1451 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1452 (Target_arm::Scan::check_non_pic): Add ifunc support.
1453 (Target_arm::Scan::local): Add ifunc support.
1454 (Target_arm::Scan::global): Add ifunc support.
1455 (Target_arm::make_plt_section): New method.
1456 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1457 (Target_arm::make_local_ifunc_plt_entry): New method.
1458 (Target_arm::got_irelative_): New member.
1459 (Target_arm::rel_irelative_): New member.
1460 (Target_arm::got_section): Add creation for got_irelative_.
1461 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1462 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1463 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1464 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1465 (Output_data_plt_arm::IRelative_data): New type.
1466 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1467 (Output_data_plt_arm::add_entry): Add more parameters.
1468 (Output_data_plt_arm::add_relocation): New method.
1469 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1470 (Output_data_plt_arm::rel_irelative): New method.
1471 (Output_data_plt_arm::entry_count): Modified.
1472 (Output_data_plt_arm::address_for_global): New method.
1473 (Output_data_plt_arm::address_for_local): New method.
23081de0 1474gold/
fa89cc82
HS
1475 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1476 (Output_data_plt_arm::insert_irelative_data): New method.
1477 (Output_data_plt_arm::irelative_rel_): New member.
1478 (Output_data_plt_arm::got_): New member.
1479 (Output_data_plt_arm::got_irelative_): New member.
1480 (Output_data_plt_arm::irelative_count_): New member.
1481 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1482 (Output_data_plt_arm::irelative_data_vec_): New member.
1483 (Output_data_plt_arm::do_write): Write out irelative entries.
1484 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1485 more parameters to ctor.
1486 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1487 more parameters to ctor.
1488 * output.h (Output_data_reloc::add_local_relative): New method.
1489 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1490
0f81d3f0
AM
14912015-01-29 Alan Modra <amodra@gmail.com>
1492
1493 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1494 and GOT_TLSGD to LE optimization.
1495
65d92137
CC
14962015-01-28 Cary Coutant <ccoutant@google.com>
1497
1498 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1499 for undef TLS symbols.
1500 (Target_x86_64::Relocate::relocate_tls): Likewise.
1501 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1502
5485698a
CC
15032015-01-25 Cary Coutant <ccoutant@google.com>
1504
1505 * output.cc (Output_segment::set_section_addresses): Fix calculation
1506 of size of relro segment.
1507
b01a4b04
AM
15082015-01-22 Alan Modra <amodra@gmail.com>
1509
1510 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1511 condition for need of ifunc plt entry.
1512 (Target_powerpc::Scan::global <got relocs>): Likewise.
1513
3d0064a9
CC
15142015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1515
1516 * mips.cc (reloc_high): Add r_sym.
1517 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1518 reloc_high constructor.
1519 (Mips_relocate_functions::relgot16_local): Likewise.
1520 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1521 r_type to decide whether LO16 matches HI16.
1522 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1523 rello16 and relgot16_local.
1524
a5cd8f05
CC
15252015-01-09 Cary Coutant <ccoutant@google.com>
1526
1527 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1528 unless alignment is larger than page size.
1529
4fc1b9d4
L
15302015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1531 Cary Coutant <ccoutant@google.com>
1532
1533 PR gold/17729
1534 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1535 (DEFAULT_TARGET_X32): Set for x32.
1536 * x86_64.cc (cmp_insn_32): New.
1537 (lea_r10_insn_32): Likewise.
1538 (lea_r11_insn_32): Likewise.
1539 (cmp_insn_64): Likewise.
1540 (lea_r10_insn_64): Likewise.
1541 (lea_r11_insn_64): Likewise.
1542 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1543 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1544 (check_DATA): Add split_x32 files.
1545 (split_x32_[1234n].o): New targets.
1546 (split_x32_[124]): New targets.
1547 (split_x32_[1234r].stdout): New targets.
1548 * testsuite/split_x32.sh: New file.
1549 * testsuite/split_x32_1.s: Likewise.
1550 * testsuite/split_x32_2.s: Likewise.
1551 * testsuite/split_x32_3.s: Likewise.
1552 * testsuite/split_x32_4.s: Likewise.
1553 * testsuite/split_x32_n.s: Likewise.
1554 * configure: Regenerated.
1555 * testsuite/Makefile.in: Likewise.
1556
e749cab8
L
15572015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1558
1559 PR gold/17809
1560 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1561 x32.
1562
af759df0
AM
15632015-01-02 Alan Modra <amodra@gmail.com>
1564
1565 * version.cc (print_version): Just print current year.
1566 * dwp.cc (print_version): Likewise.
1567
b90efa5b
AM
15682015-01-01 Alan Modra <amodra@gmail.com>
1569
1570 Update year range in copyright notice of all files.
1571
f12d1e8a
AM
15722014-12-25 Alan Modra <amodra@gmail.com>
1573
1574 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1575 new enums.
1576 (Target_arm::merge_object_attributes, ): Likewise.
1577
5c294fee
TG
15782014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1579
1580 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1581 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1582 AEABI_VFP_args_vfp to check that.
1583 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1584 value and replace hardcoded values by enum values.
1585
e30880c2
CC
15862014-12-22 Cary Coutant <ccoutant@google.com>
1587
1588 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1589
bd040da1
L
15902014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1591
1592 PR gold/14608
1593 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1594 to "return i * i * 3;".
1595
e02a4046
CC
15962014-12-16 Cary Coutant <ccoutant@google.com>
1597
1598 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1599 (Mapfile::print_output_data): Use current_data_size() to avoid
1600 assert for sections requiring postprocessing; if address is not valid,
1601 print 0.
1602 (Mapfile::print_output_section): Use current_data_size(); print note
1603 that addresses and sizes are before compression.
1604
add6016b
L
16052014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1606
1607 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1608 Cast current_group_size to unsigned long when reporting error.
1609
0bf32ea9
JY
16102014-12-10 Jing Yu <jingyu@google.com>
1611
1612 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1613 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1614 Update error message.
1615 (Target_aarch64::do_relax): Use absolute value of option
1616 stub_group_size. Replace local variable with class member
1617 stub_group_size_.
1618
cbcb23fa
AM
16192014-12-04 Alan Modra <amodra@gmail.com>
1620
1621 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1622 addend of PLTREL24 reloc when not generating a plt stub. Make
1623 max_branch_offset an "Address".
fbad6518 1624 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1625 (Target_powerpc::Relocate::relocate): Likewise.
1626
1611bc4a
AM
16272014-12-04 Alan Modra <amodra@gmail.com>
1628
1629 PR 17670
1630 * symtab.cc (Symbol::set_undefined): Remove assertion.
1631 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1632 on symbols defined in discarded sections, instead return false.
1633 Rearrange params, update all callers.
1634 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1635 branches to syms in discarded sections.
1636 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1637 undefined and flag as discarded.
1638 (Target_powerpc::Relocate::relocate): Localize variable.
1639
4759c34e
L
16402014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1641
1642 PR gold/17675
1643 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1644 * testsuite/Makefile.in: Regenerated.
1645
1f98a074
AM
16462014-12-03 Alan Modra <amodra@gmail.com>
1647
1648 PR 17566
1649 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1650 when adding dynamic relocations against section symbols.
1651
fb257835
DI
16522014-12-01 Dimitry Ivanov <dimitry@google.com>
1653
1654 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1655 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1656 * options.h (General_options): New -z option (global).
1657
d8e60314
CC
16582014-12-01 Cary Coutant <ccoutant@google.com>
1659
1660 PR gold/17578
1661 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1662 is given.
1663 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1664 given but some inputs require executable stack.
1665
982bbd97
CC
16662014-11-26 Cary Coutant <ccoutant@google.com>
1667
1668 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1669 .debug_str_offsets; strip .debug_gnu_pubnames and
1670 .debug_gnu_pubtypes.
1671 (lines_only_debug_sections): Strip all four new sections.
1672
bb779192
HS
16732014-11-26 Jing Yu <jingyu@google.com>
1674
1675 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1676 register to be x0 when to relax TLSDESC_LD64_LO12.
1677
a3e60ddb
AM
16782014-11-26 Alan Modra <amodra@gmail.com>
1679
1680 * powerpc.cc (struct Stub_table_owner): New.
1681 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1682 unsigned int vector. Update all references.
1683 (powerpc_relobj::set_stub_table): Take an unsigned int param
1684 rather than a Stub_table. Update callers.
1685 (Powerpc_relobj::clear_stub_table): New function.
1686 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1687 stub_group_size_ vars.
1688 (Target_powerpc::new_stub_table): Delete.
1689 (max_branch_delta): New function, extracted from..
1690 (Target_powerpc::Relocate::relocate): ..here..
1691 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1692 status on whether stub created successfully.
1693 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1694 default sizing to..
1695 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1696 reduce on relax failure.
1697 (Target_powerpc::group_sections): Add "no_size_errors" param.
1698 Use stub_group_size_. Set up group info in a temp vector,
1699 before building Stub_table vector. Account for input sections
1700 possibly already converted to relaxed sections.
1701 (Stub_table::init): Delete. Merge into..
1702 (Stub_table::Stub_table): ..here.
1703 (Stub_table::can_reach_stub): New function.
1704 (Stub_table::add_plt_call_entry): Add "from" parameter and
1705 return true iff stub could be reached.
1706 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1707 param too.
1708 (Stub_table::clear_stubs): Add "all" param.
1709
a20605cf
AM
17102014-11-26 Alan Modra <amodra@gmail.com>
1711
1712 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1713 (Target_powerpc::group_sections): Use it.
1714
43b64deb
CC
17152014-11-25 Cary Coutant <ccoutant@google.com>
1716
1717 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1718 (Binary_to_elf::write_symbol): Add st_size parameter.
1719 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1720
c924eb67
CC
17212014-11-25 Cary Coutant <ccoutant@google.com>
1722
1723 PR gold/17639
1724 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1725 (Sized_relobj_file::do_layout): Handle deferred sections properly
1726 during GC pass 1. Don't add reloc sections to deferred list twice.
1727 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1728 (Sized_relobj_file::is_deferred_layout_): New data member.
1729
9d585188
L
17302014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1731
1732 PR gold/17619
1733 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1734 Check PC-relative offset overflow in PLT entry.
1735
3ffaac20
AM
17362014-11-21 Alan Modra <amodra@gmail.com>
1737
1738 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1739 for undefined weaks.
1740
0cfb0717
AM
17412014-11-20 Alan Modra <amodra@gmail.com>
1742
1743 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1744 from --stub-group-size parameter divided by 1024.
1745 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1746 template parameter. Update all uses.
1747 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1748 has_stub_value. Set for long branches. Don't report overflow for
1749 branch to undefined weak symbols. Print info message on
1750 overflowing branch to stub.
1751
f9dffbf0
AM
17522014-11-20 Alan Modra <amodra@gmail.com>
1753
1754 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1755
e88ba8d5
L
17562014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1757
1758 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1759 entry for R_X86_64_GOTPLT64.
1760 (Target_x86_64<size>::Relocate::relocate): Update comments for
1761 R_X86_64_GOTPLT64.
1762
d37ffe25
ED
17632014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1764
1765 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1766 * plugin.h: add lock definition
1767
9726c3c1
HS
17682014-10-29 Han Shen <shenhan@google.com>
1769 Jing Yu <jingyu@google.com>
1770
1771 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1772 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1773 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1774 Symbol::TLS_REF.
1775 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1776 method.
1777 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1778 (Target_aarch64::tls_ld_to_le): New method.
1779 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1780 for 64bit targets.
1781 (Output_data_plt_aarch64::irelative_rel_): New data member.
1782 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1783 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1784 (Output_data_plt_aarch64::add_relocation): New method.
1785 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1786 offset. Add got_irelative size to got size.
1787 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1788 type string with the new typename.
1789 (AArch64_relocate_functions::update_adr): Replace parameter x with
1790 immed.
1791 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1792 (AArch64_relocate_functions::reloc_common): New method.
1793 (AArch64_relocate_funcsions::rela_general): Extract common part out
1794 into reloc_common method.
1795 (AArch64_relocate_functions::rela_general): Likewise.
1796 (AArch64_relocate_functions::pcrela_general): Likewise.
1797 (AArch64_relocate_functions::adr): New method.
1798 (AArch64_relocate_functions::adrp): Calculate immed before calling
1799 update_adr.
1800 (AArch64_relocate_functions::adrp): Likewise.
1801 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1802 comparing x to 0. Calculate immed from ~x when x < 0.
1803 (Target_aarch64::optimize_tls_reloc): Add new cases for
1804 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1805 TLSLD_MOVW_DTPREL_G0_NC.
1806 (Target_aarch64::possible_function_pointer_reloc): Implement this
1807 method.
1808 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1809 comment.
1810 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1811 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1812 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1813 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1814 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1815 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1816 (Target_aarch64::make_plt_entry): Call add_entry with two more
1817 parameters.
1818 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1819 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1820 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1821 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1822 (Target_aarch64::Relocate::relocate_tls): Add cases for
1823 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1824 TLSLD_MOVW_DTPREL_G0_NC.
1825 * testsuite/icf_safe_so_test.cc: Correct test comment.
1826 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1827
80272b8c
AM
18282014-10-22 Alan Modra <amodra@gmail.com>
1829
1830 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1831 thread_starter.
1832
998a69f4
AS
18332014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1834
1835 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1836
aed56ec5
CC
18372014-10-17 Cary Coutant <ccoutant@google.com>
1838
1839 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1840 Add "typename" keyword.
1841
bb779192 18422014-10-15 Han Shen <shenhan@google.com>
72f4393d 1843 Jing Yu <jingyu@google.com>
83a01957
HS
1844
1845 Patch for gold aarch64 backend to support relaxation.
1846 * aarch64-reloc.def: Change format.
1847 * aarch64.cc (class Reloc_stub): New class.
1848 (class Stub_table): New class.
1849 (class AArch64_relobj): New class.
1850 (class AArch64_input_section): New class.
1851 (class AArch64_output_section): New class.
1852 (Target_aarch64::new_stub_table): New method.
1853 (Target_aarch64::new_aarch64_input_section): New method.
1854 (Target_aarch64::find_aarch64_input_section): New method.
1855 (Target_aarch64::scan_section_for_stubs): New method.
1856 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1857 (Target_aarch64::relocate_stub): New method.
1858 (Target_aarch64::current_target): New method.
1859 (Target_aarch64::do_make_elf_object): New method.
1860 (Target_aarch64::do_may_relax): New method.
1861 (Target_aarch64::do_relax): New method.
1862 (Target_aarch64::group_sections): New method.
1863 (Target_aarch64::scan_reloc_for_stub): New method.
1864 (Target_aarch64::do_make_output_section): New method.
1865 (Target_aarch64::stub_tables_): New data member.
1866 (Target_aarch64::aarch64_input_section_map_): New data member.
1867 (AArch64_relocate_functions::maybe_apply_stub): New method.
1868
db4c9594
CC
18692014-09-30 Cary Coutant <ccoutant@google.com>
1870
1871 PR gold/17432
1872 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1873
cd6da036
KC
18742014-09-30 Kito Cheng <kito@0xlab.org>
1875
1876 PR gold/13597
1877 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1878 hash table before sysv-style hash table.
1879
5f772412
ST
18802014-09-29 Sriraman Tallam <tmsriram@google.com>
1881
1882 * options.h (--pic-executable): Add negative to alias to -no-pie.
1883
5efeedf6
CC
18842014-09-26 Cary Coutant <ccoutant@google.com>
1885
1886 PR gold/16773
1887 * object.cc (Sized_relobj_file): Compute value of section symbols
1888 for TLS sections the same as TLS symbols.
1889
1707f183
CC
18902014-09-25 Cary Coutant <ccoutant@google.com>
1891
1892 PR gold/17432
1893 * resolve.cc (Symbol_table::resolve): Override common placeholder
1894 symbols, but adjust sizes.
1895 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1896 symbols to common lists.
1897
00cac886
AM
18982014-09-24 Alan Modra <amodra@gmail.com>
1899
1900 * po/POTFILES.in: Regenerate.
1901
635aa30e 19022014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1903 Cary Coutant <ccoutant@google.com>
635aa30e 1904
71b9b91b 1905 PR gold/14860
635aa30e
CC
1906 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1907 on input_sections_blocker.
1908 * layout.cc (Write_sections_task::locks): Unblock
1909 input_sections_blocker_.
1910 * layout.h (Write_sections_task::Write_sections_task): Add
1911 input_sections_blocker.
1912 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1913 to DEPENDENCIES.
1914 * testsuite/Makefile.in: Regenerate.
1915
c0c71592
RÁE
19162014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1917
1918 * testsuite/Makefile.am (plugin_test_10): New test.
1919 * testsuite/Makefile.in: Regenerate
1920 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1921 * testsuite/plugin_test_10.sh: New file.
1922
6168c2a1
RÁE
19232014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1924
1925 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1926 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1927 during the replacement phase.
1928
3a531937
JY
19292014-09-17 Han Shen <shenhan@google.com>
1930 Jing Yu <jingyu@google.com>
1931
1932 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1933 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1934 * aarch64.cc (Target_aarch64): Add data members
1935 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1936 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1937 constructor.
1938 (Target_aarch64::do_reloc_symbol_index): New method.
1939 (Target_aarch64::do_reloc_addend): New method.
1940 (Target_aarch64::add_tlsdesc_info): New method.
1941 (Target_aarch64::do_dynsym_value): New method.
1942 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1943 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1944 (Target_aarch64::make_data_plt): Add new parameters: got,
1945 got_irelative. Pass them to do_make_data_plt.
1946 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1947 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1948 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1949 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1950 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1951 (Target_aarch64::got_tlsdesc_section): New method.
1952 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1953 (Target_aarch64::define_tls_base_symbol): New method.
1954 (Target_aarch64::reserve_tlsdesc_entries): New method.
1955 (Target_aarch64::got_mod_index_entry): New method.
1956 (Target_aarch64::rela_tlsdesc_section): New method.
1957 (Target_aarch64::rela_irelative_section): New method.
1958 (Target_aarch64::Tlsdesc_info): New struct.
1959 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1960 relocations and tlsdesc relocations.
1961 (Target_aarch64::optimize_tls_reloc): Implement method.
1962 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1963 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1964 in constructor.
1965 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1966 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1967 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1968 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1969 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1970 (Output_data_plt_aarch64::rela_irelative): New method.
1971 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1972 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1973 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1974 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1975 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1976 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1977 (Output_data_plt_aarch64_standard): New member variables:
1978 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1979 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1980 New parameter: got, got_irelative.
1981 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1982 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1983 (Output_data_plt_aarch64::do_write): Replace got_address with
1984 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1985 (AArch64_relocate_functions::update_movnz): New method.
1986 (AArch64_relocate_functions): Correct format.
1987 (AArch64_relocate_functions::movnz): New method.
1988 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1989 before the switch. Add new cases to switch.
00cac886 1990 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1991 tlsgd tlsdesc cases.
1992 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1993 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1994 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1995 Call reloc_name_in_error_message to print unsupported reloc.
1996 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1997 make_data_plt.
1998 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1999 relocs. Fill in some more dynamic tags.
2000 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2001 Skip call tls_get_addr when tlsgd is relaxed.
2002 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2003 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2004 tlsdesc->ie relaxation.
2005
62661c93
SS
20062014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2007
2008 * mips.cc (Target_mips_nacl): New class.
2009 (Target_selector_mips_nacl): New class.
2010 (target_selector_mips32): Rename from target_selector_mips32be and use
2011 Target_selector_mips_nacl instead of Target_selector_mips.
2012 (target_selector_mips32el): Rename from target_selector_mips32 and use
2013 Target_selector_mips_nacl instead of Target_selector_mips.
2014 (target_selector_mips64): Rename from target_selector_mips64be and use
2015 Target_selector_mips_nacl instead of Target_selector_mips.
2016 (target_selector_mips64el): Rename from target_selector_mips64 and use
2017 Target_selector_mips_nacl instead of Target_selector_mips.
2018 (Target_mips::mips_info): Add const attribute.
2019
54674d38
CC
20202014-09-02 Cary Coutant <ccoutant@google.com>
2021
2022 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2023 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2024 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2025 (Sized_incr_dynobj::do_section_name): Likewise.
2026 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2027 (Sized_incr_dynobj::do_section_name): Likewise.
2028 * object.h (Object::section_name): Likewise.
2029 (Object::do_section_name): Likewise.
2030 (Sized_relobj_file::do_section_name): Likewise.
2031 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2032 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2033
9860cbcf
CC
20342014-09-02 Cary Coutant <ccoutant@google.com>
2035
2036 PR gold/17005
2037 * ehframe.cc (Fde::write): Add output_offset parameter.
2038 (Cie::write): Likewise.
2039 (Eh_frame::set_final_data_size): Account for offset within output
2040 section.
2041 (Eh_frame::do_sized_write): Likewise.
2042 * ehframe.h (Fde::write): Add output_offset parameter.
2043 (Cie::write): Likewise.
2044 * output.cc (Output_section::Input_section_sort_entry): Remove
2045 section_has_name_; add output_section_name parameter. Use
2046 output section name for non-input sections.
2047 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2048 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2049 (Output_section::Input_section_sort_compare): Remove logic for
2050 sections without names.
2051 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2052 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2053 Likewise.
2054 (Output_section::Input_section_sort_section_name_compare): Likewise.
2055
8e33481e
HS
20562014-08-29 Han Shen <shenhan@google.com>
2057 Jing Yu <jingyu@google.com>
2058
2059 * aarch64-reloc-property.cc
2060 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2061 reference reloc property in the table.
2062 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2063 3 other entries.
2064 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2065 2 new overloaded methods.
2066 (Output_data_got_aarch64::do_write): Add code to write out
2067 static relocs.
2068 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2069 static relocs.
2070 (Output_data_got_aarch64::static_relocs): New vector to
2071 hold static relocs.
2072 (Target_aarch64::TCB_SIZE): New const static memeber.
2073 (Target_aarch64::tcb_size): New method.
2074 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2075 (Target_aarch64::Relocate::relocate_tls): New method.
2076 (Target_aarch64::Scan::local): Add code handling new reloc types.
2077 (Target_aarch64::Scan::global): Add code handling new reloc types.
2078
81233653
ST
20792014-08-13 Sriraman Tallam <tmsriram@google.com>
2080
2081 * options.h (-no-pie): Add option.
2082
9363c7c3
JY
20832014-08-08 Jing Yu <jingyu@google.com>
2084 Han Shen <shenhan@google.com>
2085
2086 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2087 (DEFFILES): add aarch64-reloc.def.
2088 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2089 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2090 * Makefile.in: Regenerate.
2091 * aarch64-reloc-property.cc: New file.
2092 * aarch64-reloc-property.h: New file.
2093 * aarch64-reloc.def: New file.
2094 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2095 with tab to make the format consistent.
2096 (Output_data_got_aarch64::symbol_table_): New method.
2097 (Target_aarch64::do_plt_address_for_global): New method.
2098 (Target_aarch64::do_plt_address_for_local): New method.
2099 (Target_aarch64::do_select_as_default_target): New method.
2100 (Target_aarch64::do_make_data_plt): New method.
2101 (Target_aarch64::make_data_plt): New method.
2102 (Output_data_plt_aarch64::has_irelative_section): New method.
2103 (Output_data_plt_aarch64::address_for_global): New method.
2104 (Output_data_plt_aarch64::address_for_local): New method.
2105 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2106 (Output_data_plt_aarch64::add_entry): Implement contents.
2107 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2108 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2109 the got_pov entry to plt0.
2110 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2111 Implement contents.
2112 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2113 (AArch64_howto): New struct.
2114 (aarch64_howto[]): New static const array.
2115 (AArch64_relocate_functions): New class.
2116 (Target_aarch64::Scan::get_reference_flags): Remove method.
2117 (Target_aarch64::Scan::local): Implement to support a few relocations.
2118 (Target_aarch64::Scan::global): Implement to support a few relocations.
2119 (Target_aarch64::make_plt_section): Implement contents.
2120 (Target_aarch64::make_plt_entry): Implement contents.
2121 (Target_aarch64::do_finalize_sections): Implement contents.
2122 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2123 (Target_aarch64::relocate_section): Implement contents.
2124
ad9fe6c1
AM
21252014-08-06 Alan Modra <amodra@gmail.com>
2126
2127 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2128
7cd4e5b7
AM
21292014-08-06 Alan Modra <amodra@gmail.com>
2130
2131 PR 13227
2132 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2133
5ad9b0a7
ST
21342014-07-21 Sriraman Tallam <tmsriram@google.com>
2135
2136 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2137 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2138
e051745c
CC
21392014-07-08 Cary Coutant <ccoutant@google.com>
2140
2141 * expression.cc (struct Expression::Expression_eval_info): Add
2142 new fields type_pointer, vis_pointer, and nonvis_pointer.
2143 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2144 nonvis_pointer parameters. Adjust all calls.
2145 (Symbol_expression::value): Update type, visibility, and nonvis bits
2146 in caller.
2147 * script.cc (Symbol_assignment::sized_finalize): Update type,
2148 visibility, and remaining st_other bits for new symbol.
2149 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2150 vis_pointer, and nonvis_pointer parameters.
2151 * symtab.h (Symbol::set_type): New method.
2152
2153 * testsuite/Makefile.am (defsym_test): New test.
2154 * testsuite/Makefile.in: Regenerate.
2155 * testsuite/defsym_test.c: New file.
2156 * testsuite/defsym_test.sh: New file.
2157
f35c4853
CC
21582014-07-08 Cary Coutant <ccoutant@google.com>
2159
2160 PR gold/15639
2161 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2162 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2163 (Sized_dynobj::base_read_symbols): ...new method.
2164 * object.h (Sized_relobj_file::base_read_symbols): New method.
2165 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2166 (Sized_relobj_file::base_read_symbols): ...new method.
2167 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2168 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2169 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2170
2900af2d
AM
21712014-07-04 Alan Modra <amodra@gmail.com>
2172
2173 * po/POTFILES.in: Regenerate.
2174
053a4d68
JY
21752014-07-02 Jing Yu <jingyu@google.com>
2176
2177 * aarch64.cc: New file
2178 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2179 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2180 * Makefile.in: Regenerate.
2181 * configure.tgt: Add entries for aarch64*.
2182 * configure.ac: Likewise.
2183 * configure: Likewise.
2184
7b549045
AM
21852014-06-27 Alan Modra <amodra@gmail.com>
2186
2187 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2188
cb818dbf
CC
21892014-06-24 Cary Coutant <ccoutant@google.com>
2190
2191 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2192 sections.
2193 (Dwo_file::sized_read_unit_index): Likewise.
2194
9810d34d
SS
21952014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2196
2197 * mips.cc: New file.
2198 * Makefile.am (TARGETSOURCES): Add mips.cc
2199 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2200 * configure.tgt: Add entries for mips*.
2201 * configure.ac: Likewise.
2202 * Makefile.in: Regenerate.
2203 * configure: Likewise.
2204
9baa787b
CC
22052014-06-09 Cary Coutant <ccoutant@google.com>
2206
2207 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2208 unit_length is within section bounds.
2209
8f89af0a
CC
22102014-06-09 Cary Coutant <ccoutant@google.com>
2211
2212 PR gold/16980
2213 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2214 map.
2215
a47622ac
AM
22162014-06-07 Alan Modra <amodra@gmail.com>
2217
2218 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2219
4320c691
CC
22202014-06-06 Cary Coutant <ccoutant@google.com>
2221
2222 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2223 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2224 (Dwarf_pubnames_table::read_header): Likewise.
2225 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2226 .debug_gnu_pubtypes.
2227
270c9937
JB
22282014-06-05 Joel Brobecker <brobecker@adacore.com>
2229
2230 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2231 * Makefile.in, configure: Regenerate.
2232
397998fc
AM
22332014-06-03 Alan Modra <amodra@gmail.com>
2234
2235 * powerpc.cc (addis_12_2): Define.
2236 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2237
61f5c66f
AM
22382014-06-03 Alan Modra <amodra@gmail.com>
2239
2240 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2241 st_other output.
2242
f6971787
AM
22432014-06-02 Alan Modra <amodra@gmail.com>
2244
2245 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2246 Only ignore relocs on ELFv1.
2247 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2248
f6fb8322
CC
22492014-05-30 Cary Coutant <ccoutant@google.com>
2250
2251 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2252 * testsuite/Makefile.in: Regenerate.
2253 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2254
c23dd342
L
22552014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2256
2257 PR gold/16945
2258 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2259 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2260
5fe7ffdc
AM
22612014-05-15 Alan Modra <amodra@gmail.com>
2262
2263 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2264 Compare FDE contents with DW_CFA_nop rather than 0.
2265
a82bef93
ST
22662014-05-13 Sriraman Tallam <tmsriram@google.com>
2267
2268 * symtab.h (may_need_copy_reloc): Remove check for position independent
2269 code.
2270 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2271 position independence before pc absolute may_need_copy_reloc call.
2272 Add check for executable output befor pc relative may_need_copy_reloc
2273 call.
2274 * i386.cc: Ditto.
2275 * arm.cc: Ditto.
2276 * sparc.cc: Ditto.
2277 * tilegx.cc: Ditto.
2278 * powerpc.cc: Add check for no position independence before
2279 may_need_copy_reloc calls.
2280 * testsuite/pie_copyrelocs_test.cc: New file.
2281 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2282 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2283 * Makefile.in: Regenerate.
a82bef93 2284
53c66605
ML
22852014-05-08 Martin Liška <mliska@suse.cz>
2286
2287 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2288
57b2284c
CC
22892014-05-06 Cary Coutant <ccoutant@google.com>
2290
2291 PR gold/16900
2292 * i386.cc (Output_data_got_plt_i386): New class.
2293 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2294 parameter. Change all callers.
2295 (Output_data_plt_i386::layout_): Remove.
2296 (Output_data_plt_i386::got_plt_): Change type.
2297 (Target_i386::got_plt_): Change type. Change all references.
2298 (Target_i386::got_section): Create instance of new class.
2299 (Output_data_got_plt_i386::do_write): New function.
2300 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2301 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2302 parameter. Change all callers.
2303 (Output_data_plt_x86_64::layout_): Remove.
2304 (Output_data_plt_x86_64::got_plt_): Change type.
2305 (Target_x86_64::got_plt_): Change type. Change all references.
2306 (Target_x86_64::got_section): Create instance of new class.
2307 (Output_data_got_plt_x86_64::do_write): New function.
2308 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2309 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2310 class.
2311
6b97515d 23122014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2313
6b97515d
CC
2314 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2315 if we have pubnames/pubtypes.
2316
d1bddd3c
CC
23172014-05-02 Cary Coutant <ccoutant@google.com>
2318
5fe7ffdc
AM
2319 * defstd.cc (in_segment): Define __ehdr_start here...
2320 * layout.cc (Layout::finalize): ...Instead of here. Set the
2321 output segment when known.
2322 * resolve.cc (Symbol::override_base_with_special): Remember
2323 the original binding.
2324 * symtab.cc (Symbol::set_output_segment): New function.
2325 (Symbol::set_undefined): New function.
2326 * symtab.h (Symbol::is_weak_undefined): Check original undef
2327 binding.
2328 (Symbol::is_strong_undefined): New function.
2329 (Symbol::set_output_segment): New function.
2330 (Symbol::set_undefined): New function.
2331 * target-reloc.h (is_strong_undefined): Remove.
2332 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2333 Check for hidden undefs.
2334 (relocate_section): Call Symbol::is_strong_undefined.
2335
2336 * testsuite/Makefile.am (ehdr_start_test_1)
2337 (ehdr_start_test_2, ehdr_start_test_3)
2338 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2339 * testsuite/Makefile.in: Regenerate.
2340 * testsuite/ehdr_start_def.cc: New source file.
2341 * testsuite/ehdr_start_test.cc: New source file.
2342 * testsuite/ehdr_start_test.t: New linker script.
2343 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2344
7849f6d8
CC
23452014-04-23 Cary Coutant <ccoutant@google.com>
2346
bf2cc635 2347 PR gold/16870
7849f6d8
CC
2348 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2349
99fd8cff
CC
23502014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2351
2352 * layout.cc (Layout::include_section): Allow a target to decide
2353 whether to include a section.
2354 * target.h (Target::should_include_section): New function.
2355 (Target::do_should_include_section): New function.
2356
91f43acd
CC
23572014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2358
2359 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2360 inline into ...
2361 (Copy_relocs::emit): ... here.
2362 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2363 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2364 (Copy_reloc_entry::entries_): Change from private to protected.
2365
c4eb27e1
ST
23662014-04-02 Sriraman Tallam <tmsriram@google.com>
2367
2368 * icf.cc (get_section_contents): Replace copies of reloc
2369 vectors with const references.
2370
ae447ddd
CC
23712014-04-02 Cary Coutant <ccoutant@google.com>
2372
2373 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2374 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2375 * configure: Regenerate.
2376 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2377 -fno-use-linker-plugin.
2378 (LINK1, CXXLINK1): Add it to the link command.
2379 * testsuite/Makefile.in: Regenerate.
2380
fa47fa92
AM
23812014-03-12 Alan Modra <amodra@gmail.com>
2382
2383 * Makefile.in: Regenerate.
2384
9b12c500
CC
23852014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2386
2387 * symtab.h (Symbol::set_nonvis): New function.
2388
beacaa96
CC
23892014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2390
2391 * symtab.cc (Sized_symbol<32>::init_output_data):
2392 Instantiate the template.
2393 (Sized_symbol<64>::init_output_data): Likewise.
2394
800d9823
CC
23952014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2396
2397 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2398 adjust dynamic symbol value.
2399 * target.h (Target::adjust_dyn_symbol): New function.
2400 (Target::do_adjust_dyn_symbol): New function.
2401
918fc1f8 24022014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2403
918fc1f8
CC
2404 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2405 Get the value of DYNAMIC_CUSTOM dynamic entry.
2406 * output.h (Output_data_dynamic::add_custom): New function.
2407 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2408 dynamic entry.
2409 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2410 * target.h (Target::dynamic_tag_custom_value): New function.
2411 (Target::do_dynamic_tag_custom_value): New function.
2412
98ff9231
CC
24132014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2414
2415 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2416 dynsym indexes.
2417 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2418 (Target::do_has_custom_set_dynsym_indexes): New function.
2419 (Target::set_dynsym_indexes): New function.
2420 (Target::do_set_dynsym_indexes): New function.
2421
b80eed39
AM
24222014-03-07 Alan Modra <amodra@gmail.com>
2423
2424 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2425 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2426 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2427 (Powerpc_relocate_functions::has_overflow_bitfield,
2428 overflowed): Use the above.
2429 (Target_powerpc::Relocate::relocate): Correct overflow checking
2430 for a number of relocations. Modify overflow test for 16-bit
2431 fields in instructions to signed/unsigned according to whether
2432 the field takes a signed or unsigned value.
2433
4b95cf5c
AM
24342014-03-05 Alan Modra <amodra@gmail.com>
2435
2436 Update copyright years.
2437
45965137
AM
24382014-03-05 Alan Modra <amodra@gmail.com>
2439
2440 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2441 R_PPC64_ADDR64_LOCAL.
2442 (Target_powerpc::Relocate::relocate): Likewise.
2443
2c80b753
AM
24442014-03-03 Alan Modra <amodra@gmail.com>
2445
2446 * dwp.cc (print_version): Update copyright year to current.
2447
c1c69e83
AM
24482014-02-10 Alan Modra <amodra@gmail.com>
2449
2450 * po/gold.pot: Regenerate.
2451
dd0c4e70
CC
24522014-02-06 Cary Coutant <ccoutant@google.com>
2453
2454 Fix problem where -u is ignored when a weak undef is seen.
2455
2456 * archive.cc (Library_base::should_include_member): Reorder
2457 code to check for -u option if a weak undef has already been seen.
2458 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2459 * testsuite/Makefile.in: Regenerate.
2460 * testsuite/weak_undef_file3.cc: New file.
2461 * testsuite/weak_undef_file4.cc: New file.
2462 * testsuite/weak_undef_test_2.cc: New file.
2463
1a221d3d
CC
24642014-02-05 Cary Coutant <ccoutant@google.com>
2465
2466 Fix issues with gold undefined symbol diagnostics.
2467
2468 PR binutils/15435
2469 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2470 check to here.
2471 * target-reloc.h (is_strong_undefined): New function.
2472 (relocate_section): Move undef vtable symbol check from here.
2473 Check for is_strong_undefined.
2474
e889f0a4 24752014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2476
e889f0a4
CC
2477 Fix problems with the --dynamic-list option.
2478
2479 PR gold/13577
2480 * options.cc (General_options::parse_dynamic_list):
2481 Set have_dynamic_list_.
2482 (General_options::General_options): Initialize have_dynamic_list_.
2483 (General_options::finalize): Turn off -Bsymbolic and
2484 -Bsymbolic-functions if --dynamic-list provided.
2485 * options.h (General_options::have_dynamic_list): New function.
2486 (General_options::have_dynamic_list_): New data member.
2487 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2488 correctly.
5fe7ffdc 2489
e889f0a4
CC
2490 PR gold/16530
2491 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2492 in --dynamic-list, mark it.
5fe7ffdc 2493
e889f0a4
CC
2494 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2495 (dynamic_list_2): New test case.
2496 * testsuite/Makefile.in: Regenerate.
2497 * testsuite/dynamic_list_2.cc: New file.
2498 * testsuite/dynamic_list_2.t: New file.
2499 * testsuite/dynamic_list_lib1.cc: New file.
2500 * testsuite/dynamic_list_lib2.cc: New file.
2501 * testsuite/gc_dynamic_list_test.c: New file.
2502 * testsuite/gc_dynamic_list_test.sh: New file.
2503 * testsuite/gc_dynamic_list_test.t: New file.
2504
ec673e64
CC
25052014-01-28 Cary Coutant <ccoutant@google.com>
2506
2507 Add .gdb_index version 7 support.
2508
2509 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2510 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2511 debug sections.
2512 (Dwarf_ranges_table::read_ranges_table): Likewise.
2513 (Dwarf_pubnames_table::read_section): Check for GNU-style
2514 sections, and for compressed debug sections.
2515 (Dwarf_pubnames_table::read_header): Compute end address of table.
2516 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2517 for end of list by offset, not by offset == 0.
2518 (Dwarf_info_reader::do_read_string_table): Check for compressed
2519 debug sections.
2520 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2521 Initialize new data members.
2522 (Dwarf_pubnames_table::next_name): return flag_byte.
2523 (Dwarf_pubnames_table::end_of_table_): New data member.
2524 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2525 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2526 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2527 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2528 read skeleton type unit DIEs.
2529 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2530 (Gdb_index::do_write): Write flag_byte.
2531 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2532 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2533 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2534 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2535
221fd5d5
L
25362014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2537
2538 * version.cc (print_version): Update copyright year to 2014.
2539
6c09fb0b
ILT
25402013-12-19 Dimitry Andric <dimitry@andric.com>
2541
2542 * stringpool.cc (Stringpool_template::reserve): Add
2543 HAVE_UNORDERED_MAP case.
2544 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2545
8356f2d0
CC
25462013-12-18 Cary Coutant <ccoutant@google.com>
2547
2548 * configure.ac: Check for <unordered_set> and <unordered_map>.
2549 * config.in: Regenerate.
2550 * configure: Regenerate.
2551 * system.h: Use <unordered_set> and <unordered_map> if available.
2552
f2c7d7ee
RM
25532013-12-10 Roland McGrath <mcgrathr@google.com>
2554
2555 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2556 with $(INSTALL_PROGRAM_ENV).
2557 * Makefile.in: Regenerate.
2558
6632e8cc
CC
25592013-11-22 Cary Coutant <ccoutant@google.com>
2560
2561 * configure.ac: Add check for which library is needed for
2562 dlopen.
2563 * configure: Regenerate.
2564
0c075858
CC
25652013-11-22 Cary Coutant <ccoutant@google.com>
2566
2567 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2568 assembler.
2569 * testsuite/Makefile.in: Regenerate.
2570
f49fe902
L
25712013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2572
2573 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2574 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2575 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2576 (Target_x86_64<size>::Scan::local): Likewise.
2577 (Target_x86_64<size>::Scan::global): Likewise.
2578 (Target_x86_64<size>::Relocate::relocate): Likewise.
2579 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2580 Likewise.
2581 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2582 R_X86_64_PC32_BND.
2583
2584 * testsuite/Makefile.am (check_PROGRAMS): Add
2585 exception_x86_64_bnd_test.
2586 (exception_x86_64_bnd_test_SOURCES): New macro.
2587 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2588 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2589 (exception_x86_64_bnd_test_LDADD): Likewise.
2590 (exception_x86_64_bnd_1.o): New rule.
2591 (exception_x86_64_bnd_2.o): Likewise.
2592 * testsuite/Makefile.in: Regenerated.
2593
9055360d
AM
25942013-11-15 Alan Modra <amodra@gmail.com>
2595
2596 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2597 accessor.
2598 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2599 Only call ppc64_local_entry_offset for 64-bit. Restrict
2600 symval_for_branch lookup to ELFv1.
2601 (Stub_table::add_plt_call_entry): Use unsigned int off.
2602 (Output_data_glink::Address, invalid_address): New.
2603 (Output_data_glink::add_eh_frame): Move out of line. Add
2604 support for ELFv2.
2605 (Output_data_glink::add_global_entry, find_global_entry,
2606 global_entry_address): New functions.
2607 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2608 ge_size): New variables.
2609 (Output_data_glink::set_final_data_size): Add global entry
2610 stub sizing.
2611 (Output_data_glink::do_write): Write global entry stubs.
2612 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2613 parameter. Return true for ELFv2. Adjust callers.
2614 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2615 ELFv1. Similarly for ifunc and dynamic relocation processing
2616 specific to ELFv1. Recognize that symbols are defined on
2617 their plt entries for ELFv2.
2618 (Target_powerpc::symval_for_branch): Assert if called for
2619 ELFv2 or ppc32.
2620 (Target_powerpc::Relocate::relocate): Use global entry plt
2621 stub for symbol value if such exists on ELFv2.
2622 (Target_powerpc::Relocate::relocate): Don't call
2623 symval_for_branch when ELFv2. Do adjust for local entry
2624 offset when ELFv2.
2625 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2626 plt stub for ELFv2.
2627 (Target_powerpc::do_plt_address_for_global): Similarly.
2628
cafdd569
CC
26292013-11-14 Cary Coutant <ccoutant@google.com>
2630
2631 Revert patch -- this did not fix the problem, and there is
2632 no race there.
2633
2634 2013-11-14 Cary Coutant <ccoutant@google.com>
2635
2636 PR gold/14860
2637 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2638 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2639 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2640 updating fde_offsets_.
2641 (Eh_frame_hdr::lock_): New data member.
2642
94e49e16
CC
26432013-11-14 Cary Coutant <ccoutant@google.com>
2644
2645 * dwp.cc (Dwo_file_entry): New type.
2646 (File_list): Use Dwo_file_entry.
2647 (Dwo_file::verify): New function.
2648 (Dwo_file::verify_dwo_list): New function.
2649 (Dwo_file::sized_verify_dwo_list): New function.
2650 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2651 list.
2652 (Dwp_options): New enum type.
2653 (dwp_options): Add --verify-only.
2654 (usage): Likewise.
2655 (main): Likewise.
2656 * dwp.h (gold_info): Add declaration.
2657
7cdd7d57
CC
26582013-11-14 Cary Coutant <ccoutant@google.com>
2659
2660 PR gold/14860
2661 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2662 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2663 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2664 updating fde_offsets_.
2665 (Eh_frame_hdr::lock_): New data member.
2666
1d946cb3
CC
26672013-11-06 Cary Coutant <ccoutant@google.com>
2668
2669 PR gold/15758
2670 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2671 before reloc sections.
2672
4f65b40e
AM
26732013-11-04 Alan Modra <amodra@gmail.com>
2674
2675 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2676 (Symbol::needs_dynamic_reloc): Test new flag.
2677 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2678 (Target_powerpc::Scan::get_reference_flags): Add target param.
2679 Return FUNC_DESC_ABI for 64-bit ELFv1.
2680 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2681 call.
2682 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2683 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2684
908794a9
CC
26852013-10-31 Cary Coutant <ccoutant@google.com>
2686
2687 Restore support for dwp v2 DWARF package file format.
2688
2689 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2690 tu_length parameter. Adjust all callers.
2691 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2692 * dwp.cc: Include dwarf.h.
2693 (Section_bounds): New struct type.
2694 (Unit_set): New struct type.
2695 (Dwo_file::Dwo_file): Initialize new data member.
2696 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2697 Combine and rename to...
2698 (Dwo_file::read_unit_index): ...this.
2699 (Dwo_file::sized_read_compunit_index)
2700 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2701 (Dwo_file::sized_read_unit_index): ...this.
2702 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2703 parameters; add section_id parameter.
2704 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2705 (Dwo_file::add_unit_set): ...this.
2706 (Dwo_file::shndx_map_): Remove.
2707 (Dwo_file::sect_offsets_): New data member.
2708 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2709 (Dwp_output_file::add_section): Rename to...
2710 (Dwp_output_file::add_contribution): ...this.
2711 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2712 (Dwp_output_file::add_tu_set): Likewise.
2713 (Dwp_output_file::Contribution): New type.
2714 (Dwp_output_file::Section::contributions): New data member.
2715 (Dwp_output_file::Cu_or_tu_set): Remove.
2716 (Dwp_output_file::Section::Section): New ctor.
2717 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2718 (Dwp_output_file::Dwp_index::Section_table): New type.
2719 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2720 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2721 parameter.
2722 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2723 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2724 (Dwp_output_file::Dwp_index::section_table): New member function.
2725 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2726 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2727 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2728 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2729 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2730 (Dwp_output_file::Dwp_index::section_table_): New data member.
2731 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2732 (Dwp_output_file::add_output_section): New member function.
2733 (Dwp_output_file::write_new_section): New member function.
2734 (Dwp_output_file::write_contributions): New member function.
2735 (Dwp_output_file::section_id_map_): New data member.
2736 (class Dwo_id_info_reader): Remove.
2737 (class Unit_reader): New class.
2738 (get_dwarf_section_name): New function.
2739 (Dwo_file::read_executable): Adjust initializations of class data.
2740 (Dwo_file::read): Add support for v2 package file format.
2741 (Dwo_file::read_unit_index): Likewise.
2742 (Dwo_file::sized_read_unit_index): Likewise.
2743 (Dwo_file::copy_section): Likewise.
2744 (Dwo_file::add_unit_set): Likewise.
2745 (Dwp_output_file::add_output_section): Likewise.
2746 (Dwp_output_file::add_contribution): Likewise.
2747 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2748 for empty slot.
2749 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2750 file format.
2751 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2752 slot.
2753 (Dwp_output_file::initialize): Remove unused function.
2754 (Dwp_output_file::finalize): Add support for v2 package file format.
2755 (Dwp_output_file::write_index): Likewise.
2756 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2757 function prototype.
2758
2500c017
CC
27592013-10-31 Cary Coutant <ccoutant@google.com>
2760
2761 * configure.ac: Fix check for -fmerge-constants.
2762 * configure.ac: Regenerate.
2763
dd0845d7
RM
27642013-10-30 Roland McGrath <mcgrathr@google.com>
2765
2766 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2767 Correct 9-byte nop sequence to match what the assembler generates.
2768
b4f7960d
AM
27692013-10-30 Alan Modra <amodra@gmail.com>
2770
2771 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2772 ppc64_local_entry_offset, ppc64_local_entry_offset,
2773 do_read_symbols): New functions.
2774 (Powerpc_relobj::e_flags_, st_other_): New vars.
2775 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2776 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2777 (Powerpc_relobj::e_flags_): New var.
2778 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2779 and adjust for ELFv2.
2780 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2781 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2782 (Powerpc_dynobj::do_find_special_sections): Likewise.
2783 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2784 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2785 to ELFv2 local entry.
2786 (Target_powerpc::do_relax): No thread safe barriers needed for
2787 ELFv2.
2788 (Output_data_plt_powerpc::initial_plt_entry_size_,
2789 plt_entry_size): Delete. Replace all uses with
2790 first_plt_entry_offset() and plt_entry_size().
2791 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2792 reserved_size parm. Update callers.
2793 (Output_data_plt_powerpc::entry_count): Update.
2794 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2795 and use Target_powerpc::first_plt_entry_offset().
2796 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2797 rename to plt_entry_size.
2798 (Output_data_plt_powerpc::add_ifunc_entry,
2799 add_local_ifunc_entry): Adjust reloc for ELFv2.
2800 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2801 (glink_eh_frame_fde_64v2): New.
2802 (Stub_table::plt_call_size): Support ELFv2 sizing.
2803 (Output_data_glink::add_eh_frame): Use the new FDE.
2804 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2805 (Stub_table::do_write): Write ELFv2 stubs and glink.
2806 (Target_powerpc::Relocate::relocate): Replaces nop after call
2807 with ld 2,24(1) and adjust local offset destination for ELFv2.
2808
f9c6b907
AM
28092013-10-30 Alan Modra <amodra@gmail.com>
2810
2811 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2812 (Target_powerpc::Scan::global, local): Likewise.
2813 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2814 on all ppc64 @h and @ha relocs.
2815
e84fe78f
AM
28162013-10-14 Alan Modra <amodra@gmail.com>
2817
2818 * output.h (Output_data_got::add_constant): Tidy.
2819 (Output_data_got::add_constant_pair): New function.
2820 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2821 methods used so as to first call reserve_ent().
2822
679e4abf
RM
28232013-10-11 Roland McGrath <mcgrathr@google.com>
2824
44dcb735
RM
2825 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2826 add_got_entry and add_got_entry_pair.
2827
13323c49
RM
2828 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2829 (HAVE_PUBNAMES): Likewise.
2830 * configure: Regenerate.
2831
1496b446
RM
2832 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2833 * testsuite/Makefile.in: Regenerate.
2834
cc84c10b
RM
2835 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2836 Remove const from declaration.
2837 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2838 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2839 * output.h (Output_file_header): Remove const from member target_
2840 and corresponding constructor argument.
2841 * output.cc (Output_file_header::Output_file_header): Update prototype.
2842 (Output_file_header::do_sized_write): Use this->target_ in place
2843 of parameters()->target().
2844
52f66a2c
RM
2845 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2846
2b64b551
RM
2847 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2848 * configure: Regenerate.
2849 * Makefile.in: Regenerate.
2850 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2851 * testsuite/merge_string_literals_2.c: Likewise.
2852 * testsuite/Makefile.am
2853 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2854 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2855 literal -fmerge-constants.
2856 * testsuite/Makefile.in: Regenerate.
2857
43819297
RM
2858 * i386.cc (Target_i386): Remove unused member dynbss_.
2859 * arm.cc (Target_arm): Likewise.
2860 * powerpc.cc (Target_powerpc): Likewise.
2861 * sparc.cc (Target_sparc): Likewise.
2862 * tilegx.cc (Target_tilegx): Likewise.
2863 * x86_64.cc (Target_x86_64): Likewise.
2864 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2865 type_signature_, type_offset_.
2866 * plugin.h (Plugin_hook): Remove unused member layout_.
2867 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2868 mapfile_.
2869 (Read_member): Remove unused members input_objects_, symtab_,
2870 mapfile_, layout_.
2871 (Check_library): Remove unused member symtab_.
2872 * archive.h (Lib_group): Remove unused member lib_.
2873 * archive.cc (Lib_group::Lib_group): Update initializer.
2874 * incremental.h (Incremental_binary): Remove unused member target_.
2875 (Incremental_script_entry): Removed unused member script_.
2876 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2877 * icf.h (Icf): Remove unused member num_tracked_relocs.
2878
39d9ead7
RM
2879 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2880 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2881 its only use.
2882 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2883
679e4abf
RM
2884 * archive.h: Use struct rather than class for forward declaration
2885 of Read_symbols_data.
2886
54de2ea6
CC
28872013-10-07 Cary Coutant <ccoutant@google.com>
2888
2889 PR gold/16010
2890 * testsuite/Makefile.am (icf_test): Fix dependencies.
2891 (icf_safe_test): Likewise.
2892 (icf_safe_so_test): Likewise.
2893 (large_symbol_alignment): Add empty _LDADD rule.
2894 * testsuite/Makefile.in: Regenerate.
2895
b14016f0
L
28962013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2897
2898 PR gold/15927
2899 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2900 relocation for R_X86_64_32 on x32.
2901
eb426534
RM
29022013-08-27 Roland McGrath <mcgrathr@google.com>
2903
2904 * output.cc (Output_segment::set_section_addresses): Take new
2905 Target* argument. If target->isolate_execinstr() and the segment
2906 is executable and starts at a target->abi_pagesize() boundary,
2907 pad its end out to a target->abi_pagesize() boundary with code fill.
2908 * output.h (Output_segment::set_section_addresses): Update decl.
2909 * layout.h (Layout::check_output_data_for_reset_values): Take new
2910 argument RELAX_OUTPUTS.
2911 (Layout): New member relax_output_list_.
2912 (Layout::add_relax_output): New method.
2913 * layout.cc (Layout::Layout): Update constructor.
2914 (Layout::reset_relax_output): New method.
2915 (Layout::clean_up_after_relaxation): Call it.
2916 (Layout::prepare_for_relaxation): Update caller.
2917 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2918 Call reset_relax_output before re-processing segments for
2919 isolate_execinstr case.
2920 (Layout::write_data): Handle relax_output_list_.
2921 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2922 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2923
9aff4b7a
NC
29242013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2925
2926 PR binutils/15834
2927 * object.h: Fix typos.
2928
93f8221c
RM
29292013-08-16 Roland McGrath <mcgrathr@google.com>
2930
2931 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2932 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2933
e44c3715
CC
29342013-08-07 Cary Coutant <ccoutant@google.com>
2935
2936 Revert support for v2 DWP files:
2937
2938 2013-03-01 Cary Coutant <ccoutant@google.com>
2939
2940 Add dwp support for v2 DWARF package file format.
2941 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2942 tu_length parameter. Adjust all callers.
2943 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2944 * dwp.cc: Include dwarf.h.
2945 (Section_bounds): New struct type.
2946 (Unit_set): New struct type.
2947 (Dwo_file::Dwo_file): Initialize new data member.
2948 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2949 Combine and rename to...
2950 (Dwo_file::read_unit_index): ...this.
2951 (Dwo_file::sized_read_compunit_index)
2952 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2953 (Dwo_file::sized_read_unit_index): ...this.
2954 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2955 parameters; add section_id parameter.
2956 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2957 (Dwo_file::add_unit_set): ...this.
2958 (Dwo_file::shndx_map_): Remove.
2959 (Dwo_file::sect_offsets_): New data member.
2960 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2961 (Dwp_output_file::add_section): Rename to...
2962 (Dwp_output_file::add_contribution): ...this.
2963 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2964 (Dwp_output_file::add_tu_set): Likewise.
2965 (Dwp_output_file::Contribution): New type.
2966 (Dwp_output_file::Section::contributions): New data member.
2967 (Dwp_output_file::Cu_or_tu_set): Remove.
2968 (Dwp_output_file::Section::Section): New ctor.
2969 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2970 (Dwp_output_file::Dwp_index::Section_table): New type.
2971 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2972 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2973 parameter.
2974 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2975 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2976 (Dwp_output_file::Dwp_index::section_table): New member function.
2977 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2978 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2979 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2980 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2981 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2982 (Dwp_output_file::Dwp_index::section_table_): New data member.
2983 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2984 (Dwp_output_file::add_output_section): New member function.
2985 (Dwp_output_file::write_new_section): New member function.
2986 (Dwp_output_file::write_contributions): New member function.
2987 (Dwp_output_file::section_id_map_): New data member.
2988 (class Dwo_id_info_reader): Remove.
2989 (class Unit_reader): New class.
2990 (get_dwarf_section_name): New function.
2991 (Dwo_file::read_executable): Adjust initializations of class data.
2992 (Dwo_file::read): Add support for v2 package file format.
2993 (Dwo_file::read_unit_index): Likewise.
2994 (Dwo_file::sized_read_unit_index): Likewise.
2995 (Dwo_file::copy_section): Likewise.
2996 (Dwo_file::add_unit_set): Likewise.
2997 (Dwp_output_file::add_output_section): Likewise.
2998 (Dwp_output_file::add_contribution): Likewise.
2999 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3000 for empty slot.
3001 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3002 file format.
3003 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3004 slot.
3005 (Dwp_output_file::initialize): Remove unused function.
3006 (Dwp_output_file::finalize): Add support for v2 package file format.
3007 (Dwp_output_file::write_index): Likewise.
3008 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3009 function prototype.
3010
c6905c28
CC
30112013-07-31 Cary Coutant <ccoutant@google.com>
3012
3013 * object.cc (Sized_relobj::do_output_section_address): New function.
3014 (Sized_relobj): Instantiate explicitly.
3015 * object.h (Object::output_section_address): New function.
3016 (Object::do_output_section_address): New function.
3017 (Sized_relobj::do_output_section_address): New function.
3018 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3019
30202013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 3021 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
3022
3023 * parameters.cc (Parameters::entry): Return target-specific entry
3024 symbol name.
3025 * target.h (Target::entry_symbol_name): New function.
3026 (Target_info::entry_symbol_name): New data member.
3027
3028 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3029 * i386.cc (Target_i386::i386_info): Likewise.
3030 (Target_i386_nacl::i386_nacl_info): Likewise.
3031 * sparc.cc (Target_sparc::sparc_info): Likewise.
3032 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3033 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3034 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3035 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3036
234d4ab8
SA
30372013-07-22 Sterling Augustine <saugustine@google.com>
3038
3039 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3040 Convert parameter shndx to local variable. Add parameters symtab
3041 and symtab_size. Scan over section names. Find relocation
3042 section corresponding to current section. Create and initialize
3043 reloc_mapper_ and reloc_type_.
3044 (Dwarf_pubnames_table::read_header): Add assertion. Change
3045 unit_length to off_t. Initialize member unit_length_. Fill in field
3046 cu_offset_.
3047 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3048 Initialize new fields unit_length_ and cu_offset_.
3049 (Dwarf_pubnames_table::read_section): Update prototype.
3050 (Dwarf_pubnames_table::cu_offset): New member function.
3051 (Dwarf_pubnames_table::subsection_size): Likewise.
3052 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3053 New fields.
3054 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3055 member functions public.
3056 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3057 Update comment. Rework logic. Move repeated parts to...
3058 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3059 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3060 pubtypes_table_, and stmt_list_offset.
3061 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3062 Gdb_index::find_pubtype_offset,
3063 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3064 (Gdb_index::pubnames_read): Update prototype and rework logic.
3065 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3066 Forward declare.
3067 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3068 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3069 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3070 Gdb_index::map_pubtable_to_dies):
3071 Declare functions.
3072 (Gdb_index::pubnames_read): Update declaration.
3073 (Gdb_index::Pubname_offset_map): New type.
3074 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3075 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3076 Gdb_index::stmt_list_offset): Declare.
3077 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3078 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3079 Gdb_index::pubtypes_offset_): Remove.
3080
a3ed37d8
RM
30812013-07-19 Roland McGrath <mcgrathr@google.com>
3082
3083 * options.h (General_options): Add -Trodata-segment option.
3084 * parameters.cc (Parameters::check_rodata_segment): New function.
3085 (Parameters::set_target_once): Call it.
3086 * parameters.h (Parameters): Declare it (private member function).
3087 * layout.cc (load_seg_unusable_for_headers): New function, broken
3088 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3089 then validate rodata segment rather than text segment.
3090 (relaxation_loop_body): Call that.
3091 (is_text_segment): New function. Don't admit a non-executable
3092 segment if TARGET->isolate_execinstr().
3093 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3094
eb5b4ded
CC
30952013-07-15 Shawn Landden <shawnlandden@gmail.com>
3096
3097 PR gold/15070
3098 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3099 * nacl.h (Sniff_file::View::View): Request aligned view.
3100
4d5effb9
CC
31012013-07-11 Cary Coutant <ccoutant@google.com>
3102
3103 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3104 correct BRLT entry size.
3105
ba8ca3e7
AM
31062013-07-03 Alan Modra <amodra@gmail.com>
3107
3108 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3109 comment.
3110
267257d2
CC
31112013-07-01 Cary Coutant <ccoutant@google.com>
3112
3113 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3114 reloc_type_.
3115 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3116 (Dwarf_ranges_table::lookup_reloc): New function.
3117 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3118 reloc_type_.
3119 (Dwarf_ranges_table::lookup_reloc): New function.
3120 (Dwarf_ranges_table::reloc_type_): New data member.
3121
06f30c9d
CC
31222013-06-27 Jing Yu <jingyu@google.com>
3123
3124 PR gold/15662
3125 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3126 function.
3127 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3128 (Target_powerpc::do_relax): Call the above.
3129
a2d7bf59
AM
31302013-06-27 Cary Coutant <ccoutant@google.com>
3131
3132 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3133 on garbage collected .opd section.
3134
31352013-06-27 Alan Modra <amodra@gmail.com>
3136
3137 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3138 is non-zero.
3139 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3140 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3141
32364e50
CC
31422013-06-14 Cary Coutant <ccoutant@google.com>
3143
3144 * resolve.cc (Symbol::override_base): Don't override st_type
3145 from plugin placeholder symbols.
3146 (Symbol_table::resolve): Likewise.
3147 (Symbol_table::should_override): Don't complain about TLS mismatch
3148 if the TO symbol is a plugin placeholder.
3149 * testsuite/Makefile.am (plugin_test_tls): New test.
3150 * testsuite/Makefile.in: Regenerate.
3151 * testsuite/plugin_test_tls.sh: New test script.
3152 * testsuite/two_file_test_2_tls.cc: New test source.
3153 * testsuite/two_file_test_tls.cc: New test source.
3154
7fb47cc9
CC
31552013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3156
3157 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3158 the maximum segment alignment is larger than the page size.
3159 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3160 correctly aligns the symbols with large alignemnt.
3161 * testsuite/Makefile.in: Regenerate.
3162 * testsuite/large_symbol_alignment.cc: New file.
3163
6934001a
CC
31642013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3165 Sriraman Tallam <tmsriram@google.com>
3166
3167 * options.h (sort_section): New option.
3168 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3169 Rename from Input_section_sort_section_name_special_ordering_compare.
3170 (Input_section_sort_section_name_compare): New struct.
3171 * output.cc (Output_section::Input_section_sort_section_name_compare::
3172 operator()): New function.
3173 (Output_section::sort_attached_input_sections): Use new sort function
3174 for .text if --sort-section=name is specified.
3175 * layout.cc (Layout::make_output_section):
3176 Add sorting by name when --sort-section=name is specified.
3177 * testsuite/Makefile.am (text_section_grouping): Test option
3178 --sort-section=name.
3179 * testsuite/Makefile.in: Regenerate.
3180 * testsuite/section_sorting_name.cc: New file.
3181 * testsuite/section_sorting_name.sh: New file.
3182
93acabad
CC
31832013-05-21 Cary Coutant <ccoutant@google.com>
3184
3185 * symtab.h (Symbol::is_cxx_vtable): New function.
3186 * target-reloc.h (relocate_section): Check for vtable symbol.
3187 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3188 * testsuite/Makefile.in: Regenerate.
3189 * testsuite/missing_key_func.cc: New test source.
3190 * testsuite/missing_key_func.sh: New test script.
3191
60e8b3fc
CC
31922013-05-21 Cary Coutant <ccoutant@google.com>
3193
2b64b551
RM
3194 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3195 type of enclosing symbol.
3196 (Relocate_info::location): Check symbol type when describing symbol.
3197 * object.h (Symbol_location_info): Remove unused line_number;
3198 add enclosing_symbol_type.
3199 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3200
9df9de2c
CC
32012013-05-13 Cary Coutant <ccoutant@google.com>
3202
2b64b551
RM
3203 * configure.ac: Export DEFAULT_TARGET.
3204 * configure: Regenerate.
3205 * Makefile.in: Regenerate.
3206 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3207 * testsuite/Makefile.in: Regenerate.
3208 * testsuite/debug_msg.sh: Delete duplicate tests.
3209 Don't check undef_int error message match for powerpc where the
3210 source file and line number aren't available.
9df9de2c 3211
bbc5ae17
RM
32122013-05-10 Roland McGrath <mcgrathr@google.com>
3213
3214 * options.h (General_options): Add --rosegment-gap option.
3215 * options.cc (finalize): --rosegment-gap implies --rosegment.
3216 * layout.cc (set_segment_offsets): Let user option override
3217 target->rosegment_gap().
3218
0c6e6c39
RM
32192013-05-10 Roland McGrath <mcgrathr@google.com>
3220
3221 * options.h (General_options): Remove leading space from help
3222 messages for -nostdlib and --rosegment.
3223
cde7cb01
MR
32242013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3225
3226 PR ld/15365
3227 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3228
f31ae5b8
AM
32292013-05-03 Alan Modra <amodra@gmail.com>
3230
3231 * merge.cc (Output_merge_string::do_add_input_section): Correct
3232 scan for number of strings. Rename vars to avoid shadowing.
3233 Include missing terminator in input_size_.
3234
d3a7cd45
L
32352013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3236
3237 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3238 Restore empty string handling.
3239
6ad3daba
CC
32402013-05-01 Cary Coutant <ccoutant@google.com>
3241
3242 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3243 uninitialized warning.
3244
e31908b6
CC
32452013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3246
3247 * output.cc (Output_section::add_merge_input_section): Allow
3248 to merge sections if the alignment is more than character size.
3249 * merge.h (Output_merge_string::Output_merge_string): Remove
3250 assert.
3251 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3252 only not-null strings. Check the alignment of strings.
3253 * stringpool.h
3254 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3255 alignment as the argument.
3256 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3257 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3258 Align non-zero length strings according to the addralign_.
3259 (Stringpool_template<Stringpool_char>::set_string_offsets):
3260 Updating offsets according to the given alignment.
3261 * testsuite/Makefile.am (text_section_grouping): Test if string
3262 literals are getting merged.
3263 * testsuite/Makefile.in: Regenerate.
3264 * testsuite/merge_string_literals_1.c: New file.
3265 * testsuite/merge_string_literals_2.c: Ditto.
3266 * testsuite/merge_string_literals.sh: Ditto.
3267
0e804863
ILT
32682013-04-26 Ian Lance Taylor <iant@google.com>
3269
3270 * target-reloc.h (relocate_section): If the reloc offset is out of
3271 range, pass VIEW as NULL to relocate.relocate.
3272 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3273 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3274 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3275 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3276 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3277 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3278
e7c5ea40
CC
32792013-04-26 Geoff Pike <gpike@chromium.org>
3280
3281 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3282 * layout.cc (Hash_task): New class.
3283 (Layout::queue_build_id_tasks): New function.
3284 (Layout::write_build_id): Handle single-thread portion of build ID
3285 computation. (In some cases, all of it is single-threaded.) Replace
3286 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3287 functionality in fewer lines of code.
3288 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3289 * options.h (General_options): make "--build-id" default to tree
3290 rather than sha1. Add two new options related to --build-id=tree:
3291 --build-id-chunk-size-for-treehash and
3292 --build-id-min-file-size-for-treehash.
3293 * Makefile.am: add testing of --build-id=tree and related new options
3294 (these tests will be invoked by "make check").
3295 * Makefile.in: Regenerate.
3296
49926cd0
AM
32972013-04-25 Alan Modra <amodra@gmail.com>
3298
3299 * configure.tgt: Add powerpcle and powerpc64le.
3300
a4034750
AM
33012013-04-22 Alan Modra <amodra@gmail.com>
3302
3303 PR gold/15355
3304 * layout.cc (Layout::segment_precedes): Allow more than one
3305 segment with the same type and flags.
3306
e79c84aa
CC
33072013-04-15 Cary Coutant <ccoutant@google.com>
3308
3309 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3310 allocate space in file for BSS sections.
3311
2199fbe7
CC
33122013-04-15 Cary Coutant <ccoutant@google.com>
3313
3314 * script-sections.cc (Orphan_output_section): Reset address
3315 to zero after each orphaned section for relocatable links.
3316
502e8a84
CC
33172013-04-15 Cary Coutant <ccoutant@google.com>
3318
a4034750
AM
3319 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3320 section starting address for relocatable link.
3321 * testsuite/Makefile.am (script_test_11): New test.
3322 * testsuite/Makefile.in: Regenerate.
3323 * testsuite/script_test_11.c: New source file.
3324 * testsuite/script_test_11.t: New linker script.
502e8a84 3325
0cfdc767
AM
33262013-04-13 Alan Modra <amodra@gmail.com>
3327
3328 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3329 owner when sections are not adjacent and exceed group size.
3330 (Target_powerpc::group_sections): Handle corner case.
3331 (Target_powerpc::Branch_info::make_stub): Handle case where
3332 stub table doesn't exist due to branches in non-exec sections.
3333 (Target_powerpc::Relocate::relocate): Likewise.
3334
6830ee24
AM
33352013-04-11 Alan Modra <amodra@gmail.com>
3336
3337 PR gold/15354
3338 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3339 .branch_lt to match bfd ld. Adjust comments throughout file.
3340
54a3d865
ILT
33412013-04-04 Ian Lance Taylor <iant@google.com>
3342
3343 GCC PR c++/56840
3344 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3345 sections before checking whether they are included in the link.
3346
9993ba11
ST
33472013-03-29 Sriraman Tallam <tmsriram@google.com>
3348
3349 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3350 object before calling the plugin claim_file handler. Pass the elf
3351 object of the archive to the plugin. Delete the elf object if the
3352 plugin claims the file.
3353
ebacd51e
AM
33542013-03-21 Alan Modra <amodra@gmail.com>
3355
3356 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3357 segment when omagic.
3358
117be58f
AM
33592013-03-21 Alan Modra <amodra@gmail.com>
3360
3361 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3362 comparison warning.
3363 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3364 uninitialized" warning.
3365
32e2b61d
AM
33662013-03-20 Alan Modra <amodra@gmail.com>
3367
3368 * symtab.h (Symbol::clear_version): New function.
3369 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3370 is_needed by weak references. Clear version for symbols defined
3371 in as-needed objects that are not needed.
3372
b3ccdeb5
AM
33732013-03-15 Alan Modra <amodra@gmail.com>
3374
3375 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3376 static and public. Add report_err param. Return false for data refs.
3377 (Target_powerpc::rela_dyn_section): New overloaded function.
3378 (Target_powerpc::plt_, iplt_): Elucidate.
3379 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3380 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3381 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3382 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3383 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3384 push_branch and make_plt_entry for ifunc syms when
3385 reloc_needs_plt_for_ifunc.
3386 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3387 for ifunc unless reloc_needs_plt_for_ifunc.
3388
ad3d8a2f
AM
33892013-03-15 Alan Modra <amodra@gmail.com>
3390
3391 * gc.h (gc_process_relocs): Don't look through function descriptors.
3392 * icf.cc (get_section_contents): Do so here instead.
3393
4d9aa155
AM
33942013-03-13 Alan Modra <amodra@gmail.com>
3395
3396 * powerpc.cc (is_branch_reloc): Forward declare.
3397 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3398 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3399 false for 64-bit, true for 32-bit non-branch relocs.
3400 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3401 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3402 nm output.
3403 (icf_safe_test): Generate linker map file as well as nm output.
3404 (icf_safe_so_test): Likewise.
3405 * testsuite/Makefile.in: Regenerate.
3406 * testsuite/icf_test.sh: Parse linker map file to determine
3407 section folding.
3408 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3409 * testsuite/icf_safe_so_test.sh: Likewise.
3410 (X86_32_or_ARM_specific_safe_fold): Merge into..
3411 (arch_specific_safe_fold): ..this.
3412 (X86_64_specific_safe_fold): Delete unused function.
3413
57420c20
AM
34142013-03-12 Alan Modra <amodra@gmail.com>
3415
3416 * gc.h (gc_process_relocs): Look through function descriptors
3417 to determine shndx, symvalue and addend used by ICF. Tidy
3418 variable duplication.
3419
dc3714f3
AM
34202013-03-11 Alan Modra <amodra@gmail.com>
3421
3422 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3423 * layout.cc (Layout_task_runner::run): ..to here.
3424 * symtab.h (struct Symbol_location): Extract from..
3425 (class Symbol_table): ..here.
3426 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3427 * target.h (class Target): Add function_location and
3428 do_function_location functions.
3429 (class Sized_target): Add do_function_location.
3430 * object.h (class Sized_relobj_file): Move find_shdr..
3431 (class Object): ..to here.
3432 * object.cc: Likewise. Update to suit. Instantiate.
3433 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3434 * powerpc.cc (class Powerpc_dynobj): New.
3435 (Target_powerpc::do_function_location): New function.
3436 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3437 (Powerpc_dynobj::do_read_symbols): New function.
3438 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3439
956b03bb
ILT
34402013-03-08 Ian Lance Taylor <iant@google.com>
3441
3442 * options.cc (General_options::string_to_object_format): Accept
3443 "default".
3444
4bead2d5
AM
34452013-03-08 Alan Modra <amodra@gmail.com>
3446
3447 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3448 pointer to Post_fde.
3449 (struct Post_fde): Move definition to here..
3450 * ehframe.cc (struct Post_fde): ..from here.
3451 (Cie::write): Don't alloc Post_fde.
3452 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3453
02e60bf7
AM
34542013-03-07 Alan Modra <amodra@gmail.com>
3455
3456 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3457 relocation referencing .LC0.
3458 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3459
8343f03a
AM
34602013-03-07 Alan Modra <amodra@gmail.com>
3461
3462 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3463 always_inline. Add assembly for powerpc to avoid GOT.
3464
3366d57c
AM
34652013-03-07 Alan Modra <amodra@gmail.com>
3466
3467 * testsuite/script_test_10.sh: Don't test .bss section
3468 header number.
3469
6c77229c
AM
34702013-03-06 Alan Modra <amodra@gmail.com>
3471
3472 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3473 (Target_powerpc::symval_for_branch): Add symtab param. Update
3474 all callers. Handle folded sections.
3475 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3476 to Powerpc_relobj.
3477 (Global_symbol_visitor_opd::operator()): Likewise.
3478
a39e4af6
AM
34792013-03-04 Alan Modra <amodra@gmail.com>
3480
3481 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3482 * testsuite/Makefile.in: Regenerate.
3483
d5834edb
CC
34842013-03-01 Cary Coutant <ccoutant@google.com>
3485
3486 Add dwp support for v2 DWARF package file format.
3487 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3488 tu_length parameter. Adjust all callers.
3489 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3490 * dwp.cc: Include dwarf.h.
3491 (Section_bounds): New struct type.
3492 (Unit_set): New struct type.
3493 (Dwo_file::Dwo_file): Initialize new data member.
3494 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3495 Combine and rename to...
3496 (Dwo_file::read_unit_index): ...this.
3497 (Dwo_file::sized_read_compunit_index)
3498 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3499 (Dwo_file::sized_read_unit_index): ...this.
3500 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3501 parameters; add section_id parameter.
3502 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3503 (Dwo_file::add_unit_set): ...this.
3504 (Dwo_file::shndx_map_): Remove.
3505 (Dwo_file::sect_offsets_): New data member.
3506 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3507 (Dwp_output_file::add_section): Rename to...
3508 (Dwp_output_file::add_contribution): ...this.
3509 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3510 (Dwp_output_file::add_tu_set): Likewise.
3511 (Dwp_output_file::Contribution): New type.
3512 (Dwp_output_file::Section::contributions): New data member.
3513 (Dwp_output_file::Cu_or_tu_set): Remove.
3514 (Dwp_output_file::Section::Section): New ctor.
3515 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3516 (Dwp_output_file::Dwp_index::Section_table): New type.
3517 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3518 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3519 parameter.
3520 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3521 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3522 (Dwp_output_file::Dwp_index::section_table): New member function.
3523 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3524 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3525 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3526 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3527 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3528 (Dwp_output_file::Dwp_index::section_table_): New data member.
3529 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3530 (Dwp_output_file::add_output_section): New member function.
3531 (Dwp_output_file::write_new_section): New member function.
3532 (Dwp_output_file::write_contributions): New member function.
3533 (Dwp_output_file::section_id_map_): New data member.
3534 (class Dwo_id_info_reader): Remove.
3535 (class Unit_reader): New class.
3536 (get_dwarf_section_name): New function.
3537 (Dwo_file::read_executable): Adjust initializations of class data.
3538 (Dwo_file::read): Add support for v2 package file format.
3539 (Dwo_file::read_unit_index): Likewise.
3540 (Dwo_file::sized_read_unit_index): Likewise.
3541 (Dwo_file::copy_section): Likewise.
3542 (Dwo_file::add_unit_set): Likewise.
3543 (Dwp_output_file::add_output_section): Likewise.
3544 (Dwp_output_file::add_contribution): Likewise.
3545 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3546 for empty slot.
3547 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3548 file format.
3549 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3550 slot.
3551 (Dwp_output_file::initialize): Remove unused function.
3552 (Dwp_output_file::finalize): Add support for v2 package file format.
3553 (Dwp_output_file::write_index): Likewise.
3554 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3555 function prototype.
3556
a68a081d
CC
35572013-03-01 Cary Coutant <ccoutant@google.com>
3558
3559 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3560 function into class definition in header file.
3561 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3562 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3563 New function.
3564 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3565
9d5781f8
AM
35662013-02-28 Alan Modra <amodra@gmail.com>
3567
3568 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3569 * target.cc (Target::do_plt_fde_location): New function.
3570 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3571 accessor function, and constructor param.
3572 (struct Post_fde, Post_fdes): Declare.
3573 (Cie::write): Add post_fdes param.
3574 * ehframe.cc (Fde::write): Use plt_fde_location.
3575 (struct Post_fde): Define.
3576 (Cie::write): Stash FDEs added post merge mapping.
3577 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3578 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3579 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3580 other FDEs.
3581 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3582 (Target_powerpc::has_glink): New function.
3583 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3584 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3585 glink_eh_frame_fde_32, default_fde): New data.
3586 (Stub_table::eh_frame_added_): New var.
3587 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3588 Make const.
3589 (Stub_table::add_eh_frame): New function.
3590 (Output_data_glink::add_eh_frame): New function.
3591 (Target_powerpc::make_glink_section): Call add_eh_frame.
3592
214383dd
ILT
35932013-02-15 Ian Lance Taylor <iant@google.com>
3594
3595 * options.h (DEFINE_uint64_alias): Define.
3596 (class General_options): Add -Ttext-segment as an alias for
3597 -Ttext.
3598
91c2b899
AM
35992013-02-15 Alan Modra <amodra@gmail.com>
3600
3601 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3602 (Stub_table::do_write): ..here, two places.
3603 (Stub_table::plt_call_size): Use it here too.
3604
20e2a8aa
ILT
36052013-02-11 Ian Lance Taylor <iant@google.com>
3606
3607 * descriptors.cc (Descriptors::close_all): New function.
3608 * descriptors.h (class Descriptors): Declare close_all.
3609 (close_all_descriptors): New inline function.
3610 * plugin.cc: Include "descriptors.h".
3611 (Plugin_manager::cleanup): Call close_all_descriptors.
3612
8952bc69
AM
36132013-02-06 Alan Modra <amodra@gmail.com>
3614
3615 * README: Update coding style link.
3616
29bd8b6b
CC
36172013-01-28 Cary Coutant <ccoutant@google.com>
3618
a4034750
AM
3619 * dwp.cc (File_list): New typedef.
3620 (Dwo_name_info_reader): New class.
3621 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3622 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3623 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3624 (Dwo_file::read_executable): New function.
3625 (Dwo_file::read): Move common setup code to ...
3626 (Dwo_file::make_object): ... here.
3627 (dwp_options): Add --exec/-e.
3628 (usage): Likewise.
3629 (main): Likewise.
29bd8b6b 3630
c6ac678d
ST
36312013-01-24 Sriraman Tallam <tmsriram@google.com>
3632
3633 * layout.cc (Layout::layout): Check for option text_reorder.
3634 (Layout::make_output_section): Ditto.
3635 * options.h (text_reorder): New option.
3636 * output.cc (Input_section_sort_compare): Remove special ordering
3637 of section names.
3638 (Output_section::
3639 Input_section_sort_section_name_special_ordering_compare::
3640 operator()): New function.
3641 (Output_section::sort_attached_input_sections): Use new sort function
3642 for .text.
3643 * output.h (Input_section_sort_section_name_special_ordering_compare):
3644 New struct.
3645 * testsuite/Makefile.am (text_section_grouping): Test option
3646 --no-text-reorder
3647 * testsuite/Makefile.in: Regenerate.
3648 * testsuite/text_section_grouping.sh: Check order of functions without
3649 default text reordering.
3650
50701cc1
MF
36512013-01-18 Mike Frysinger <vapier@gentoo.org>
3652
3653 * options.h (General_options): Change default to true for new_dtags.
3654
b1b00fcc
MF
36552013-01-18 Mike Frysinger <vapier@gentoo.org>
3656
3657 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3658 when enable_new_dtags is false. Only add DT_RUNPATH when
3659 enable_new_dtags is true.
3660
ec5b8187
AM
36612013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3662
3663 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3664 used in declaration and definition consistent.
3665 (Target_powerpc::symval_for_branch): Ditto.
3666
a880d4c4
ST
36672013-01-16 Sriraman Tallam <tmsriram@google.com>
3668
3669 * testsuite/plugin_final_layout.cc: Fix comment.
3670
7c381248
ST
36712013-01-16 Sriraman Tallam <tmsriram@google.com>
3672
3673 * layout.cc (Layout::layout): Do not do default sorting for
3674 text sections when section ordering is specified.
3675 (make_output_section): Ditto.
3676 * testsuite/plugin_final_layout.cc: Name the function sections
3677 to catch reordering issues.
3678
e2458743
AM
36792013-01-15 Alan Modra <amodra@gmail.com>
3680
3681 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3682 plt-thread-safe.
3683
431ed302
AM
36842013-01-15 Alan Modra <amodra@gmail.com>
3685
3686 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3687 * testsuite/Makefile.in: Regenerate.
3688
0ec6429b
AM
36892013-01-14 Alan Modra <amodra@gmail.com>
3690
3691 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3692 * testsuite/Makefile.in: Regenerate.
3693
0bf402d5
ILT
36942013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3695
36af3926 3696 PR bfd/14430
0bf402d5
ILT
3697 Fix mingw gold build with plugins enabled
3698 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3699 * configure.ac: Export DLOPEN_LIBS and add headers check.
3700 * plugin.cc: Handle non-dlfcn case.
3701 * Makefile.in: Regenerate.
3702 * config.in: Regenerate.
3703 * configure: Regenerate.
3704 * testsuite/Makefile.in: Regenerate.
3705
9e9143bc
ST
37062013-01-09 Sriraman Tallam <tmsriram@google.com>
3707
3708 * output.h (sort_attached_input_sections): Change to be public.
3709 * script-sections.cc
3710 (Output_section_definition::set_section_addresses): Sort
3711 attached input sections according to section order before linker
3712 script assigns section addresses.
3713 (Orphan_output_section::set_section_addresses): Sort
3714 attached input sections according to section order before linker
3715 script assigns section addresses.
3716 * Makefile.am (final_layout.sh): Use a simple linker script to
3717 check if section ordering still works.
3718 * Makefile.in: Regenerate.
3719
679af368
ILT
37202013-01-09 Ben Cheng <bccheng@google.com>
3721
3722 * arm.cc (Target_arm::attributes_accept_div): New function.
3723 (Target_arm::attributes_forbid_div): New function.
3724 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3725 attribute using the same new functions as what bfd/elf32_arm.c
3726 does.
3727
3136a00e
CC
37282013-01-07 Cary Coutant <ccoutant@google.com>
3729
3730 PR gold/14993
3731 * output.cc (Output_section::add_input_section): For incremental
3732 updates, don't track input sections that are allocated from patch
3733 space.
3734
f2a6224b
L
37352013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3736 Ian Lance Taylor <iant@google.com>
3737
3738 PR gold/14897
3739 * configure.ac (--enable-ld): Removed.
3740 (install_as_default): Set to yes only for --enable-gold=default
3741 or --disable-ld.
3742 * configure: Regenerated.
3743
4f46f626
L
37442013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3745
3746 * options.h (General_options): Add -fuse-ld= for GCC linker
3747 option compatibility.
3748
26e4ef59
CC
37492013-01-04 Cary Coutant <ccoutant@google.com>
3750
3751 * configure.ac: Fix typo restoring CXXFLAGS.
3752 * configure: Regenerate.
3753
3d587466
CC
37542013-01-04 Cary Coutant <ccoutant@google.com>
3755
4f46f626
L
3756 * testsuite/Makefile.am (CXXLINK_S): New macro.
3757 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3758 * testsuite/Makefile.in: Regenerate.
3d587466 3759
44db6695
L
37602013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3761
3762 * version.cc (print_version): Update copyright year to 2013.
3763
edcac0c1
ILT
37642012-12-20 Ian Lance Taylor <iant@google.com>
3765
3766 * layout.cc (Layout::special_ordering_of_input_section): New
3767 function.
3768 (Layout::layout): If input section requires special ordering, must
3769 sort input sections.
3770 (Layout::make_output_section): May sort .text input sections.
3771 (Layout::is_section_name_prefix_grouped): Remove.
3772 * layout.h (class Layout): Declare
3773 special_ordering_of_input_section. Don't declare
3774 is_section_name_prefix_grouped.
3775 * output.cc (Output_section::add_input_section): Revert last
3776 change.
3777 (Output_section::Input_section_sort::match_file_name): Don't crash
3778 if called on output section data.
3779 (Output_section::Input_section_sort_compare): Sort based on
3780 special ordering.
3781 (Output_section::Input_section_sort_section_order_index_compare):
3782 Revert last patch.
3783 (Output_section::sort_attached_input_sections): Likewise.
3784
28f2a4ac
ST
37852012-12-18 Sriraman Tallam <tmsriram@google.com>
3786
edcac0c1 3787 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3788 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3789 * output.cc (Output_section::add_input_section): Check if section
3790 name contains special prefix. Keep input sections to sort such
3791 sections.
3792 (Output_section::Input_section_sort_section_order_index_compare
3793 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3794 (Output_section::sort_attached_input_sections): Add condition to
3795 Input_section_entry constructor call.
28f2a4ac
ST
3796 * testsuite/Makefile.am (text_section_grouping): New test.
3797 * testsuite/Makefile.in: Regenerate.
3798 * testsuite/text_section_grouping.cc: New file.
3799 * testsuite/text_section_grouping.sh: New file.
3800
5bf135a7
NC
38012012-12-17 Nick Clifton <nickc@redhat.com>
3802
3803 * Makefile.am: Add copyright notice.
3804 * NEWS: Likewise.
3805 * README: Likewise.
3806 * configure.ac: Likewise.
3807 * ftruncate.c: Likewise.
3808 * Makefile.in: Regenerate.
3809
59965708
CC
38102012-12-14 Cary Coutant <ccoutant@google.com>
3811
a4034750
AM
3812 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3813 --no-as-needed flag.
3814 (exception_separate_shared_12_test): Likewise.
3815 (incremental_copy_test): Likewise.
3816 * testsuite/Makefile.in: Regenerate.
59965708 3817
2a77e2ab
CC
38182012-12-14 Cary Coutant <ccoutant@google.com>
3819
3820 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3821 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3822
e3deeb9c
AM
38232012-12-12 Alan Modra <amodra@gmail.com>
3824
3825 * powerpc.cc (class Track_tls): New.
3826 (class Relocate, class Scan): Inherit Track_tls.
3827 (Target_powerpc::Scan::local, global): Track tls optimization
3828 and avoid creating plt entry for __tls_get_addr if all uses
3829 are optimized away.
3830 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3831
d8f5a274
AM
38322012-12-12 Alan Modra <amodra@gmail.com>
3833
3834 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3835 Replace no_toc_optimize with toc_optimize.
3836 * output.h (Output_section::input_sections): Provide non-const variant.
3837 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3838 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3839 accessors.
3840 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3841 (class Sort_toc_sections): New.
3842 (Target_powerpc::do_finalize_sections): Sort toc sections.
3843 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3844
4c8a1de1
RM
38452012-12-10 Roland McGrath <mcgrathr@google.com>
3846
3847 * testsuite/binary_unittest.cc (read_all): New function.
3848 (Sized_binary_test): Use it instead of ::read.
3849 * fileread.cc (do_read): Don't assume pread always reads the whole
3850 amount in a single call.
3851
edc27beb
AM
38522012-12-10 Alan Modra <amodra@gmail.com>
3853
3854 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3855 Set EM_PPC64 or EM_PPC here.
3856 (Target_selector_powerpc::do_recognize): Delete.
3857
906b9150
AM
38582012-12-10 Alan Modra <amodra@gmail.com>
3859
3860 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3861 stub_table_.
3862 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3863
418c15ae
RM
38642012-12-07 Roland McGrath <mcgrathr@google.com>
3865
3866 * testsuite/binary_unittest.cc (Sized_binary_test):
3867 Use open_descriptor rather than ::open.
3868
decdd3bc
AM
38692012-12-07 Alan Modra <amodra@gmail.com>
3870
3871 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3872 typedef and invalid_address constant.
3873 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3874 instantiate constants.
3875
db399005
ILT
38762012-12-06 Roland McGrath <mcgrathr@google.com>
3877
3878 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3879 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3880 * aclocal.m4: Regenerate.
3881 * configure: Regenerate.
3882 * Makefile.in: Regenerate.
3883 * testsuite/Makefile.in: Regenerate.
3884
aba6bc71
AM
38852012-12-07 Alan Modra <amodra@gmail.com>
3886
3887 * options.h (General_options): Add no_toc_optimize.
3888 * powerpc.cc (ok_lo_toc_insn): New function.
3889 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3890
9e69ed50
AM
38912012-12-06 Alan Modra <amodra@gmail.com>
3892
3893 * options.h (General_options): Add plt_align, plt_static_chain,
3894 plt_thread_safe. Update stub_group_size help text.
3895 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3896 for new plt_thread_safe_ var.
3897 (use_plt_offset): Correct comments.
3898 (Target_powerpc::do_relax): Look for thread creation symbols to
3899 determine default plt_thread_safe value. Clear plt call stubs
3900 as well as branch stubs each iteration.
3901 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3902 insn constants.
3903 (l, hi, ha, write_insn): Move earlier.
3904 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3905 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3906 plt stubs too.
3907 (Stub_table::update_size): Adjust.
3908 (Stub_table::prev_size, set_prev_size): Delete.
3909 (Stub_table::stub_align): Let --plt-align affect result.
3910 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3911 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3912 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3913 (Stub_table::do_write): Support more stub variants.
3914
f43ba157
AM
39152012-12-04 Alan Modra <amodra@gmail.com>
3916
3917 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3918 (Target_powerpc::do_define_standard_symbols): New function.
3919
34171bc5
AM
39202012-12-03 Alan Modra <amodra@gmail.com>
3921
3922 * output.h: Formatting, whitespace.
3923
dc9589e9 39242012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3925
3926 * layout.h (Layout::get_executable_sections): Declare.
3927 * layout.cc (Layout::get_executable_sections): New function.
3928 * arm.cc (Target_arm::group_sections): Use it.
3929 (Arm_output_section::group_sections): Delete now redundant test.
3930 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3931 param to handle relative relocs.
3932 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3933 (Output_data_reloc::add_absolute): Adjust.
3934 (Output_data_reloc::add_relative): New function.
3935 (Output_data::reset_data_size): New function.
3936 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3937 (Output_section::set_addralign): New function.
3938 (Output_section::checkpoint_set_addralign): New function.
3939 (Output_section::clear_section_offsets_need_adjustment): New function.
3940 (Output_section::input_sections): Make public.
3941 * powerpc.cc (class Output_data_brlt_powerpc): New.
3942 (class Stub_table, class Stub_control): New.
3943 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3944 stub_table_, set_stub_table, stub_table): New vectors and accessor
3945 functions.
3946 (Target_powerpc::do_may_relax, do_relax, push_branch,
3947 new_stub_table, stub_tables, brlt_section, group_sections,
3948 add_branch_lookup_table, find_branch_lookup_table,
3949 write_branch_lookup_table, make_brlt_section): New functions.
3950 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3951 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3952 branch_info_): New vars.
3953 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3954 make call stubs here.
3955 (Output_data_glink): Remove all call stub handling from this class.
3956 (Target_powerpc::Scan::local, global): Save interesting branch
3957 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3958 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3959 functions on final link.
3960 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3961 Handle long branch destinations too.
3962 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3963 do_plt_address_for_local): Adjust lookup of plt call stubs.
3964
627b30b7
AM
39652012-11-30 Alan Modra <amodra@gmail.com>
3966
3967 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3968 relocs against protected symbols when building 32-bit shared libs.
3969
40b469d7
AM
39702012-11-30 Alan Modra <amodra@gmail.com>
3971
3972 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3973 param. Call got_section() to make .got. Update all callers
3974 and their callers and so on.
3975
bb66a627
AM
39762012-11-30 Alan Modra <amodra@gmail.com>
3977
3978 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3979 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3980 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3981 value if it already exists.
3982
d2cf1c6c
L
39832012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3984
3985 PR gold/14858
3986 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3987
edccdf7c
RM
39882012-11-14 Roland McGrath <mcgrathr@google.com>
3989
3990 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3991 than bfc instruction for data sandboxing.
3992
6febeb74
AM
39932012-11-08 Alan Modra <amodra@gmail.com>
3994
3995 * po/POTFILES.in: Regenerate.
3996
0a6f1bf2
AM
39972012-11-05 Alan Modra <amodra@gmail.com>
3998
3999 * configure.ac: Apply 2012-09-10 change to config.in here.
4000 * configure: Regenerate.
4001
26a4e9cb
AM
40022012-11-05 Alan Modra <amodra@gmail.com>
4003
4004 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4005 (struct Opd_ent): Use "Address" rather than "Offset".
4006 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4007 (Target_powerpc::got_section): Make public.
4008 (Target_powerpc::scan_relocs): Move code setting symbols..
4009 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4010 Create _SDA_BASE_ only when referenced.
4011
cc928013
RM
40122012-11-02 Roland McGrath <mcgrathr@google.com>
4013
4014 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4015 from last change.
4016
50ed5eb1
RM
40172012-11-01 Roland McGrath <mcgrathr@google.com>
4018
62fe925a
RM
4019 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4020 for offset_in_output_section parameter.
4021 (Sized_target::relocate_special_relocatable): Likewise.
4022 * arm.cc (Target_arm::relocate_relocs): Likewise.
4023 (Target_arm::relocate_special_relocatable): Likewise.
4024 * i386.cc (Target_i386::relocate_relocs): Likewise.
4025 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4026 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4027 * target-reloc.h (relocate_relocs): Likewise.
4028 * testsuite/testfile.cc (Target_test): Likewise.
4029 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4030 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4031
4032 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4033 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4034
4035 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4036 parameter, which is unused in the [!F_SETFD] case.
4037
50ed5eb1
RM
4038 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4039 SYMNDX to off_t before comparing it to this->data_size().
4040 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4041 * incremental.cc (Output_section_incremental_inputs::do_write):
4042 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4043
2cadc0bf
RM
4044 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4045
3bfcb652
NC
40462012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4047
4048 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4049 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4050 in EABI_VER5.
4051
c1a8d56e
CC
40522012-10-29 Cary Coutant <ccoutant@google.com>
4053
4054 * dwp.cc (usage): Add file and exit status parameters;
4055 add --help and --version options.
4056 (print_version): New function.
4057 (main): Add --help and --version options.
4058
b2490a7b
L
40592012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4060
4061 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4062 final_layout_sequence.txt.
4063 * testsuite/Makefile.in: Regenerated.
4064
aa543512
L
40652012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4066
4067 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4068 COMPILE generated by automake.
4069 (LINK1): Likewise.
4070 (CXXCOMPILE1): Likewise.
4071 (CXXLINK1): Likewise.
4072 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4073 (LINK): Likewise.
4074 (CXXCOMPILE): Likewise.
4075 (CXXLINK): Likewise.
4076 * testsuite/Makefile.in: Regenerated.
4077
d361fafb
L
40782012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4079
4080 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4081 on bad fwrite return.
4082
598c7410
L
40832012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4084
4085 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4086 on val.
4087
35c813e2
CC
40882012-10-23 Cary Coutant <ccoutant@google.com>
4089
4090 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4091 * testsuite/Makefile.in: Regenerate.
4092 * testsuite/dwp_test.h: New source file.
4093 * testsuite/dwp_test_1.cc: New source file.
4094 * testsuite/dwp_test_1.s: New source file.
4095 * testsuite/dwp_test_1.sh: New source file.
4096 * testsuite/dwp_test_1b.cc: New source file.
4097 * testsuite/dwp_test_1b.s: New source file.
4098 * testsuite/dwp_test_2.cc: New source file.
4099 * testsuite/dwp_test_2.s: New source file.
4100 * testsuite/dwp_test_2.sh: New source file.
4101 * testsuite/dwp_test_main.cc: New source file.
4102 * testsuite/dwp_test_main.s: New source file.
4103
77429909
CC
41042012-10-23 Cary Coutant <ccoutant@google.com>
4105
4106 * dwp.h: New header file.
4107 * dwp.cc: New source file.
4108 * gold.h: Move shared declarations to system.h.
4109 * system.h: New header file.
4110 * Makefile.am: Add dwp.
4111 * Makefile.in: Regenerate.
4112
ed5d6712
CC
41132012-10-23 Cary Coutant <ccoutant@google.com>
4114
4115 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4116 Dwarf_info_reader::read_from_pointer.
4117 (Dwarf_pubnames_table::read_header): Likewise.
4118 (Dwarf_pubnames_table::next_name): Likewise.
4119 (Dwarf_die::read_attributes): Likewise.
4120 (Dwarf_die::skip_attributes): Likewise.
4121 (Dwarf_info_reader::read_from_pointer): New function template.
4122 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4123 (Dwarf_pubnames_table): Likewise.
4124 (Dwarf_info_reader::read_from_pointer): New function template.
4125 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4126 Dwarf_pubnames_table ctor.
4127
8787852d
CC
41282012-10-23 Cary Coutant <ccoutant@google.com>
4129
4130 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4131 abbrev_shndx.
4132 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4133 abbrev_shndx_.
4134 (Dwarf_info_reader::set_abbrev_shndx): New method.
4135 (Dwarf_info_reader::abbrev_shndx_): New data member.
4136
9fc236f3
CC
41372012-10-23 Cary Coutant <ccoutant@google.com>
4138
4139 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4140 from object, not parameters.
4141 (Dwarf_info_reader::parse): Likewise.
4142 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4143 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4144 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4145 methods.
4146
effe8365
CC
41472012-10-23 Cary Coutant <ccoutant@google.com>
4148
4149 * fileread.cc (Input_file::Input_file): New constructor.
4150 * fileread.h (class Input_file): Add new constructor.
4151
1698990d
AM
41522012-10-18 Alan Modra <amodra@gmail.com>
4153
4154 PR gold/14727
4155 * object.cc (Relobj::is_section_name_included): Also match
4156 .sdata personality section.
4157
168a4726
AM
41582012-10-18 Alan Modra <amodra@gmail.com>
4159
4160 * target-reloc.h (class Default_comdat_behavior): New, package up..
4161 (get_comdat_behaviour): ..this.
4162 (relocate_section): Add Relocate_comdat_behavior template arg,
4163 adjust code to suit.
4164 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4165 (Target_arm::scan_reloc_section): Likewise.
4166 * i386.cc (Target_i386::relocate_section): Likewise.
4167 * sparc.cc (Target_sparc::relocate_section): Likewise.
4168 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4169 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4170 * powerpc.cc (class Relocate_comdat_behavior): New.
4171 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4172 gold::relocate_section with new template arg.
4173
acc276d8
AM
41742012-10-18 Alan Modra <amodra@gmail.com>
4175
4176 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4177 dynamic relocs for GOT_TPREL got entries, without symbol if
4178 resolving locally.
4179 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4180 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4181 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4182
e10f9870
AM
41832012-10-17 Alan Modra <amodra@gmail.com>
4184
4185 PR gold/14726
4186 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4187
ae034989
ST
41882012-10-16 Sriraman Tallam <tmsriram@google.com>
4189
4190 * layout.cc (Layout::include_section): Keep sections marked
4191 SHF_EXCLUDE when doing relocatable links.
4192
f3a0ed29
AM
41932012-10-16 Alan Modra <amodra@gmail.com>
4194
4195 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4196 (Target_powerpc::do_finalize_sections): Call it.
4197 (Output_data_save_res): New class and supporting functions.
4198 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4199 normal symbols defined in object files.
4200
c6de8ed4
AM
42012012-10-12 Alan Modra <amodra@gmail.com>
4202
4203 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4204 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4205 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4206 section if scan_opd_relocs not yet called.
4207 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4208
03e25981
AM
42092012-10-12 Alan Modra <amodra@gmail.com>
4210
4211 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4212 add_local_ifunc_entry): Revert last change.
4213 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4214
c9824451
AM
42152012-10-05 Alan Modra <amodra@gmail.com>
4216
4217 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4218 do_plt_address_for_global): New functions.
4219 (Output_data_got_powerpc::do_write): Don't segfault when linking
4220 statically.
4221 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4222 add_local_ifunc_entry): Return true on adding entry..
4223 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4224 glink->add_entry call. Remove unused symtab param. Adjust calls.
4225 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4226 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4227 set up symbols here.
4228 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4229 syms here. Do so even when no .iplt. Don't segfault when linking
4230 statically.
4231 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4232 new variants without reloc param.
4233 (Glink_sym_ent::Glink_sym_ent): Likewise.
4234 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4235 reloc when refs will resolve to plt call stub.
4236 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4237 R_PPC_PLTREL24 to resolve locally.
4238 (Target_powerpc::Scan::global): Correct ifunc handling.
4239 (Target_powerpc::Relocate::relocate): Correct local sym glink
4240 lookup. Don't destroy "value" when we have a plt call stub,
4241 and when checking plt call validity.
4242 (Target_powerpc::do_dynsym_value): Simplify.
4243
19fec8c1
AM
42442012-10-05 Alan Modra <amodra@gmail.com>
4245
4246 * i386.cc (Output_data_plt_i386::address_for_global,
4247 address_for_local): Add plt offset to returned value. Adjust uses.
4248 * sparc.cc (Output_data_plt_sparc::address_for_global,
4249 address_for_local): Likewise.
4250 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4251 address_for_local): Likewise.
4252 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4253 address_for_local): Likewise.
4254 * target.h (Target::plt_address_for_global, plt_address_for_local):
4255 Update comment.
4256 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4257 (Output_data_got::Got_entry::write): Nor here.
4258 * output.h: Comment fix.
4259
e867b647
WL
42602012-10-02 Jiong Wang <jiwang@tilera.com>
4261
4262 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4263 global_offset_table_ value for larget got.
4264 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4265
e5d5f5ed
AM
42662012-09-29 Alan Modra <amodra@gmail.com>
4267
4268 * powerpc.cc (Target_powerpc::iplt_): New output section.
4269 (Target_powerpc::iplt_section, make_iplt_section,
4270 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4271 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4272 Target_powerpc::plt_entry_count): Count iplt entries too.
4273 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4274 reloc section in constructor. New params.
4275 (Target_powerpc::make_plt_section): Create reloc section here instead.
4276 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4277 functions.
4278 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4279 (Output_data_glink::add_entry, find_entry): New functions to
4280 deal with local syms.
4281 (Glink_sym_ent): Add support for local syms.
4282 (Output_data_glink::do_write): Handle ifunc plt entries.
4283 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4284 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4285 (Target_powerpc::Relocate::relocate): Likewise.
4286 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4287
ec4dbad3
AM
42882012-09-25 Alan Modra <amodra@gmail.com>
4289
4290 * object.h (Sized_relobj_file::adjust_local_symbol,
4291 do_adjust_local_symbol): New functions.
4292 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4293 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4294 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4295 and irregular opd entry spacing.
4296 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4297 (Global_symbol_visitor_opd): New functor.
4298 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4299 on deleted opd entries.
4300
5c0b3823
WL
43012012-09-15 Jiong Wang <jiwang@tilera.com>
4302
4303 * tilegx.cc: New file.
4304 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4305 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4306 * configure.tgt: Add entries for tilegx*.
4307 * configure.ac: Likewise.
4308 * Makefile.in: Rebuild.
4309 * configure: Likewise.
4310 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4311 tilegx.
4312
bfdfa4cd
AM
43132012-09-13 Alan Modra <amodra@gmail.com>
4314
4315 * target-reloc.h (scan_relocs): Call scan.local for relocs
4316 against symbols in discarded sections. Pass is_discarded
4317 param.
4318 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4319 Add is_discarded param.
4320 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4321 is_discarded to flag opd entry as discarded. Don't emit dyn
4322 relocs on such entries.
4323 (Target_powerpc::Scan::global): Similarly detect and handle
4324 such opd entries.
4325 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4326 opd_ent_. Update all uses.
4327 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4328 (Target_powerpc::relocate_section): Zero out discarded opd
4329 entry relocs.
4330
d77a0555
ILT
43312012-09-12 Ian Lance Taylor <iant@google.com>
4332
4333 PR gold/14570
4334 * output.cc: Rename Output_data_got template parameter from size
4335 to got_size for all functions. Compile all variants of
4336 Output_data_got.
4337 (Output_data_got::Got_entry::write): Correct use of size for
4338 symbol value. Use local_is_tls rather than casting to
4339 Sized_relobj_file.
4340 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4341 (class Sized_relobj_file): Add do_local_is_tls.
4342 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4343
815a1205
AM
43442012-09-11 Alan Modra <amodra@gmail.com>
4345
4346 PR gold/14566
4347 * layout.cc (Layout::set_segment_offsets): When using
4348 common-page-size alignment, ensure we are on a new max-page-size
4349 page.
4350 * output.cc (Output_segment::set_section_addresses): Use
4351 abi_pagesize, not common_pagesize for relro boundary.
4352 (Output_segment::set_offset): Likewise.
4353
bd73a62d
AM
43542012-09-11 Alan Modra <amodra@gmail.com>
4355
4356 * output.h (Output_data_got::add_global_tls, add_local_tls,
4357 add_local_tls_pair): New functions.
4358 (Output_data_got::add_local_pair_with_rel): Remove second
4359 reloc param. Expand comment.
4360 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4361 use_plt_or_tls_offset_, similarly for constructor param.
4362 (Output_data_got::Got_entry::write): Add got_index param.
4363 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4364 add_local_tls_pair): New functions.
4365 (Output_data_got::Got_entry::write): Handle tls symbols
4366 with use_plt_or_tls_offset_ set specially.
4367 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4368 (Output_data_got::do_write): Replace iterator with index, pass
4369 index to entry write function.
4370 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4371 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4372 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4373 call.
4374 * i386.cc (Target_i386::Scan::local): Likewise.
4375 * sparc.cc (Target_sparc::Scan::local): Likewise.
4376 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4377 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4378 do_tls_offset_for_global): New functions.
4379 (Target_powerpc::Scan::local): Correct TLS relocations and got
4380 entry values.
4381 (Target_powerpc::Scan::global): Don't emit unnecessary
4382 dynamic relocations on TLS GOT entries.
4383
00716ab1
AM
43842012-09-10 Matthias Klose <doko@ubuntu.com>
4385
4386 * config.in: Disable sanity check for kfreebsd.
4387
c891b3f9
SA
43882012-09-10 Sterling Augustine <saugustine@google.com>
4389
4390 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4391 (Gdb_index::pubtypes_read): New parameter.
4392 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4393 to calls.
4394 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4395 pubtypes_object_.
4396
e81fea4d
AM
43972012-09-09 Alan Modra <amodra@gmail.com>
4398
4399 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4400 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4401 * gc.h (gc_process_relocs): Call target gc_add_reference.
4402 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4403 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4404 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4405 unnecessary cast.
4406 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4407 to cater for when we don't need code offset. Update use.
4408 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4409 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4410 set_opd_valid): New functions.
4411 (Target_powerpc::do_gc_add_reference): New function.
4412 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4413 stashed refs.
4414 (Target_powerpc::do_gc_mark_symbol): New function.
4415
d2d60eef
CC
44162012-09-06 Cary Coutant <ccoutant@google.com>
4417
4418 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4419 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4420 (Dwarf_die::skip_attributes): Likewise.
4421 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4422 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4423 (main): Call it.
4424 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4425
32ed4573
L
44262012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4427
4428 * testsuite/script_test_3.t: Add .got.plt output section
4429 statement.
4430 * testsuite/script_test_4.t: Likewise.
4431
f4baf0d4
AM
44322012-09-05 Alan Modra <amodra@gmail.com>
4433
4434 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4435 update all uses and lose "enum" when using type.
4436
864a1b56
AM
44372012-09-05 Alan Modra <amodra@gmail.com>
4438
4439 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4440 * configure: Regenerate.
4441 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4442 (plugin_final_layout.stdout): Likewise.
4443 (memory_test): Set page sizes to 0x1000.
4444 * testsuite/Makefile.in: Regenerate.
4445 * testsuite/discard_locals_test.sh: Add FIXME comment.
4446 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4447 * testsuite/pr14265.t: Add .got output section statement.
4448 * testsuite/script_test_2.t: Likewise.
4449 * testsuite/script_test_3.t: Likewise.
4450 * testsuite/script_test_4.t: Likewise.
4451 * testsuite/script_test_5.t: Likewise.
4452 * testsuite/script_test_6.t: Likewise.
4453 * testsuite/script_test_7.t: Likewise.
4454 * testsuite/script_test_9.t: Likewise.
4455
3ea0a085
AM
44562012-09-05 Alan Modra <amodra@gmail.com>
4457
4458 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4459 (Powerpc_relocate_functions::Status): New typedef.
4460 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4461 (Target_powerpc::Scan::local): Handle REL64.
4462 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4463 for REL32 and REL64.
4464 (Target_powerpc::symval_for_branch): New function, extracted from..
4465 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4466 checks. Report overflow errors.
4467
7404fe1b
AM
44682012-09-05 Alan Modra <amodra@gmail.com>
4469
4470 * object.h (Sized_relobj_file::emit_relocs): Delete.
4471 (Sized_relobj_file::emit_relocs_reltype): Delete.
4472 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4473 relocate_relocs for --emit-relocs.
4474 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4475 * output.h: Update comment.
4476 (Output_segment::first_section): New function.
4477 (Output_segment::first_section_load_address): Use first_section.
4478 * output.cc (Output_segment::first_section): New function extracted..
4479 (Output_segment::first_section_load_address): ..from here. Delete.
4480 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4481 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4482 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4483 adjust call to target.h function.
4484 * i386.cc (Target_i386): Likewise.
4485 * sparc.cc (Target_sparc): Likewise.
4486 * x86_64.cc (Target_x86_64): Likewise.
4487 * powerpc.cc (Target_powerpc): Likewise.
4488 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4489 first tls section has section symbol for optimised local dynamic
4490 output relocs.
4491 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4492 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4493 optimised tls code.
4494 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4495 Rename to relocate_relocs. Update error message.
4496
957564c9
AS
44972012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4498
4499 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4500 --just-symbols.
4501
dd93cd0a
AM
45022012-08-31 Alan Modra <amodra@gmail.com>
4503
4504 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4505 (Powerpc_relobj::toc_base_offset): New stub function.
4506 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4507 got_mod_index_offset to tlsld_got_offset. Update all refs.
4508 (Target_powerpc::Relocate::enum skip_tls): New.
4509 (Target_powerpc::call_tls_get_addr_): New var.
4510 (Target_powerpc::is_branch_reloc): Move to file scope.
4511 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4512 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4513 New functions.
4514 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4515 (powerpc_info): Correct common_pagesize for ppc64.
4516 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4517 (Powerpc_relocate_functions): Add overflow check enums and functions.
4518 Add non-shift version of rela, rela_ua. Delete all rel public
4519 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4520 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4521 addr16_ha3, addr14 functions.
4522 (Output_data_got_powerpc::add_constant_pair): New function.
4523 (Output_data_got_powerpc::got_base_offset): Likewise.
4524 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4525 (instruction constants): Sort, add some more.
4526 (Output_data_glink::do_write): Add and use Address typedef. Use
4527 object->toc_base_offset() stub for 64-bit.
4528 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4529 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4530 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4531 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4532 Always treat .opd relocs as against locally defined symbol.
4533 Correct condition for RELATIVE relocs.
4534 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4535 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4536 for 32-bit syms with a plt entry. Correct ppc64 toc base
4537 calculations. Handle TLS relocs, and more. Add overflow
4538 checking and adjust for Powerpc_relocate_functions changes.
4539 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4540 Reinstate --emit-relocs code with FIXME.
4541
a1373b60
AM
45422012-08-30 Alan Modra <amodra@gmail.com>
4543
4544 * layout.cc (Layout::set_segment_offsets): Set p_align to
4545 abi_pagesize, not common_pagesize.
4546 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4547 to determine whether file header can go in segment.
4548
703d02da
AM
45492012-08-30 Alan Modra <amodra@gmail.com>
4550
4551 * output.h (Output_reloc::Output_reloc <output section>): Add
4552 is_relative param. Adjust calls.
4553 (Output_reloc::add_output_section_relative): New functions.
4554 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4555 is_relative.
4556 (Output_reloc::symbol_value): Handle SECTION_CODE.
4557
16164a6b
ST
45582012-08-24 Sriraman Tallam <tmsriram@google.com>
4559
4560 * gold.cc (queue_middle_tasks): Call layout again when unique
4561 segments for sections is desired.
4562 * layout.cc (Layout::Layout): Initialize new members.
4563 (Layout::get_output_section_flags): New function.
4564 (Layout::choose_output_section): Call get_output_section_flags.
4565 (Layout::layout): Make output section for mapping to a unique segment.
4566 (Layout::insert_section_segment_map): New function.
4567 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4568 output sections marked so.
16164a6b
ST
4569 (Layout::segment_precedes): Check for unique segments when sorting.
4570 * layout.h (Layout::Unique_segment_info): New struct.
4571 (Layout::Section_segment_map): New typedef.
4572 (Layout::insert_section_segment_map): New function.
4573 (Layout::get_output_section_flags): New function.
4574 (Layout::is_unique_segment_for_sections_specified): New function.
4575 (Layout::set_unique_segment_for_sections_specified): New function.
4576 (Layout::unique_segment_for_sections_specified_): New member.
4577 (Layout::section_segment_map_): New member.
4578 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4579 Rename is_gc_pass_one to is_pass_one.
4580 Rename is_gc_pass_two to is_pass_two.
4581 Rename is_gc_or_icf to is_two_pass.
4582 Check for which pass based on whether symbols data is present.
4583 Make it two pass when unique segments for sections is desired.
4584 * output.cc (Output_section::Output_section): Initialize new
4585 members.
4586 * output.h (Output_section::is_unique_segment): New function.
4587 (Output_section::set_is_unique_segment): New function.
4588 (Output_section::is_unique_segment_): New member.
4589 (Output_section::extra_segment_flags): New function.
4590 (Output_section::set_extra_segment_flags): New function.
4591 (Output_section::extra_segment_flags_): New member.
4592 (Output_section::segment_alignment): New function.
4593 (Output_section::set_segment_alignment): New function.
4594 (Output_section::segment_alignment_): New member.
4595 (Output_segment::Output_segment): Initialize is_unique_segment_.
4596 (Output_segment::is_unique_segment): New function.
4597 (Output_segment::set_is_unique_segment): New function.
4598 (Output_segment::is_unique_segment_): New member.
4599 * plugin.cc (allow_unique_segment_for_sections): New function.
4600 (unique_segment_for_sections): New function.
4601 (Plugin::load): Add new functions to transfer vector.
4602 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4603 * Makefile.in: Regenerate.
4604 * testsuite/plugin_final_layout.sh: Check if unique segment
4605 functionality works.
4606 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4607 are available.
4608 (allow_unique_segment_for_sections): New global.
4609 (unique_segment_for_sections): New global.
4610 (claim_file_hook): Call allow_unique_segment_for_sections.
4611 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4612
1e2bee4f
CC
46132012-08-22 Cary Coutant <ccoutant@google.com>
4614
4615 * layout.cc (Layout::include_section): Don't assert on GROUP
4616 sections with --emit-relocs.
4617
1d5dfe78
CC
46182012-08-21 Cary Coutant <ccoutant@google.com>
4619
4620 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4621 if --export-dynamic-symbol names an undef symbol.
4622
c9269dff
AM
46232012-08-18 Alan Modra <amodra@gmail.com>
4624
4625 * powerpc.cc: Formatting and white space.
4626 (Powerpc_relobj): Rename got2_section_ to special_.
4627 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4628 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4629 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4630 (Target_powerpc): Add Address typedef and invalid_address. Use
4631 throughout.
4632 (Target_powerpc::is_branch_reloc): New function.
4633 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4634 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4635 for dst_mask, value and addend.
4636 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4637 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4638 (Output_data_glink::do_write): Correct toc base. Don't try to use
4639 uint16_t for 24-bit offset. Use get_output_section_offset and
4640 check return.
4641 (Target_powerpc::Scan::local): Handle more relocs.
4642 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4643 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4644 Plug in toc restoring insn after plt calls. Translate branches
4645 to function descriptor symbols to corresponding entry point.
4646 (Target_powerpc::relocate_for_relocatable): Check return from
4647 get_output_section_offset.
4648 * symtab.h: Comment typo.
4649
b1759dce
ILT
46502012-08-14 Ian Lance Taylor <iant@google.com>
4651
4652 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4653 unsupported_relocal_local to call unsupported_reloc_global.
4654
b9b2ae8b
NC
46552012-08-14 Nick Clifton <nickc@redhat.com>
4656
4657 PR ld/14265
4658 * script-sections.cc (Sections_element::output_section_name): Add
4659 keep return parameter.
4660 (Output_section_element::match_name): Add keep return parameter.
4661 Return the value of the keep_ member.
4662 * script-sections.h (class Output_section): Update
4663 output_section_name prototype.
4664 * layout.cc (Layout::keep_input_section): New public member
4665 function.
4666 (Layout::choose_output_section): Pass keep parameter to
4667 output_section_name.
4668 * layout.h (class Layout): Add keep_input_section.
4669 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4670 sections.
4671 * testsuite/Makefile.am: Add a test.
4672 * testsuite/Makefile.in: Regenerate.
4673 * testsuite/pr14265.c: Source file for the test.
4674 * testsuite/pr14265.t: Linker script for the test.
4675 * testsuite/pr14265.sh: Shell script for the test.
4676
921b5322
AM
46772012-08-14 Alan Modra <amodra@gmail.com>
4678
4679 * target.h (Target::output_section_name): New function.
4680 (Target::do_output_section_name): New function.
4681 * layout.cc (Layout::choose_output_section): Call the above.
4682 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4683
6ce78956
AM
46842012-08-14 Alan Modra <amodra@gmail.com>
4685
4686 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4687 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4688 for replace_constant call.
4689 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4690 (Output_data_glink::do_print_to_mapfile): New function.
4691 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4692 (Target_powerpc::Relocate::relocate): Likewise.
4693
d1a8cabd
AM
46942012-08-14 Alan Modra <amodra@gmail.com>
4695
4696 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4697 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4698 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4699 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4700 all references to shndx_. Handle special case for R_PPC_PLTREL24
4701 here.
4702 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4703 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4704 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4705 here.
4706 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4707 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4708
d83ce4e3
AM
47092012-08-12 Alan Modra <amodra@gmail.com>
4710
4711 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4712 (glink insn constants): Use uint32_t.
4713 (Output_data_glink::add_entry): Use insert, not [] operator.
4714
cf43a2fe
AM
47152012-08-11 Alan Modra <amodra@gmail.com>
4716
4717 * object.h (Sized_relobj_file::find_shdr): New function.
4718 (Sized_relobj_file::find_special_sections): New function.
4719 * object.cc (Sized_relobj_file::find_shdr): New function.
4720 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4721 (Sized_relobj_file::find_special_sections): New function, split out..
4722 (Sized_relobj_file::do_read_symbols): ..from here.
4723 * output.h (Output_data_got::replace_constant): New function.
4724 (Output_data_got::num_entries): New function.
4725 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4726 (Output_data_got::got_offset): Protected rather than private.
4727 (Output_data_got::replace_got_entry): New function.
4728 * output.cc (Output_data_got::replace_got_entry): New function.
4729 * powerpc.cc (class Powerpc_relobj): New.
4730 (class Powerpc_relocate_functions): Delete all psymval variants or
4731 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4732 Implement _ha functions using corresponding _hi function.
4733 (Powerpc_relobj::find_special_sections): New function.
4734 (Target_powerpc::do_make_elf_object): New function.
4735 (class Output_data_got_powerpc): New.
4736 (class Output_data_glink): New.
4737 (class Powerpc_scan_relocatable_reloc): New.
4738 Many more changes througout file.
4739
3c892704
NC
47402012-08-09 Nick Clifton <nickc@redhat.com>
4741
4742 * po/vi.po: Updated Vietnamese translation.
4743
82435b3b
ILT
47442012-08-07 Ian Lance Taylor <iant@google.com>
4745
4746 * layout.cc (Layout::add_target_dynamic_tags): If
4747 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4748 plt_rel.
4749
a6dc81d2
NC
47502012-07-30 Nick Clifton <nickc@redhat.com>
4751
4752 * po/gold.pot: Updated template.
4753 * po/es.po: Updated Spanish translation.
4754
f1415016
CC
47552012-07-18 Cary Coutant <ccoutant@google.com>
4756
4757 PR gold/14344
4758 * configure.ac: Add check for -gpubnames support.
4759 * configure: Regenerate.
4760 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4761 support; force -gno-pubnames.
4762 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4763 support.
4764 (gdb_index_test_4): New test.
4765 * testsuite/Makefile.in: Regenerate.
4766 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4767 * testsuite/gdb_index_test_2.sh: Likewise.
4768 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4769 * testsuite/gdb_index_test_4.sh: New script.
4770 * testsuite/gdb_index_test_comm.sh: New script with common code;
4771 don't look for space after colon.
4772
b7fd7c37
ST
47732012-07-16 Sriraman Tallam <tmsriram@google.com>
4774
4775 * gold.cc (queue_middle_tasks): Update function order only after
4776 deferred objects due to plugins are processed.
4777
1f3212db
ILT
47782012-07-11 Ian Lance Taylor <iant@google.com>
4779
4780 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4781 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4782 (Target_arm::scan_reloc_for_stub): Likewise.
4783 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4784 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4785 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4786 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4787 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4788
81c82a68
ILT
47892012-07-10 Dodji Seketeli <dodji@redhat.com>
4790 Ian Lance Taylor <iant@google.com>
4791
4792 PR gold/14309
4793 * configure.ac: Test whether std::tr1::hash<off_t> works.
4794 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4795 needed.
4796 * output.h (class Output_fill): Add virtual destructor.
4797 * configure, config.in: Rebuild.
4798
eabc84f4
RM
47992012-06-22 Roland McGrath <mcgrathr@google.com>
4800
4801 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4802
370e30b6
RÁE
48032012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4804
4805 * plugin.cc (Plugin::load): Handle position independent executables.
4806
fb1b895d
CC
48072012-06-06 Cary Coutant <ccoutant@google.com>
4808
4809 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4810 add .debug_macro.
4811 (lines_only_debug_sections): Likewise.
4812 (gdb_fast_lookup_sections): New static array.
4813 (is_gdb_debug_section): Rename formal parameter.
4814 (is_lines_only_debug_section): Likewise.
4815 (is_gdb_fast_lookup_section): New function.
4816 (Layout::include_section): Check for ".zdebug_" prefix; pass
4817 section name suffix to is_gdb_debug_section, et al.; check for
4818 fast-lookup sections when building .gdb_index.
4819 * options.h (--strip-debug-gdb): Update GDB version number.
4820
7c0640fa
CC
48212012-06-06 Cary Coutant <ccoutant@google.com>
4822
4823 * configure.ac: Add check for fallocate.
4824 * configure: Regenerate.
4825 * config.in: Regenerate.
4826
4827 * options.h (class General_options): Add --mmap-output-file and
4828 --posix-fallocate options.
4829 * output.cc: (posix_fallocate): Remove; replace with...
4830 (gold_fallocate): New function.
4831 (Output_file::map_no_anonymous): Call gold_fallocate.
4832 (Output_file::map): Check --mmap-output-file option.
4833
2a49eb69
DK
48342012-06-05 Jing Yu <jingyu@google.com>
4835
4836 * gold.h (textdomain): Add do {} to empty while(0).
4837 (bindtextdomain): Likewise.
4838
fad072ac
CC
48392012-06-04 Cary Coutant <ccoutant@google.com>
4840
4841 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4842 has_dynsym_index.
4843
8cc69fb6
ST
48442012-05-25 Sriraman Tallam <tmsriram@google.com>
4845
4846 * symtab.cc (Symbol_table::define_special_symbol):
4847 Initialize *poldsym to prevent uninitialized variable errors.
4848
1be75daa
CC
48492012-05-23 Cary Coutant <ccoutant@google.com>
4850
4851 * layout.cc (Layout::section_name_mapping): Add rules to handle
4852 exact match on .data.rel.ro.local or .data.rel.ro.
4853 (Layout::output_section_name): Check for exact matches.
4854
9b689de0
CC
48552012-05-23 Cary Coutant <ccoutant@google.com>
4856
4857 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4858 more carefully.
4859
b24fdbf5
CC
48602012-05-22 Cary Coutant <ccoutant@google.com>
4861
4862 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4863 object before exporting symbol.
4864
e550e1a2
L
48652012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4866
4867 * testsuite/tls_test.cc: Include "config.h" first.
4868 * testsuite/tls_test_c.c: Likewise.
4869
df7b86aa
NC
48702012-05-17 Daniel Richard G. <skunk@iskunk.org>
4871 Nick Clifton <nickc@redhat.com>
4872
4873 PR 14072
4874 * configure.in: Add check that sysdep.h has been included before
4875 any system header files.
4876 * configure: Regenerate.
4877 * config.in: Regenerate.
4878
1007b503
CC
48792012-05-14 Cary Coutant <ccoutant@google.com>
4880
4881 * layout.cc (Layout::make_output_section): Mark .tdata section
4882 as RELRO.
4883 * testsuite/relro_test.cc: Add a TLS variable.
4884
fd885f3a
L
48852012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4886
4887 PR gold/14091
4888 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4889 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4890 R_X86_64_64.
4891
80f5885c
CC
48922012-05-08 Cary Coutant <ccoutant@google.com>
4893
4894 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4895 (lines_only_debug_sections): Likewise.
4896
2e702c99
RM
48972012-05-02 Roland McGrath <mcgrathr@google.com>
4898
4899 * nacl.cc: New file.
4900 * nacl.h: New file.
4901 * Makefile.am (CCFILES, HFILES): Add them.
4902 * Makefile.in: Regenerate.
4903 * i386.cc (Output_data_plt_i386_nacl): New class.
4904 (Output_data_plt_i386_nacl_exec): New class.
4905 (Output_data_plt_i386_nacl_dyn): New class.
4906 (Target_i386_nacl): New class.
4907 (Target_selector_i386_nacl): New class.
4908 (target_selector_i386): Use it instead of Target_selector_i386.
4909 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4910 (Target_x86_64_nacl): New class.
4911 (Target_selector_x86_64_nacl): New class.
4912 (target_selector_x86_64, target_selector_x32): Use it instead of
4913 Target_selector_x86_64.
4914 * arm.cc (Output_data_plt_arm_nacl): New class.
4915 (Target_arm_nacl): New class.
4916 (Target_selector_arm_nacl): New class.
4917 (target_selector_arm, target_selector_armbe): Use it instead of
4918 Target_selector_arm.
4919
4920 * target-select.cc (select_target): Take new Input_file* and off_t
4921 arguments, pass them on to recognize method of selector.
4922 * object.cc (make_elf_sized_object): Update caller.
4923 * parameters.cc (parameters_force_valid_target): Likewise.
4924 * incremental.cc (make_sized_incremental_binary): Likewise.
4925 * target-select.h: Update decl.
4926 (Target_selector::recognize): Take new Input_file* argument,
4927 pass it on to do_recognize.
4928 (Target_selector::do_recognize): Take new Input_file* argument.
4929 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4930 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4931 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4932 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4933
4934 * target.h (Target::Target_info): New members isolate_execinstr
4935 and rosegment_gap.
4936 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4937 * arm.cc (Target_arm::arm_info): Update initializer.
4938 * i386.cc (Target_i386::i386_info): Likewise.
4939 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4940 * sparc.cc (Target_sparc::sparc_info): Likewise.
4941 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4942 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4943 * layout.cc (Layout::attach_allocated_section_to_segment):
4944 Take new const Target* argument. If target->isolate_execinstr(), act
4945 like --rosegment.
4946 (Layout::find_first_load_seg): Take new const Target* argument;
4947 if target->isolate_execinstr(), reject PF_X segments.
4948 (Layout::relaxation_loop_body): Update caller.
4949 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4950 reset file offset to zero when we hit LOAD_SEG, and then do a second
4951 loop over the segments before LOAD_SEG to reassign offsets after
4952 addresses have been determined. Handle target->rosegment_gap().
4953 (Layout::attach_section_to_segment): Take new const Target* argument;
4954 pass it to attach_allocated_section_to_segment.
4955 (Layout::make_output_section): Update caller.
4956 (Layout::attach_sections_to_segments): Take new const Target* argument;
4957 pass it to attach_section_to_segment.
4958 * gold.cc (queue_middle_tasks): Update caller.
4959 * layout.h (Layout): Update method decls with new arguments.
4960
4961 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4962 Target_info pointer to use.
4963 (Target_arm::do_make_data_plt): New virtual method.
4964 (Target_arm::make_data_plt): New method that calls it.
4965 (Target_arm::make_plt_entry): Use it.
4966 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4967 for the section alignment.
4968 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4969 method.
4970 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4971 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4972 method.
4973 (Output_data_plt_arm::get_plt_entry_size): Call it.
4974 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4975 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4976 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4977 method.
4978 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4979 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4980 method instead of sizeof(plt_entry).
4981 (Output_data_plt_arm::add_entry): Likewise.
4982 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4983 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4984 than static method.
4985 (Target_arm::plt_entry_size): Likewise.
4986 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4987 Move to ...
4988 (Output_data_plt_arm_standard): ... here, new class.
4989 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4990 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4991 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4992
4993 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4994 Take additional argument for the PLT entry size.
4995 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4996 Use get_plt_entry_size method rather than plt_entry_size variable.
4997 (Output_data_plt_x86_64::reserve_slot): Likewise.
4998 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4999 (Output_data_plt_x86_64::add_entry): Likewise.
5000 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5001 (Output_data_plt_x86_64::address_for_global): Likewise.
5002 (Output_data_plt_x86_64::address_for_local): Likewise.
5003 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5004 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5005 Make method non-static.
5006 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5007 method.
5008 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5009 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5010 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5011 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5012 virtual method.
5013 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5014 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5015 virtual method.
5016 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5017 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5018 virtual method.
5019 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5020 (Output_data_plt_x86_64::plt_entry_size)
5021 (Output_data_plt_x86_64::first_plt_entry)
5022 (Output_data_plt_x86_64::plt_entry)
5023 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5024 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5025 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5026 (Output_data_plt_x86_64_standard): ... here, new class.
5027 (Target_x86_64::Target_x86_64): Take optional argument for the
5028 Target_info pointer to use.
5029 (Target_x86_64::do_make_data_plt): New virtual method.
5030 (Target_x86_64::make_data_plt): New method to call it.
5031 (Target_x86_64::init_got_plt_for_update): Use that.
5032 Call this->plt_->add_eh_frame method here.
5033 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5034 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5035 rather than static method.
5036 (Target_x86_64::plt_entry_size): Likewise.
5037 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5038 rather than plt_entry_size variable. Move guts of PLT filling to...
5039 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5040 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5041 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5042
5043 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5044 additional argument for the section alignment.
5045 Don't do add_eh_frame_for_plt here.
5046 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5047 non-static. Use get_plt_entry_size method rather than plt_entry_size
5048 variable.
5049 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5050 method.
5051 (Output_data_plt_i386::get_plt_entry_size): Call it.
5052 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5053 (Output_data_plt_i386::add_eh_frame): New method to call it.
5054 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5055 method.
5056 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5057 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5058 method.
5059 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5060 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5061 method instead of plt_entry_size.
5062 (Output_data_plt_i386::plt_entry_size)
5063 (Output_data_plt_i386::plt_eh_frame_fde_size)
5064 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5065 (Output_data_plt_i386_standard): ... here, new class.
5066 (Output_data_plt_i386_exec): New class.
5067 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5068 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5069 (Output_data_plt_i386::exec_plt_entry): Move to ...
5070 (Output_data_plt_i386_exec::plt_entry): ... here.
5071 (Output_data_plt_i386_dyn): New class.
5072 (Output_data_plt_i386::first_plt_entry): Move to ...
5073 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5074 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5075 (Output_data_plt_i386_dyn::plt_entry): ... here.
5076 (Target_i386::Target_i386): Take optional argument for the Target_info
5077 pointer to use.
5078 (Target_i386::do_make_data_plt): New virtual method.
5079 (Target_i386::make_data_plt): New method to call it.
5080 (Target_i386::make_plt_section): Use that.
5081 Call this->plt_->add_eh_frame method here.
5082 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5083 rather than plt_entry_size variable.
5084 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5085 (Output_data_plt_i386::address_for_local): Likewise.
5086 (Output_data_plt_i386::do_write): Likewise.
5087 Move guts of PLT filling to...
5088 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5089 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5090 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5091 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5092
b9b9f2ee
CC
50932012-05-01 Cary Coutant <ccoutant@google.com>
5094
5095 * dwarf_reader.cc (Dwarf_die::read_attributes)
5096 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5097 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5098 * reduced_debug_output.cc
5099 (Output_reduced_debug_info_section::get_die_end): Remove
5100 DW_FORM_GNU_ref_index. Add default case.
5101
57923f48
MW
51022012-04-26 Mark Wielaard <mjw@redhat.com>
5103
5104 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5105 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5106 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5107 DW_AT_high_pc as offset from DW_AT_low_pc.
5108
5109 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5110 * testsuite/Makefile.in: Regenerate.
5111 * testsuite/gdb_index_test_3.c: New test source file.
5112 * testsuite/gdb_index_test_3.sh: New test source file.
5113
2c54b4f4
ILT
51142012-04-25 Ian Lance Taylor <iant@google.com>
5115
5116 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5117 pointer.
5118 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5119 as a class, not a struct.
5120 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5121 (Target_arm::apply_cortex_a8_workaround): Likewise.
5122 * gc.h: Declare Reloc_types as a struct, not a class.
5123 * object.h: Declare Symbols_data as a struct.
5124 * reloc.h: Declare Read_relocs_data as a struct.
5125 * target.h: Declare Relocate_info as a struct.
5126
a5a5f7a3
DM
51272012-04-24 David S. Miller <davem@davemloft.net>
5128
5129 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5130 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5131 and R_SPARC_WPLT30.
5132
f038d496
CC
51332012-04-24 Cary Coutant <ccoutant@google.com>
5134
5135 * incremental-dump.cc (find_input_containing_global): Replace
5136 magic number with symbolic constant.
5137 (dump_incremental_inputs): Update version number.
5138 * incremental.cc (Output_section_incremental_inputs): Update version
5139 number; import symbolic constants from Incremental_inputs_reader.
5140 (Incremental_inputs::create_data_sections): Align relocations
5141 section correctly for 64-bit targets.
5142 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5143 constants; add padding.
5144 (Output_section_incremental_inputs::write_header): Add assert for
5145 header_size.
5146 (Output_section_incremental_inputs::write_input_files): Add assert
5147 for input_entry_size.
5148 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5149 add assert for object_info_size, input_section_entry_size,
5150 global_sym_entry_size.
5151 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5152 for data structure sizes; use them.
5153 (Incremental_input_entry_reader): Import symbolic constants from
5154 Incremental_inputs_reader; use them.
5155
a4d85145
DM
51562012-04-23 David S. Miller <davem@davemloft.net>
5157
5158 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5159 and elf_flags_set_.
5160 (Target_sparc::Target_sparc): Initialize new fields.
5161 (Target_sparc::do_make_elf_object): New function.
5162 (Target_sparc::do_adjust_elf_header): New function.
5163
1d509098
CC
51642012-04-23 Cary Coutant <ccoutant@google.com>
5165
5166 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5167 CU range table of gdb index.
5168
7ebeff7f
DM
51692012-04-20 David S. Miller <davem@davemloft.net>
5170
5171 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5172 instead of false.
5173
13cf9988
DM
51742012-04-16 David S. Miller <davem@davemloft.net>
5175
2a1079e8
DM
5176 * sparc.cc (Target_sparc::got_address): New function.
5177 (Sparc_relocate_functions::gdop_hix22): New function.
5178 (Sparc_relocate_functions::gdop_lox10): New function.
5179 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5180 relocs.
5181 (Target_sparc::Scan::local): Likewise if the global symbol is not
5182 preemptible and is not IFUNC.
5183 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5184 transformations for local and non-preemptible non-IFUNC global
5185 symbols.
5186
0bc964fc
DM
5187 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5188 writing out 64-bit part of ranges.
5189
661d7a80
DM
5190 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5191 -fpic and -fpie respectively.
5192 * Makefile.in: Regenerate.
5193
8c2bf391
DM
5194 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5195 (Target_sparc::Target_sparc): Initialize new field.
5196 (Target_sparc::do_plt_section_for_global): New function.
5197 (Target_sparc::do_plt_section_for_local): New function.
5198 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5199 (Target_sparc::make_plt_section): New function, broken out of
5200 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5201 (Target_sparc::make_plt_entry): Call make_plt_section.
5202 (Target_sparc::make_local_ifunc_plt_entry): New function.
5203 (Target_sparc::rela_ifunc_section): New function.
5204 (Target_sparc::plt_section): Remove const.
5205 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5206 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5207 and ifunc_count_ fields.
5208 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5209 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5210 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5211 (Output_data_plt_sparc::rela_ifunc): New function.
5212 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5213 (Output_data_plt_sparc::has_ifunc_section): New function.
5214 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5215 (Output_data_plt_sparc::address_for_global): New function.
5216 (Output_data_plt_sparc::address_for_local): New function.
5217 (Output_data_plt_sparc::plt_index_to_offset): New function.
5218 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5219 and entry_count.
5220 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5221 entry_count.
5222 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5223 R_SPARC_JMP_IREL to switch.
5224 (Target_sparc::Scan::check_non_pic): Likewise.
5225 (Target_sparc::Scan::local): Handle IFUNC symbols.
5226 (Target_sparc::Scan::local): Likewise.
5227 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5228 and plt_address_for_local.
5229 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5230 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5231
13cf9988
DM
5232 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5233 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5234 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5235 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5236 global relocs too.
5237 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5238 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5239 calls.
5240 * sparc.cc (Target_sparc::Scan::global): Likewise.
5241 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5242
31821be0
CC
52432012-04-16 Cary Coutant <ccoutant@google.com>
5244
5245 * archive.cc (Library_base::should_include_member): Check for
5246 --export-dynamic-symbol.
5247 * options.h (class General_options): Add --export-dynamic-symbol.
5248 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5249 --export-dynamic-symbol.
5250 (Symbol_table::gc_mark_undef_symbols): Likewise.
5251 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5252
2615994e
DM
52532012-04-12 David S. Miller <davem@davemloft.net>
5254
5255 * sparc.cc (Reloc::wdisp10): New relocation method.
5256 (Reloc::h34): Likewise.
5257 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5258 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5259 R_SPARC_WDISP10.
5260 (Target_sparc::Scan::local): Likewise.
5261 (Target_sparc::Scan::global): Likewise.
5262 (Target_sparc::Relocate::relocate): Likewise.
5263
6782735d
CC
52642012-04-09 Cary Coutant <ccoutant@google.com>
5265
5266 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5267 low_pc == 0.
5268
8c7a0b00
ILT
52692012-04-06 Ian Lance Taylor <iant@google.com>
5270
5271 * timer.cc: #include <unistd.h>.
5272
58797674
RM
52732012-04-06 Roland McGrath <mcgrathr@google.com>
5274
5275 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5276 * config.in: Regenerate.
5277 * configure: Regenerate.
5278
44350750
NC
52792012-04-05 Nick Clifton <nickc@redhat.com>
5280
5281 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5282 (AM_LC_MESSAGES): Add.
5283 * aclocal.m4: Regenerate.
5284 * config.in: Regenerate.
5285 * configure: Regenerate.
5286
c1027032
CC
52872012-03-21 Cary Coutant <ccoutant@google.com>
5288
5289 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5290 * Makefile.in: Regenerate.
5291 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5292 (Sized_elf_reloc_mapper::symbol_section): New function.
5293 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5294 (make_elf_reloc_mapper): New function.
5295 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5296 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5297 (Dwarf_abbrev_table::do_get_abbrev): New function.
5298 (Dwarf_ranges_table::read_ranges_table): New function.
5299 (Dwarf_ranges_table::read_range_list): New function.
5300 (Dwarf_pubnames_table::read_section): New function.
5301 (Dwarf_pubnames_table::read_header): New function.
5302 (Dwarf_pubnames_table::next_name): New function.
5303 (Dwarf_die::Dwarf_die): New function.
5304 (Dwarf_die::read_attributes): New function.
5305 (Dwarf_die::skip_attributes): New function.
5306 (Dwarf_die::set_name): New function.
5307 (Dwarf_die::set_linkage_name): New function.
5308 (Dwarf_die::attribute): New function.
5309 (Dwarf_die::string_attribute): New function.
5310 (Dwarf_die::int_attribute): New function.
5311 (Dwarf_die::uint_attribute): New function.
5312 (Dwarf_die::ref_attribute): New function.
5313 (Dwarf_die::child_offset): New function.
5314 (Dwarf_die::sibling_offset): New function.
5315 (Dwarf_info_reader::check_buffer): New function.
5316 (Dwarf_info_reader::parse): New function.
5317 (Dwarf_info_reader::do_parse): New function.
5318 (Dwarf_info_reader::do_read_string_table): New function.
5319 (Dwarf_info_reader::lookup_reloc): New function.
5320 (Dwarf_info_reader::get_string): New function.
5321 (Dwarf_info_reader::visit_compilation_unit): New function.
5322 (Dwarf_info_reader::visit_type_unit): New function.
5323 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5324 Sized_elf_reloc_mapper.
5325 (Sized_dwarf_line_info::symbol_section): Remove function.
5326 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5327 (Sized_dwarf_line_info::read_line_mappings): Remove object
5328 parameter, adjust callers.
5329 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5330 * dwarf_reader.h: Include <sys/types.h>.
5331 (class Track_relocs): Remove forward declaration.
5332 (class Elf_reloc_mapper): New class.
5333 (class Sized_elf_reloc_mapper): New class.
5334 (class Dwarf_abbrev_table): New class.
5335 (class Dwarf_range_list): New class.
5336 (class Dwarf_ranges_table): New class.
5337 (class Dwarf_pubnames_table): New class.
5338 (class Dwarf_die): New class.
5339 (class Dwarf_info_reader): New class.
5340 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5341 (Sized_dwarf_line_info::symbol_section): Remove member function.
5342 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5343 base class.
5344 * gdb-index.cc: New source file.
5345 * gdb-index.h: New source file.
5346 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5347 and .debug_types sections, call Layout::add_to_gdb_index.
5348 (Sized_relobj_incr::do_section_name): Implement.
5349 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5350 return type; Implement.
5351 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5352 return type.
5353 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5354 parameter list and return type.
5355 (Sized_incr_dynobj::do_section_contents): Likewise.
5356 * layout.cc: Include gdb-index.h.
5357 (Layout::Layout): Initialize gdb_index_data_.
5358 (Layout::init_fixed_output_section): Check for .gdb_index section.
5359 (Layout::add_to_gdb_index): New function. Instantiate.
5360 * layout.h: Add forward declaration for class Gdb_index.
5361 (Layout::add_to_gdb_index): New member function.
5362 (Layout::gdb_index_data_): New data member.
5363 * main.cc: Include gdb-index.h.
5364 (main): Print statistics for gdb index.
5365 * object.cc (Object::section_contents): Move code into
5366 do_section_contents.
5367 (need_decompressed_section): Check for sections needed when building
5368 gdb index.
5369 (build_compressed_section_map): Likewise.
5370 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5371 gdb index.
5372 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5373 sections; call Layout::add_to_gdb_index.
5374 (Sized_relobj_file::do_decompressed_section_contents): Call
5375 do_section_contents directly.
5376 * object.h (Object::do_section_contents): Adjust parameter list and
5377 return type.
5378 (Object::do_decompressed_section_contents): Call do_section_contents
5379 directly.
5380 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5381 return type.
5382 * options.h (class General_options): Add --gdb-index option.
5383 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5384 list and return type.
5385 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5386 * reloc.h (Track_relocs::checkpoint): New function.
5387 (Track_relocs::reset): New function.
5388
5389 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5390 New test cases.
5391 * testsuite/Makefile.in: Regenerate.
5392 * testsuite/gdb_index_test.cc: New test source file.
5393 * testsuite/gdb_index_test_1.sh: New test source file.
5394 * testsuite/gdb_index_test_2.sh: New test source file.
5395
647f1574
DK
53962012-03-19 Doug Kwan <dougkwan@google.com>
5397
5398 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5399 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5400 __exidx_start and __exidx_end. Make symbol table parameter
5401 anonymous as it is not used.
5402 * gold.cc (queue_middle_tasks): Call target hook to define any
5403 target-specific symbols.
5404 * target.h (Target::define_standard_symbols): New method.
5405 (Target::do_define_standard_symbols): Same.
5406 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5407 * testsuite/Makefile.in: Regenerate.
5408 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5409 and __exidx_end.
5410 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5411 relocations are generated for __exidx_start and __exidx_end.
5412
7c6109da
DK
54132012-03-16 Doug Kwan <dougkwan@google.com>
5414
5415 * testsuite/Makefile.am: Disable test initpri3b.
5416 * testsuite/Makefile.in: Regenerate.
5417
7b8957f8
DK
54182012-03-15 Doug Kwan <dougkwan@google.com>
5419
5420 * arm.cc (Target_arm::got_section): Make .got section read-only
5421 if -z now is given.
5422
14dc9ef7
ILT
54232012-03-15 Ian Lance Taylor <iant@google.com>
5424
5425 PR gold/13850
5426 * layout.cc (Layout::make_output_section): Correctly mark
5427 SHT_INIT_ARRAY, et. al., as relro.
5428
fa40b62a
DK
54292012-03-14 Doug Kwan <dougkwan@google.com>
5430
5431 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5432 dynamic relocations for protected symbols in shared objects.
5433
fd325007
ILT
54342012-03-13 Ian Lance Taylor <iant@google.com>
5435
5436 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5437 keep the larger alignment.
5438
e8dd54e1
CC
54392012-03-12 Cary Coutant <ccoutant@google.com>
5440
5441 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5442 handling of DW_LNE_define_file.
5443
feb5f3b0
CC
54442012-03-12 Cary Coutant <ccoutant@google.com>
5445
5446 * reduced_debug_output.cc
5447 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5448 codes to switch.
5449
a1fb4256
CC
54502012-02-29 Cary Coutant <ccoutant@google.com>
5451
5452 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5453
5dd8762a
CC
54542012-02-29 Cary Coutant <ccoutant@google.com>
5455
5456 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5457 Call Object::decompressed_section_contents.
5458 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5459 New dtor.
5460 (Sized_dwarf_line_info::buffer_start_): New data member.
5461 * merge.cc (Output_merge_data::do_add_input_section): Call
5462 Object::decompressed_section_contents.
5463 (Output_merge_string::do_add_input_section): Likewise.
5464 * object.cc (need_decompressed_section): New function.
5465 (build_compressed_section_map): Decompress sections needed later.
5466 (Sized_relobj_file::do_decompressed_section_contents): New function.
5467 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5468 * object.h (Object::decompressed_section_contents): New function.
5469 (Object::discard_decompressed_sections): New function.
5470 (Object::do_decompressed_section_contents): New function.
5471 (Object::do_discard_decompressed_sections): New function.
5472 (Compressed_section_info): New type.
5473 (Compressed_section_map): Include decompressed section contents.
5474 (Sized_relobj_file::do_decompressed_section_contents): New function.
5475 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5476
7b5de7ee
CC
54772012-02-16 Cary Coutant <ccoutant@google.com>
5478
5479 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5480 * testsuite/Makefile.in: Regenerate.
5481
f9fa4a63
CC
54822012-02-14 Cary Coutant <ccoutant@google.com>
5483
5484 * options.cc (General_options::finalize): Disallow -pie and -static.
5485
2c175ebc
DK
54862012-02-03 Doug Kwan <dougkwan@google.com>
5487
5488 * arm.cc (Arm_relocate_functions::abs8,
5489 Arm_relocate_functions::abs16): Use
5490 Bits::has_signed_unsigned_overflow32.
5491 (Arm_relocate_functions::thm_abs8): Correct range of
5492 overflow check.
5493 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5494 in assertions.
5495
90cff06f
DK
54962012-02-02 Doug Kwan <dougkwan@google.com>
5497
5498 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5499 position independent outputs, not just shared objects.
5500
63887f3d
L
55012012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5502
5503 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5504 * configure: Regenerated.
5505
bef2b434
ILT
55062012-01-27 Ian Lance Taylor <iant@google.com>
5507
5508 * reloc.h (Bits): New class with static functions, copied from
5509 namespace utils in arm.cc.
5510 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5511 instead.
5512
c335b55d
L
55132012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5514
5515 * incremental.cc (write_info_blocks): Correct relocation offset.
5516
41194d9f
L
55172012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5518
5519 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5520 (Relocate::tls_gd_to_le): Likewise.
5521
1bae613c
L
55222012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5523
5524 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5525
24482ca0
L
55262012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5527
5528 * configure.ac: Check if -mcmodel=medium works.
5529 * configure: Regenerated.
5530
c2c7840a
CC
55312012-01-24 Cary Coutant <ccoutant@google.com>
5532
5533 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5534 definition and ...
5535 (read_unsigned_LEB_128_x): ... this new function.
5536 (read_signed_LEB_128): Replaced with inline definition and ...
5537 (read_signed_LEB_128_x): ... this new function.
5538 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5539 (read_unsigned_LEB_128): Add inline definition.
5540 (read_signed_LEB_128_x): New function.
5541 (read_signed_LEB_128): Add inline definition.
5542 * testsuite/Makefile.am (leb128_unittest): New unit test.
5543 * testsuite/Makefile.in: Regenerate.
5544 * testsuite/leb128_unittest.cc: New unit test.
5545
833de760 55462012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5547
5548 PR gold/13617
5549 * i386.cc (Target_i386::do_code_fill): When using a jmp
5550 instruction, pad with nop instructions.
5551 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5552
618d6666
L
55532012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5554
5555 * x86_64.cc (gc_process_relocs): Add typename on types used in
5556 template.
5557 (scan_relocs): Likewise.
5558 (relocate_section): Likewise.
5559 (apply_relocation): Likewise.
5560
3660ff06
L
55612012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5562
5563 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5564 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5565 under x32.
5566
fc51264f
L
55672012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5568
5569 * x86_64.cc: Initial support for x32.
5570
dd74ae06
CC
55712012-01-03 Cary Coutant <ccoutant@google.com>
5572
5573 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5574 Use abstract base class for GOT.
5575 * gold/output.h (class Output_data_got_base): New abstract base class.
5576 (class Output_data_got): Derive from new base class, adjust ctors.
5577 (Output_data_got::reserve_slot): Make virtual; rename to
5578 do_reserve_slot; Adjust callers.
5579 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5580 pointer to abstract base class.
5581 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5582
83896202
ILT
55832011-12-18 Ian Lance Taylor <iant@google.com>
5584
5585 * object.h (Relobj::local_symbol_value): New function.
5586 (Relobj::local_plt_offset): New function.
5587 (Relobj::local_has_got_offset): New function.
5588 (Relobj::local_got_offset): New function.
5589 (Relobj::set_local_got_offset): New function.
5590 (Relobj::do_local_symbol_value): New pure virtual function.
5591 (Relobj::do_local_plt_offset): Likewise.
5592 (Relobj::do_local_has_got_offset): Likewise.
5593 (Relobj::do_local_got_offset): Likewise.
5594 (Relobj::do_set_local_got_offset): Likewise.
5595 (Sized_relobj::do_local_has_got_offset): Rename from
5596 local_has_got_offset.
5597 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5598 (Sized_relobj::do_set_local_got_offset): Rename from
5599 set_local_got_offset.
5600 (Sized_relobj_file::do_local_plt_offset): Rename from
5601 local_plt_offset.
5602 (Sized_relobj_file::do_local_symbol_value): New function.
5603 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5604 local_plt_offset.
5605 * output.cc (Output_data_got::Got_entry::write): Change object to
5606 Relobj. Use local_symbol_value.
5607 (Output_data_got::add_global_with_rel): Change rel_dyn to
5608 Output_data_reloc_generic*. Use add_global_generic.
5609 (Output_data_got::add_global_with_rela): Remove. Change all
5610 callers to use add_global_with_rel.
5611 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5612 Output_data_reloc_generic*. Use add_global_generic.
5613 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5614 callers to use add_global_pair_with_rel.
5615 (Output_data_got::add_local): Change object to Relobj*.
5616 (Output_data_got::add_local_plt): Likewise.
5617 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5618 change rel_dyn to Output_data_reloc_generic*. Use
5619 add_local_generic.
5620 (Output_data_got::add_local_with_rela): Remove. Change all
5621 callers to use all_local_with_rel.
5622 (Output_data_got::add_local_pair_with_rel): Change object to
5623 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5624 add_output_section_generic.
5625 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5626 callers to use add_local_pair_with_rel.
5627 (Output_data_got::reserve_local): Change object to Relobj*.
5628 * output.h: (class Output_data_reloc_generic): Add pure virtual
5629 declarations for add_global_generic, add_local_generic,
5630 add_output_section_generic.
5631 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5632 functions for Output_data_reloc_generic. Update declarations for
5633 changes listed in output.cc.
5634 (class Output_data_got): Change template parameter to got_size.
5635 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5636 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5637 function.
5638 (Sized_relobj_incr::do_local_plt_offset): New function.
5639 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5640 add_global_generic.
5641
76677ad0
CC
56422011-12-17 Cary Coutant <ccoutant@google.com>
5643
5644 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5645 * resolve.cc (Symbol_table::resolve): Likewise.
5646 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5647 arrays.
5648 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5649
8b8dd8d5
ILT
56502011-12-16 Ian Lance Taylor <iant@google.com>
5651
5652 * output.h (Output_data_reloc_generic::add): Only call
5653 add_dynamic_reloc if this is a dynamic reloc section.
5654
d55525b9
L
56552011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5656
5657 PR gold/13505
5658 * target-reloc.h (apply_relocation): Replace <64, false> with
5659 <size, big_endian>.
5660
ff81c7c1
NC
56612011-11-25 Nick Clifton <nickc@redhat.com>
5662
5663 * po/it.po: New Italian translation.
5664
628f39be
SA
56652011-11-17 Sterling Augustine <saugustine@google.com>
5666
5667 * script.cc (script_include_directive): Implement.
5668 (read_script_file): New local variables name and search_path. Update
5669 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5670 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5671 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5672
98ef3ea4
SA
56732011-11-11 Sterling Augustine <saugustine@google.com>
5674
5675 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5676 (file_or_sections_cmd): Likewise.
5677
f4a8b6d7
DK
56782011-11-11 Doug Kwan <dougkwan@google.com>
5679
5680 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5681 if --just-symbols is given.
5682
29ab395d
DK
56832011-11-10 Doug Kwan <dougkwan@google.com>
5684
5685 PR gold/13362
5686 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5687 when processing data relocs.
5688 * reloc.h (Relocate_functions::rel_unaligned): New method.
5689 (Relocate_functions::pcrel_unaligned): Ditto.
5690 (Relocate_functions::rel32_unaligned): Ditto.
5691 (Relocate_functions::pcrel32_unaligned): Ditto.
5692
2c339f71
DK
56932011-11-09 Doug Kwan <dougkwan@google.com>
5694
5695 PR gold/13362
5696 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5697 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5698 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5699 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5700 (Relocate_functions::rel_unaligned): New.
5701 (Relocate_functions::rel32_unaligned): New.
5702 * target-reloc.h (relocate_for_relocatable): Add code to handle
5703 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5704 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5705 arm_unaligned_reloc_r): New targets.
5706 * testsuite/Makefile.in: Regenerate.
5707 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5708 linking.
5709
3f3cddf1
ILT
57102011-11-02 Ian Lance Taylor <iant@google.com>
5711
5712 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5713 NATIVE_LINKER.
5714 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5715 * options.cc (General_options::finalize): Use library search path
5716 from configure script if specified. If not native and no sysroot,
5717 only search TOOLLIBDIR.
5718 * options.h (Search_directory::Search_directory): Change name to
5719 const std::string&.
5720 (General_options::add_to_library_path_with_sysroot): Change arg to
5721 const std::string&.
5722 * configure, Makefile.in, config.in: Rebuild.
5723
a8e2273b
ILT
57242011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5725
5726 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5727 we are working around the ARM1176 Erratum.
5728 * options.h (General_options::fix_arm1176): Add option.
5729 * testsuite/Makefile.am: Add testcases, and keep current ones
5730 working.
5731 * testsuite/Makefile.in: Regenerate.
5732 * testsuite/arm_fix_1176.s: New file.
5733 * testsuite/arm_fix_1176.sh: Likewise.
5734
cd6eab1c
ILT
57352011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5736
5737 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5738 may_use_blx_.
5739 (Target_arm::may_use_blx): Remove method.
5740 (Target_arm::set_may_use_blx): Likewise.
5741 (Target_arm::may_use_v4t_interworking): New method.
5742 (Target_arm::may_use_v5t_interworking): Likewise.
5743 (Target_arm::may_use_blx_): Remove member variable.
5744 (Arm_relocate_functions::arm_branch_common): Check for v5T
5745 interworking.
5746 (Arm_relocate_functions::thumb_branch_common): Likewise.
5747 (Reloc_stub::stub_type_for_reloc): Likewise.
5748 (Target_arm::do_finalize_sections): Correct interworking checks.
5749 * testsuite/Makefile.am: Add new tests.
5750 * testsuite/Makefile.in: Regenerate.
5751 * testsuite/arm_farcall_arm_arm.s: New test.
5752 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5753 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5754 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5755 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5756 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5757 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5758 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5759
286adcf4
CC
57602011-10-31 Cary Coutant <ccoutant@google.com>
5761
5762 PR gold/13023
5763 * expression.cc (Expression::eval_with_dot): Add
5764 is_section_dot_assignment parameter.
5765 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5766 absolute and assigning to dot within a section.
5767 * script-sections.cc
5768 (Output_section_element_assignment::set_section_addresses): Pass
5769 dot_section to set_if_absolute.
5770 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5771 as is_section_dot_assignment flag to eval_with_dot.
5772 (Output_section_element_dot_assignment::set_section_addresses):
5773 Likewise.
5774 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5775 parameter. Also set value if relative to dot_section; set the
5776 symbol's output_section.
5777 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5778 parameter. Adjust all callers.
5779 (Expression::eval_maybe_dot): Likewise.
5780 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5781 Adjust all callers.
5782 * testsuite/script_test_2.t: Test assignment of an absolute value
5783 to dot within an output section element.
5784
9634ed06
CC
57852011-10-31 Cary Coutant <ccoutant@google.com>
5786
5787 * options.h (class General_options): Add --[no-]gnu-unique options.
5788 * symtab.cc (Symbol_table::sized_write_globals): Convert
5789 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5790
de4101c7
CC
57912011-10-31 Cary Coutant <ccoutant@google.com>
5792
5793 PR gold/13359
5794 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5795 unnecessary assertion.
5796 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5797
7257cc92
ST
57982011-10-31 Sriraman Tallam <tmsriram@google.com>
5799
5800 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5801 gc_mark_symbol.
5802 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5803 gc_mark_symbol.
5804 Change to just keep the section associated with symbol.
5805 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5806 they are externally visible and --export-dynamic is turned on.
5807 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5808
bfc34b3f
ILT
58092011-10-19 Ian Lance Taylor <iant@google.com>
5810
5811 PR gold/13163
5812 * script-sections.cc
5813 (Output_section_element_dot_assignment::needs_output_section): New
5814 function.
5815
ea0d8c47
ILT
58162011-10-19 Ian Lance Taylor <iant@google.com>
5817
5818 PR gold/13204
5819 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5820 --section-start option was seen.
5821 * options.h (General_options::any_section_start): New function.
5822
abd242a9
DM
58232011-10-18 David S. Miller <davem@davemloft.net>
5824
5825 PR binutils/13301
5826 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5827 member to track relocation locations that have moved during TLS
5828 reloc optimizations.
5829 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5830 (Target_sparc::Relocate::relocate): Adjust view down by 4
5831 bytes if it matches reloc_adjust_addr_.
5832 (Target_sparc::Relocate::relocate_tls): Always move the
5833 __tls_get_addr call delay slot instruction forward 4 bytes when
5834 performing relaxation.
5835
bab9090f
CC
58362011-10-18 Cary Coutant <ccoutant@google.com>
5837
5838 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5839 (Output_file::map_no_anonymous): Check for non-zero
5840 return code from posix_fallocate.
5841
f7c5b166
CC
58422011-10-17 Cary Coutant <ccoutant@google.com>
5843
5844 PR gold/13245
5845 * plugin.cc (is_visible_from_outside): Check for symbols
5846 referenced from dynamic objects.
5847 * resolve.cc (Symbol_table::resolve): Don't count references
5848 from dynamic objects as references from real ELF files.
5849 * testsuite/plugin_test_2.sh: Adjust expected result.
5850
b490c0bb
CC
58512011-10-17 Cary Coutant <ccoutant@google.com>
5852
5853 * gold.cc: Include timer.h.
5854 (queue_middle_tasks): Stamp time.
5855 (queue_final_tasks): Likewise.
5856 * main.cc (main): Store timer in parameters. Print timers
5857 for each pass.
5858 * parameters.cc (Parameters::Parameters): Initialize timer_.
5859 (Parameters::set_timer): New function.
5860 (set_parameters_timer): New function.
5861 * parameters.h (Parameters::set_timer): New function.
5862 (Parameters::timer): New function.
5863 (Parameters::timer_): New data member.
5864 (set_parameters_timer): New function.
5865 * timer.cc (Timer::stamp): New function.
5866 (Timer::get_pass_time): New function.
5867 * timer.h (Timer::stamp): New function.
5868 (Timer::get_pass_time): New function.
5869 (Timer::pass_times_): New data member.
5870
f475cf7b
CC
58712011-10-17 Cary Coutant <ccoutant@google.com>
5872
5873 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5874 task for members of lib groups.
5875
cdd7e244
CC
58762011-10-17 Cary Coutant <ccoutant@google.com>
5877
5878 PR gold/13288
4f95c8b4 5879 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5880 (File_read::make_view): Move bounds check (replace with assert)...
5881 (File_read::find_or_make_view): ... to here.
5882
dfb45471
CC
58832011-10-12 Cary Coutant <ccoutant@google.com>
5884
4f95c8b4 5885 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5886 ::read returns less than requested size.
5887
53bbcc1b
CC
58882011-10-10 Cary Coutant <ccoutant@google.com>
5889
4f95c8b4 5890 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5891 Initialize defined_count_.
5892 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5893 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5894 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5895 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5896 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5897 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5898 member.
5899 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5900 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5901 Return zeroes instead of internal error.
5902
397b129b
CC
59032011-10-10 Cary Coutant <ccoutant@google.com>
5904
5905 PR gold/13249
4f95c8b4 5906 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5907 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5908 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5909 (Output_reloc::type_): Adjust size of bit field.
5910 (Output_reloc::use_plt_offset_): New bit field.
5911 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5912 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5913 flag. Adjust all callers.
4f95c8b4 5914 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5915 creating RELATIVE relocations.
5916
d5698657
NC
59172011-10-10 Nick Clifton <nickc@redhat.com>
5918
5919 * po/es.po: Updated Spanish translation.
5920 * po/fi.po: Updated Finnish translation.
5921
6a59a5c2
DN
59222011-10-03 Diego Novillo <dnovillo@google.com>
5923
5924 * options.cc (parse_uint): Fix dereference of RETVAL.
5925
f0558624
ST
59262011-09-29 Sriraman Tallam <tmsriram@google.com>
5927
5928 * layout.h (section_order_map_): New member.
5929 (get_section_order_map): New member function.
5930 * output.cc (Output_section::add_input_section): Check for patterns
5931 only when --section-ordering-file is specified.
5932 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5933 output_sections have been formed.
5934 * layout.cc (Layout_Layout): Initialize section_order_map_.
5935 * plugin.cc (update_section_order): Store order in order_map. Do not
5936 update the order.
5937 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5938 * testsuite/Makefile.in: Regenerate.
5939 * testsuite/plugin_section_order.c: New file.
5940 * testsuite/plugin_final_layout.cc: New file.
5941 * testsuite/plugin_final_layout.sh: New file.
5942
a7dac153
CC
59432011-09-29 Cary Coutant <ccoutant@google.com>
5944
4f95c8b4 5945 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5946 Check for NULL.
4f95c8b4 5947 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5948 symbols during incremental update.
5949 (Symbol_table::add_from_dynobj): Likewise.
5950
eebd87a5
ILT
59512011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5952 Ian Lance Taylor <iant@google.com>
5953
5954 * symtab.cc (Symbol_table::define_special_symbol): Always
5955 canonicalize version string.
5956
403a3331
CC
59572011-09-26 Cary Coutant <ccoutant@google.com>
5958
4f95c8b4
CC
5959 * gold.cc (queue_initial_tasks): Move option checks ...
5960 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5961 some options; make others fatal.
5962
235061c2
CC
59632011-09-26 Cary Coutant <ccoutant@google.com>
5964
5965 gcc PR lto/47247
5966 * plugin.cc (get_symbols_v2): New function.
5967 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5968 (is_referenced_from_outside): New function.
5969 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5970 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5971 (get_symbols): Pass version parameter.
5972 (get_symbols_v2): New function.
5973 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5974 parameter.
5975 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5976 (onload): Add LDPT_GET_SYMBOLS_V2.
5977 (all_symbols_read_hook): Use get_symbols_v2; check for
5978 LDPR_PREVAILING_DEF_IRONLY_EXP.
5979 * testsuite/plugin_test_3.sh: Update expected results.
5980
dc87f620
ILT
59812011-09-23 Simon Baldwin <simonb@google.com>
5982
5983 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5984 configuration options.
5985 * configure: Regenerate.
5986 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5987 * Makefile.in: Regenerate.
5988 * testsuite/Makefile.in: Regenerate.
5989
a8279f82
ST
59902011-09-19 Sriraman Tallam <tmsriram@google.com>
5991
5992 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5993
0c9350c8
CC
59942011-09-19 Cary Coutant <ccoutant@google.com>
5995
5996 * incremental.cc (can_incremental_update): Fix typo in comment.
5997 * incremental.h (can_incremental_update): Likewise.
5998
aa06ae28
CC
59992011-09-18 Cary Coutant <ccoutant@google.com>
6000
6001 * incremental.cc (can_incremental_update): New function.
6002 * incremental.h (can_incremental_update): New function.
6003 * layout.cc (Layout::init_fixed_output_section): Call it.
6004 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6005 * object.cc (Sized_relobj_file::do_layout): Call
6006 can_incremental_update.
6007
ebb300b2
CC
60082011-09-13 Cary Coutant <ccoutant@google.com>
6009
6010 * configure.ac: Check for glibc support for gnu_indirect_function
6011 support with static linking, setting automake conditional
6012 IFUNC_STATIC.
6013 * Makefile.in: Regenerate.
6014 * configure: Regenerate.
6015
6016 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6017 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6018 for IFUNC_STATIC.
6019 * testsuite/Makefile.in: Regenerate.
6020
1206d0d5
CC
60212011-09-13 Cary Coutant <ccoutant@google.com>
6022
6023 * incremental.cc (Sized_relobj_incr::do_layout): Call
6024 report_comdat_group for kept comdat sections.
6025 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6026 * testsuite/Makefile.in: Regenerate.
6027 * testsuite/incr_comdat_test_1.cc: New source file.
6028 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6029 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6030 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6031
40b29874
ILT
60322011-09-13 Ian Lance Taylor <iant@google.com>
6033
6034 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6035 variable external_symbols_offset.
6036
1b045aac
ILT
60372011-09-12 Ian Lance Taylor <iant@google.com>
6038
6039 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6040 triggered if object has no symbols.
6041
24c6c55a
DM
60422011-09-09 David S. Miller <davem@davemloft.net>
6043
6044 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6045 (Output_fill_debug_line::do_write): Likewise.
6046
66570254
CC
60472011-08-29 Cary Coutant <ccoutant@google.com>
6048
6049 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6050 casts to match formatting specs.
6051 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6052
8ea8cd50
CC
60532011-08-26 Cary Coutant <ccoutant@google.com>
6054
6055 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6056 remaining hole size when allocating.
6057 (Layout::make_output_section): Set fill methods for debug sections.
6058 * layout.h (Free_list::Free_list_node): Move from private to
6059 public.
6060 (Free_list::set_min_hole_size): New function.
6061 (Free_list::begin, Free_list::end): New functions.
6062 (Free_list::min_hole_): New data member.
6063 * output.cc: Include dwarf.h.
6064 (Output_fill_debug_info::do_minimum_hole_size): New function.
6065 (Output_fill_debug_info::do_write): New function.
6066 (Output_fill_debug_line::do_minimum_hole_size): New function.
6067 (Output_fill_debug_line::do_write): New function.
6068 (Output_section::Output_section): Initialize new data member.
6069 (Output_section::set_final_data_size): Ensure patch space is larger
6070 than minimum hole size.
6071 (Output_section::do_write): Fill holes in debug sections.
6072 * output.h (Output_fill): New class.
6073 (Output_fill_debug_info): New class.
6074 (Output_fill_debug_line): New class.
6075 (Output_section::set_free_space_fill): New function.
6076 (Output_section::free_space_fill_): New data member.
6077 * testsuite/Makefile.am (incremental_test_3): Add
6078 --incremental-patch option.
6079 (incremental_test_4): Likewise.
6080 (incremental_test_5): Likewise.
6081 (incremental_test_6): Likewise.
6082 (incremental_copy_test): Likewise.
6083 (incremental_common_test_1): Likewise.
6084 * testsuite/Makefile.in: Regenerate.
6085
7cf80422
NC
60862011-08-26 Nick Clifton <nickc@redhat.com>
6087
6088 * po/es.po: Updated Spanish translation.
6089
c3f7b0e5
CC
60902011-08-01 Cary Coutant <ccoutant@google.com>
6091
6092 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6093 * gold/testsuite/Makefile.in: Regenerate.
6094 * gold/testsuite/justsyms_exec.c: New source file.
6095 * gold/testsuite/justsyms_lib.c: New source file.
6096
9590bf25
CC
60972011-08-01 Cary Coutant <ccoutant@google.com>
6098
6099 * layout.cc (Layout::set_segment_offsets): Don't realign text
6100 segment if -Ttext was specified.
6101 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6102 file type.
6103 * object.h (Sized_relobj_file::e_type): New function.
6104 (Sized_relobj_file::e_type_): New data member.
6105 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6106 base address for ET_EXEC files.
6107 * target.cc (Target::do_make_elf_object_implementation): Allow
6108 ET_EXEC files with --just-symbols option.
6109
dcd8d12e
CC
61102011-07-28 Cary Coutant <ccoutant@google.com>
6111
6112 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6113 Add thread_number parameter.
6114 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6115 * workqueue-threads.cc
6116 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6117 current thread if its thread number is greater than desired thread
6118 count.
6119 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6120 Add thread_number parameter.
6121 (Workqueue::should_cancel_thread): Likewise.
6122 (Workqueue::find_runnable_or_wait): Pass thread_number to
6123 should_cancel_thread.
6124 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6125 parameter.
6126
804eb480
ST
61272011-07-22 Sriraman Tallam <tmsriram@google.com>
6128
6129 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6130 only after checking if it cannot be forced local.
6131 * symtab.h (is_externally_visible): Check if the symbol is not forced
6132 local.
6133
f1ddb600
ILT
61342011-07-15 Ian Lance Taylor <iant@google.com>
6135
6136 * options.h (class General_options): Add --print-output-format.
6137 Move -EL next to -EB, for better --help output.
6138 * target-select.cc: Include <cstdio>, "options.h", and
6139 "parameters.h".
6140 (Target_selector::do_target_bfd_name): New function.
6141 (print_output_format): New function.
6142 * target-select.h (class Target_selector): Update declarations.
6143 (Target_selector::target_bfd_name): New function.
6144 (print_output_format): Declare.
6145 * main.cc: Include "target-select.h".
6146 (main): Handle --print-output-format.
6147 * gold.cc: Include "target-select.h".
6148 (queue_initial_tasks): Handle --print-output-format when there are
6149 no input files.
6150 * parameters.cc (parameters_force_valid_target): Give a better
6151 error message if -EB/-EL does not match target.
6152 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6153 function.
6154
7d172687
ILT
61552011-07-15 Ian Lance Taylor <iant@google.com>
6156
6157 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6158 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6159 (Output_data_plt_i386::do_write): Write address of .dynamic
6160 section to first entry in .got.plt section.
6161 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6162 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6163 Initialize layout_.
6164 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6165 section to first entry in .got.plt section.
6166 * layout.h (Layout::dynamic_section): New function.
6167
e9552f7e
ST
61682011-07-13 Sriraman Tallam <tmsriram@google.com>
6169
6170 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6171 to claim_file call.
6172 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6173 input_section_position_, and input_section_glob_.
6174 (read_layout_from_file): Call function section_ordering_specified.
6175 * layout.h (is_section_ordering_specified): New function.
6176 (section_ordering_specified): New function.
6177 (section_ordering_specified_): New boolean member.
6178 * main.cc(main): Call load_plugins after layout object is defined.
6179 * output.cc (Output_section::add_input_section): Use
6180 function section_ordering_specified to check if section ordering is
6181 needed.
6182 * output.cc (Output_section::add_relaxed_input_section): Use
6183 function section_ordering_specified to check if section ordering is
6184 needed.
6185 (Output_section::update_section_layout): New function.
6186 (Output_section::sort_attached_input_sections): Check if input section
6187 must be reordered.
6188 * output.h (Output_section::update_section_layout): New function.
6189 * plugin.cc (get_section_count): New function.
6190 (get_section_type): New function.
6191 (get_section_name): New function.
6192 (get_section_contents): New function.
6193 (update_section_order): New function.
58797674 6194 (allow_section_ordering): New function.
e9552f7e
ST
6195 (Plugin::load): Add the new interfaces to the transfer vector.
6196 (Plugin_manager::load_plugins): New parameter.
6197 (Plugin_manager::all_symbols_read): New parameter.
6198 (Plugin_manager::claim_file): New parameter. Save the elf object for
6199 unclaimed objects.
6200 (Plugin_manager::get_elf_object): New function.
6201 (Plugin_manager::get_view): Change to directly use the bool to check
6202 if get_view is called from claim_file_hook.
6203 * plugin.h (input_objects): New function
6204 (Plugin__manager::load_plugins): New parameter.
6205 (Plugin_manager::claim_file): New parameter.
6206 (Plugin_manager::get_elf_object): New function.
6207 (Plugin_manager::in_claim_file_handler): New function.
6208 (Plugin_manager::in_claim_file_handler_): New member.
6209 (layout): New function.
6210 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6211 handler with an extra parameter. Make the elf object before calling
6212 claim_file handler.
6213 * testsuite/plugin_test.c (get_section_count): New function pointer.
6214 (get_section_type): New function pointer.
6215 (get_section_name): New function pointer.
6216 (get_section_contents): New function pointer.
6217 (update_section_order): New function pointer.
6218 (allow_section_ordering): New function pointer.
6219 (onload): Check if the new interfaces exist.
6220
9446efde
ILT
62212011-07-13 Ian Lance Taylor <iant@google.com>
6222
6223 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6224 relro section.
6225 * x86_64.cc (Target_x86_64::got_section): Likewise.
6226 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6227 (relro_now_test_SOURCES): New variable.
6228 (relro_now_test_DEPENDENCIES): New variable.
6229 (relro_now_test_LDFLAGS): New variable.
6230 (relro_now_test_LDADD): New variable.
6231 (relro_now_test.so): New target.
6232 * testsuite/Makefile.in: Rebuild.
6233
07aa62f2
ILT
62342011-07-12 Ian Lance Taylor <iant@google.com>
6235
6236 PR gold/12980
6237 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6238 GLOB_DAT relocation rather than a RELATIVE relocation for a
6239 protected symbol when creating a shared library.
6240 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6241 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6242 * testsuite/protected_main_1.cc (main): Test that protected
6243 function has same address.
6244
e2153196
ILT
62452011-07-11 Ian Lance Taylor <iant@google.com>
6246
6247 PR gold/12979
6248 * options.h (class General_options): Add -Bgroup.
6249 * options.cc (General_options::finalize): If -Bgroup is set,
6250 default to --unresolved-symbols=report-all.
6251 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6252 * target-reloc.h (issue_undefined_symbol_error): Handle
6253 --unresolved-symbols=report-all.
6254
6daf5215
ILT
62552011-07-08 Ian Lance Taylor <iant@google.com>
6256
6257 PR gold/11985
6258 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6259 if linker script discards key sections.
6260 (Layout::create_dynamic_symtab): Likewise.
6261 (Layout::assign_local_dynsym_offsets): Likewise.
6262 (Layout::sized_create_version_sections): Likewise.
6263 (Layout::create_interp): Likewise.
6264 (Layout::finish_dynamic_section): Likewise.
6265 (Layout::set_dynamic_symbol_size): Likewise.
6266
beabb2c6
ILT
62672011-07-08 Ian Lance Taylor <iant@google.com>
6268
6269 PR gold/12386
6270 * options.h (class General_options): Add --unresolved-symbols.
6271 * target-reloc.h (issue_undefined_symbol_error): Check
6272 --unresolved-symbols. Add comments.
6273
9c16daf1
ILT
62742011-07-08 Ian Lance Taylor <iant@google.com>
6275
6276 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6277 expression more complex.
6278
191f1a2d
ILT
62792011-07-08 Ian Lance Taylor <iant@google.com>
6280
6281 PR gold/11317
6282 * target-reloc.h (issue_undefined_symbol_error): New inline
6283 function, broken out of relocate_section.
6284 (relocate_section): Call issue_undefined_symbol_error.
6285 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6286 there is no TLS segment if we are about to issue an undefined
6287 symbol error.
6288 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6289
62855347
ILT
62902011-07-08 Ian Lance Taylor <iant@google.com>
6291
6292 PR gold/12279
6293 * resolve.cc (Symbol_table::should_override): Add fromtype
6294 parameter. Change all callers. Give error when linking together
6295 TLS and non-TLS symbol.
6296 (Symbol_table::should_override_with_special): Add fromtype
6297 parameter. Change all callers.
6298 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6299 there is no TLS segment if we have reported some errors.
6300 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6301
67181c72
ILT
63022011-07-08 Ian Lance Taylor <iant@google.com>
6303
6304 PR gold/12372
6305 * target.h (Target::plt_address_for_global): New function.
6306 (Target::plt_address_for_local): New function.
6307 (Target::plt_section_for_global): Remove.
6308 (Target::plt_section_for_local): Remove.
6309 (Target::do_plt_address_for_global): New virtual function.
6310 (Target::do_plt_address_for_local): New virtual function.
6311 (Target::do_plt_section_for_global): Remove.
6312 (Target::do_plt_section_for_local): Remove.
6313 (Target::register_global_plt_entry): Add Symbol_table and Layout
6314 parameters.
6315 * output.cc (Output_data_got::Got_entry::write): Use
6316 plt_address_for_global and plt_address_for_local.
6317 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6318 address of output section.
6319 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6320 got_irelative_, and irelative_count_ fields. Update
6321 declarations.
6322 (Output_data_plt_i386::has_irelative_section): New function.
6323 (Output_data_plt_i386::entry_count): Add irelative_count_.
6324 (Output_data_plt_i386::set_final_data_size): Likewise.
6325 (class Target_i386): Add got_irelative_ and rel_irelative_
6326 fields. Update declarations.
6327 (Target_i386::Target_i386): Initialize new fields.
6328 (Target_i386::do_plt_address_for_global): New function replacing
6329 do_plt_section_for_global.
6330 (Target_i386::do_plt_address_for_local): New function replacing
6331 do_plt_section_for_local.
6332 (Target_i386::got_section): Create got_irelative_.
6333 (Target_i386::rel_irelative_section): New function.
6334 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6335 fields. Don't define __rel_iplt_{start,end}.
6336 (Output_data_plt_i386::add_entry): Add symtab and layout
6337 parameters. Change all callers. Use different PLT and GOT for
6338 IFUNC symbols.
6339 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6340 layout parameters. Change all callers. Use different PLT and
6341 GOT.
6342 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6343 (Output_data_plt_i386::rel_irelative): New function.
6344 (Output_data_plt_i386::address_for_global): New function.
6345 (Output_data_plt_i386::address_for_local): New function.
6346 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6347 IRELATIVE GOT when changing IFUNC GOT entries.
6348 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6349 reloc.
6350 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6351 if we didn't create an IRELATIVE GOT.
6352 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6353 plt_address_for_local.
6354 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6355 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6356 got_irelative_, and irelative_count_ fields. Update
6357 declarations.
6358 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6359 Initialize new fields. Remove symtab parameter. Change all
6360 callers.
6361 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6362 irelative_count_.
6363 (Output_data_plt_x86_64::has_irelative_section): New function.
6364 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6365 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6366 fields. Update declarations.
6367 (Target_x86_64::Target_x86_64): Initialize new fields.
6368 (Target_x86_64::do_plt_address_for_global): New function replacing
6369 do_plt_section_for_global.
6370 (Target_x86_64::do_plt_address_for_local): New function replacing
6371 do_plt_section_for_local.
6372 (Target_x86_64::got_section): Create got_irelative_.
6373 (Target_x86_64::rela_irelative_section): New function.
6374 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6375 all callers. Don't create __rel_iplt_{start,end}.
6376 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6377 parameters. Change all callers. Use different PLT and GOT for
6378 IFUNC symbols.
6379 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6380 layout parameters. Change all callers. Use different PLT and
6381 GOT.
6382 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6383 parameters. Change all callers. Use different PLT and GOT for
6384 IFUNC symbols.
6385 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6386 (Output_data_plt_x86_64::rela_irelative): New function.
6387 (Output_data_plt_x86_64::address_for_global): New function.
6388 (Output_data_plt_x86_64::address_for_local): New function.
6389 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6390 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6391 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6392 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6393 parameters.
6394 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6395 reloc.
6396 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6397 symbols if we didn't create an IRELATIVE GOT.
6398 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6399 plt_address_for_local.
6400 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6401 * testsuite/ifuncvar1.c: New test file.
6402 * testsuite/ifuncvar2.c: New test file.
6403 * testsuite/ifuncvar3.c: New test file.
6404 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6405 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6406 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6407 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6408 * testsuite/Makefile.in: Rebuild.
6409
33c15b45
CC
64102011-07-07 Cary Coutant <ccoutant@google.com>
6411
6412 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6413 (two_file_test_1_ndebug.o): Likewise.
6414 (two_file_test_1b_ndebug.o): Likewise.
6415 (two_file_test_2_ndebug.o): Likewise.
6416 (two_file_test_main_ndebug.o): Likewise.
6417 (incremental_test_2): Link with no-debug versions.
6418
f48b5fb7
CC
64192011-07-06 Cary Coutant <ccoutant@google.com>
6420
6421 * gold/incremental.cc
6422 (Output_section_incremental_inputs::write_info_blocks): Check for
6423 hidden and internal symbols.
6424
221597a5
CC
64252011-07-06 Cary Coutant <ccoutant@google.com>
6426
6427 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6428 Check disposition for startup file.
6429 (Incremental_inputs::report_command_line): Ignore
6430 --incremental-startup-unchanged option.
6431 * options.cc (General_options::parse_incremental_startup_unchanged):
6432 New function.
6433 (General_options::General_options): Initialize new data member.
6434 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6435 (General_options): Add --incremental-startup-unchanged option.
6436 (General_options::incremental_startup_disposition): New function.
6437 (General_options::incremental_startup_disposition_): New data member.
6438
e24719f6
CC
64392011-07-06 Cary Coutant <ccoutant@google.com>
6440
6441 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6442 input file index to Script_info ctor.
6443 (Sized_incremental_binary::do_file_has_changed): Find the
6444 command-line argument for files named in scripts.
6445 * incremental.h (Script_info::Script_info): New ctor
6446 with input file index.
6447 (Script_info::input_file_index): New function.
6448 (Script_info::input_file_index_): New data member.
6449 (Incremental_binary::get_library): Add const.
6450 (Incremental_binary::get_script_info): Add const.
6451 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6452 * testsuite/Makefile.am (incremental_test_5): New test case.
6453 (incremental_test_6): New test case.
6454 * testsuite/Makefile.in: Regenerate.
6455
8f7c81e8
CC
64562011-07-06 Cary Coutant <ccoutant@google.com>
6457
6458 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6459 debug output when command lines differ.
6460
9fbd3822
CC
64612011-07-06 Cary Coutant <ccoutant@google.com>
6462
6463 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6464 --incremental-patch option.
6465 * layout.cc (Free_list::allocate): Extend allocation beyond original
6466 end if enabled.
6467 (Layout::make_output_section): Mark sections that should get
6468 patch space.
6469 * options.cc (parse_percent): New function.
6470 * options.h (parse_percent): New function.
6471 (DEFINE_percent): New macro.
6472 (General_options): Add --incremental-patch option.
6473 * output.cc (Output_section::Output_section): Initialize new data
6474 members.
6475 (Output_section::add_input_section): Print section name when out
6476 of patch space.
6477 (Output_section::add_output_section_data): Likewise.
6478 (Output_section::set_final_data_size): Add patch space when
6479 doing --incremental-full.
6480 (Output_section::do_reset_address_and_file_offset): Remove patch
6481 space.
6482 (Output_segment::set_section_list_addresses): Print debug output
6483 only if --incremental-update.
6484 * output.h (Output_section::set_is_patch_space_allowed): New function.
6485 (Output_section::is_patch_space_allowed_): New data member.
6486 (Output_section::patch_space_): New data member.
6487 * parameters.cc (Parameters::incremental_full): New function.
6488 * parameters.h (Parameters::incremental_full): New function
6489 * testsuite/Makefile.am (incremental_test_2): Add test for
6490 --incremental-patch option.
6491 * testsuite/Makefile.in: Regenerate.
6492 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6493 (t18): Remove function body.
6494
f6cccc2c
DK
64952011-07-05 Doug Kwan <dougkwan@google.com>
6496
6497 PR gold/12771
6498 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6499 Arm_Address type for relocation result.
6500 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6501 overflow check.
6502 (Arm_relocate_functions::abs32): Use unaligned access.
6503 (Arm_relocate_functions::rel32): Ditto.
6504 (Arm_relocate_functions::prel31): Ditto.
6505 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6506 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6507 static data relocations.
6508 * testsuite/Makefile.in: Regnerate.
6509 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6510
28a13fec
ILT
65112011-07-05 Ian Lance Taylor <iant@google.com>
6512
6513 PR gold/12392
6514 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6515 symbols if necessary.
6516 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6517
24d47b34
ILT
65182011-07-05 Ian Lance Taylor <iant@google.com>
6519
6520 PR gold/12952
6521 * resolve.cc (Symbol::override_base_with_special): Simply override
6522 version with special symbol version, ignoring previous version.
6523
41f9cbbe
ILT
65242011-07-05 Ian Lance Taylor <iant@google.com>
6525
6526 * object.cc (Sized_relobj_file::include_section_group): Add
6527 information to comment about signature location.
6528
886288f1
ILT
65292011-07-02 Ian Lance Taylor <iant@google.com>
6530
6531 PR gold/12957
6532 * options.h (class General_options): Add -f and -F.
6533 * options.cc (General_options::finalize): Fatal error if -f/-F
6534 are used without -shared.
6535 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6536
ae3a6d4f
ILT
65372011-07-02 Ian Lance Taylor <iant@google.com>
6538
6539 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6540
21131061
ILT
65412011-07-01 Ian Lance Taylor <iant@google.com>
6542
6543 PR gold/12525
6544 PR gold/12952
6545 * resolve.cc (Symbol::override_base_with_special): Don't override
6546 the version if the overriding symbol has a different name.
6547 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6548 all callers. If we give an error about an undefined version,
6549 define the base version if necessary.
6550 * dynobj.h (class Versions): Update declaration.
6551 * testsuite/weak_alias_test_5.cc: New file.
6552 * testsuite/weak_alias_test.script: New file.
6553 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6554 and versioned_alias have the right value, and call t2.
6555 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6556 weak_alias_test_5.so.
6557 (weak_alias_test_LDADD): Likewise.
6558 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6559 * testsuite/Makefile.in: Rebuild.
6560
611062c0
ILT
65612011-07-01 Ian Lance Taylor <iant@google.com>
6562
6563 PR gold/12525
6564 * options.h (class General_options): Support -z notext.
6565 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6566 -Wl,-z,notext.
6567 (two_file_shared_nonpic.so): Likewise.
6568 (two_file_shared_mixed.so): Likewise.
6569 (two_file_shared_mixed_1.so): Likewise.
6570 (weak_undef_lib_nonpic.so): Likewise.
6571 (alt/weak_undef_lib_nonpic.so): Likewise.
6572 (tls_test_shared_nonpic.so): Likewise.
6573 * testsuite/Makefile.in: Rebuild.
6574
328c7c2f
ILT
65752011-07-01 Ian Lance Taylor <iant@google.com>
6576
6577 PR gold/12525
6578 * configure.ac: Test whether static linking works, setting
6579 the automake conditional HAVE_STATIC.
6580 * testsuite/Makefile.am: Disable tests using -static if
6581 HAVE_STATIC is not true.
6582 * configure, testsuite/Makefile.in: Rebuild.
6583
02d7cd44
ILT
65842011-07-01 Ian Lance Taylor <iant@google.com>
6585
6586 PR gold/12525
6587 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6588 Assert if we see DW_EH_PE_indirect.
6589 * target.h (Target::ehframe_datarel_base): New function.
6590 (Target::do_ehframe_datarel_base): New target function.
6591 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6592 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6593 function.
6594
07a60597
ILT
65952011-07-01 Ian Lance Taylor <iant@google.com>
6596
6597 PR gold/12571
6598 * options.h (class General_options): Add
6599 --ld-generated-unwind-info.
6600 * ehframe.cc (Fde::write): Add address parameter. Change all
6601 callers. If associated with PLT, fill in address and size.
6602 (Cie::set_output_offset): Only add merge mapping if there is an
6603 object.
6604 (Cie::write): Add address parameter. Change all callers.
6605 (Eh_frame::add_ehframe_for_plt): New function.
6606 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6607 input_offset_ fields into union u_, with new plt field.
6608 (Fde::Fde): Adjust for new union field.
6609 (Fde::Fde) [Output_data version]: New constructor.
6610 (Fde::add_mapping): Only add merge mapping if there is an object.
6611 (class Cie): Update declarations.
6612 (class Eh_frame): Declare add_ehframe_for_plt.
6613 * layout.cc (Layout::layout_eh_frame): Break out code into
6614 make_eh_frame_section, and call it.
6615 (Layout::make_eh_frame_section): New function.
6616 (Layout::add_eh_frame_for_plt): New function.
6617 * layout.h (class Layout): Update declarations.
6618 * merge.cc (Merge_map::add_mapping): Add assertion.
6619 * i386.cc: Include "dwarf.h".
6620 (class Output_data_plt_i386): Make first_plt_entry,
6621 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6622 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6623 and plt_eh_frame_fde.
6624 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6625 boundary. Call add_eh_frame_for_plt if appropriate.
6626 * x86_64.cc: Include "dwarf.h".
6627 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6628 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6629 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6630 and plt_eh_frame_fde.
6631 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6632 appropriate.
6633
14788a3f
ILT
66342011-06-29 Ian Lance Taylor <iant@google.com>
6635
6636 PR gold/12629
6637 * object.cc (Sized_relobj_file::layout_section): Change shdr
6638 parameter to be const.
6639 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6640 out of do_layout.
6641 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6642 appropriate. Call layout_eh_frame_section.
6643 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6644 sections.
6645 * object.h (class Sized_relobj_file): Update declarations.
6646
6c21fce1
ILT
66472011-06-29 Ian Lance Taylor <iant@google.com>
6648
37e41b03 6649 PR gold/12652
6c21fce1
ILT
6650 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6651 modifier.
6652 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6653
4d5e4e62
ILT
66542011-06-29 Ian Lance Taylor <iant@google.com>
6655
6656 PR gold/12675
6657 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6658 SHT_X86_64_UNWIND.
6659 * layout.cc (Layout::layout_eh_frame): Likewise.
6660
886f533a
ILT
66612011-06-29 Ian Lance Taylor <iant@google.com>
6662
6663 PR gold/12695
6664 * layout.cc (Layout::symtab_section_shndx): New function.
6665 * layout.h (class Layout): Declare symtab_section_shndx.
6666 * output.cc (Output_section::write_header): Call it.
6667
f3ae1b28
ILT
66682011-06-29 Ian Lance Taylor <iant@google.com>
6669
6670 PR gold/12818
6671 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6672 symbols which are not used in a relocation.
6673
aecf301f
ILT
66742011-06-28 Ian Lance Taylor <iant@google.com>
6675
6676 PR gold/12898
6677 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6678 script create indistinguishable segments.
6679 (Layout::set_segment_offsets): Use stable_sort when sorting
6680 segments. Pass this to Compare_segments constructor.
6681 * layout.h (class Layout): Make segment_precedes non-static.
6682 (class Compare_segments): Change from struct to class. Add
6683 layout_ field. Add constructor.
6684 * script-sections.cc
6685 (Script_sections::attach_sections_using_phdrs_clause): Rename
6686 local orphan to is_orphan. Don't report failure to put empty
6687 section in segment. On attachment failure, report name of
6688 section, and attach to first PT_LOAD segment.
6689
03ef7571
ILT
66902011-06-28 Ian Lance Taylor <iant@google.com>
6691
6692 PR gold/12934
6693 * target-select.cc (Target_selector::Target_selector): Add
6694 emulation parameter. Change all callers.
6695 (select_target_by_bfd_name): Rename from select_target_by_name.
6696 Change all callers.
6697 (select_target_by_emulation): New function.
6698 (supported_emulation_names): New function.
6699 * target-select.h (class Target_selector): Add emulation_ field.
6700 Update declarations.
6701 (Target_selector::recognize_by_bfd_name): Rename from
6702 recognize_by_name. Change all callers.
6703 (Target_selector::supported_bfd_names): Rename from
6704 supported_names. Change all callers.
6705 (Target_selector::recognize_by_emulation): New function.
6706 (Target_selector::supported_emulations): New function.
6707 (Target_selector::emulation): New function.
6708 (Target_selector::do_recognize_by_bfd_name): Rename from
6709 do_recognize_by_name. Change all callers.
6710 (Target_selector::do_supported_bfd_names): Rename from
6711 do_supported_names. Change all callers.
6712 (Target_selector::do_recognize_by_emulation): New function.
6713 (Target_selector::do_supported_emulations): New function.
6714 (select_target_by_bfd_name): Change name in declaration.
6715 (select_target_by_emulation): Declare.
6716 (supported_emulation_names): Declare.
6717 * parameters.cc (parameters_force_valid_target): Try to find
6718 target based on emulation from -m option.
6719 * options.h (class General_options): Change doc string for -m.
6720 * options.cc (help): Print emulations.
6721 (General_options::parse_V): Likewise.
6722 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6723 Add emulation parameter. Change all callers.
6724
200b2bb9
ILT
67252011-06-28 Ian Lance Taylor <iant@google.com>
6726
6727 * target.h (class Target): Add osabi_ field.
6728 (Target::osabi): New function.
6729 (Target::set_osabi): New function.
6730 (Target::Target): Initialize osabi_.
6731 (Target::do_adjust_elf_header): Make pure virtual.
6732 (Sized_target::do_adjust_elf_header): Declare.
6733 * target.cc (Sized_target::do_adjust_elf_header): New function.
6734 (class Sized_target): Instantiate all versions.
6735 * freebsd.h (class Target_freebsd): Remove.
6736 (Target_selector_freebsd::do_recognize): Call set_osabi on
6737 Target.
6738 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6739 (Target_selector_freebsd::set_osabi): Remove.
6740 * i386.cc (class Target_i386): Inherit from Sized_target rather
6741 than Target_freebsd.
6742 * x86_64.cc (class Target_x86_64): Likewise.
6743
b3ce541e
ILT
67442011-06-28 Ian Lance Taylor <iant@google.com>
6745
6746 * target.h (Target::can_check_for_function_pointers): Rewrite.
6747 Make non-virtual.
6748 (Target::can_icf_inline_merge_sections): Likewise.
6749 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6750 (Target::Target_info): Add can_icf_inline_merge_sections field.
6751 (Target::do_can_check_for_function_pointers): New virtual
6752 function.
6753 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6754 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6755 from can_check_for_function_pointers, move in file.
6756 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6757 section_may_have_icf_unsafe_poineters, move in file.
6758 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6759 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6760 Rename from can_check_for_function_pointers, move in file.
6761 (Target_i386::can_icf_inline_merge_sections): Remove.
6762 (Target_i386::i386_info): Initialize
6763 can_icf_inline_merge_sections.
6764 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6765 Initialize can_icf_inline_merge_sections.
6766 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6767 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6768 Rename from can_check_for_function_pointers, move in file.
6769 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6770 (Target_x86_64::x86_64_info): Initialize
6771 can_icf_inline_merge_sections.
6772 * testsuite/testfile.cc (Target_test::test_target_info):
6773 Likewise.
6774 * icf.cc (get_section_contents): Correct formatting.
6775
6d1c4efb
ILT
67762011-06-27 Ian Lance Taylor <iant@google.com>
6777
6778 * symtab.cc (Symbol::versioned_name): New function.
6779 (Symbol_table::add_to_final_symtab): Use versioned_name when
6780 appropriate.
6781 (Symbol_table::sized_write_symbol): Likewise.
6782 * symtab.h (class Symbol): Declare versioned_name.
6783 * stringpool.h (class Stringpool_template): Add variant of add
6784 which takes a std::basic_string.
6785 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6786 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6787 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6788 (ver_test_12.o): New target.
6789 * testsuite/Makefile.in: Rebuild.
6790
57eb9b50
DK
67912011-06-27 Doug Kwan <dougkwan@google.com>
6792
6793 * arm.cc (Arm_relocate_functions::thm_jump8,
6794 Arm_relocate_functions::thm_jump11): Use a wider signed
6795 type to compute offset.
6796 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6797 arm_thm_jump8.
6798 * testsuite/Makefile.in: Regenerate.
6799 * testsuite/arm_branch_in_range.sh: Check test results of
6800 arm_thm_jump11 and arm_thm_jump8.
6801 * testsuite/arm_thm_jump11.s: New test source file.
6802 * testsuite/arm_thm_jump11.t: New linker script.
6803 * testsuite/arm_thm_jump8.s: New test source file.
6804 * testsuite/arm_thm_jump8.t: New linker script.
6805
487b39df
ILT
68062011-06-24 Ian Lance Taylor <iant@google.com>
6807
6808 * layout.cc: Include "object.h".
6809 (ctors_sections_in_init_array): New static variable.
6810 (Layout::is_ctors_in_init_array): New function.
6811 (Layout::layout): Add entry to ctors_sections_in_init_array if
6812 appropriate.
6813 * layout.h (class Layout): Declare is_ctors_in_init_array.
6814 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6815 is_ctors_reverse_view is set.
6816 (Sized_relobj_file::write_sections): Add layout parameter. Change
6817 all callers. Set is_ctors_reverse_view field of View_size.
6818 (Sized_relobj_file::reverse_words): New function.
6819 * object.h (Sized_relobj_file::View_size): Add
6820 is_ctors_reverse_view field.
6821 (class Sized_relobj_file): Update declarations.
6822 * testsuite/initpri3.c: New test.
6823 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6824 initpri3b.
6825 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6826 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6827 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6828 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6829 * testsuite/Makefile.in: Rebuild.
6830
472076e4
CC
68312011-06-24 Cary Coutant <ccoutant@google.com>
6832
6833 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6834 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6835 (debug_msg_cdebug.err): New targets.
6836 * testsuite/Makefile.in: Regenerate.
6837 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6838 Fix checks for link with shared library.
6839
a60af0db
DK
68402011-06-24 Doug Kwan <dougkwan@google.com>
6841
6842 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6843 skip empty text sections.
6844 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6845
5393d741
ILT
68462011-06-22 Ian Lance Taylor <iant@google.com>
6847
6848 PR gold/12910
6849 * options.h (class General_options): Add --ctors-in-init-array.
6850 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6851 friends as SHT_PROGBITS for merging sections.
6852 (Layout::layout): Remove special handling of .init_array and
6853 friends. Don't sort if doing relocatable link. Sort for .ctors
6854 and .dtors if ctors_in_init_array.
6855 (Layout::make_output_section): Force correct section types for
6856 .init_array and friends. Don't sort if doing relocatable link,
6857 Don't sort .ctors and .dtors if ctors_in_init_array.
6858 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6859 (Layout::output_section_name): Add relobj parameter. Change all
6860 callers. Handle .ctors. and .dtors. in code rather than table.
6861 Handle .ctors and .dtors if ctors_in_init_array.
6862 (Layout::match_file_name): New function, moved from output.cc.
6863 * layout.h (class Layout): Update declarations.
6864 * output.cc: Include "layout.h".
6865 (Input_section_sort_entry::get_priority): New function.
6866 (Input_section_sort_entry::match_file_name): Just call
6867 Layout::match_file_name.
6868 (Output_section::Input_section_sort_init_fini_compare::operator()):
6869 Handle .ctors and .dtors. Sort by explicit priority rather than
6870 by name.
6871 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6872 * testsuite/initpri2.c: New test.
6873 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6874 (check_PROGRAMS): Add initpri2.
6875 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6876 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6877 * configure, testsuite/Makefile.in: Rebuild.
6878
e1f74f98
ILT
68792011-06-19 Ian Lance Taylor <iant@google.com>
6880
6881 PR gold/12880
6882 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6883 .interp section to a PT_INTERP segment even if we have seen a
6884 --dynamic-linker option. Don't do it if we have seen a PHDRS
6885 clause in a linker script.
6886 (Layout::finalize): Don't create a .interp section if we've
6887 already create a PT_INTERP segment.
6888 (Layout::create_interp): Always call choose_output_section (revert
6889 patch of 2011-06-17). Don't create PT_INTERP segment.
6890 * script-sections.cc
6891 (Script_sections::create_note_and_tls_segments): Add a .interp
6892 section to a PT_INTERP segment even if we have seen a
6893 --dynamic-linker option.
6894
766f91bb
ILT
68952011-06-18 Ian Lance Taylor <iant@google.com>
6896
6897 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6898 merely because a non-PT_LOAD segment has a dynamic reloc.
6899
0d212c3a
ILT
69002011-06-18 Ian Lance Taylor <iant@google.com>
6901
6902 * layout.cc (Layout::finish_dynamic_section): Don't create
6903 DT_FLAGS entry if not needed.
6904
911a5072
ILT
69052011-06-18 Ian Lance Taylor <iant@google.com>
6906
6907 PR gold/12745
6908 * layout.cc (Layout::layout_eh_frame): Correct handling of
6909 writable .eh_frame section.
6910
534b4e5f
ILT
69112011-06-17 Ian Lance Taylor <iant@google.com>
6912
6913 PR gold/12893
6914 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6915 symbol is redefined with the exact same object and value.
6916
10b4f102
ILT
69172011-06-17 Ian Lance Taylor <iant@google.com>
6918
6919 PR gold/12880
6920 * layout.h (class Layout): Add interp_segment_ field.
6921 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6922 (Layout::attach_allocated_section_to_segment): If making shared
6923 library, put .interp section in PT_INTERP segment.
6924 (Layout::finalize): Also call create_interp if -dynamic-linker
6925 option was used.
6926 (Layout::create_interp): Assert that there is no PT_INTERP
6927 segment. If not using a SECTIONS clause, use make_output_section.
6928 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6929 * script-sections.cc
6930 (Script_sections::create_note_and_tls_segments): If making shared
6931 library, put .interp section in PT_INTERP segment.
6932
a29b0dad
ILT
69332011-06-17 Ian Lance Taylor <iant@google.com>
6934
e588ea8d
ILT
6935 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6936 when making a shared library.
6937
69382011-06-17 Ian Lance Taylor <iant@google.com>
6939
6940 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6941 parameter. Change all callers. Don't issue warning about PC32
6942 against locally defined symbol.
a29b0dad 6943
9d3b0698
ILT
69442011-06-16 Ian Lance Taylor <iant@google.com>
6945
6946 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6947 occurs in same object.
6948
85b0f90c
AM
69492011-06-14 Alan Modra <amodra@gmail.com>
6950
6951 * po/POTFILES.in: Regenerate.
6952
a94907d9
ILT
69532011-06-09 Ian Lance Taylor <iant@google.com>
6954
6955 * script-sections.cc
6956 (Orphan_output_section::set_section_addresses): For a relocatable
6957 link set address to 0.
6958
4fb3a1c3
CC
69592011-06-09 Cary Coutant <ccoutant@google.com>
6960
6961 PR gold/12804
6962 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6963 used with --compress-debug-sections.
6964 * gold/object.cc (Sized_relobj_file::do_layout): Report
6965 uncompressed size of compressed input sections.
6966
61220854
CC
69672011-06-08 Cary Coutant <ccoutant@google.com>
6968
6969 PR gold/12804
6970 * testsuite/two_file_test_2_v1.cc: Change initialization of
6971 v2 to keep it in .data.
6972
e6455dfb
CC
69732011-06-07 Cary Coutant <ccoutant@google.com>
6974
6975 * common.cc (Symbol_table::do_allocate_commons_list): Call
6976 gold_fallback.
6977 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6978 (Errors::fallback): New function.
6979 (gold_fallback): New function.
6980 * errors.h (Errors::fallback): New function.
6981 * gold.cc (gold_exit): Change status parameter to enum; adjust
6982 all callers.
6983 (queue_initial_tasks): Call gold_fallback.
6984 * gold.h: Include cstdlib.
6985 (Exit_status): New enum type.
6986 (gold_exit): Change status parameter to enum.
6987 (gold_fallback): New function.
6988 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6989 (Layout::create_symtab_sections): Likewise.
6990 (Layout::create_shdrs): Likewise.
6991 * main.cc (main): Adjust call to gold_exit.
6992 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6993 (Output_data_got::add_got_entry_pair): Likewise.
6994 (Output_section::add_input_section): Likewise.
6995 (Output_section::add_output_section_data): Likewise.
6996 (Output_segment::set_section_list_addresses): Likewise.
6997 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6998
fb0e076f
CC
69992011-06-07 Cary Coutant <ccoutant@google.com>
7000
7001 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7002 for incremental links.
7003 * output.cc (Output_segment::set_section_list_addresses): Remove
7004 FIXME and test for TLS or BSS.
7005
a5ee4d5d
CC
70062011-06-07 Cary Coutant <ccoutant@google.com>
7007
7008 * testsuite/Makefile.am: Add incremental_copy_test,
7009 incremental_common_test_1.
7010 * testsuite/Makefile.in: Regenerate.
7011 * testsuite/common_test_1_v1.c: New source file.
7012 * testsuite/common_test_1_v2.c: New source file.
7013 * testsuite/copy_test_v1.cc: New source file.
7014
5146f448
CC
70152011-06-07 Cary Coutant <ccoutant@google.com>
7016
7017 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7018 update, allocate common from bss section's free list.
7019 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7020 linker-defined symbols.
7021 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7022 Skip GOT and PLT entries that are no longer referenced.
7023 (Output_section_incremental_inputs::write_info_blocks): Mark
7024 linker-defined symbols.
7025 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7026 * output.cc (Output_section::allocate): New function.
7027 * output.h (Output_section::allocate): New function.
7028 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7029 linker-defined symbols.
7030 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7031 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7032 (Symbol::init_base_output_data): Likewise.
7033 (Symbol::init_base_output_segment): Likewise.
7034 (Symbol::init_base_constant): Likewise.
7035 (Sized_symbol::init_output_data): Likewise.
7036 (Sized_symbol::init_output_segment): Likewise.
7037 (Sized_symbol::init_constant): Likewise.
7038 (Symbol_table::do_define_in_output_data): Likewise.
7039 (Symbol_table::do_define_in_output_segment): Likewise.
7040 (Symbol_table::do_define_as_constant): Likewise.
7041 * symtab.h (Symbol::is_predefined): New function.
7042 (Symbol::init_base_output_data): Add is_predefined parameter.
7043 (Symbol::init_base_output_segment): Likewise.
7044 (Symbol::init_base_constant): Likewise.
7045 (Symbol::is_predefined_): New data member.
7046 (Sized_symbol::init_output_data): Add is_predefined parameter.
7047 (Sized_symbol::init_output_segment): Likewise.
7048 (Sized_symbol::init_constant): Likewise.
7049 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7050
26d3c67d
CC
70512011-06-07 Cary Coutant <ccoutant@google.com>
7052
7053 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7054 instead of emit_copy_reloc.
7055 (Copy_relocs::emit_copy_reloc): Refactor.
7056 (Copy_relocs::make_copy_reloc): New function.
7057 (Copy_relocs::add_copy_reloc): Remove.
7058 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7059 section.
7060 (Copy_relocs::make_copy_reloc): New function.
7061 (Copy_relocs::add_copy_reloc): Remove.
7062 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7063 unchanged input files.
7064 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7065 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7066 Reserve BSS space for COPY relocations.
7067 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7068 (Output_section_incremental_inputs::write_info_blocks): Record
7069 whether a symbol is copied from a shared object.
7070 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7071 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7072 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7073 (Incremental_input_entry_reader::get_output_symbol_index): Add
7074 is_copy parameter.
7075 (Incremental_binary::emit_copy_relocs): New function.
7076 (Incremental_binary::do_emit_copy_relocs): New function.
7077 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7078 new data member.
7079 (Sized_incremental_binary::add_copy_reloc): New function.
7080 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7081 (Sized_incremental_binary::Copy_reloc): New struct.
7082 (Sized_incremental_binary::Copy_relocs): New typedef.
7083 (Sized_incremental_binary::copy_relocs_): New data member.
7084 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7085 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7086 * target.h (Sized_target::emit_copy_reloc): New function.
7087 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7088
7cdb37d9
CC
70892011-06-02 Cary Coutant <ccoutant@google.com>
7090
7091 PR gold/12163
7092 * gold/archive.cc (Archive::Archive): Initialize new data member.
7093 (Archive::include_all_members): Return if archive has already been
7094 included.
7095 * gold/archive.h (Archive::include_all_members_): New data member.
7096
cc643b88
NC
70972011-06-02 Nick Clifton <nickc@redhat.com>
7098
7099 * dynobj.h: Fix spelling mistake in comment.
7100 * output.cc: Likewise.
7101
f62a3ca7 71022011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7103 Asier Llano
f62a3ca7
DK
7104
7105 PR gold/12826
cc643b88 7106 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7107 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7108 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7109 redundant arm_exidx_test.so.
7110 * testsuite/Makefile.in: Regenerate.
7111 (check_SCRIPTS): Add pr12826.sh
7112 (check_DATA): Add pr12826.stdout
7113 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7114 * testsuite/pr12826.sh: New file.
7115 * testsuite/pr12826_1.s: Ditto.
7116 * testsuite/pr12826_1.s: Ditto.
7117
8dbe1edc
ILT
71182011-05-30 Ian Lance Taylor <iant@google.com>
7119
7120 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7121 sections.
7122
c49875be
ILT
71232011-05-29 Ian Lance Taylor <iant@google.com>
7124
7125 PR gold/12804
7126 * testsuite/Makefile.am: Use different file name for two_file_test
7127 temporary file for each incremental test.
7128 * testsuite/Makefile.in: Rebuild.
7129
69d53f7a
ILT
71302011-05-29 Ian Lance Taylor <iant@google.com>
7131
7132 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7133 binary input file is empty.
7134
41d0ab5f
ILT
71352011-05-27 Ian Lance Taylor <iant@google.com>
7136
7137 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7138 (ver_test_9.so): Likewise.
7139 * testsuite/Makefile.in: Rebuild.
7140
89d8a36b
CC
71412011-05-26 Cary Coutant <ccoutant@google.com>
7142
7143 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7144 * incremental.cc (Incremental_inputs::report_input_section): Fix
7145 comment, indentation.
7146 (Incremental_inputs::report_comdat_group): New function.
7147 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7148 of data for incremental input file entry.
7149 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7150 group count, COMDAT group signatures.
7151 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7152 an unchanged input file.
7153 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7154 Initialize new data member.
7155 (Incremental_object_entry::add_comdat_group): New function.
7156 (Incremental_object_entry::get_comdat_group_count): New function.
7157 (Incremental_object_entry::get_comdat_signature_key): New function.
7158 (Incremental_object_entry::groups_): New data member.
7159 (Incremental_inputs::report_comdat_group): New function.
7160 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7161 data for incremental input file entry.
7162 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7163 (Incremental_input_entry_reader::get_input_section): Adjust size of
7164 data for incremental input file entry.
7165 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7166 (Incremental_input_entry_reader::get_comdat_group_signature): New
7167 function.
7168 * object.cc (Sized_relobj::include_section_group): Report kept
7169 COMDAT groups for incremental links.
7170
1706a06f
ILT
71712011-05-24 David Meyer <pdox@google.com>
7172
7173 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7174 with name parameter. Add found_name parameter.
7175 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7176 * dirsearch.h (class Dirsearch): Update declaration.
7177
a10ae760
ILT
71782011-05-24 Ian Lance Taylor <iant@google.com>
7179
7180 * archive.cc (Library_base::should_include_member): Pull in object
7181 from archive if it defines the entry symbol.
7182 * parameters.cc (Parameters::entry): New function.
7183 * parameters.h (class Parameters): Declare entry.
7184 * output.h (class Output_file_header): Remove entry_ field.
7185 * output.cc (Output_file_header::Output_file_header): Remove entry
7186 parameter. Change all callers.
7187 (Output_file_header::entry): Use parameters->entry.
7188 * gold.cc (queue_middle_tasks): Likewise.
7189 * plugin.cc (Plugin_hook::run): Likewise.
7190
aa92d6ed
CC
71912011-05-24 Cary Coutant <ccoutant@google.com>
7192
7193 * gold.cc (queue_initial_tasks): Pass incremental base filename
7194 to Output_file::open_base_file; don't print error message.
7195 * incremental-dump.cc (main): Adjust call to
7196 Output_file::open_for_modification.
7197 * incremental-dump.cc (main): Likewise.
7198 * incremental.cc (Incremental_inputs::report_command_line):
7199 Ignore --incremental-base option when comparing command lines.
7200 Ignore parameter when given as separate argument.
7201 * options.h (class General_options): Add --incremental-base.
7202 * output.cc (Output_file::Output_file):
7203 (Output_file::open_base_file): Add base_name and writable parameters;
7204 read base file into new file; print error message here.
7205 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7206 callers.
7207 * output.h (Output_file::open_for_modification): Rename to...
7208 (Output_file::open_base_file): ...this; add base_name and
7209 writable parameters; adjust all callers.
7210 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7211 callers.
7212 * testsuite/Makefile.am (incremental_test_4): Test
7213 --incremental-base.
7214 * testsuite/Makefile.in: Regenerate.
7215
2eedd706
CC
72162011-05-24 Cary Coutant <ccoutant@google.com>
7217
7218 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7219 incremental_test_4.
7220 * testsuite/Makefile.in: Regenerate.
7221 * testsuite/two_file_test_1_v1.cc: New test source file.
7222 * testsuite/two_file_test_1b_v1.cc: New test source file.
7223 * testsuite/two_file_test_2_v1.cc: New test source file.
7224
0f1c85a6
CC
72252011-05-24 Cary Coutant <ccoutant@google.com>
7226
7227 * dynobj.h (Dynobj::do_dynobj): New function.
7228 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7229 flag and soname for shared objects.
7230 * incremental.cc (Incremental_inputs::report_object): Make
7231 either Incremental_object_entry or Incremental_dynobj_entry; add
7232 soname to string table.
7233 (Incremental_inputs::report_input_section): Add assertion.
7234 (Output_section_incremental_inputs::set_final_data_size): Adjust
7235 type of input file entry for shared libraries; adjust size of
7236 shared library info entry.
7237 (Output_section_incremental_inputs::write_input_files): Write
7238 as_needed flag for shared libraries.
7239 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7240 of input file entry for shared libraries; write soname.
7241 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7242 soname from incremental info.
7243 * incremental.h (enum Incremental_input_flags): Add
7244 INCREMENTAL_INPUT_AS_NEEDED.
7245 (Incremental_input_entry::Incremental_input_entry): Initialize new
7246 data member.
7247 (Incremental_input_entry::set_as_needed): New function.
7248 (Incremental_input_entry::as_needed): New function.
7249 (Incremental_input_entry::do_dynobj_entry): New function.
7250 (Incremental_input_entry::as_needed_): New data member.
7251 (Incremental_object_entry::Incremental_object_entry): Don't check
7252 for shared library.
7253 (Incremental_object_entry::do_type): Likewise.
7254 (class Incremental_dynobj_entry): New class.
7255 (Incremental_input_entry_reader::as_needed): New function.
7256 (Incremental_input_entry_reader::get_soname): New function.
7257 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7258 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7259 size of shared library info entry.
58797674 7260 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7261 incremental link when adding DT_NEEDED entries.
7262 * object.h (Object::Object): Initialize new data member.
7263 (Object::dynobj): New function.
7264 (Object::set_as_needed): New function.
7265 (Object::as_needed): New function.
7266 (Object::do_dynobj): New function.
7267 (Object::as_needed_): New data member.
7268
6fa2a40b
CC
72692011-05-24 Cary Coutant <ccoutant@google.com>
7270
7271 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7272 info; adjust display of GOT entries.
7273 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7274 vector of input objects; remove file_status_.
7275 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7276 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7277 got_plt reader; call target hooks to reserve GOT entries.
7278 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7279 of input file info header and GOT info entry.
7280 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7281 relocation info.
7282 (Got_plt_view_info::got_descriptor): Remove.
7283 (Got_plt_view_info::sym_index): New data member.
7284 (Got_plt_view_info::input_index): New data member.
7285 (Local_got_offset_visitor::visit): Write input file index.
7286 (Global_got_offset_visitor::visit): Write 0 for input file index.
7287 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7288 with sym_index and input_index.
7289 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7290 incremental info GOT entry; replace got_descriptor with input_index.
7291 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7292 map from input file index to object.
7293 (Sized_relobj_incr::do_layout): Replace direct data member reference
7294 with accessor function.
7295 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7296 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7297 Adjust size of input file info header.
7298 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7299 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7300 (Incremental_input_entry_reader::get_input_section): Adjust size of
7301 input file info header.
7302 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7303 of incremental info GOT entry.
7304 (Incremental_got_plt_reader::get_got_desc): Remove.
7305 (Incremental_got_plt_reader::get_got_symndx): New function.
7306 (Incremental_got_plt_reader::get_got_input_index): New function.
7307 (Sized_incremental_binary::Sized_incremental_binary): Remove
7308 file_status_; add input_objects_.
7309 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7310 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7311 (Sized_incremental_binary::file_is_unchanged): Remove.
7312 (Sized_incremental_binary::set_input_object): New function.
7313 (Sized_incremental_binary::input_object): New function.
7314 (Sized_incremental_binary::file_status_): Remove.
7315 (Sized_incremental_binary::input_objects_): New data member.
7316 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7317 references.
7318 (Sized_relobj_incr::invalid_address): Move to base class.
7319 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7320 class.
7321 (Sized_relobj_incr::do_output_section_offset): Likewise.
7322 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7323 (Sized_relobj_incr::section_offsets_): Likewise.
7324 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7325 function.
7326 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7327 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7328 with accessor function.
7329 (Sized_relobj_file::do_layout): Likewise.
7330 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7331 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7332 (Sized_relobj_file::compute_final_local_value): Replace refs to
7333 section_offsets_ with accessor function.
7334 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7335 * object.h (Relobj::Relobj): Initialize new data members.
7336 (Relobj::add_dyn_reloc): New function.
7337 (Relobj::first_dyn_reloc): New function.
7338 (Relobj::dyn_reloc_count): New function.
7339 (Relobj::first_dyn_reloc_): New data member.
7340 (Relobj::dyn_reloc_count_): New data member.
7341 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7342 references.
7343 (Sized_relobj::Address): New typedef.
7344 (Sized_relobj::invalid_address): Move here from child class.
7345 (Sized_relobj::Sized_relobj): Initialize new data members.
7346 (Sized_relobj::sized_relobj): New function.
7347 (Sized_relobj::is_output_section_offset_invalid): Move here from
7348 child class.
7349 (Sized_relobj::get_output_section_offset): Likewise.
7350 (Sized_relobj::local_has_got_offset): Likewise.
7351 (Sized_relobj::local_got_offset): Likewise.
7352 (Sized_relobj::set_local_got_offset): Likewise.
7353 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7354 (Sized_relobj::clear_got_offsets): New function.
7355 (Sized_relobj::section_offsets): Move here from child class.
7356 (Sized_relobj::do_output_section_offset): Likewise.
7357 (Sized_relobj::do_set_section_offset): Likewise.
7358 (Sized_relobj::Local_got_offsets): Likewise.
7359 (Sized_relobj::local_got_offsets_): Likewise.
7360 (Sized_relobj::section_offsets_): Likewise.
7361 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7362 references.
7363 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7364 class.
7365 (Sized_relobj_file::sized_relobj): New function
7366 (Sized_relobj_file::local_has_got_offset): Move to base class.
7367 (Sized_relobj_file::local_got_offset): Likewise.
7368 (Sized_relobj_file::set_local_got_offset): Likewise.
7369 (Sized_relobj_file::get_output_section_offset): Likewise.
7370 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7371 (Sized_relobj_file::do_output_section_offset): Likewise.
7372 (Sized_relobj_file::do_set_section_offset): Likewise.
7373 (Sized_relobj_file::Local_got_offsets): Likewise.
7374 (Sized_relobj_file::local_got_offsets_): Likewise.
7375 (Sized_relobj_file::section_offsets_): Likewise.
7376 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7377 (all constructors).
7378 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7379 (Output_reloc::get_symbol_index): Likewise.
7380 (Output_reloc::local_section_offset): Likewise.
7381 (Output_reloc::get_address): Likewise.
7382 (Output_reloc::symbol_value): Likewise.
7383 (Output_data_got::reserve_slot): Move to class definition.
7384 (Output_data_got::reserve_local): New function.
7385 (Output_data_got::reserve_slot_for_global): Remove.
7386 (Output_data_got::reserve_global): New function.
7387 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7388 (all constructors, two instantiations).
7389 (Output_reloc::get_relobj): New function (two instantiations).
7390 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7391 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7392 (Output_data_reloc::add_global): Adjust type of relobj.
7393 (Output_data_reloc::add_global_relative): Likewise.
7394 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7395 (Output_data_reloc::add_local): Likewise.
7396 (Output_data_reloc::add_local_relative): Likewise.
7397 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7398 (Output_data_reloc::add_local_section): Likewise.
7399 (Output_data_reloc::add_output_section): Likewise.
7400 (Output_data_reloc::add_absolute): Likewise.
7401 (Output_data_reloc::add_target_specific): Likewise.
7402 (Output_data_got::reserve_slot): Move definition here.
7403 (Output_data_got::reserve_local): New function.
7404 (Output_data_got::reserve_global): New function.
7405 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7406 section_offsets_ with accessor function.
7407 (Sized_relobj_file::write_sections): Likewise.
7408 (Sized_relobj_file::do_relocate_sections): Likewise.
7409 * target.h (Sized_target::reserve_local_got_entry): New function.
7410 (Sized_target::reserve_global_got_entry): New function.
7411 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7412 (Target_x86_64::reserve_global_got_entry): New function.
7413 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7414
4829d394
CC
74152011-05-23 Cary Coutant <ccoutant@google.com>
7416
7417 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7418 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7419 bit when checking got_type.
7420 * incremental.cc (Sized_incremental_binary::setup_readers):
7421 Store symbol table and string table locations; initialize bit vector
7422 of file status flags.
7423 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7424 unchanged files.
7425 (Sized_incremental_binary::do_process_got_plt): New function.
7426 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7427 (Output_section_incremental_inputs::set_final_data_size): Record
7428 file index for each input file.
7429 (Output_section_incremental_inputs::write_got_plt): Store file index
7430 instead of input entry offset for each GOT entry.
7431 * incremental.h
7432 (Incremental_input_entry::Incremental_input_entry): Initialize new
7433 data member.
7434 (Incremental_input_entry::set_offset): Store file index.
7435 (Incremental_input_entry::get_file_index): New function.
7436 (Incremental_input_entry::file_index_): New data member.
7437 (Incremental_binary::process_got_plt): New function.
7438 (Incremental_binary::do_process_got_plt): New function.
7439 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7440 data members.
7441 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7442 (Sized_incremental_binary::set_file_is_unchanged): New function.
7443 (Sized_incremental_binary::file_is_unchanged): New function.
7444 (Sized_incremental_binary::do_process_got_plt): New function.
7445 (Sized_incremental_binary::file_status_): New data member.
7446 (Sized_incremental_binary::main_symtab_loc_): New data member.
7447 (Sized_incremental_binary::main_strtab_loc_): New data member.
7448 * output.cc (Output_data_got::Got_entry::write): Add case
7449 RESERVED_CODE.
7450 (Output_data_got::add_global): Call add_got_entry.
7451 (Output_data_got::add_global_plt): Likewise.
7452 (Output_data_got::add_global_with_rel): Likewise.
7453 (Output_data_got::add_global_with_rela): Likewise.
7454 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7455 (Output_data_got::add_global_pair_with_rela): Likewise.
7456 (Output_data_got::add_local): Call add_got_entry.
7457 (Output_data_got::add_local_plt): Likewise.
7458 (Output_data_got::add_local_with_rel): Likewise.
7459 (Output_data_got::add_local_with_rela): Likewise.
7460 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7461 (Output_data_got::add_local_pair_with_rela): Likewise.
7462 (Output_data_got::reserve_slot): New function.
7463 (Output_data_got::reserve_slot_for_global): New function.
7464 (Output_data_got::add_got_entry): New function.
7465 (Output_data_got::add_got_entry_pair): New function.
7466 (Output_section::add_output_section_data): Edit FIXME.
7467 * output.h
7468 (Output_section_data_build::Output_section_data_build): New
7469 constructor with size parameter.
7470 (Output_data_space::Output_data_space): Likewise.
7471 (Output_data_got::Output_data_got): Initialize new data member; new
7472 constructor with size parameter.
7473 (Output_data_got::add_constant): Call add_got_entry.
7474 (Output_data_got::reserve_slot): New function.
7475 (Output_data_got::reserve_slot_for_global): New function.
7476 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7477 (Output_data_got::add_got_entry): New function.
7478 (Output_data_got::add_got_entry_pair): New function.
7479 (Output_data_got::free_list_): New data member.
7480 * target.h (Sized_target::init_got_plt_for_update): New function.
7481 (Sized_target::register_global_plt_entry): New function.
7482 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7483 Initialize new data member; call init; add constructor with PLT count.
7484 (Output_data_plt_x86_64::init): New function.
7485 (Output_data_plt_x86_64::add_relocation): New function.
7486 (Output_data_plt_x86_64::reserve_slot): New function.
7487 (Output_data_plt_x86_64::free_list_): New data member.
7488 (Target_x86_64::init_got_plt_for_update): New function.
7489 (Target_x86_64::register_global_plt_entry): New function.
7490 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7491 incremental updates.
7492 (Output_data_plt_x86_64::add_relocation): New function.
7493 * testsuite/object_unittest.cc (Object_test): Set default options.
7494
ec69d6da
ILT
74952011-05-16 Ian Lance Taylor <iant@google.com>
7496
7497 * options.h (class General_options): Make -i a synonym for -r.
7498
732e31de
ILT
74992011-05-16 Ian Lance Taylor <iant@google.com>
7500
7501 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7502
403676b5
CC
75032011-05-10 Cary Coutant <ccoutant@google.com>
7504
7505 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7506 strip_all (-s).
7507
5b7b7d6e
ILT
75082011-05-06 Ian Lance Taylor <iant@google.com>
7509
7510 * layout.cc (Layout::layout): If the output section flags change,
7511 update the ordering.
7512
f0f9babf
CC
75132011-04-25 Cary Coutant <ccoutant@google.com>
7514
7515 * incremental-dump.cc (dump_incremental_inputs): Print local
7516 symbol info for each input file.
7517 * incremental.cc
7518 (Output_section_incremental_inputs::set_final_data_size): Add local
7519 symbol info to input file entries in incremental info.
7520 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7521 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7522 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7523 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7524 implementation.
7525 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7526 (Sized_incr_relobj::do_relocate): Write the local symbols.
7527 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7528 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7529 Adjust size of input file header.
7530 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7531 (Incremental_inputs_reader::get_local_symbol_count): New function.
7532 (Incremental_inputs_reader::get_input_section): Adjust size of input
7533 file header.
7534 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7535 (Sized_incr_relobj::This): New typedef.
7536 (Sized_incr_relobj::sym_size): New const data member.
7537 (Sized_incr_relobj::Local_symbol): New struct.
7538 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7539 (Sized_incr_relobj::do_local_symbol_offset): New function.
7540 (Sized_incr_relobj::local_symbol_count_): New data member.
7541 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7542 (Sized_incr_relobj::local_symbol_index_): New data member.
7543 (Sized_incr_relobj::local_symbol_offset_): New data member.
7544 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7545 (Sized_incr_relobj::local_symbols_): New data member.
7546 * object.h (Relobj::output_local_symbol_count): New function.
7547 (Relobj::local_symbol_offset): New function.
7548 (Relobj::do_output_local_symbol_count): New function.
7549 (Relobj::do_local_symbol_offset): New function.
7550 (Sized_relobj::do_output_local_symbol_count): New function.
7551 (Sized_relobj::do_local_symbol_offset): New function.
7552
d0a9ace3
ILT
75532011-04-22 Vladimir Simonov <sv@sw.ru>
7554
7555 * descriptors.cc (set_close_on_exec): New function.
7556 (Descriptors::open): Use set_close_on_exec.
7557 * output.cc (S_ISLNK): Define if not defined.
7558
94a3fc8b
CC
75592011-04-22 Cary Coutant <ccoutant@google.com>
7560
7561 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7562 global symbol map.
7563 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7564 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7565 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7566 relocations.
7567 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7568 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7569 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7570 * incremental.h
7571 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7572 function.
7573 (Incremental_binary::apply_incremental_relocs): New function.
7574 (Incremental_binary::do_apply_incremental_relocs): New function.
7575 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7576 data member.
7577 (Sized_incremental_binary::add_global_symbol): New function.
7578 (Sized_incremental_binary::global_symbol): New function.
7579 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7580 (Sized_incremental_binary::symbol_map_): New data member.
7581 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7582 * target.h (Sized_target::apply_relocation): New function.
7583 * target-reloc.h (apply_relocation): New function.
7584 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7585
c87e4302
DK
75862011-04-22 Doug Kwan <dougkwan@google.com>
7587
7588 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7589 flag of a SHT_ARM_EXIDX section.
2e702c99 7590 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7591 * testsuite/Makefile.in: Regenerate.
7592 * testsuite/arm_exidx_test.s: New file.
7593 * testsuite/arm_exidx_test.sh: Same.
7594
e7782cf6
CC
75952011-04-20 Cary Coutant <ccoutant@google.com>
7596
7597 PR gold/12689
7598 * archive.h (Incremental_archive_entry::Archive_member):
7599 Initialize arg_serial_ (second constructor).
7600
308ecdc7
ILT
76012011-04-17 Ian Lance Taylor <iant@google.com>
7602
7603 * object.cc (Relocate_info::location): Simplify location string.
7604 * errors.cc (Errors::error_at_location): Don't print program
7605 name.
7606 (Errors::warning_at_location): Likewise.
7607 (Errors::undefined_symbol): Likewise.
7608 * testsuite/debug_msg.sh: Update accordingly.
7609
bec5b579
CC
76102011-04-14 Cary Coutant <ccoutant@google.com>
7611
7612 * gold/layout.cc (Layout::symtab_section_offset): New function.
7613 * gold/layout.h (Layout::symtab_section_offset): New function.
7614 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7615
88597d34
ILT
76162011-04-12 Ian Lance Taylor <iant@google.com>
7617
7618 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7619 with MREMAP_MAYMOVE.
7620 * output.h (class Output_file): Add map_is_allocated_ field.
7621 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7622 not available, provide stubs. If mremap is not available, #define
7623 it to gold_mremap.
7624 (MREMAP_MAYMOVE): Define if not defined.
7625 (Output_file::Output_file): Initialize map_is_allocated_.
7626 (Output_file::resize): Check map_is_allocated_.
7627 (Output_file::map_anonymous): If mmap fails, use malloc.
7628 (Output_file::unmap): Don't do anything for an anonymous map.
7629 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7630 is not available, provide stubs.
7631 (File_read::View::~View): Use free rather than delete[].
7632 (File_read::make_view): Use malloc rather than new[]. If mmap
7633 fails, use malloc.
7634 (File_read::find_or_make_view): Use malloc rather than new[].
7635 * gold.h: Remove HAVE_REMAP code.
7636 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7637 exists. Rename mremap to gold_mremap. If mmap is not available
7638 don't do anything.
7639 * configure, config.in: Rebuild.
7640
11e361bc
ILT
76412011-04-11 Ian Lance Taylor <iant@google.com>
7642
7643 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7644 initialize local variable v.
7645
cdc29364
CC
76462011-04-11 Cary Coutant <ccoutant@google.com>
7647
7648 * archive.cc (Archive::include_member): Adjust call to
7649 report_object.
7650 (Add_archive_symbols::run): Track argument serial numbers.
7651 (Lib_group::include_member): Likewise.
7652 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7653 * archive.h (Incremental_archive_entry::Archive_member):
7654 Initialize arg_serial_.
7655 (Archive_member::arg_serial_): New data member.
7656 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7657 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7658 incremental link.
7659 (Sized_dynobj::do_for_all_local_got_entries): New function.
7660 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7661 function.
7662 * fileread.cc (get_mtime): New function.
7663 * fileread.h (get_mtime): New function.
7664 * gold.cc (queue_initial_tasks): Check for incremental update.
7665 (process_incremental_input): New function.
7666 (queue_middle_tasks): Don't force valid target for incremental
7667 update.
7668 * incremental-dump.cc (find_input_containing_global): Adjust
7669 size of symbol info entry.
7670 (dump_incremental_inputs): Dump argument serial number and
7671 in_system_directory flag; bias shndx by 1; print symbol names
7672 when dumping per-file symbol lists; use new symbol info readers.
7673 * incremental.cc
7674 (Output_section_incremental_inputs:update_data_size): New function.
7675 (Sized_incremental_binary::setup_readers): Setup input readers
7676 for each input file; build maps for files added from libraries
7677 and scripts.
7678 (Sized_incremental_binary::check_input_args): New function.
7679 (Sized_incremental_binary::do_check_inputs): Build map of argument
7680 serial numbers to input arguments.
7681 (Sized_incremental_binary::do_file_has_changed): Rename
7682 do_file_is_unchanged to this; compare file modification times.
7683 (Sized_incremental_binary::do_init_layout): New function.
7684 (Sized_incremental_binary::do_reserve_layout): New function.
7685 (Sized_incremental_binary::do_get_input_reader): Remove.
7686 (Sized_incremental_binary::get_symtab_view): New function.
7687 (Incremental_checker::can_incrementally_link_output_file): Remove.
7688 (Incremental_inputs::report_command_line): Exclude --debug options.
7689 (Incremental_inputs::report_archive_begin): Add parameter; track
7690 argument serial numbers; don't put input file entry for archive
7691 before archive members.
7692 (Incremental_inputs::report_archive_end): Put input file entry
7693 for archive after archive members.
7694 (Incremental_inputs::report_object): Add parameter; track argument
7695 serial numbers and in_system_directory flag.
7696 (Incremental_inputs::report_script): Add parameter; track argument
7697 serial numbers.
7698 (Output_section_incremental_inputs::set_final_data_size): Adjust
7699 size of symbol info entry; check for forwarding symbols.
7700 (Output_section_incremental_inputs::write_input_files): Write
7701 in_system_directory flag and argument serial number.
7702 (Output_section_incremental_inputs::write_info_blocks): Map section
7703 indices between incremental info and original input file; store
7704 input section index for each symbol.
7705 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7706 change operator() to visit().
7707 (class Global_got_offset_visitor): Likewise.
7708 (class Global_symbol_visitor_got_plt):
7709 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7710 classes.
7711 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7712 (Sized_incr_relobj::do_read_symbols): New function.
7713 (Sized_incr_relobj::do_layout): New function.
7714 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7715 (Sized_incr_relobj::do_add_symbols): New function.
7716 (Sized_incr_relobj::do_should_include_member): New function.
7717 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7718 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7719 (Sized_incr_relobj::do_section_size): New function.
7720 (Sized_incr_relobj::do_section_name): New function.
7721 (Sized_incr_relobj::do_section_contents): New function.
7722 (Sized_incr_relobj::do_section_flags): New function.
7723 (Sized_incr_relobj::do_section_entsize): New function.
7724 (Sized_incr_relobj::do_section_address): New function.
7725 (Sized_incr_relobj::do_section_type): New function.
7726 (Sized_incr_relobj::do_section_link): New function.
7727 (Sized_incr_relobj::do_section_info): New function.
7728 (Sized_incr_relobj::do_section_addralign): New function.
7729 (Sized_incr_relobj::do_initialize_xindex): New function.
7730 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7731 (Sized_incr_relobj::do_read_relocs): New function.
7732 (Sized_incr_relobj::do_gc_process_relocs): New function.
7733 (Sized_incr_relobj::do_scan_relocs): New function.
7734 (Sized_incr_relobj::do_count_local_symbols): New function.
7735 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7736 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7737 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7738 (Sized_incr_relobj::do_relocate): New function.
7739 (Sized_incr_relobj::do_set_section_offset): New function.
7740 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7741 (Sized_incr_dynobj::do_read_symbols): New function.
7742 (Sized_incr_dynobj::do_layout): New function.
7743 (Sized_incr_dynobj::do_add_symbols): New function.
7744 (Sized_incr_dynobj::do_should_include_member): New function.
7745 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7746 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7747 (Sized_incr_dynobj::do_section_size): New function.
7748 (Sized_incr_dynobj::do_section_name): New function.
7749 (Sized_incr_dynobj::do_section_contents): New function.
7750 (Sized_incr_dynobj::do_section_flags): New function.
7751 (Sized_incr_dynobj::do_section_entsize): New function.
7752 (Sized_incr_dynobj::do_section_address): New function.
7753 (Sized_incr_dynobj::do_section_type): New function.
7754 (Sized_incr_dynobj::do_section_link): New function.
7755 (Sized_incr_dynobj::do_section_info): New function.
7756 (Sized_incr_dynobj::do_section_addralign): New function.
7757 (Sized_incr_dynobj::do_initialize_xindex): New function.
7758 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7759 (make_sized_incremental_object): New function.
7760 (Incremental_library::copy_unused_symbols): New function.
7761 (Incremental_library::do_for_all_unused_symbols): New function.
7762 * incremental.h (enum Incremental_input_flags): New type.
7763 (class Incremental_checker): Remove.
7764 (Incremental_input_entry::Incremental_input_entry): Add argument
7765 serial number.
7766 (Incremental_input_entry::arg_serial): New function.
7767 (Incremental_input_entry::set_is_in_system_directory): New function.
7768 (Incremental_input_entry::is_in_system_directory): New function.
7769 (Incremental_input_entry::arg_serial_): New data member.
7770 (Incremental_input_entry::is_in_system_directory_): New data member.
7771 (class Script_info): Move here from script.h.
7772 (Script_info::Script_info): Add filename parameter.
7773 (Script_info::filename): New function.
7774 (Script_info::filename_): New data member.
7775 (Incremental_script_entry::Incremental_script_entry): Add argument
7776 serial number.
7777 (Incremental_object_entry::Incremental_object_entry): Likewise.
7778 (Incremental_object_entry::add_input_section): Build list of input
7779 sections with map to original shndx.
7780 (Incremental_object_entry::get_input_section_index): New function.
7781 (Incremental_object_entry::shndx_): New data member.
7782 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7783 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7784 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7785 serial number.
7786 (Incremental_inputs::report_archive_begin): Likewise.
7787 (Incremental_inputs::report_object): Likewise.
7788 (Incremental_inputs::report_script): Likewise.
7789 (class Incremental_global_symbol_reader): New class.
7790 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7791 and store flags and input file type.
7792 (Incremental_input_entry_reader::arg_serial): New function.
7793 (Incremental_input_entry_reader::type): Extract type from flags.
7794 (Incremental_input_entry_reader::is_in_system_directory): New function.
7795 (Incremental_input_entry_reader::get_input_section_count): Call
7796 accessor function for type.
7797 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7798 function for type; adjust size of global symbol entry.
7799 (Incremental_input_entry_reader::get_global_symbol_count): Call
7800 accessor function for type.
7801 (Incremental_input_entry_reader::get_object_count): Likewise.
7802 (Incremental_input_entry_reader::get_object_offset): Likewise.
7803 (Incremental_input_entry_reader::get_member_count): Likewise.
7804 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7805 (Incremental_input_entry_reader::get_member_offset): Likewise.
7806 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7807 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7808 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7809 (Incremental_input_entry_reader::get_global_symbol_reader): New
7810 function.
7811 (Incremental_input_entry_reader::get_output_symbol_index): New
7812 function.
7813 (Incremental_input_entry_reader::type_): Remove.
7814 (Incremental_input_entry_reader::flags_): New data member.
7815 (Incremental_inputs_reader::input_file_offset): New function.
7816 (Incremental_inputs_reader::input_file_index): New function.
7817 (Incremental_inputs_reader::input_file): Call input_file_offset.
7818 (Incremental_inputs_reader::input_file_at_offset): New function.
7819 (Incremental_relocs_reader::get_r_type): Reformat.
7820 (Incremental_relocs_reader::get_r_shndx): Reformat.
7821 (Incremental_relocs_reader::get_r_offset): Reformat.
7822 (Incremental_relocs_reader::data): New function.
7823 (Incremental_binary::Incremental_binary): Initialize new data members.
7824 (Incremental_binary::check_inputs): Add cmdline parameter.
7825 (Incremental_binary::file_is_unchanged): Remove.
7826 (Input_reader::arg_serial): New function.
7827 (Input_reader::get_unused_symbol_count): New function.
7828 (Input_reader::get_unused_symbol): New function.
7829 (Input_reader::do_arg_serial): New function.
7830 (Input_reader::do_get_unused_symbol_count): New function.
7831 (Input_reader::do_get_unused_symbol): New function.
7832 (Incremental_binary::input_file_count): New function.
7833 (Incremental_binary::get_input_reader): Change signature to use
7834 index instead of filename.
7835 (Incremental_binary::file_has_changed): New function.
7836 (Incremental_binary::get_input_argument): New function.
7837 (Incremental_binary::get_library): New function.
7838 (Incremental_binary::get_script_info): New function.
7839 (Incremental_binary::init_layout): New function.
7840 (Incremental_binary::reserve_layout): New function.
7841 (Incremental_binary::output_file): New function.
7842 (Incremental_binary::do_check_inputs): New function.
7843 (Incremental_binary::do_file_is_unchanged): Remove.
7844 (Incremental_binary::do_file_has_changed): New function.
7845 (Incremental_binary::do_init_layout): New function.
7846 (Incremental_binary::do_reserve_layout): New function.
7847 (Incremental_binary::do_input_file_count): New function.
7848 (Incremental_binary::do_get_input_reader): Change signature.
7849 (Incremental_binary::input_args_map_): New data member.
7850 (Incremental_binary::library_map_): New data member.
7851 (Incremental_binary::script_map_): New data member.
7852 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7853 new data members.
7854 (Sized_incremental_binary::output_section): New function.
7855 (Sized_incremental_binary::inputs_reader): Add const.
7856 (Sized_incremental_binary::symtab_reader): Add const.
7857 (Sized_incremental_binary::relocs_reader): Add const.
7858 (Sized_incremental_binary::got_plt_reader): Add const.
7859 (Sized_incremental_binary::get_symtab_view): New function.
7860 (Sized_incremental_binary::Inputs_reader): New typedef.
7861 (Sized_incremental_binary::Input_entry_reader): New typedef.
7862 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7863 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7864 (Sized_incremental_binary::do_file_has_changed): New function.
7865 (Sized_incremental_binary::do_init_layout): New function.
7866 (Sized_incremental_binary::do_reserve_layout): New function.
7867 (Sized_input_reader::Inputs_reader): Remove.
7868 (Sized_input_reader::Input_entry_reader): Remove.
7869 (Sized_input_reader::do_arg_serial): New function.
7870 (Sized_input_reader::do_get_unused_symbol_count): New function.
7871 (Sized_input_reader::do_get_unused_symbol): New function.
7872 (Sized_incremental_binary::do_input_file_count): New function.
7873 (Sized_incremental_binary::do_get_input_reader): Change signature;
7874 use index instead of filename.
7875 (Sized_incremental_binary::section_map_): New data member.
7876 (Sized_incremental_binary::input_entry_readers_): New data member.
7877 (class Sized_incr_relobj): New class.
7878 (class Sized_incr_dynobj): New class.
7879 (make_sized_incremental_object): New function.
7880 (class Incremental_library): New class.
7881 * layout.cc (Free_list::num_lists): New static data member.
7882 (Free_list::num_nodes): New static data member.
7883 (Free_list::num_removes): New static data member.
7884 (Free_list::num_remove_visits): New static data member.
7885 (Free_list::num_allocates): New static data member.
7886 (Free_list::num_allocate_visits): New static data member.
7887 (Free_list::init): New function.
7888 (Free_list::remove): New function.
7889 (Free_list::allocate): New function.
7890 (Free_list::dump): New function.
7891 (Free_list::print_stats): New function.
7892 (Layout_task_runner::run): Resize output file for incremental updates.
7893 (Layout::Layout): Initialize new data members.
7894 (Layout::set_incremental_base): New function.
7895 (Layout::init_fixed_output_section): New function.
7896 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7897 incremental updates.
7898 (Layout::create_gold_note): Do not create gold note section for
7899 incremental updates.
7900 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7901 for incremental updates.
7902 (Layout::set_section_offsets): For incremental updates, allocate space
7903 from free list.
7904 (Layout::create_symtab_sections): Layout with offsets relative to
7905 start of section; for incremental updates, allocate space from free
7906 list.
7907 (Layout::create_shdrs): For incremental updates, allocate space from
7908 free list.
7909 (Layout::finish_dynamic_section): For incremental updates, do not
7910 check --as-needed (fixed in subsequent patch).
7911 * layout.h (class Free_list): New class.
7912 (Layout::set_incremental_base): New function.
7913 (Layout::incremental_base): New function.
7914 (Layout::init_fixed_output_section): New function.
7915 (Layout::allocate): New function.
7916 (Layout::incremental_base_): New data member.
7917 (Layout::free_list_): New data member.
7918 * main.cc (main): Print Free_list statistics.
7919 * object.cc (Relobj::finalize_incremental_relocs): Add
7920 clear_counts parameter; clear counts only when clear_counts is set.
7921 (Sized_relobj::Sized_relobj): Initialize new base class.
7922 (Sized_relobj::do_layout): Don't report special sections.
7923 (Sized_relobj::do_for_all_local_got_entries): New function.
7924 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7925 symtab_off to all symbol table offsets.
7926 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7927 * object.h (class Got_offset_list): Move to top of file.
7928 (Object::Object): Allow case where input_file == NULL.
7929 (Object::~Object): Likewise.
7930 (Object::input_file): Assert that input_file != NULL.
7931 (Object::lock): Allow case where input_file == NULL.
7932 (Object::unlock): Likewise.
7933 (Object::is_locked): Likewise.
7934 (Object::token): Likewise.
7935 (Object::release): Likewise.
7936 (Object::is_incremental): New function.
7937 (Object::get_mtime): New function.
7938 (Object::for_all_local_got_entries): New function.
7939 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7940 (Object::set_is_in_system_directory): New function.
7941 (Object::is_in_system_directory): New function.
7942 (Object::do_is_incremental): New function.
7943 (Object::do_get_mtime): New function.
7944 (Object::do_for_all_local_got_entries): New function.
7945 (Object::is_in_system_directory_): New data member.
7946 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7947 (class Sized_relobj_base): New class.
7948 (class Sized_relobj): Derive from Sized_relobj_base.
7949 (class Sized_relobj::Symbols): Redeclare from base class.
7950 (class Sized_relobj::local_got_offset_list): Remove.
7951 (class Sized_relobj::Output_sections): Redeclare from base class.
7952 (class Sized_relobj::do_for_all_local_got_entries): New function.
7953 (class Sized_relobj::write_local_symbols): Add offset parameter.
7954 (class Sized_relobj::local_symbol_offset_): Update comment.
7955 (class Sized_relobj::local_dynsym_offset_): Update comment.
7956 * options.cc (Input_arguments::add_file): Remove const.
7957 * options.h (Input_file_argument::Input_file_argument):
7958 Initialize arg_serial_ (all constructors).
7959 (Input_file_argument::set_arg_serial): New function.
7960 (Input_file_argument::arg_serial): New function.
7961 (Input_file_argument::arg_serial_): New data member.
7962 (Input_arguments::Input_arguments): Initialize file_count_.
7963 (Input_arguments::add_file): Remove const.
7964 (Input_arguments::number_of_input_files): New function.
7965 (Input_arguments::file_count_): New data member.
7966 (Command_line::number_of_input_files): Call
7967 Input_arguments::number_of_input_files.
7968 * output.cc (Output_segment_headers::Output_segment_headers):
7969 Set current size.
7970 (Output_section::Input_section::current_data_size): New function.
7971 (Output_section::Output_section): Initialize new data members.
7972 (Output_section::add_input_section): Don't do merge sections for
7973 an incremental link; allocate space from free list for an
7974 incremental update.
7975 (Output_section::add_output_section_data): Allocate space from
7976 free list for an incremental update.
7977 (Output_section::update_data_size): New function.
7978 (Output_section::set_fixed_layout): New function.
7979 (Output_section::reserve): New function.
7980 (Output_segment::set_section_addresses): Remove const.
7981 (Output_segment::set_section_list_addresses): Remove const; allocate
7982 space from free list for an incremental update.
7983 (Output_segment::set_offset): Adjust size of RELRO segment for an
7984 incremental update.
7985 * output.h (Output_data::current_data_size): Move here from
7986 child classes.
7987 (Output_data::pre_finalize_data_size): New function.
7988 (Output_data::update_data_size): New function.
7989 (Output_section_headers::update_data_size): new function.
7990 (Output_section_data_build::current_data_size): Move to Output_data.
7991 (Output_data_strtab::update_data_size): New function.
7992 (Output_section::current_data_size): Move to Output_data.
7993 (Output_section::set_fixed_layout): New function.
7994 (Output_section::has_fixed_layout): New function.
7995 (Output_section::reserve): New function.
7996 (Output_section::update_data_size): New function.
7997 (Output_section::has_fixed_layout_): New data member.
7998 (Output_section::free_list_): New data member.
7999 (Output_segment::set_section_addresses): Remove const.
8000 (Output_segment::set_section_list_addresses): Remove const.
8001 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8002 New function.
8003 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8004 New function.
8005 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8006 parameter when calling Add_symbols constructor; store argument
8007 serial number for members of a lib group.
8008 (Add_symbols::locks): Allow case where token == NULL.
8009 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8010 (Read_member::~Read_member): New function.
8011 (Read_member::is_runnable): New function.
8012 (Read_member::locks): New function.
8013 (Read_member::run): New function.
8014 (Check_script::~Check_script): New function.
8015 (Check_script::is_runnable): New function.
8016 (Check_script::locks): New function.
8017 (Check_script::run): New function.
8018 (Check_library::~Check_library): New function.
8019 (Check_library::is_runnable): New function.
8020 (Check_library::locks): New function.
8021 (Check_library::run): New function.
8022 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8023 (Add_symbols::library_): New data member.
8024 (class Read_member): New class.
8025 (class Check_script): New class.
8026 (class Check_library): New class.
8027 * reloc.cc (Read_relocs::is_runnable): Allow case where
8028 token == NULL.
8029 (Read_relocs::locks): Likewise.
8030 (Scan_relocs::locks): Likewise.
8031 (Relocate_task::locks): Likewise.
8032 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8033 to clear counters.
8034 (Sized_relobj::incremental_relocs_scan): Fix comment.
8035 (Sized_relobj::do_relocate): Pass output file offset to
8036 write_local_symbols.
8037 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8038 from class declaration.
8039 * script.cc (read_input_script): Allocate Script_info; pass
8040 argument serial number to report_script.
8041 * script.h (class Script_info): Move to incremental.h.
8042 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8043 * symtab.h (Symbol_table::add_from_incrobj): New function.
8044 (Symbol_table::set_file_offset): New function.
8045
b961d0d7
CC
80462011-04-05 Cary Coutant <ccoutant@google.com>
8047
8048 * incremental-dump.cc (dump_incremental_inputs): Change signature
8049 to take a Sized_incremental_binary; change caller. Use readers
8050 in Sized_incremental_binary.
8051 * incremental.cc
8052 (Sized_incremental_binary::find_incremental_inputs_sections):
8053 Rename do_find_incremental_inputs_sections to this.
8054 (Sized_incremental_binary::setup_readers): New function.
8055 (Sized_incremental_binary::do_check_inputs): Check
8056 has_incremental_info_ flag; move setup code to setup_readers;
8057 use input readers.
8058 (Sized_incremental_binary::do_file_is_unchanged): New function.
8059 (Sized_incremental_binary::do_get_input_reader): New function.
8060 * incremental.h (class Incremental_binary): Move to end of file.
8061 (Incremental_binary::file_is_unchanged): New function.
8062 (Incremental_binary::do_file_is_unchanged): New function.
8063 (Incremental_binary::Input_reader): New class.
8064 (Incremental_binary::get_input_reader): New function.
8065 (class Sized_incremental_binary): Move to end of file.
8066 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8067 input section reader classes.
8068 (Sized_incremental_binary::has_incremental_info): New function.
8069 (Sized_incremental_binary::inputs_reader): New function.
8070 (Sized_incremental_binary::symtab_reader): New function.
8071 (Sized_incremental_binary::relocs_reader): New function.
8072 (Sized_incremental_binary::got_plt_reader): New function.
8073 (Sized_incremental_binary::do_file_is_unchanged): New function.
8074 (Sized_incremental_binary::Sized_input_reader): New class.
8075 (Sized_incremental_binary::get_input_reader): New function.
8076 (Sized_incremental_binary::find_incremental_inputs_sections):
8077 Rename do_find_incremental_inputs_sections to this.
8078 (Sized_incremental_binary::setup_readers): New function.
8079 (Sized_incremental_binary::has_incremental_info_): New data member.
8080 (Sized_incremental_binary::inputs_reader_): New data member.
8081 (Sized_incremental_binary::symtab_reader_): New data member.
8082 (Sized_incremental_binary::relocs_reader_): New data member.
8083 (Sized_incremental_binary::got_plt_reader_): New data member.
8084 (Sized_incremental_binary::current_input_file_): New data member.
8085
a869183f
PP
80862011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8087
8088 PR gold/12640
8089 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8090 violation.
8091
80922011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8093
8094 * archive.cc (Archive::include_member): Adjust call to report_object.
8095 (Add_archive_symbols::run): Add script_info to call to
8096 report_archive_begin.
8097 (Lib_group::include_member): Adjust call to report_object.
8098 (Add_lib_group_symbols::run): Adjust call to report_object.
8099 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8100 blocks. Add object count for script input files.
8101 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8102 script_info parameter; change all callers.
8103 (Incremental_inputs::report_object): Add script_info parameter;
8104 change all callers.
8105 (Incremental_inputs::report_script): Store backpointer to
8106 incremental info entry.
8107 (Output_section_incremental_inputs::set_final_data_size): Record
8108 additional information for scripts.
8109 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8110 * incremental.h (Incremental_script_entry::add_object): New function.
8111 (Incremental_script_entry::get_object_count): New function.
8112 (Incremental_script_entry::get_object): New function.
8113 (Incremental_script_entry::objects_): New data member; adjust
8114 constructor.
8115 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8116 (Incremental_inputs::report_object): Add script_info parameter.
8117 (Incremental_inputs_reader::get_object_count): New function.
8118 (Incremental_inputs_reader::get_object_offset): New function.
8119 * options.cc (Input_arguments::add_file): Return reference to
8120 new input argument.
8121 * options.h (Input_argument::set_script_info): New function.
8122 (Input_argument::script_info): New function.
8123 (Input_argument::script_info_): New data member; adjust all
8124 constructors.
8125 (Input_file_group::add_file): Return reference to new input argument.
8126 (Input_file_lib::add_file): Likewise.
8127 (Input_arguments::add_file): Likewise.
8128 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8129 * script.cc (Parser_closure::Parser_closure): Add script_info
8130 parameter; adjust all callers.
8131 (Parser_closure::script_info): New function.
8132 (Parser_closure::script_info_): New data member.
8133 (read_input_script): Report scripts earlier to incremental info.
8134 (script_add_file): Set script_info in Input_argument.
8135 (script_add_library): Likewise.
8136 * script.h (Script_options::Script_info): Rewrite class.
8137
a869183f 81382011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8139
8140 * archive.cc (Library_base::should_include_member): Move
8141 method here from class Archive.
8142 (Archive::Archive): Initialize base class.
8143 (Archive::should_include_member): Move to base class.
8144 (Archive::do_for_all_unused_symbols): New function.
8145 (Add_archive_symbols::run): Remove redundant access to
8146 incremental_inputs.
8147 (Lib_group::Lib_group): Initialize base class.
8148 (Lib_group::do_filename): New function.
8149 (Lib_group::include_member): Pass pointer to Lib_group to
8150 report_object.
8151 (Lib_group::do_for_all_unused_symbols): New function.
8152 (Add_lib_group_symbols::run): Report archive information for
8153 incremental links.
8154 * archive.h (class Library_base): New base class.
8155 (class Archive): Derive from Library_base.
8156 (Archive::filename): Move to base class.
8157 (Archive::set_incremental_info): Likewise.
8158 (Archive::incremental_info): Likewise.
8159 (Archive::Should_include): Likewise.
8160 (Archive::should_include_member): Likewise.
8161 (Archive::Armap_entry): Remove.
8162 (Archive::Unused_symbol_iterator): Remove.
8163 (Archive::unused_symbols_begin): Remove.
8164 (Archive::unused_symbols_end): Remove.
8165 (Archive::do_filename): New function.
8166 (Archive::do_get_mtime): New function.
8167 (Archive::do_for_all_unused_symbols): New function.
8168 (Archive::task_): Move to base class.
8169 (Archive::incremental_info_): Likewise.
8170 (class Lib_group): Derive from Library_base.
8171 (Lib_group::do_filename): New function.
8172 (Lib_group::do_get_mtime): New function.
8173 (Lib_group::do_for_all_unused_symbols): New function.
8174 (Lib_group::task_): Move to base class.
8175 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8176 function.
8177 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8178 function.
8179 * incremental.cc (Incremental_inputs::report_archive_begin):
8180 Use Library_base; call library's get_mtime; add incremental inputs
8181 entry before members.
8182 (class Unused_symbol_visitor): New class.
8183 (Incremental_inputs::report_archive_end): Use Library_base; use
8184 visitor class to record unused symbols; don't add incremental inputs
8185 entry after members.
8186 (Incremental_inputs::report_object): Use Library_base.
8187 * incremental.h
8188 (Incremental_archive_entry::Incremental_archive_entry): Remove
8189 unused Archive parameter.
8190 (Incremental_inputs::report_archive_begin): Use Library_base.
8191 (Incremental_inputs::report_archive_end): Likewise.
8192 (Incremental_inputs::report_object): Likewise.
8193 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8194 function.
8195 * object.h (Object::for_all_global_symbols): New function.
8196 (Object::do_for_all_global_symbols): New function.
8197 (Sized_relobj::do_for_all_global_symbols): New function.
8198 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8199 function.
8200 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8201 function.
8202
61ab3e40
ILT
82032011-03-27 Ian Lance Taylor <iant@google.com>
8204
8205 * archive.cc (Archive::interpret_header): Return -1 if something
8206 goes wrong. Change callers accordingly.
8207
30e1f9e6
CC
82082011-03-25 Cary Coutant <ccoutant@google.com>
8209
8210 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8211 * testsuite/Makefile.in: Regenerate.
8212
9370ce59 82132011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8214
8215 * plugin.cc (get_view): New.
8216 (Plugin::load): Pass get_view to the plugin.
8217 (Plugin_manager::get_view): New.
8218
9312bb0a
ILT
82192011-03-21 Ian Lance Taylor <iant@google.com>
8220
8221 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8222 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8223
7e12ba9e
ST
82242011-03-21 Sriraman Tallam <tmsriram@google.com>
8225
8226 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8227 Change == to -eq.
8228 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8229 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8230 Change == to -eq.
8231 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8232 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8233
fd7a005d
ILT
82342011-03-14 Ian Lance Taylor <iant@google.com>
8235
8236 * script-sections.cc (Sort_output_sections::script_compare):
8237 Rename from is_before, change return type.
8238 (Sort_output_sections::operator()): Adjust accordingly.
8239
ed16fd1b
ILT
82402011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8241
8242 PR gold/12572
8243 * testsuite/odr_violation2.cc: Add comment to make all error line
8244 numbers double digits.
8245 * testsuite/debug_msg.sh: Adjust expected errors.
8246
71ff8986
ILT
82472011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8248
8249 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8250 but mark earlier ones as non-canonical
8251 (offset_to_iterator): Update search target and example
8252 (do_addr2line): Return extra lines in a vector*
8253 (format_file_lineno): Extract from do_addr2line
8254 (one_addr2line): Add vector* out-param
8255 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8256 when a lineno entry appeared last for its instruction
8257 (Dwarf_line_info): Add vector* out-param
8258 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8259 * symtab.cc (Odr_violation_compare): Include the lineno in the
8260 comparison again.
8261 (linenos_from_loc): New. Combine the canonical line for an
8262 address with its other lines.
8263 (True_if_intersect): New. Helper functor to make
8264 std::set_intersection a query.
8265 (detect_odr_violations): Compare sets of lines instead of just
8266 one line for each function. This became less deterministic, but
8267 has fewer false positives.
8268 * symtab.h: Declarations.
8269 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8270 mix an optimized and non-optimized object in the same binary
8271 (odr_violation2.so): Same.
8272 * testsuite/Makefile.in: Regenerate from Makefile.am.
8273 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8274 * testsuite/debug_msg.sh: Update line numbers and add
8275 assertions.
8276 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8277 non-optimized context.
8278 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8279 isn't inlined, and use OdrDerived in an optimized context.
8280 * testsuite/odr_header1.h: Defines OdrDerived, where
8281 optimization will change the
8282 first-instruction-in-the-destructor's file and line number.
8283 * testsuite/odr_header2.h: Defines OdrBase.
8284
a19fefdc
ILT
82852011-03-09 Ian Lance Taylor <iant@google.com>
8286
8287 * fileread.cc (File_read::clear_views): Don't delete the whole
8288 file view.
8289
ecb351e9
ILT
82902011-03-08 Ian Lance Taylor <iant@google.com>
8291
8292 PR gold/12525
8293 * fileread.cc: #include <climits>.
8294 (GOLD_IOV_MAX): Define.
8295 (File_read::read_multiple): Limit number of entries by iov_max.
8296 * fileread.h (class File_read): Always set max_readv_entries to
8297 128.
8298
b821d13c
ILT
82992011-03-07 Ian Lance Taylor <iant@google.com>
8300
8301 PR gold/12525
8302 * options.h (class General_options): Add -dy and -dn.
8303
89243142
CC
83042011-03-02 Cary Coutant <ccoutant@google.com>
8305
8306 * testsuite/script_test_9.t: Add TLS segment.
8307
d0773f31
ILT
83082011-03-02 Simon Baldwin <simonb@google.com>
8309
8310 * configure.ac: Add check for gnu_indirect_function support in
8311 the toolchain building binutils.
8312 * configure: Rebuild.
8313
9370ce59 83142011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8315
8316 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8317 plugin only symbols.
8318 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8319 in plugin files as not needed in the symbol table.
8320
4cf7a849
ST
83212011-02-11 Sriraman Tallam <tmsriram@google.com>
8322
8323 * output.cc (Output_section::add_input_section): Delay fill
8324 generation for section ordering.
8325
b578bd7d
ILT
83262011-02-09 Ian Lance Taylor <iant@google.com>
8327
8328 PR gold/12316
8329 * object.h (class Sized_relobj): Remove clear_local_symbols.
8330 * reloc.cc (Sized_relobj::do_relocate): Don't call
8331 clear_local_symbols.
8332
9370ce59 83332011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8334
8335 * plugin.cc (is_visible_from_outside): Return true for symbols
8336 in the -u option.
8337
55382fb7
ILT
83382011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8339
8340 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8341 filename.
8342
4e271fff
ST
83432011-02-02 Sriraman Tallam <tmsriram@google.com>
8344
8345 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8346 to std::string.
4e271fff 8347 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8348 section_name to be std::string.
4e271fff
ST
8349 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8350
d433c3ac
ILT
83512011-01-25 Ian Lance Taylor <iant@google.com>
8352
8353 * script.cc (script_add_extern): Rewrite to use
8354 add_symbol_reference.
8355
880473a6
DK
83562011-01-25 Doug Kwan <dougkwan@google.com>
8357
d433c3ac 8358 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8359
f30f86fa
ILT
83602011-01-24 Ian Lance Taylor <iant@google.com>
8361
8362 * options.h (class General_options): Accept
8363 --no-detect-odr-violations.
8364
8e51a0b9
ILT
83652011-01-24 Ian Lance Taylor <iant@google.com>
8366
8367 * version.cc (version_string): Bump to 1.11.
8368
0f3b89d8
ILT
83692011-01-24 Ian Lance Taylor <iant@google.com>
8370
8371 * plugin.cc (class Plugin_rescan): Define new class.
8372 (Plugin_manager::claim_file): Set any_claimed_.
8373 (Plugin_manager::save_archive): New function.
8374 (Plugin_manager::save_input_group): New function.
8375 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8376 necessary.
8377 (Plugin_manager::new_undefined_symbol): New function.
8378 (Plugin_manager::rescan): New function.
8379 (Plugin_manager::rescannable_defines): New function.
8380 (Plugin_manager::add_input_file): Set any_added_.
8381 * plugin.h (class Plugin_manager): define new fields rescannable_,
8382 undefined_symbols_, any_claimed_, and any_added_. Declare
8383 Plugin_rescan as friend. Declare new functions.
8384 (Plugin_manager::Rescannable): Define type.
8385 (Plugin_manager::Rescannable_list): Define type.
8386 (Plugin_manager::Undefined_symbol_list): Define type.
8387 (Plugin_manager::Plugin_manager): Initialize new fields.
8388 * archive.cc (Archive::defines_symbol): New function.
8389 (Add_archive_symbols::run): Pass archive to plugins if any.
8390 * archive.h (class Archive): Declare defines_symbol.
8391 * readsyms.cc (Input_group::~Input_group): New function.
8392 (Finish_group::run): Pass input_group to plugins if any.
8393 * readsyms.h (class Input_group): Declare destructor.
8394 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8395 any.
8396
3bb951e5
ILT
83972011-01-10 Ian Lance Taylor <iant@google.com>
8398
8399 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8400 section as relro.
8401 (Layout::set_segment_offsets): Reset increase_relro before calling
8402 set_section_addresses a second time.
8403
0aa45fac
CC
84042011-01-04 Cary Coutant <ccoutant@google.com>
8405
8406 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8407 sections before NOBITS sections.
8408
0db46eb4
L
84092011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8410
8411 * version.cc (print_version): Update copyright to 2011.
8412
829c9745
CC
84132010-12-23 Cary Coutant <ccoutant@google.com>
8414
8415 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8416 of OS to this->add. Add OD parameter to second form of the function.
8417
7500420b
ILT
84182010-12-20 Ian Lance Taylor <iant@google.com>
8419
8420 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8421 second of two consecutive entries with same offset.
8422
f8e9a930
RW
84232010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8424
8425 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8426 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8427 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8428 to avoid unneeded links against $(LDADD).
8429 * testsuite/Makefile.in: Regenerate.
8430
2fbb4320
ILT
84312010-12-15 Ian Lance Taylor <iant@google.com>
8432
8433 PR gold/12324
8434 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8435 for R_X86_64_32 and R_X86_64_PC32.
8436 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8437 ver_matching_def_pic.o.
8438 (ver_matching_def_pic.o): New target.
8439
fedb228d
RW
84402010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8441
8442 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8443 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8444 Move definition before File_read::View member definitions.
8445 (File_read::View::~View): Initialize and hold lock before
8446 updating current_mapped_bytes.
8447
9b547ce6
RW
84482010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8449
8450 * dwarf_reader.cc: Remove outdated comment.
8451 * gold-threads.cc: Fix typo in error message.
8452 * archive.cc: Fix typos in comments.
8453 * archive.h: Likewise.
8454 * arm-reloc-property.cc: Likewise.
8455 * arm-reloc-property.h: Likewise.
8456 * arm-reloc.def: Likewise.
8457 * arm.cc: Likewise.
8458 * attributes.h: Likewise.
8459 * cref.cc: Likewise.
8460 * ehframe.cc: Likewise.
8461 * fileread.h: Likewise.
8462 * gold.h: Likewise.
8463 * i386.cc: Likewise.
8464 * icf.cc: Likewise.
8465 * incremental.h: Likewise.
8466 * int_encoding.cc: Likewise.
8467 * layout.h: Likewise.
8468 * main.cc: Likewise.
8469 * merge.h: Likewise.
8470 * object.cc: Likewise.
8471 * object.h: Likewise.
8472 * options.cc: Likewise.
8473 * readsyms.cc: Likewise.
8474 * reduced_debug_output.cc: Likewise.
8475 * reloc.cc: Likewise.
8476 * script-sections.cc: Likewise.
8477 * sparc.cc: Likewise.
8478 * symtab.h: Likewise.
8479 * target-reloc.h: Likewise.
8480 * target.cc: Likewise.
8481 * target.h: Likewise.
8482 * timer.cc: Likewise.
8483 * timer.h: Likewise.
8484 * x86_64.cc: Likewise.
8485
83e17bd5
CC
84862010-12-09 Cary Coutant <ccoutant@google.com>
8487
8488 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8489 stack.
8490 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8491 parameter; change all callers.
8492 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8493 * options.h (warn_execstack): New option.
8494
017257f8
DK
84952010-12-07 Doug Kwan <dougkwan@google.com>
8496
8497 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8498 like function call relocations.
8499
c20cbc06
ILT
85002010-12-07 Ian Lance Taylor <iant@google.com>
8501
8502 * archive.cc (Archive::get_elf_object_for_member): Permit
8503 punconfigured to be NULL.
8504 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8505 (Archive::include_member): Pass NULL to get_elf_object_for_member
8506 if we searched for the archive and this is the first included
8507 object.
8508
4dbfafcc
ILT
85092010-12-01 Ian Lance Taylor <iant@google.com>
8510
8511 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8512 track_relocs_type_ field.
8513 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8514 Set track_relocs_type_.
8515 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8516 contents when using RELA relocs.
8517 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8518 reloc_map_.
8519 * reloc.cc (Track_relocs::next_addend): New function.
8520 * reloc.h (class Track_relocs): Declare next_addend.
8521
e5e19edd
ILT
85222010-12-01 Ian Lance Taylor <iant@google.com>
8523
8524 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8525 virtual destructor.
8526
9a5ce24c
ILT
85272010-12-01 Ian Lance Taylor <iant@google.com>
8528
8529 * README: Update compilers known to work and fail.
8530
c7791212
NC
85312010-11-23 Matthias Klose <doko@ubuntu.com>
8532
8533 * configure.in: For --enable-gold, handle value `default' instead of
8534 `both*'. Always install ld as ld.bfd, install as ld if gold is
8535 not the default.
8536 * configure: Regenerate.
8537
0ad220c9
DK
85382010-11-18 Doug Kwan <dougkwan@google.com>
8539
8540 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8541 and right_alignment to be zero. Store result alignment only if it is
8542 greater than existing alignment.
8543
ab8056e0
CC
85442010-11-16 Cary Coutant <ccoutant@google.com>
8545
8546 PR gold/12220
8547 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8548 Check for ".zdebug_line".
8549
fd064a5b
CC
85502010-11-16 Doug Kwan <dougkwan@google.com>
8551 Cary Coutant <ccoutant@google.com>
8552
8553 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8554 by reference; adjust all callers.
8555 * output.cc (Output_segment::set_section_addresses): Adjust references
8556 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8557 list is empty.
8558 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8559 end at page boundary.
8560
6fc6ea19
CC
85612010-11-16 Cary Coutant <ccoutant@google.com>
8562
8563 PR gold/12220
8564 * layout.cc (Layout::choose_output_section): Transform names of
8565 compressed sections even when using a script with a SECTIONS clause.
8566 (Layout::output_section_name): Remove code to transform
8567 compressed debug section names.
8568 * output.cc (Output_section::add_input_section): Use uncompressed
8569 section size when tracking input sections.
8570
95a2c8d6
RS
85712010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8572
8573 * symtab.h (Symbol::NON_PIC_REF): Remove.
8574 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8575 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8576 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8577 (Symbol::use_plt_offset): Take a flags argument and pass it
8578 directly to needs_dynamic_reloc. Restrict check for undefined
8579 weak symbols to function calls.
8580 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8581 (Target_arm::Scan::global): Use it.
8582 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8583 (Target_arm::Relocate::relocate): Likewise.
8584 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8585 parameter with an r_type parameter. Use get_reference_flags
8586 to get the flags.
8587 (Target_arm::Relocate::relocate): Update accordingly.
8588 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8589 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8590 (Target_i386::Scan::global): Likewise.
8591 (Target_i386::Relocate::relocate): Likewise.
8592 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8593 parameter with an r_type parameter. Use get_reference_flags
8594 to get the flags.
8595 (Target_i386::Relocate::relocate): Update accordingly.
8596 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8597 (Target_powerpc::Scan::global): Use it.
8598 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8599 (Target_powerpc::Relocate::relocate): Likewise.
8600 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8601 (Target_sparc::Scan::global): Use it.
8602 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8603 (Target_sparc::Relocate::relocate): Likewise.
8604 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8605 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8606 (Target_x86_64::Scan::global): Likewise.
8607 (Target_x86_64::Relocate::relocate): Likewise.
8608
f625ae50
DK
86092010-11-08 Doug Kwan <dougkwan@google.com>
8610 Cary Coutant <ccoutant@google.com>
8611
8612 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8613 (Arm_exidx_merge_section::section_contents_): New data member.
8614 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8615 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8616 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8617 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8618 in parameters instead of calling Object::section_contents without
8619 locking.
8620 (Arm_output_section::group_section): New parameter TASK. Pass it
8621 to callees that need locking objects.
8622 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8623 to lock EXIDX input sections. Fix a formatting issue. Call
8624 Arm_exidx_merged_section::build_contents to create merged section
8625 contents.
8626 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8627 to lock object of stub table owner.
8628 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8629 TEXT_SIZE to initialize data member TEXT_SIZE_.
8630 (Arm_exidx_input_section::addralign): Fix typo in comment.
8631 (Arm_exidx_input_section::text_size): New method.
8632 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8633 that require locking objects. Lock objects before scanning for stubs
8634 and updating local symbols.
8635 (Arm_input_section<big_endian>::init): Copy contents of original
8636 input section.
2e702c99 8637 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8638 original input section instead of calling Object::section_contents
8639 without locking.
8640 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8641 size without calling Object::section_size().
8642 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8643 for size. Allocate a buffer for merged EXIDX entries.
8644 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8645 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8646 building code to Arm_exidx_merged_section::build_contetns. Write
8647 out contetns in buffer instead of building it on the fly.
8648 (Arm_relobj::make_exidx_input_section): Also pass text section size
8649 to Arm_exidx_input_section constructor.
8650 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8651 (Arm_dynobj::do_read_symbols): Fix memory leak.
8652 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8653 * target.h: (class Task): Add forward declaration.
8654 (Target::relax): Add new parameter TASK and pass it to
8655 Target::do_relax().
8656 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8657
5f9bcf58
CC
86582010-11-05 Cary Coutant <ccoutant@google.com>
8659
8660 PR gold/10708
8661 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8662 object when reading from the file.
8663 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8664 second layout pass.
8665 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8666 when reading section contents.
8667 (get_section_contents): Likewise.
8668 (icf::find_identical_sections): Likewise.
8669 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8670 object when reading from the file.
8671 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8672 the object when doing deferred section layout.
8673
e597fa08
NC
86742010-11-03 Nick Clifton <nickc@redhat.com>
8675
8676 PR gold/12001
8677 * script.h (class Symbol_assignment: name): New member. Returns
8678 the name of the symbol.
8679 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8680 Returns true if the given symbol name is on the list of
8681 assignments wating to be processed.
8682 * archive.cc (should_incldue_member): If the symbol is undefined,
8683 check to see if it is on the list of symbols pending assignment.
8684
3f9a3278
ILT
86852010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8686
8687 * script-sections.cc (Script_sections::find_memory_region): Check
8688 for a NULL output section pointer.
8689
d06fb4d1
DK
86902010-10-29 Doug Kwan <dougkwan@google.com>
8691
8692 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8693 Output_section::add_relaxed_input_section.
8694 * output.cc (Output_section::add_relaxed_input_section): Add new
8695 arguments LAYOUT and NAME. Set section order index.
8696 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8697 Copy section order index.
8698 * output.h (Output_section::add_relaxed_input_section): Add new
8699 arguments LAYOUT and NAME.
8700
90e24de5
ILT
87012010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8702
8703 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8704 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8705 * testsuite/Makefile.in: Regenerate.
8706
c9484ea5
DK
87072010-10-20 Doug Kwan <dougkwan@google.com>
8708
8709 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8710 without SHF_LINK_ORDER flags.
8711 * layout.cc (Layout::choose_output_section): Do not filter
8712 SHF_LINK_ORDER flag in a relocatable link.
8713
5bc2f5be
CC
87142010-10-17 Cary Coutant <ccoutant@google.com>
8715
8716 * output.h (Output_segment::set_section_addresses): Change function
8717 signature. Update all callers.
8718 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8719 sections.
8720 (Output_segment::set_section_addresses): Align after last TLS
8721 section. Add padding before last relro section instead of after.
8722
0c91cf04
DK
87232010-10-17 Doug Kwan <dougkwan@google.com>
8724
8725 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8726 GOT output section to be writable.
8727
8c21d9d3
CC
87282010-10-14 Cary Coutant <ccoutant@google.com>
8729
8730 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8731 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8732 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8733 mode.
8734 * incremental.cc (report_command_line): Ignore all forms of
8735 --incremental.
8736 * layout.cc (Layout::Layout): Check parameters for incremental link
8737 mode.
8738 * options.cc (General_options::parse_incremental): New function.
8739 (General_options::parse_no_incremental): New function.
8740 (General_options::parse_incremental_full): New function.
8741 (General_options::parse_incremental_update): New function.
8742 (General_options::incremental_mode_): New data member.
8743 (General_options::finalize): Check incremental_mode_.
8744 * options.h (General_options): Update help text for --incremental.
8745 Add --no-incremental, --incremental-full, --incremental-update.
8746 (General_options::Incremental_mode): New enum type.
8747 (General_options::incremental_mode): New function.
8748 (General_options::incremental_mode_): New data member.
8749 * parameters.cc (Parameters::incremental_mode_): New data member.
8750 (Parameters::set_options): Set incremental_mode_.
8751 (Parameters::set_incremental_full): New function.
8752 (Parameters::incremental): New function.
8753 (Parameters::incremental_update): New function.
8754 (set_parameters_incremental_full): New function.
8755 * parameters.h (Parameters::set_incremental_full): New function.
8756 (Parameters::incremental): New function.
8757 (Parameters::incremental_update): New function.
8758 (Parameters::incremental_mode_): New data member.
8759 (set_parameters_incremental_full): New function.
8760 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8761 incremental link mode.
8762 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8763 (Sized_relobj::do_relocate_sections): Likewise.
8764 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8765 option.
8766 * testsuite/Makefile.in: Regenerate.
8767 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8768
bb32aa18 87692010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8770
8771 * script-sections.h (class Script_sections): Make
8772 Sections_elements typedef public.
8773 * script-sections.cc (class Sort_output_sections): Add elements_
8774 field. Add constructor which sets it; change all callers.
8775 (Sort_output_sections::is_before): New function.
8776 (Sort_output_sections::operator()): Call is_before.
8777 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8778 conditional.
8779 * testsuite/script_test_10.sh: New test. Test script section
8780 order.
8781 * testsuite/script_test_10.t: Likewise.
8782 * testsuite/script_test_10.s: Likewise.
8783 * testsuite/Makefile.am: Wrap the cross linker tests and the
8784 common tests into NATIVE_OR_CROSS_LINKER.
8785 (check_SCRIPTS): Add script_test_10.sh.
8786 (check_DATA): Add script_test_10.stdout.
8787 (script_test_10.o, script_test_10): New targets.
8788 (script_test_10.stdout): New target.
8789 * configure, testsuite/Makefile.in: Regenerate.
8790
3cef7179
ILT
87912010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8792
8793 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8794 error for the deprecated relocations.
8795 (Target_arm::Scan::global): Likewise.
8796 (Target_arm::Relocate::relocate): Likewise.
8797
7411e9a8
RS
87982010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8799
8800 * fileread.cc (Input_file::find_file): Initialize *found_name
8801 and *namep when using the fallback search for case 4.
8802
6a9da32a
CC
88032010-10-11 Cary Coutant <ccoutant@google.com>
8804
8805 * options.h (class General_options): Redefine -z lazy as an alias for
8806 the negation of -z now.
8807
ac897c20
ILT
88082010-10-11 Ian Lance Taylor <iant@google.com>
8809
8810 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8811 binding.
8812
ea5cae92
NC
88132010-10-06 Nick Clifton <nickc@redhat.com>
8814
8815 * script-sections.cc(class Memory_region): Remove
8816 current_lma_offset_ field. Rename current_vma_offset_ to
8817 current_offset_. Add last_section_ field.
8818 (Memory_region::get_current_vma_address): Rename to
8819 get_current_address.
8820 (Memory_region::get_current_lma_address): Delete.
8821 (Memory_region::increment_vma_offset): Rename to
8822 increment_offset.
8823 (Memory_region::increment_lma_offset): Delete.
8824 (Memory_region::attributes_compatible): New method. Returns
8825 true if the provided section is compatible with the region.
8826 (Memory_region::get_last_section): New method. Returns the last
8827 section to use the region.
8828 (Memory_region::set_last_section): New method. Stores the last
8829 section to use the region.
8830 (Script_sections::block_in_region): New method. Returns true if
8831 a block of memory is contained within a region.
8832 (Script_sections::find_memory_region): New method. Locates a
8833 memory region to be used to set a VMA or LMA address.
8834 (Output_section_definition::set_section_addresses): Add code to
8835 check for addresses set by memory regions.
8836 (Output_segment::set_section_addresses): Remove memory region
8837 walking code.
8838 (Script_sections::create_segment): Add a warning if a header
8839 segment is created outside of any region.
8840 * script-sections.h (class Script_sections): Add prototypes for
8841 find_memory_region and block_in_region methods.
8842 * testsuite/memory_test.s: Use .long instead of .word.
8843 * testsuite/memory_test.t: Add some more output sections.
8844 * testsuite/memory_test.sh: Update expected output.
8845
a9bfd952
DK
88462010-10-02 Doug Kwan <dougkwan@google.com>
8847
8848 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8849 defintion to symtab.h
8850 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8851 declaration to defintion.
8852
bacff3ab
NC
88532010-10-01 Nick Clifton <nickc@redhat.com>
8854
8855 * expression.cc (eval): Replace dummy argument with NULL.
8856 (eval_maybe_dot): Check for a NULL result section pointer.
8857 (Symbol_expression::value): Likewise.
8858 (Dot_expression::value): Likewise.
8859 (BINARY_EXPRESSION): Likewise.
8860 (Max_expression::value): Likewise.
8861 (Min_expression::value): Likewise.
8862 (Absolute_expression::value): Likewise.
8863 (Addr_expression::value_from_output_section): Likewise.
8864 (Loaddddr_expression::value_from_output_section): Likewise.
8865 (Segment_start_expression::value): Likewise.
8866 * script-sections.cc
8867 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8868 argument with NULL.
8869 (Sections_elememt_dot_assignment::set_section_addresses):
8870 Likewise.
8871 (Output_data_expression::do_write_to_buffer): Likewise.
8872 (Output_section_definition::finalize_symbols): Likewise.
8873 (Output_section_definition::set_section_addresses): Likewise.
8874
f81bc8b5
DK
88752010-09-30 Doug Kwan <dougkwan@google.com>
8876
8877 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8878
c95e9f27
ST
88792010-09-28 Sriraman Tallam <tmsriram@google.com>
8880
8881 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8882 function.
c95e9f27
ST
8883 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8884 virtual function.
8885 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8886 virtual function.
8887 * icf.cc (get_section_contents): Inline merge sections only when
8888 target allows it.
8889
3cac54d2
RW
88902010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8891
8892 * configure: Regenerate.
8893
2904037a
ILT
88942010-09-17 Ian Lance Taylor <iant@google.com>
8895
8896 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8897 * testsuite/Makefile.am (memory_test.o): New target.
8898 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8899 memory_test.t.
8900 * testsuite/Makefile.in: Rebuild.
2904037a 8901
bca7fb63
DK
89022010-09-17 Doug Kwan <dougkwan@google.com>
8903
8904 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8905 defintion if relocation uses GOT entries of the symbol.
8906 * testsuite/icf_safe_test.sh: Fix test.
8907 * testsuite/icf_safe_so_test.sh: Fix test.
8908
4ef28648
CC
89092010-09-16 Cary Coutant <ccoutant@google.com>
8910
8911 * script_sections.cc (class Memory_region): Remove "NULL" from
8912 vector initializations.
8913
793990de
CC
89142010-09-15 Cary Coutant <ccoutant@google.com>
8915
8916 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8917 Resolve forwarding symbols.
8918
81e015e2
DK
89192010-09-15 Doug Kwan <dougkwan@google.com>
8920
8921 * gold/testsuite/script_test_3.t: Add ARM special sections.
8922 * gold/testsuite/script_test_4.t: Same.
8923 * gold/testsuite/script_test_5.t: Same.
8924 * gold/testsuite/script_test_6.t: Same.
8925 * gold/testsuite/script_test_7.t: Same.
8926 * gold/testsuite/script_test_7.t: Same.
8927 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8928
36171d64
CC
89292010-09-14 Cary Coutant <ccoutant@google.com>
8930
8931 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8932 (Target_x86_64::Relocate::relocate_tls): Replace check for
8933 saw_tls_block_reloc_ with test for executable section.
8934
d89051bd
CC
89352010-09-12 Cary Coutant <ccoutant@google.com>
8936
8937 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8938 position-independent executables to shared libraries need dynamic
8939 relocations.
8940 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8941 position-independent executables.
8942 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8943 * testsuite/Makefile.in: Regenerate.
8944
fca41f0f
NC
89452010-09-10 Nick Clifton <nickc@redhat.com>
8946
8947 PR gold/11997
8948 * testsuite/memory_test.t: Discard any sections that are not
8949 needed.
8950
6695e4b3
L
89512010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8952
8953 PR gold/11996
8954 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8955 "This::" to work around a bug in gcc 4.2.
8956
8957 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8958
0f72bf6f
RÁE
89592010-09-09 Rafael Espindola <espindola@google.com>
8960
8961 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8962 sections with different PF_X flags in the same segment.
8963 (Layout::find_first_load_seg): Search all segments to find the first
8964 one.
8965 * options.h (rosegment): New.
8966
89672010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8968
05a79166 8969 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8970
aa98ff75
DK
89712010-09-08 Doug Kwan <dougkwan@google.com>
8972
8973 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8974 (Arm_relobj::do_relocate_sections): Add new parameter for output
8975 file to match the parent.
8976 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8977 of local symbols instead of input values. Update code to track
8978 changes in gold::relocate_section.
8979 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8980 (Sized_relobj::compute_final_local_value_internal): New methods.
8981 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8982 body into private version of Sized_relobj::compute_final_local_value.
8983 Call the inline method.
8984 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8985 merged symbol value if there is one.
8986 (Symbol_value::has_output_value): New method defintiion.
8987 (Sized_relobj::Compute_final_local_value_status): New enum type.
8988 (Sized_relobj::compute_final_local_value): New methods.
8989 (Sized_relobj::compute_final_local_value_internal): New methods.
8990 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8991 and arm_cortex_a8.sh.
8992 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8993 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8994 New tests.
8995 * Makefile.in: Regenerate.
8996 * testsuite/arm_bl_out_of_range.s: Update test.
8997 * testsuite/thumb_bl_out_of_range.s: Ditto.
8998 * testsuite/thumb_blx_out_of_range.s: Ditto.
8999 * testsuite/arm_branch_out_of_range.sh: New file.
9000 * testsuite/arm_cortex_a8.sh: Ditto.
9001 * testsuite/arm_cortex_a8_b.s: Ditto.
9002 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9003 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9004 * testsuite/arm_cortex_a8_bl.s: Ditto.
9005 * testsuite/arm_cortex_a8_blx.s: Ditto.
9006 * testsuite/arm_cortex_a8_local.s: Ditto.
9007 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9008 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9009
05a79166
L
90102010-09-08 Rafael Espindola <espindola@google.com>
9011
9012 * Makefile.am (memory_test.stdout): Run readelf with -W.
9013 * Makefile.in: Regenerate.
9014 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9015 64 bit output.
9016
33dbc701
RÁE
90172010-09-08 Rafael Espindola <espindola@google.com>
9018
9019 * script-sections.cc (Script_sections::add_memory_region): Convert
9020 field precision to int.
9021 * script.cc (script_set_section_region, script_set_section_region):
9022 Convert field precision to int.
9023
731ca54a
RÁE
90242010-09-08 Rafael Espindola <espindola@google.com>
9025
9026 * arm.cc (do_finalize_sections): Create the __exidx_start and
9027 __exdix_end symbols even when the section is missing.
9028
7f8cd844
NC
90292010-09-08 Nick Clifton <nickc@redhat.com>
9030
9031 * README: Remove claim that MEMORY is not supported.
9032 * expression.cc (script_exp_function_origin)
9033 (script_exp_function_length): Move from here to ...
9034 * script.cc: ... here.
9035 (script_set_section_region, script_add_memory)
9036 (script_parse_memory_attr, script_include_directive): New
9037 functions.
9038 * script-sections.cc
9039 (class Memory_region): New class.
9040 (class Output_section_definition): Add set_memory_region,
9041 set_section_vma, set_section_lma and get_section_name methods.
9042 (class Script_Sections): Add add_memory_region,
9043 find_memory_region, find_memory_region_origin,
9044 find_memory_region_length and set_memory_region methods.
9045 Have set_section_addresses method walk the list of set memory
9046 regions.
9047 Extend the print methos to display memory regions.
9048 * script-sections.h: Add prototypes for new methods.
9049 Add enum for MEMORY region attributes.
9050 * yyscript.y: Add support for parsing MEMORY regions.
9051 * script-c.h: Add prototypes for new functions.
9052 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9053 * testsuite/Makefile.in: Regenerate.
9054 * testsuite/memory_test.sh: New script.
9055 * testsuite/memory_test.s: New assembler source file.
9056 * testsuite/memory_test.t: New linker script.
9057
a4649286
DK
90582010-08-27 Doug Kwan <dougkwan@google.com>
9059
9060 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9061 reference override an existing dynamic weak reference.
9062 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9063 * testsuite/Makefile.in: Regenerate.
9064 * testsuite/dyn_weak_ref.sh: New file.
9065 * testsuite/dyn_weak_ref_1.c: Ditto.
9066 * testsuite/dyn_weak_ref_2.c: Ditto.
9067
b56648ad
ILT
90682010-08-27 Ian Lance Taylor <iant@google.com>
9069
9070 * incremental.h (class Incremental_input_entry): Add virtual
9071 destructor.
9072
809313cb
ILT
90732010-08-27 Ian Lance Taylor <iant@google.com>
9074
9075 * testsuite/start_lib_test_3.c: Mark t3 as used.
9076
11e32464
NC
90772010-08-27 Nick Clifton <nickc@redhat.com>
9078
9079 * options.cc (version_script): Fix small typo in previous
9080 whitespace tidyup.
9081
ca09d69a
NC
90822010-08-25 Nick Clifton <nickc@redhat.com>
9083
9084 * archive.cc: Formatting fixes: Remove whitespace between
9085 typename and following asterisk. Remove whitespace between
9086 function name and opening parenthesis.
9087 * archive.h: Likewise.
9088 * arm.cc: Likewise.
9089 * attributes.cc: Likewise.
9090 * attributes.h: Likewise.
9091 * common.cc: Likewise.
9092 * copy-relocs.cc: Likewise.
9093 * dirsearch.h: Likewise.
9094 * dynobj.cc: Likewise.
9095 * ehframe.cc: Likewise.
9096 * ehframe.h: Likewise.
9097 * expression.cc: Likewise.
9098 * fileread.cc: Likewise.
9099 * fileread.h: Likewise.
9100 * gc.h: Likewise.
9101 * gold-threads.cc: Likewise.
9102 * gold.cc: Likewise.
9103 * i386.cc: Likewise.
9104 * icf.h: Likewise.
9105 * incremental-dump.cc: Likewise.
9106 * incremental.cc: Likewise.
9107 * layout.cc: Likewise.
9108 * layout.h: Likewise.
9109 * main.cc: Likewise.
9110 * merge.cc: Likewise.
9111 * merge.h: Likewise.
9112 * object.cc: Likewise.
9113 * object.h: Likewise.
9114 * options.cc: Likewise.
9115 * options.h: Likewise.
9116 * output.cc: Likewise.
9117 * output.h: Likewise.
9118 * plugin.cc: Likewise.
9119 * plugin.h: Likewise.
9120 * powerpc.cc: Likewise.
9121 * reloc.cc: Likewise.
9122 * script-c.h: Likewise.
9123 * script-sections.cc: Likewise.
9124 * script.cc: Likewise.
9125 * stringpool.cc: Likewise.
9126 * symtab.cc: Likewise.
9127 * symtab.h: Likewise.
9128 * target.cc: Likewise.
9129 * timer.cc: Likewise.
9130 * timer.h: Likewise.
9131 * version.cc: Likewise.
9132 * x86_64.cc: Likewise.
9133
b8fa8750
NC
91342010-08-24 Nick Clifton <nickc@redhat.com>
9135
9136 PR 11899
9137 * layout.cc (segment_precedes): Sort segments by their physical
9138 addresses, if they have been set.
9139
9919d93b
CC
91402010-08-23 Cary Coutant <ccoutant@google.com>
9141
9142 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9143 symbols data.
9144 (Lib_group::include_member): Unlock object after deleting its
9145 symbols data.
9146 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9147 the bug fixed here.
9148
97b4be1c
CC
91492010-08-19 Neil Vachharajani <nvachhar@google.com>
9150 Cary Coutant <ccoutant@google.com>
9151
9152 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9153 constructor, and set_blocker.
9154 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9155 readsyms_blocker_.
9156 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9157 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9158 * testsuite/Makefile.am (start_lib_test): New test case.
9159 * testsuite/Makefile.in: Regenerate.
9160 * testsuite/start_lib_test_main.c: New file.
9161 * testsuite/start_lib_test_1.c: New file.
9162 * testsuite/start_lib_test_2.c: New file.
9163 * testsuite/start_lib_test_3.c: New file.
9164
dd0b1884
ILT
91652010-08-19 Ian Lance Taylor <iant@google.com>
9166
9167 * Makefile.in: Rebuild with automake 1.11.1.
9168 * aclocal.m4: Likewise.
9169 * testsuite/Makefile.in: Likewise.
9170
7223e9ca
ILT
91712010-08-19 Ian Lance Taylor <iant@google.com>
9172
9173 PR 10893
9174 * i386.cc (class Output_data_plt_i386): Update declarations.
9175 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9176 local_ifuncs_ fields.
9177 (Target_i386::do_plt_section_for_global): New function.
9178 (Target_i386::do_plt_section_for_local): New function.
9179 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9180 parameter; change all callers. Initialize global_ifuncs_ and
9181 local_ifuncs_. If doing a static link define __rel_iplt_start and
9182 __rel_iplt_end.
9183 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9184 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9185 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9186 symbols.
9187 (Target_i386::make_plt_section): New function, broken out of
9188 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9189 (Target_i386::make_plt_entry): Call make_plt_section.
9190 (Target_i386::make_local_ifunc_plt_entry): New function.
9191 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9192 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9193 R_386_IRELATIVE to switch.
9194 (Target_i386::Scan::global): Likewise.
9195 (Target_i386::Relocate::relocate): Likewise.
9196 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9197 switch.
9198 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9199 (Target_x86_64::do_plt_section_for_global): New function.
9200 (Target_x86_64::do_plt_section_for_local): New function.
9201 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9202 parameter; change all callers. If doing a static link define
9203 __rela_iplt_start and __rela_iplt_end.
9204 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9205 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9206 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9207 to point to .plt.
9208 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9209 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9210 switch.
9211 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9212 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9213 R_X86_64_IRELATIVE to switch.
9214 (Target_x86_64::Scan::global): Likewise.
9215 (Target_x86_64::Relocate::relocate): Likewise.
9216 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9217 switch.
9218 * target.h (class Target): Add plt_section_for_global and
9219 plt_section_for_local functions. Add do_plt_section_for_global
9220 and do_plt_section_for_local virtual functions.
9221 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9222 clarifying comments.
9223 (Symbol::use_plt_offset): Handle IFUNC symbol.
9224 * object.cc (Sized_relobj::Sized_relobj): Initialize
9225 local_plt_offsets_.
9226 (Sized_relobj::local_has_plt_offset): New function.
9227 (Sized_relobj::local_plt_offset): New function.
9228 (Sized_relobj::set_local_plt_offset): New function.
9229 (Sized_relobj::do_count): Handle IFUNC symbol.
9230 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9231 a bit away from input_shndx_ field. Add set_is_func_symbol and
9232 is_ifunc_symbol functions.
9233 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9234 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9235 local_plt_offsets_ field.
9236 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9237 * output.h (class Output_section_data): Add non-const
9238 output_section function.
9239 (class Output_data_got): Update declarations.
9240 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9241 Add use_plt_offset parameter to global and local constructors.
9242 Change all callers. Change local_sym_index_ field to 31 bits.
9243 Change GSYM_CODE and CONSTANT_CODE accordingly.
9244 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9245 doing a static link don't set sh_link field.
9246 (Output_data_got::Got_entry::write): Use PLT offset if
9247 appropriate.
9248 (Output_data_got::add_global_plt): New function.
9249 (Output_data_got::add_local_plt): New function.
9250 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9251 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9252 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9253 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9254 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9255 IFUNC conditional.
9256 * testsuite/ifunc-sel.h: New file.
9257 * testsuite/ifuncmain1.c: New file.
9258 * testsuite/ifuncmain1vis.c: New file.
9259 * testsuite/ifuncmod1.c: New file.
9260 * testsuite/ifuncdep2.c: New file.
9261 * testsuite/ifuncmain2.c: New file.
9262 * testsuite/ifuncmain3.c: New file.
9263 * testsuite/ifuncmod3.c: New file.
9264 * testsuite/ifuncmain4.c: New file.
9265 * testsuite/ifuncmain5.c: New file.
9266 * testsuite/ifuncmod5.c: New file.
9267 * testsuite/ifuncmain6pie.c: New file.
9268 * testsuite/ifuncmod6.c: New file.
9269 * testsuite/ifuncmain7.c: New file.
9270 * configure, testsuite/Makefile.in: Rebuild.
9271
56f75c03
ILT
92722010-08-18 Ian Lance Taylor <iant@google.com>
9273
9274 * incremental.cc
9275 (Output_section_incremental_inputs::write_input_files): Add cast
9276 to avoid signed/unsigned comparison warning.
9277 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9278
55455f89
CC
92792010-08-12 Cary Coutant <ccoutant@google.com>
9280
9281 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9282
e2054bcb
ILT
92832010-08-13 Ian Lance Taylor <iant@google.com>
9284
9285 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9286
74f67560
DK
92872010-08-12 Cary Coutant <ccoutant@google.com>
9288 Doug Kwan <dougkwan@google.com>
9289
9290 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9291 defintion overrides non-weak undef, remember that the original undef
9292 is not weak.
9293 * symtab.cc (Symbol_table::sized_write_global): For undef without
9294 an original weak binding, set binding to global in output.
9295 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9296 * testsuite/Makefile.in: Regenerate.
9297 * testsuite/strong_ref_weak_def.sh: New file.
9298 * testsuite/strong_ref_weak_def_1.c: Ditto.
9299 * testsuite/strong_ref_weak_def_2.c: Ditto.
9300
d1238d12
CC
93012010-08-12 Cary Coutant <ccoutant@google.com>
9302
9303 * testsuite/incremental_test.sh: Rewrite.
9304 * testsuite/incremental_test_1.c: Rewrite.
9305 * testsuite/incremental_test_2.c: Rewrite.
9306
0e70b911
CC
93072010-08-12 Cary Coutant <ccoutant@google.com>
9308
9309 * arm.cc (Target_arm::got_size): Add const.
9310 (Target_arm::got_entry_count): New function.
9311 (Target_arm::plt_entry_count): New function.
9312 (Target_arm::first_plt_entry_offset): New function.
9313 (Target_arm::plt_entry_size): New function.
9314 (Output_data_plt_arm::entry_count): New function.
9315 (Output_data_plt_arm::first_plt_entry_offset): New function.
9316 (Output_data_plt_arm::get_plt_entry_size): New function.
9317 * i386.cc (Target_i386::got_size): Add const.
9318 (Target_i386::got_entry_count): New function.
9319 (Target_i386::plt_entry_count): New function.
9320 (Target_i386::first_plt_entry_offset): New function.
9321 (Target_i386::plt_entry_size): New function.
9322 (Output_data_plt_i386::entry_count): New function.
9323 (Output_data_plt_i386::first_plt_entry_offset): New function.
9324 (Output_data_plt_i386::get_plt_entry_size): New function.
9325 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9326 find_incremental_inputs_sections. Dump incremental_got_plt section.
9327 * incremental.cc: Include target.h.
9328 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9329 parameter. Adjust all callers. Find incremental_got_plt section.
9330 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9331 section.
9332 (Output_section_incremental_inputs::set_final_data_size): Calculate
9333 size of incremental_got_plt section.
9334 (Output_section_incremental_inputs::do_write): Write the
9335 incremental_got_plt section.
9336 (Got_plt_view_info): New struct.
9337 (Local_got_offset_visitor): New class.
9338 (Global_got_offset_visitor): New class.
9339 (Global_symbol_visitor_got_plt): New class.
9340 (Output_section_incremental_inputs::write_got_plt): New function.
9341 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9342 Add parameter. Adjust all callers.
9343 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9344 (Incremental_inputs::got_plt_section): New function.
9345 (Incremental_inputs::got_plt_section_): New data member.
9346 (Incremental_got_plt_reader): New class.
9347 * layout.cc (Layout::create_incremental_info_sections): Add the
9348 incremental_got_plt section.
9349 * object.h (Got_offset_list::get_list): New function.
9350 (Got offset_list::for_all_got_offsets): New function.
9351 (Sized_relobj::local_got_offset_list): New function.
9352 * powerpc.cc (Target_powerpc::got_size): Add const.
9353 (Target_powerpc::got_entry_count): New function.
9354 (Target_powerpc::plt_entry_count): New function.
9355 (Target_powerpc::first_plt_entry_offset): New function.
9356 (Target_powerpc::plt_entry_size): New function.
9357 (Output_data_plt_powerpc::entry_count): New function.
9358 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9359 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9360 * sparc.cc (Target_sparc::got_size): Add const.
9361 (Target_sparc::got_entry_count): New function.
9362 (Target_sparc::plt_entry_count): New function.
9363 (Target_sparc::first_plt_entry_offset): New function.
9364 (Target_sparc::plt_entry_size): New function.
9365 (Output_data_plt_sparc::entry_count): New function.
9366 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9367 (Output_data_plt_sparc::get_plt_entry_size): New function.
9368 * symtab.h (Symbol::got_offset_list): New function.
9369 (Symbol_table::for_all_symbols): New function.
9370 * target.h (Sized_target::got_entry_count): New function.
9371 (Sized_target::plt_entry_count): New function.
9372 (Sized_target::plt_entry_size): New function.
9373 * x86_64.cc (Target_x86_64::got_size): Add const.
9374 (Target_x86_64::got_entry_count): New function.
9375 (Target_x86_64::plt_entry_count): New function.
9376 (Target_x86_64::first_plt_entry_offset): New function.
9377 (Target_x86_64::plt_entry_size): New function.
9378 (Output_data_plt_x86_64::entry_count): New function.
9379 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9380 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9381
09ec0418
CC
93822010-08-12 Cary Coutant <ccoutant@google.com>
9383
9384 * archive.cc: Include incremental.h.
9385 (Archive::Archive): Initialize incremental_info_.
9386 (Archive::include_member): Record archive members in incremental info.
9387 (Add_archive_symbols::run): Record begin and end of an archive in
9388 incremental info.
9389 (Lib_group::include_member): Record objects in incremental info.
9390 * archive.h (Incremental_archive_entry): Forward declaration.
9391 (Archive::set_incremental_info): New member function.
9392 (Archive::incremental_info): New member function.
9393 (Archive::Unused_symbol_iterator): New class.
9394 (Archive::unused_symbols_begin): New member function.
9395 (Archive::unused_symbols_end): New member function.
9396 (Archive::incremental_info_): New data member.
9397 * incremental-dump.cc (find_input_containing_global): New function.
9398 (dump_incremental_inputs): Dump new incremental info sections.
9399 * incremental.cc: Include symtab.h.
9400 (Output_section_incremental_inputs): New class.
9401 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9402 new incremental info sections.
9403 (Sized_incremental_binary::do_check_inputs): Likewise.
9404 (Incremental_inputs::report_archive): Remove.
9405 (Incremental_inputs::report_archive_begin): New function.
9406 (Incremental_inputs::report_archive_end): New function.
9407 (Incremental_inputs::report_object): New function.
9408 (Incremental_inputs::finalize_inputs): Remove.
9409 (Incremental_inputs::report_input_section): New function.
9410 (Incremental_inputs::report_script): Rewrite.
9411 (Incremental_inputs::finalize): Do nothing but finalize string table.
9412 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9413 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9414 (Incremental_inputs::create_data_sections): New function.
9415 (Incremental_inputs::relocs_entsize): New function.
9416 (Output_section_incremental_inputs::set_final_data_size): New function.
9417 (Output_section_incremental_inputs::do_write): New function.
9418 (Output_section_incremental_inputs::write_header): New function.
9419 (Output_section_incremental_inputs::write_input_files): New function.
9420 (Output_section_incremental_inputs::write_info_blocks): New function.
9421 (Output_section_incremental_inputs::write_symtab): New function.
9422 * incremental.h (Incremental_script_entry): Forward declaration.
9423 (Incremental_object_entry): Forward declaration.
9424 (Incremental_archive_entry): Forward declaration.
9425 (Incremental_inputs): Forward declaration.
9426 (Incremental_inputs_header_data): Remove.
9427 (Incremental_inputs_header): Remove.
9428 (Incremental_inputs_header_write): Remove.
9429 (Incremental_inputs_entry_data): Remove.
9430 (Incremental_inputs_entry): Remove.
9431 (Incremental_inputs_entry_write): Remove.
9432 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9433 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9434 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9435 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9436 Likewise.
9437 (Incremental_input_entry): New class.
9438 (Incremental_script_entry): New class.
9439 (Incremental_object_entry): New class.
9440 (Incremental_archive_entry): New class.
9441 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9442 (Incremental_inputs::report_inputs): Remove.
9443 (Incremental_inputs::report_archive): Remove.
9444 (Incremental_inputs::report_archive_begin): New function.
9445 (Incremental_inputs::report_archive_end): New function.
9446 (Incremental_inputs::report_object): Change prototype.
9447 (Incremental_inputs::report_input_section): New function.
9448 (Incremental_inputs::report_script): Change prototype.
9449 (Incremental_inputs::get_reloc_count): New function.
9450 (Incremental_inputs::set_reloc_count): New function.
9451 (Incremental_inputs::create_data_sections): New function.
9452 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9453 (Incremental_inputs::inputs_section): New function.
9454 (Incremental_inputs::symtab_section): New function.
9455 (Incremental_inputs::relocs_section): New function.
9456 (Incremental_inputs::get_stringpool): Add const.
9457 (Incremental_inputs::command_line): Add const.
9458 (Incremental_inputs::inputs): Remove.
9459 (Incremental_inputs::command_line_key): New function.
9460 (Incremental_inputs::input_file_count): New function.
9461 (Incremental_inputs::input_files): New function.
9462 (Incremental_inputs::relocs_entsize): New function.
9463 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9464 (Incremental_inputs::finalize_inputs): Remove.
9465 (Incremental_inputs::Input_info): Remove.
9466 (Incremental_inputs::lock_): Remove.
9467 (Incremental_inputs::inputs_): Change type.
9468 (Incremental_inputs::inputs_map_): Remove.
9469 (Incremental_inputs::current_object_entry_): New data member.
9470 (Incremental_inputs::inputs_section_): New data member.
9471 (Incremental_inputs::symtab_section_): New data member.
9472 (Incremental_inputs::relocs_section_): New data member.
9473 (Incremental_inputs::reloc_count_): New data member.
9474 (Incremental_inputs_reader): New class.
9475 (Incremental_symtab_reader): New class.
9476 (Incremental_relocs_reader): New class.
9477 * layout.cc (Layout::finalize): Move finalization of incremental info
9478 and creation of incremental info sections to follow finalization of
9479 symbol table. Set offsets for postprocessing sections.
9480 (Layout::create_incremental_info_sections): Call
9481 Incremental_inputs::create_data_sections. Add incremental symtab
9482 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9483 sections to layout after input sections.
9484 * layout.h (struct Timespec): Forward declaration.
9485 (Layout::incremental_inputs): Add const.
9486 (Layout::create_incremental_info_sections): Add parameter.
9487 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9488 * object.cc: Include incremental.h.
9489 (Relobj::finalize_incremental_relocs): New function.
9490 (Sized_relobj::do_layout): Record input sections in incremental info.
9491 * object.h (Object::output_section): New function.
9492 (Object::output_section_offset): Moved from Relobj.
9493 (Object::get_incremental_reloc_base): New function.
9494 (Object::get_incremental_reloc_count): New function.
9495 (Object::do_output_section): New function.
9496 (Object::do_output_section_offset): Moved from Relobj.
9497 (Object::do_get_incremental_reloc_base): New function.
9498 (Object::do_get_incremental_reloc_count): New function.
9499 (Object::Object): Initialize new data members.
9500 (Relobj::output_section): Renamed do_output_section and moved to
9501 protected.
9502 (Relobj::output_section_offset): Moved to Object.
9503 (Relobj::do_get_incremental_reloc_base): New function.
9504 (Relobj::do_get_incremental_reloc_count): New function.
9505 (Relobj::allocate_incremental_reloc_counts): New function.
9506 (Relobj::count_incremental_reloc): New function.
9507 (Relobj::finalize_incremental_relocs): New function.
9508 (Relobj::next_incremental_reloc_index): New function.
9509 (Relobj::reloc_counts_): New data member.
9510 (Relobj::reloc_bases_): New data member.
9511 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9512 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9513 (Sized_relobj::incremental_relocs_scan): New function.
9514 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9515 (Sized_relobj::incremental_relocs_write): New function.
9516 (Sized_relobj::incremental_relocs_write_reltype): New function.
9517 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9518 incremental link.
9519 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9520 archives and object files elsewhere.
9521 (Add_symbols::run): Report object files here.
9522 (Finish_group::run): Report end of archive at end of group.
9523 * reloc.cc: Include layout.h, incremental.h.
9524 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9525 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9526 (Sized_relobj::incremental_relocs_scan): New function.
9527 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9528 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9529 (Sized_relobj::incremental_relocs_write): New function.
9530 (Sized_relobj::incremental_relocs_write_reltype): New function.
9531 * script.cc (read_input_script): Rewrite test for incremental link.
9532 Change call to Incremental_inputs::report_script.
9533 * symtab.h (Symbol_table::first_global_index): New function.
9534 (Symbol_table::output_count): New function.
9535
ce0d1972
DK
95362010-08-12 Doug Kwan <dougkwan@google.com>
9537
9538 * arm.cc (Target_arm::merge_object_attributes): Check command line
9539 options --no-wchar-size-warning and --no-enum-size-warning.
9540 * options.h (General_options): Add ld-compatible options
9541 --no-enum-size-warning and --no-wchar-size-warning.
9542
6e5710ce
ILT
95432010-08-04 Ian Lance Taylor <iant@google.com>
9544
9545 * x86_64.cc (Target_x86_64::Scan::local): Use
9546 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9547 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9548 (Target_x86_64::Scan::global): Likewise.
9549 (Target_x86_64::Relocate::relocate): Likewise.
9550 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9551 Likewise.
9552
fef830db
CC
95532010-08-03 Cary Coutant <ccoutant@google.com>
9554
9555 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9556 to reserve space in merged_strings vector. Keep total input size
9557 for stats.
9558 (Output_merge_string::do_print_merge_stats): Print total input size.
9559 * merge.h (Output_merge_string): Add input_size_ field.
9560 * stringpool.cc (Stringpool_template::string_length): Move
9561 implementations out of Stringpool_template class and place in
9562 stringpool.h.
9563 * stringpool.h (string_length): Move out of Stringpool_template.
9564
1e3811b0
ILT
95652010-08-03 Ian Lance Taylor <iant@google.com>
9566
9567 PR 11712
9568 * layout.cc (relaxation_loop_body): If address of load segment is
9569 set, adjust address to include headers if possible.
9570
7af0c620
ILT
95712010-08-03 Ian Lance Taylor <iant@google.com>
9572
9573 * version.cc (version_string): Bump to 1.10.
9574
22f0da72
ILT
95752010-08-03 Ian Lance Taylor <iant@google.com>
9576
9577 PR 11805
9578 * layout.h (enum Output_section_order): Define.
9579 (class Layout): Update declarations.
9580 * layout.cc (Layout::get_output_section): Add order parameter.
9581 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9582 is_first_non_relro parameters. Change all callers.
9583 (Layout::choose_output_section): Likewise.
9584 (Layout::add_output_section_data): Likewise.
9585 (Layout::make_output_section): Likewise. Set order.
9586 (Layout::default_section_order): New function.
9587 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9588 * output.cc (Output_section::Output_section): Initialize order_.
9589 Don't initialize deleted fields.
9590 (Output_segment::Output_segment): Don't initialize deleted
9591 fields.
9592 (Output_segment::add_output_section_to_load): New function
9593 replacing add_output_section. Change all callers to call this or
9594 add_output_section_to_nonload.
9595 (Output_segment::add_output_section_to_nonload): New function.
9596 (Output_segment::remove_output_section): Rewrite.
9597 (Output_segment::add_initial_output_data): Likewise.
9598 (Output_segment::has_any_data_sections): Likewise.
9599 (Output_segment::is_first_section_relro): Likewise.
9600 (Output_segment::maximum_alignment): Likewise.
9601 (Output_segment::has_dynamic_reloc): New function replacing
9602 dynamic_reloc_count. Change all callers.
9603 (Output_segment::has_dynamic_reloc_list): New function replacing
9604 dynamic_reloc_count_list. Change all callers.
9605 (Output_segment::set_section_addresses): Rewrite.
9606 (Output_segment::set_offset): Rewrite.
9607 (Output_segment::find_first_and_last_list): Remove.
9608 (Output_segment::set_tls_offsets): Rewrite.
9609 (Output_segment::first_section_load_address): Likewise.
9610 (Output_segment::output_section_count): Likewise.
9611 (Output_segment::section_with_lowest_load_address): Likewise.
9612 (Output_segment::write_section_headers): Likewise.
9613 (Output_segment::print_sections_to_map): Likewise.
9614 * output.h (class Output_data): Remove dynamic_reloc_count_
9615 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9616 (Output_data::add_dynamic_reloc): Rewrite.
9617 (Output_data::has_dynamic_reloc): New function.
9618 (Output_data::dynamic_reloc_count): Remove.
9619 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9620 is_last_relro_, is_first_non_relro_, is_interp_,
9621 is_dynamic_linker_section_ fields. Add order and set_order
9622 functions. Remove is_relro_local, set_is_relro_local,
9623 is_last_relro, set_is_last_relro, is_first_non_relro,
9624 set_is_first_non_relro functions, is_interp, set_is_interp,
9625 is_dynamic_linker_section, and set_is_dynamic_linker_section
9626 functions.
9627 (class Output_segment): Change Output_data_list from std::list to
9628 std:;vector. Add output_lists_ field. Remove output_data_ and
9629 output_bss_ fields. Update declarations.
9630
3ff2ccb0
ILT
96312010-08-02 Ian Lance Taylor <iant@google.com>
9632
9633 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9634 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9635 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9636
88a4108b
ILT
96372010-08-02 Ian Lance Taylor <iant@google.com>
9638
9639 PR 11855
9640 * script.cc (Script_options::Script_options): Initialize
9641 symbol_definitions_ and symbol_references_.
9642 (Script_options::add_symbol_assignment): Update
9643 symbol_definitions_ and symbol_references_.
9644 (Script_options::add_symbol_reference): New function.
9645 (script_symbol): New function.
9646 * script.h (class Script_options): Add symbol_definitions_ and
9647 symbol_references_ fields.
9648 (Script_options::referenced_const_iterator): New type.
9649 (Script_options::referenced_begin): New function.
9650 (Script_options::referenced_end): New function.
9651 (Script_options::is_referenced): New function.
9652 (Script_options::any_unreferenced): New function.
9653 * script-c.h (script_symbol): Declare.
9654 * yyscript.y (exp): Call script_symbol.
9655 * symtab.cc: Include "script.h".
9656 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9657 Change all callers. Check symbols referenced by scripts.
9658 (Symbol_table::add_undefined_symbols_from_command_line): Add
9659 layout parameter. Change all callers.
9660 (Symbol_table::do_add_undefined_symbols_from_command_line):
9661 Likewise. Break out loop body. Check symbols referenced by
9662 scripts.
9663 (Symbol_table::add_undefined_symbol_from_command_line): New
9664 function broken out of
9665 do_add_undefined_symbols_from_command_line.
9666 * symtab.h (class Symbol_table): Update declarations.
9667 * archive.cc: Include "layout.h".
9668 (Archive::should_include_member): Add layout parameter. Change
9669 all callers. Check for symbol mentioned in expression.
9670 * archive.h (class Archive): Update declaration.
9671 * object.cc (Sized_relobj::do_should_include_member): Add layout
9672 parameter.
9673 * object.h (Object::should_include_member): Add layout parameter.
9674 Change all callers.
9675 (Object::do_should_include_member): Add layout parameter.
9676 (class Sized_relobj): Update declaration.
9677 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9678 parameter.
9679 * dynobj.h (class Sized_dynobj): Update declaration.
9680 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9681 layout parameter.
9682 * plugin.h (class Sized_pluginobj): Update declaration.
9683
5f1ab67a
ILT
96842010-08-02 Ian Lance Taylor <iant@google.com>
9685
9686 PR 11866
9687 * output.cc (Output_segment::set_offset): Search for the first and
9688 last sections rather than assuming that the list is in order.
9689 (Output_segment::find_first_and_last_list): New function.
9690 * output.h (class Output_segment): Update declarations.
9691 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9692 (relro_strip_test_SOURCES): New variable.
9693 (relro_strip_test_DEPENDENCIES): New variable.
9694 (relro_strip_test_LDFLAGS): New variable.
9695 (relro_strip_test_LDADD): New variable.
9696 (relro_strip_test.so): New target.
9697
a8df5856
ILT
96982010-08-02 Ian Lance Taylor <iant@google.com>
9699
9700 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9701 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9702 (Target_i386::got_tlsdesc_section): New function.
9703 (Target_i386::got_section): Create space for GOT entries for
9704 TLSDESC relocations.
9705 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9706 R_386_TLS_GOTDESC.
9707 (Target_i386::Scan::global): Likewise.
9708 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9709 using TLSDESC GOT.
9710 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9711 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9712 (Target_x86_64::got_tlsdesc_section): New function.
9713 (Target_x86_64::got_section): Create space for GOT entries for
9714 TLSDESC relocations.
9715 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9716 R_386_TLS_GOTDESC.
9717 (Target_x86_64::Scan::global): Likewise.
9718 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9719 using TLSDESC GOT.
9720
0c10a0a6
ILT
97212010-08-02 Ian Lance Taylor <iant@google.com>
9722
9723 * testsuite/final_layout.sh: Use dc to convert from hex to
9724 decimal.
9725
41cbeecc
ST
97262010-07-29 Sriraman Tallam <tmsriram@google.com>
9727
9728 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9729 paramter to the call to gold::gc_process_relocs.
9730 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9731 paramter to the call to gold::gc_process_relocs.
9732 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9733 parameter to the call to gold::gc_process_relocs.
9734 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9735 template parameter to the call to gold::gc_process_relocs.
9736 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9737 paramter to the call to gold::gc_process_relocs.
9738 * gc.h (get_embedded_addend_size): New function.
9739 (gc_process_relocs): Save the size of the reloc for use by ICF.
9740 * icf.cc (get_section_contents): Get the addend from the text section
9741 for SHT_REL relocation sections.
9742 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9743 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9744 * int_encoding.h (read_from_pointer): New overloaded function.
9745 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9746 * testsuite/icf_sht_rel_addend_test.sh: New file.
9747 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9748 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9749
6ea55b82
RW
97502010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9751
9752 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9753 * Makefile.in: Regenerate.
9754 * testsuite/Makefile.in: Regenerate.
9755
9691462b
ILT
97562010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9757
9758 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9759 * gold/testsuite/debug_msg.cc: Likewise.
9760 * gold/testsuite/odr_violation1.cc
9761 * gold/testsuite/odr_violation2.cc
9762
76897331
CC
97632010-07-21 Cary Coutant <ccoutant@google.com>
9764
9765 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9766 string, and length fields.
9767 (Output_merge_string::Merged_strings_list): New type.
9768 (Output_merge_string::Merged_strings_lists): New typedef.
9769 (Output_merge_string): Replace merged_strings_ with
9770 merged_strings_lists_.
9771 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9772 Merged_strings_list per input object and section. Don't store pointer
9773 to the string. Don't store length with each merged string entry.
9774 (Output_merge_string::finalize_merged_data): Loop over list of merged
9775 strings lists. Recompute length of each merged string.
9776
78384e8f
CC
97772010-07-15 Cary Coutant <ccoutant@google.com>
9778
9779 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9780 here.
9781
783659f9
ILT
97822010-07-14 Ian Lance Taylor <iant@google.com>
9783
9784 * descriptors.cc (Descriptors::open): Report correct name in error
9785 message.
9786
131687b4
DK
97872010-07-13 Doug Kwan <dougkwan@google.com>
9788
9789 * arm.cc (Arm_input_section::Arm_input_section): For a
9790 SHT_ARM_EXIDX section, always keeps the input sections.
9791 (Arm_input_section::set_exidx_section_link): New method.
9792 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9793 has_errors_ to false.
9794 (Arm_exidx_input_section::has_errors,
9795 Arm_exidx_input_section::set_has_errors): New methods.
9796 (Arm_exidx_input_section::has_errors_): New data member.
9797 (Arm_relobj::get_exidx_shndx_list): New method.
9798 (Arm_output_section::append_text_sections_to_list): Do not skip
9799 section without SHF_EXECINSTR.
9800 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9801 errors.
2e702c99 9802 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9803 section header. Make error messages more verbose. Check for
9804 a non-executable section linked to an EXIDX section.
9805 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9806 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9807 check that there is no deferred EXIDX section if we exit early.
9808 Instead of not making an EXIDX section in case of an error, make one
9809 and set the has_errors flag of it.
9810 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9811 in a relocatable link.
9812 (Target_arm::do_relax): Look for the EXIDX output section instead of
9813 assuming that it is called .ARM.exidx.
2e702c99 9814 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9815 section list. Do not check for SHF_EXECINSTR section flags but
9816 skip any input section with errors.
9817 * output.cc (Output_section::Output_section): Initialize
9818 always_keeps_input_sections_ to false.
9819 (Output_section::add_input_section): Check for
9820 always_keeps_input_sections_.
9821 * output.h (Output_section::always_keeps_input_sections,
9822 Output_section::set_always_keeps_input_sections): New methods.
9823 (Output_section::always_keeps_input_sections): New data member.
9824
69517287
RÁE
98252010-07-13 Rafael Espindola <espindola@google.com>
9826
9827 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9828 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9829
82742395
ILT
98302010-07-13 Philip Herron <herron.philip@googlemail.com>
9831 Ian Lance Taylor <iant@google.com>
9832
9833 * output.h (Output_section_lookup_maps::add_merge_section):
9834 Correct check of whether value was inserted.
9835 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9836 (Output_section_lookup_maps::add_relaxed_input_section):
9837 Likewise.
9838 * arm.cc (Target_arm::got_section): Remove used local os.
9839 * i386.cc (Target_i386::got_section): Likewise.
9840 * x86_64.cc (Target_x86_64::got_section): Likewise.
9841 * sparc.cc (Target_sparc::got_section): Likewise.
9842 (Target_sparc::relocate): Remove unused local have_got_offset.
9843 * powerpc.cc (Target_powerpc::relocate): Likewise.
9844
f2d707b5
ILT
98452010-07-13 Ian Lance Taylor <iant@google.com>
9846
241531d6
ILT
9847 * compressed_output.cc (zlib_decompress): Fix signature in
9848 !HAVE_ZLIB_H case.
9849
f2d707b5
ILT
9850 * archive.cc (Archive::include_member): Unlock an external member
9851 of a thin archive. Don't bother to delete an object we know is
9852 NULL.
9853
a2e47362
CC
98542010-07-12 Cary Coutant <ccoutant@google.com>
9855
9856 * compressed_output.cc (zlib_decompress): New function.
9857 (get_uncompressed_size): New function.
9858 (decompress_input_section): New function.
9859 * compressed_output.h (get_uncompressed_size): New function.
9860 (decompress_input_section): New function.
9861 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9862 Handle compressed debug sections.
9863 * layout.cc (is_compressed_debug_section): New function.
9864 (Layout::output_section_name): Map compressed section names to
9865 canonical names.
9866 * layout.h (is_compressed_debug_section): New function.
9867 (is_debug_info_section): Recognize compressed debug sections.
9868 * merge.cc: Include compressed_output.h.
9869 (Output_merge_data::do_add_input_section): Handle compressed
9870 debug sections.
9871 (Output_merge_string::do_add_input_section): Handle compressed
9872 debug sections.
9873 * object.cc: Include compressed_output.h.
9874 (Sized_relobj::Sized_relobj): Initialize new data members.
9875 (build_compressed_section_map): New function.
9876 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9877 * object.h (Object::section_is_compressed): New method.
9878 (Object::do_section_is_compressed): New method.
9879 (Sized_relobj::Compressed_section_map): New type.
9880 (Sized_relobj::do_section_is_compressed): New method.
9881 (Sized_relobj::compressed_sections_): New data member.
9882 * output.cc (Output_section::add_input_section): Handle compressed
9883 debug sections.
9884 * reloc.cc: Include compressed_output.h.
9885 (Sized_relobj::write_sections): Handle compressed debug sections.
9886
ce279a62
CC
98872010-07-08 Cary Coutant <ccoutant@google.com>
9888
9889 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9890 weak when resolving to a dynamic def.
9891 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9892 for weak undef/dynamic def cases. Adjust callers.
9893 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9894 undef_binding_weak_.
9895 (Symbol_table::sized_write_globals): Adjust symbol binding.
9896 (Symbol_table::sized_write_symbol): Add binding parameter.
9897 * symtab.h (Symbol::set_undef_binding): New method.
9898 (Symbol::is_undef_binding_weak): New method.
9899 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9900 (Symbol_table::should_override): Add new parameter.
9901 (Symbol_table::sized_write_symbol): Add new parameter.
9902
9903 * testsuite/weak_undef_file1.cc: Add new test case.
9904 * testsuite/weak_undef_file2.cc: Fix header comment.
9905 * testsuite/weak_undef_test.cc: Add new test case.
9906
b2286c10
DK
99072010-06-29 Doug Kwan <dougkwan@google.com>
9908
9909 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9910 Initialize USE_SYMBOL_.
9911 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9912 definition.
9913 (Arm_reloc_property::uses_symbol_): New data member declaration.
9914 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9915 uses symbol value and symbol is undefined but not weakly undefined.
9916
4802450a
RÁE
99172010-06-28 Rafael Espindola <espindola@google.com>
9918
9919 * plugin.cc (Plugin::load): Use dlerror.
9920
e5ca47ba
ILT
99212010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9922
9923 * symtab.cc (detect_odr_violations): When reporting an ODR
9924 violation, report an object where the symbol is defined.
9925
8a75a161
DK
99262010-06-25 Doug Kwan <dougkwan@google.com>
9927
9928 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9929 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9930 definition.
9931 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9932 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9933 target hook to detect function points.
9934 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9935 * icf.h (Icf::check_section_for_function_pointers): Change type of
9936 parameter SECTION_NAME to const reference to std::string. Use
9937 target hook to determine if section may have unsafe pointers.
9938 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9939 method definition.
9940
42218b9f
RÁE
99412010-06-21 Rafael Espindola <espindola@google.com>
9942
9943 * fileread.cc (Input_file::find_fie): New
9944 (Input_file::open): Use Input_file::find_fie.
9945 * fileread.h (Input_file::find_fie): New
9946 * plugin.cc (set_extra_library_path): New.
9947 (Plugin::load): Add set_extra_library_path to the transfer vector.
9948 (Plugin_manager::set_extra_library_path): New.
9949 (Plugin_manager::add_input_file): Use the extra search path if set.
9950 (set_extra_library_path(): New.
9951 * plugin.h (Plugin_manager): Add set_extra_library_path and
9952 extra_search_path_.
9953
a0506cca
CC
99542010-06-19 Cary Coutant <ccoutant@google.com>
9955
9956 * layout.cc (gdb_sections): Add .debug_types.
9957 (lines_only_debug_sections): Likewise.
9958
6508b958
RÁE
99592010-06-18 Rafael Espindola <espindola@google.com>
9960
9961 * plugin.cc (add_input_file,add_input_library)
9962 (Plugin_manager::add_input_file): Make filename arguments const.
9963 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9964 const.
9965
3e235302
DK
99662010-06-16 Doug Kwan <dougkwan@google.com>
9967
9968 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9969 .ARM.attributes section if we have not merged any input
9970 attributes sections.
9971
106e8a6c
DK
99722010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9973
9974 * arm.cc: Allow combining objects with no EABI version
9975 information.
9976
91ff43fe
RÁE
99772010-06-15 Rafael Espindola <espindola@google.com>
9978
9979 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9980
68ed838c
ILT
99812010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9982
9983 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9984 (struct iovec): Correct !HAVE_READV definition.
9985
f3a2388f
CC
99862010-06-10 Cary Coutant <ccoutant@google.com>
9987
9988 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9989 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9990 reloc sections.
9991 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9992
9993 PR 11683
9994 * symtab.h (Symbol::is_placeholder): New member function.
9995 * target-reloc.h (relocate_section): Check for placeholder symbols.
9996
9997 * testsuite/Makefile.am (plugin_test_8): New test.
9998 (plugin_test_9): New test.
9999 * testsuite/Makefile.in: Regenerate.
10000
e1df38aa
NC
100012010-06-09 Nick Clifton <nickc@redhat.com>
10002
10003 * yyscript.y (input_list_element): Allow strings prefixed with
10004 the '-' character. Treat these as libraries.
10005 * script.cc (script_add_library): New function. Adds a library
10006 specified by "-l<name>" found in an input script.
10007 * script-c.h: Add prototype for script_add_library.
10008
25bbe950
DK
100092010-06-07 Doug Kwan <dougkwan@google.com>
10010
10011 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10012 Restrict stub-group size to be within long conditional branch
10013 range when working around cortex-A8 erratum.
10014
0f32ea4c
ILT
100152010-06-07 Damien Diederen <dd@crosstwine.com>
10016
10017 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10018 #ifdef typo.
10019
8fe2a369
ST
100202010-06-03 Sriraman Tallam <tmsriram@google.com>
10021
10022 PR gold/11658
10023 * output.cc
10024 (Output_section::Input_section_sort_entry::compare_section_ordering):
10025 Change to return non-zero correctly.
10026 (Output_section::Input_section_sort_section_order_index_compare
10027 ::operator()): Change to fix ambiguity in comparisons.
10028
6e9ba2ca
ST
100292010-06-01 Sriraman Tallam <tmsriram@google.com>
10030
10031 * gold.h (is_wildcard_string): New function.
10032 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10033 (Layout::layout_eh_frame): Ditto.
10034 (Layout::find_section_order_index): New method.
10035 (Layout::read_layout_from_file): New method.
10036 * layout.h (Layout::find_section_order_index): New method.
10037 (Layout::read_layout_from_file): New method.
10038 (Layout::input_section_position_): New private member.
10039 (Layout::input_section_glob_): New private member.
10040 * main.cc (main): Call read_layout_from_file here.
10041 * options.h (--section-ordering-file): New option.
10042 * output.cc (Output_section::input_section_order_specified_): New
10043 member.
10044 (Output_section::Output_section): Initialize new member.
10045 (Output_section::add_input_section): Add new parameter.
10046 Keep input sections when --section-ordering-file is used.
10047 (Output_section::set_final_data_size): Sort input sections when
10048 section ordering file is specified.
10049 (Output_section::Input_section_sort_entry): Add new parameter.
10050 Check sorting type.
10051 (Output_section::Input_section_sort_entry::compare_section_ordering):
10052 New method.
10053 (Output_section::Input_section_sort_compare::operator()): Change to
10054 consider section_order_index.
10055 (Output_section::Input_section_sort_init_fini_compare::operator()):
10056 Change to consider section_order_index.
10057 (Output_section::Input_section_sort_section_order_index_compare
10058 ::operator()): New method.
10059 (Output_section::sort_attached_input_sections): Change to sort
10060 according to section order when specified.
e1df38aa
NC
10061 (Output_section::add_input_section<32, true>): Add new parameter.
10062 (Output_section::add_input_section<64, true>): Add new parameter.
10063 (Output_section::add_input_section<32, false>): Add new parameter.
10064 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
10065 * output.h (Output_section::add_input_section): Add new parameter.
10066 (Output_section::input_section_order_specified): New
10067 method.
10068 (Output_section::set_input_section_order_specified): New method.
10069 (Input_section::Input_section): Initialize section_order_index_.
10070 (Input_section::section_order_index): New method.
10071 (Input_section::set_section_order_index): New method.
10072 (Input_section::section_order_index_): New member.
10073 (Input_section::Input_section_sort_section_order_index_compare): New
10074 struct.
10075 (Output_section::input_section_order_specified_): New member.
10076 * script-sections.cc (is_wildcard_string): Delete and move modified
10077 method to gold.h.
10078 (Output_section_element_input::Output_section_element_input): Modify
10079 call to is_wildcard_string.
10080 (Output_section_element_input::Input_section_pattern
10081 ::Input_section_pattern): Ditto.
10082 (Output_section_element_input::Output_section_element_input): Ditto.
10083 * testsuite/Makefile.am (final_layout): New test case.
10084 * testsuite/Makefile.in: Regenerate.
10085 * testsuite/final_layout.cc: New file.
10086 * testsuite/final_layout.sh: New file.
10087
3537c84b
RÁE
100882010-06-01 Rafael Espindola <espindola@google.com>
10089
10090 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10091
105b6afd
RÁE
100922010-06-01 Rafael Espindola <espindola@google.com>
10093
10094 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10095 visibility of symbols.
10096
29e11421
DK
100972010-05-27 Doug Kwan <dougkwan@google.com>
10098
10099 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10100 from start of output section instead of address for a local symbol
10101 in a merged or relaxed section when doing a relocatable link.
10102
5e0f337e
RÁE
101032010-05-26 Rafael Espindola <espindola@google.com>
10104
703d02da 10105 PR 11604
5e0f337e
RÁE
10106 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10107 adding sections the garbage collector removed.
10108 * gold/testsuite/Makefile.am: Add test.
10109 * gold/testsuite/Makefile.in: Regenerate.
10110 * gold/testsuite/plugin_test_7.sh: New.
10111 * gold/testsuite/plugin_test_7_1.c: New.
10112 * gold/testsuite/plugin_test_7_2.c: New.
10113
f4187277
RÁE
101142010-05-26 Rafael Espindola <espindola@google.com>
10115
10116 * script-sections.cc (Output_section_definition::set_section_addresses):
10117 Check for --section-start.
10118
5c388529
DK
101192010-05-26 Doug Kwan <dougkwan@google.com>
10120
10121 * arm.cc (Arm_scan_relocatable_relocs): New class.
10122 (Target_arm::relocate_special_relocatable): New method.
10123 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10124 (Arm_relocate_functions::thumb_branch_common): Same.
10125 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10126 instead of Default_scan_relocatable_relocs.
10127 * target-reloc.h (relocate_for_relocatable): Let target handle
10128 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10129 * target.h (Sized_target::relocate_special_relocatable): New method.
10130
bca1c3ae
ILT
101312010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10132
10133 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10134
0439c796
DK
101352010-05-23 Doug Kwan <dougkwan@google.com>
10136
10137 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10138 instead of a cast.
10139 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10140 with a direct branch, not a conditional branch, to a stub.
10141 * merge.cc (Output_merge_base::record_input_section): New method
10142 defintion.
10143 (Output_merge_data::do_add_input_section): Record input section if
10144 keeps-input-sections flag is set.
10145 (Output_merge_string::do_add_input_section): Ditto.
10146 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10147 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10148 INPUT_SECTIONS_.
10149 (Output_merge_base::keeps_input_sections,
10150 Output_merge_base::set_keeps_input_sections,
10151 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10152 method definitions.
10153 (Output_merge_base::Input_sections): New type declaration.
10154 (Output_merge_base::input_sections_begin,
10155 Output_merge_base::input_sections_end,
10156 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10157 (Output_merge_base::bool keeps_input_sections_,
10158 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10159 Output_merge_base::input_sections_): New data members.
10160 (Output_merge_data::do_set_keeps_input_sections): New method
10161 defintion.
10162 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10163 * output.cc (Output_section::Input_section::relobj): Move method
10164 defintion from class declaration to here and handle merge sections.
10165 (Output_section::Input_section::shndx): Ditto.
10166 (Output_section::Output_section): Remove initializations of removed
10167 data members and initialize new data member LOOKUP_MAPS_.
10168 (Output_section::add_input_section): Set keeps-input-sections flag
10169 for a newly created merge output section as appropriate. Adjust code
10170 to use Output_section_lookup_maps class.
10171 (Output_section::add_relaxed_input_section): Adjst code for lookup
10172 maps code refactoring.
2e702c99 10173 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10174 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10175 class. If adding input section to a newly created merge output
10176 section fails, remove the new merge section.
10177 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10178 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10179 (Output_section::find_merge_section): Ditto.
0439c796 10180 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10181 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10182 Output_section_lookup_maps class.
10183 (Output_section::get_input_sections): Export merge sections. Adjust
10184 code to use Output_section_lookup_maps class.
10185 (Output_section:::add_script_input_section): Adjust code to use
10186 Output_section_lookup_maps class. Update lookup maps for merge
10187 sections also.
10188 (Output_section::discard_states): Use Output_section_lookup_maps.
10189 (Output_section::restore_states): Same.
10190 * output.h (Merge_section_properties): Move class defintion out of
10191 Output_section.
10192 (Output_section_lookup_maps): New class.
10193 (Output_section::Input_section::is_merge_section): New method
10194 defintion.
10195 (Output_section::Input_section::relobj): Move defintion out of class
10196 defintion. Declare method only.
10197 (Output_section::Input_section::shndx): Ditto.
10198 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10199 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10200 (Output_section::Merge_section_by_properties_map,
10201 Output_section::Output_section_data_by_input_section_map,
10202 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10203 Remove types.
2e702c99 10204 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10205 KEEPS_INPUT_SECTIONS.
10206 (Output_section::build_lookup_maps): New method declaration.
10207 (Output_section::merge_section_map_,
10208 Output_section::merge_section_by_properties_map_,
10209 Output_section::relaxed_input_section_map_,
10210 Output_section::is_relaxed_input_section_map_valid_): Remove data
10211 members.
10212 (Output_section::lookup_maps_): New data member.
10213
76295588
L
102142010-05-21 Doug Kwan <dougkwan@google.com>
10215
10216 PR gold/11619
10217 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10218 avoid a compilation error.
10219
d103a984
RÁE
102202010-05-19 Rafael Espindola <espindola@google.com>
10221
10222 * script-sections.cc (Output_section_definition::allocate_to_segment):
10223 Update the phdrs_list even when the output section is NULL.
10224 * testsuite/Makefile.am: Add test.
10225 * testsuite/Makefile.in: Regenerate.
10226 * testsuite/script_test_9.cc: New.
10227 * testsuite/script_test_9.sh: New.
10228 * testsuite/script_test_9.t: New.
10229
6625d24e
DK
102302010-05-19 Doug Kwan <dougkwan@google.com>
10231
10232 * arm.cc (Arm_input_section::original_size): New method.
10233 (Arm_input_section::do_addralign): Add a cast.
10234 (Arm_input_section::do_output_offset): Remove static cast.
10235 (Arm_input_section::original_addralign,
10236 Arm_input_section::original_size_): Change type to uint32_t.
10237 (Arm_input_section::init): Add safe casts for section alignment
10238 and size.
10239 (Arm_input_section::set_final_data_size): Do not set address and
10240 offset of stub table.
10241 (Arm_output_section::fix_exidx_coverage): Change use of of
10242 Output_section::Simple_input_section to that of
10243 Output_section::Input_section.
10244 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10245 except for the first pass.
10246 * output.cc (Output_section::get_input_sections): Change type of
10247 input_sections to std::list<Input_section>.
10248 (Output_section::add_script_input_section): Rename from
10249 Output_section::add_simple_input_section. Change type of SIS
10250 parameter from Simple_input_section to Input_section.
10251 * output.h (Output_section::Simple_input_section): Remove class.
10252 (Output_section::Input_section): Change class visibility to public.
10253 (Output_section::Input_section::addralign): Use stored alignments
10254 for special input sections if set.
10255 (Output_section::Input_section::set_addralign): New method.
10256 (Output_section::get_input_sections): Change parameter type from
10257 list of Simple_input_section to list of Input_section.
10258 (Output_section::add_script_input_section): Rename from
10259 Output_section::add_simple_input_section. Change first parameter's
10260 type from Simple_input_section to Input_section and remove the
10261 second and third parameters.
10262 * script-sections.cc (Input_section::Input_section_list): Change
10263 type to list of Output_section::Input_section/
10264 (Input_section_info::Input_section_info): Change parameter type of
10265 INPUT_SECTION to Output_section::Input_section.
10266 (Input_section_info::input_section): Change return type.
10267 (Input_section_info::input_section_): Change type to
10268 Output_section::Input_section.
10269 (Output_section_element_input::set_section_addresses): Adjust code
10270 to use Output_section::Input_section instead of
10271 Output_section::Simple_input_section. Adjust code for renaming
10272 of Output_section::add_simple_input_section.
10273 (Orphan_output_section::set_section_addresses): Ditto.
10274
e1e82ea4
RW
102752010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10276
10277 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10278 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10279
91e75c8a
RÁE
102802010-05-18 Rafael Espindola <espindola@google.com>
10281
10282 * options.cc (General_options::finalize): Handle -nostdlib.
10283 * options.h (nostdlib): New option.
10284 * script.cc (script_add_search_dir): Handle -nostdlib.
10285
da59ad79
DK
102862010-05-12 Doug Kwan <dougkwan@google.com>
10287
10288 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10289 attributes section only if there no attributes section after merging.
10290 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10291 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10292 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10293 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10294 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10295 and arm_attr_merge_7.stdout.
10296 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10297 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10298 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10299 arm_attr_merge_7b.o): New rules.
10300 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10301 arm_attr_merge_7
10302 * testsuite/Makefile.in: Regenerate.
10303 * testsuite/arm_attr_merge.sh: New file.
10304 * testsuite/arm_attr_merge_[67][ab].s: Same.
10305
3e01a7fd
NC
103062010-05-05 Nick Clifton <nickc@redhat.com>
10307
10308 * po/es.po: Updated Spanish translation.
10309
7ad2014a
L
103102010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10311
10312 * Makefile.am (install-exec-local): Properly install gold as
10313 default cross linker.
10314 * Makefile.in: Regenerated.
10315
4fda8867
NC
103162010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10317 Nick Clifton <nickc@redhat.com>
10318
10319 * configure.ac (install_as_default): Define and set to false
10320 unless --enable-gold or --enable-gold=both/gold has been
10321 specified.
10322 * configure: Regenerate.
10323
10324 * Makefile.am (install-exec-local): Install the executable as
10325 'ld.gold'. If install_as_default is true then also install it as
10326 'ld'.
10327 * Makefile.in: Regenerated.
10328
bd288ea2
ILT
103292010-04-24 Ian Lance Taylor <iant@google.com>
10330
10331 * layout.cc (Layout::layout_reloc): In relocatable link don't
10332 combine reloc sections for grouped sections.
10333
ef38fd8a
ST
103342010-04-23 Sriraman Tallam <tmsriram@google.com>
10335
10336 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10337 sections that are not ordinary to icf.
10338 * icf.cc (get_section_contents): Handle relocation pointing to section
10339 with no object or shndx information.
10340 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10341 * testsuite/Makefile.in: Regenerate.
10342 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10343 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10344
f6973bdc
ILT
103452010-04-22 Ian Lance Taylor <iant@google.com>
10346
10347 * expression.cc (Expression::Expression_eval_info): Add
10348 result_alignment_pointer field.
10349 (Expression::eval_with_dot): Add result_alignment_pointer
10350 parameter. Change all callers.
10351 (Expression::eval_maybe_dot): Likewise.
10352 (class Binary_expression): Add alignment_pointer parameter to
10353 left_value and right_value. Change all callers.
10354 (BINARY_EXPRESSION): Set result alignment.
10355 (class Trinary_expression): Add alignment_pointer parameter to
10356 arg2_value and arg3_value. Change all callers.
10357 (Trinary_cond::value): Set result alignment.
10358 (Max_expression::value, Min_expression::value): Likewise.
10359 (Align_expression::value): Likewise.
10360 * script-sections.cc (class Sections_element): Add dot_alignment
10361 parameter to set_section_addresses virtual function. Update
10362 instantiations.
10363 (class Output_section_element): Likewise.
10364 (Script_sections::create_segments): Add dot_alignment parameter.
10365 Change all callers.
10366 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10367 (Script_sections::set_phdrs_clause_addresses): Likewise.
10368 * script-sections.h: Update declarations.
10369 * script.h: Update declarations.
10370 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10371 min_p_align.
10372 * testsuite/script_test_3.t: Set large alignment.
10373 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10374 segment has expected alignment.
10375
9c9c98a5
NC
103762010-04-22 Nick Clifton <nickc@redhat.com>
10377
10378 * po/gold.pot: Updated by the Translation project.
10379 * po/vi.po: Updated Vietnamese translation.
10380
2253bfba
L
103812010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10382
10383 * testsuite/Makefile.am (check_PROGRAMS): Add
10384 icf_virtual_function_folding_test.
10385 * testsuite/Makefile.in: Regenerated.
10386
85fdf906
AH
103872010-04-15 Andrew Haley <aph@redhat.com>
10388
10389 * options.h (merge_exidx_entries): New option.
10390 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10391 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10392 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10393 (Target_arm::merge_exidx_entries): New function.
10394 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10395 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10396 to Arm_exidx_fixup constructor.
10397 Add new arg, merge_exidx_entries.
10398 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10399 Arm_output_section::fix_exidx_coverage.
10400
ce97fa81
ST
104012010-04-18 Sriraman Tallam <tmsriram@google.com>
10402
10403 * icf.cc (get_section_contents): Check for preemptible functions.
10404 Ignore addend when appropriate.
10405 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10406 section folded.
10407 (add_from_relobj): Check for section folded.
10408 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10409 * symtab.h (should_add_dynsym_entry): Add new parameter.
10410 * target-reloc.h (scan_relocs): Check for section folded.
10411 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10412 Check reloc types for function pointers in shared objects.
10413 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10414 case.
10415 (icf_preemptible_functions_test): New test case.
10416 (icf_string_merge_test): New test case.
10417 * testsuite.Makefile.in: Regenerate.
10418 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10419 bar_glob. Refactor code.
10420 * testsuite/icf_preemptible_functions_test.cc: New file.
10421 * testsuite/icf_preemptible_functions_test.sh: New file.
10422 * testsuite/icf_string_merge_test.cc: New file.
10423 * testsuite/icf_string_merge_test.sh: New file.
10424 * testsuite/icf_virtual_function_folding_test.cc: New file.
10425 * testsuite/icf_virtual_function_folding_test.sh: New file.
10426
04ceb17c
DK
104272010-04-14 Doug Kwan <dougkwan@google.com>
10428
10429 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10430 for local symbol recounting if we remove a section due to ICF.
10431 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10432 there are no regular objects in input.
10433
153e7da4
DK
104342010-04-13 Doug Kwan <dougkwan@google.com>
10435
10436 * arm.cc (Arm_input_section::set_final_data_size): Compute
10437 accurate final data size instead of using current data size.
10438
4dbd9faf
DK
104392010-04-09 Doug Kwan <dougkwan@google.com>
10440
10441 * layout.cc (Layout::choose_output_section): Handle script section
10442 types.
10443 (Layout::make_output_section_for_script): Add section type parameter.
10444 Handle script section types.
10445 * layout.h (Layout::make_output_section_for_script): Add section
10446 type parameter.
10447 * output.cc (Output_section::Output_section): Initialize data member
10448 is_noload_.
10449 (Output_section::do_reset_address_and_file_offset): Do not set address
10450 to 0 if section is a NOLOAD section.
10451 * output.h (Output_section::is_noload): New method.
10452 (Output_section::set_is_noload): Ditto.
10453 (Output_section::is_noload_): New data member.
10454 * script-c.h (Script_section_type): New enum type.
10455 (struct Parser_output_section_header): Add new file section_type.
10456 * script-sections.cc (Sections_element::output_section_name): Add
10457 parameter for returning script section type.
10458 (Output_section_definition::output_section_name): Ditto.
10459 (Output_section_definition::section_type)P; New method.
10460 (Output_section_definiton::script_section_type_name): Ditto.
10461 (Output_section_definition::script_section_type_): New data member.
10462 (Output_section_definition::Output_section_definition): Initialize
10463 data member Output_section_definition::script_section_type_.
10464 (Output_section_definition::create_sections): Pass script section type
10465 to Layout::make_output_section_for_script.
10466 (Output_section_definition::output_section_name): Return script
10467 section type to caller.
10468 (Output_section_definition::set_section_address): Do not advance
10469 dot value and load address if section type is NOLOAD. Set address
10470 of NOLOAD sections regardless of section flags.
10471 (Output_section_definition::print): Print section type if it is
10472 not SCRIPT_SECTION_TYPE_NONE.
10473 (Output_section_definition::section_type): New method.
10474 (Output_section_definition::script_section_type_name): Ditto.
10475 (Script_sections::output_section_name): Add new parameter
10476 PSECTION_TYPE for returning script section type. Pass it to
10477 section elements. Handle discard sections.
10478 (Sort_output_sections::operator()): Handle NOLOAD sections.
10479 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10480 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10481 returning script section type.
10482 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10483 INFO and NOLOAD.
10484 * yyscript.y (union): Add new field SECTION_TYPE.
10485 (COPY, DSECT, INFO, NOLOAD): New tokens.
10486 (opt_address_and_section_type): Change type to output_section_header.
10487 (section_type): New non-terminal
10488 (section_header): Handle section type.
2253bfba 10489 (opt_address_and_section_type): Return section type value.
4dbd9faf 10490
721ea635
L
104912010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10492
10493 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10494 * testsuite/plugin_common_test_2.c (foo): Likewise.
10495
6bf924b0
DK
104962010-04-08 Doug Kwan <dougkwan@google.com>
10497
10498 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10499 Output_merge_data.
10500 * output.cc (Output_section::add_merge_input_section): Simplify
10501 code and return status of Output_merge_base::add_input_section.
e1df38aa 10502 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10503 returns true.
10504
24af6f92
DK
105052010-04-07 Doug Kwan <dougkwan@google.com>
10506
10507 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10508 if section is marked as containing instructions but has no mapping
10509 symbols.
10510 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10511 correct section index.
10512 (Arm_relobj::find_linked_text_section): Ditto.
10513
00698fc5
CC
105142010-04-07 Cary Coutant <ccoutant@google.com>
10515
10516 * archive.cc (include_member): Destroy Read_symbols_data object before
10517 releasing file.
10518 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10519 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10520 (Read_symbols_data::~Read_symbols_data) New destructor.
10521 (Section_relocs::Section_relocs) New constructor.
10522 (Section_relocs::~Section_relocs) New destructor.
10523 (Read_relocs_data::Read_relocs_data) New constructor.
10524 (Read_relocs_data::~Read_relocs_data) New destructor.
10525 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10526 pointers to NULL after deleting.
10527
7296d933
DK
105282010-04-07 Doug Kwan <dougkwan@google.com>
10529
10530 * arm.cc: Replace "endianity" with "endianness" in comments.
10531 (Arm_exidx_cantunwind): Ditto.
10532 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10533 (Arm_relobj::merge_flags_and_attributes): New method.
10534 (Arm_relobj::merge_flags_and_attributes_): New data member.
10535 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10536 (Arm_relobj::scan_sections_for_stubs): Ditto.
10537 (Arm_relobj::do_read_symbols): Check to see if we really want to
10538 merge processor-specific flags and attributes. Exit early if
10539 an object is empty except for section names and the undefined symbol.
10540 (Target_arm::do_finalize_sections): Move check for ELF format to
10541 Arm_relobj::do_read_symbols. Merge processor specific flags and
10542 attributes from a regular object only when we have determined that
10543 it is aapropriate. Do not create an .ARM.attributes section in
10544 output if there is no regular input object.
10545 (Target_arm::merge_processor_specific_flags): Check
10546 --warn-mismatch before printing any error.
10547 (Target_arm::merge_object_attributes): Ditto.
10548 * gold.cc (queue_middle_tasks): Handle the case in which there is
10549 no regular object in input.
10550 * options.cc (General_options::parse_EB): New method.
10551 (General_options::parse_EL): Same.
10552 (General_options::General_options): Initialize endianness_.
10553 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10554 New options.
10555 (General_options::Endianness): New enum.
10556 (General_options::endianness): New method.
10557 (General_options::endianness_): New data member.
10558 * parameters.cc (Parameters::set_options): Check target endianness.
10559 (Parameters::set_target_once): Ditto.
10560 (Parameters::check_target_endianness): New method.
10561 (parameters_force_valid_target): If either -EL or -EB is specified,
10562 use it to define endianness of default target.
10563 * parameters.h (Parameters::check_target_endianness): New method
10564 declaration.
10565 * target.h (class Target): Change "endianity" to "endianness"
10566 in comments.
10567
efc8d4f2
RW
105682010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10569
10570 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10571 * configure: Regenerate.
10572 * Makefile.in: Regenerate.
10573 * testsuite/Makefile.in: Regenerate.
10574
be234d88
CC
105752010-04-06 Cary Coutant <ccoutant@google.com>
10576
10577 gcc PR lto/42757
10578 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10579 prevailing definitions of common symbols.
10580 * testsuite/plugin_test_6.sh: New test case.
10581 * testsuite/plugin_common_test_1.c: New test case.
10582 * testsuite/plugin_common_test_2.c: New test case.
10583 * testsuite/Makefile.am (plugin_test_6): New test case.
10584 * testsuite/Makefile.in: Regenerate.
10585
bd32c6bd
NC
105862010-04-06 Nick Clifton <nickc@redhat.com>
10587
10588 * po/vi.po: New Vietnamese translation.
10589
323c532f
DK
105902010-03-30 Doug Kwan <dougkwan@google.com>
10591
10592 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10593
4fcd97eb
DK
105942010-03-25 Doug Kwan <dougkwan@google.com>
10595
10596 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10597 to avoid a conversion warning on a 32-bit host.
10598
4ebf39db
ILT
105992010-03-24 Ian Lance Taylor <iant@google.com>
10600
10601 * testsuite/script_test_3.t: Add a TLS segment.
10602 * testsuite/Makefile.am (check_PROGRAMS): Add
10603 tls_phdrs_script_test.
10604 (tls_phdrs_script_test_SOURCES): Define.
10605 (tls_phdrs_script_test_DEPENDENCIES): Define.
10606 (tls_phdrs_script_test_LDFLAGS): Define.
10607 (tls_phdrs_script_test_LDADD): Define.
10608 * testsuite/Makefile.in: Rebuild.
10609
4a599bdd
CC
106102010-03-23 Cary Coutant <ccoutant@google.com>
10611
10612 * fileread.cc (find_or_make_view): Fix comment.
10613
6c93b22c
ILT
106142010-03-23 Ian Lance Taylor <iant@google.com>
10615
10616 * script-sections.cc (class Orphan_section_placement): Define
10617 PLACE_TLS and PLACE_TLS_BSS.
10618 (Orphan_section_placement::Orphan_section_placement): Initialize
10619 new places.
10620 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10621 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10622 (tls_script_test_SOURCES): Define.
10623 (tls_script_test_DEPENDENCIES): Define.
10624 (tls_script_test_LDFLAGS): Define.
10625 (tls_script_test_LDADD): Define.
10626 * testsuite/Makefile.in: Rebuild.
10627
a2c7281b
DK
106282010-03-22 Doug Kwan <dougkwan@google.com>
10629
10630 * arm.cc (Arm_relocate_functions::abs8,
10631 Arm_relocate_functions::abs16): Use correct check for overflow
10632 specified in the ARM ELF specs.
10633 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10634 target of a BLX instruction specially.
10635 (Reloc_stub::stub_type_for_reloc): Ditto.
10636 (Relocate::relocate): Use symbolic names instead of numeric relocation
10637 codes to report error.
10638 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10639 workaround.
10640 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10641 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10642 thumb2_blx_out_of_range.stdout
10643 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10644 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10645 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10646 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10647 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10648 thumb2_blx_in_range, thumb2_blx_in_range.o,
10649 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10650 thumb2_blx_out_of_range.o): New rules.
2e702c99 10651 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10652 thumb2_blx_in_range and thumb2_blx_out_of_range.
10653 * testsuite/Makefile.in: Regenerate.
10654 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10655 * testsuite/thumb_blx_in_range.s: New file.
10656 * testsuite/thumb_blx_out_of_range.s: New file.
10657
b0193076
RÁE
106582010-03-22 Rafael Espindola <espindola@google.com>
10659
10660 * archive.cc (Should_include): Move to archive.h.
10661 (should_include_member): Make it a member of Archive.
10662 (Lib_group): New.
10663 (Add_lib_group_symbols): New.
10664 * archive.h: Include options.h.
10665 (Archive_member): Moved from Archive.
10666 (Should_include): Moved from archive.cc.
10667 (Lib_group): New.
10668 (Add_lib_group_symbols): New.
10669 * dynobj.cc (do_should_include_member): New.
10670 * dynobj.h (do_should_include_member): New.
10671 * gold.cc (queue_initial_tasks): Update call to queue.
10672 * main.cc (main): Print lib group stats.
10673 * object.cc (do_should_include_member): New.
10674 * object.h: Include archive.h.
10675 (Object::should_include_member): New.
10676 (Object::do_should_include_member): New.
10677 (Sized_relobj::do_should_include_member): New.
10678 * options.cc (General_options::parse_start_lib): New.
10679 (General_options::parse_end_lib): New.
10680 (Input_arguments::add_file): Handle lib groups.
10681 (Input_arguments::start_group): Check we are not in a lib.
10682 (Input_arguments::start_lib): New.
10683 (Input_arguments::end_lib): New.
10684 * options.h (General_options): Add start_lib and end_lib.
10685 (Input_argument::lib_): New.
10686 (Input_argument::lib): New.
10687 (Input_argument::is_lib): New.
10688 (Input_file_lib): New.
10689 (Input_arguments::in_lib_): New.
10690 (Input_arguments::in_lib): New.
10691 (Input_arguments::start_lib): New.
10692 (Input_arguments::end_lib_): New.
10693 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10694 in unused members as preempted.
10695 (Sized_pluginobj::do_should_include_member): New.
10696 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10697 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10698 return the blocker.
10699 (Read_symbols::do_whole_lib_group): New.
10700 (Read_symbols::do_lib_group): New.
10701 (Read_symbols::do_read_symbols): Handle lib groups.
10702 (Read_symbols::get_name): Handle lib groups.
10703 * readsyms.h (Read_symbols): Add an archive member pointer.
10704 (Read_symbols::do_whole_lib_group): New.
10705 (Read_symbols::do_lib_group): New.
10706 (Read_symbols::member_): New.
10707 * script.cc (read_input_script): Update call to queue_soon.
10708
d099120c
DK
107092010-03-19 Doug Kwan <dougkwan@google.com>
10710
10711 * arm.cc (Stub_table::Stub_table): Initialize new data members
10712 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10713 (Stub_table::add_reloc_stub): Assign stub offset and update
10714 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10715 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10716 New data members.
2e702c99 10717 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10718 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10719 instead of going over all reloc stubs.
2e702c99 10720 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10721 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10722 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10723 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10724 Stringpool_template::offset_.
10725 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10726 Stringpool_template::offset_ to zero.
10727
1aa37384
DK
107282010-03-15 Doug Kwan <dougkwan@google.com>
10729
10730 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10731 offset_.
10732 (Stringpool_template::new_key_offset): New method.
10733 (Stringpool_template::add_string): Assign offsets when adding new
10734 strings.
10735 (Stringpool_template::set_string_offsets): Do not set string offsets
10736 when not optimizing.
10737 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10738 member size_.
2e702c99
RM
10739 (Chunked_vector::clear): Clear size_.
10740 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10741 (Chunked_vector::size): Return size_.
10742 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10743 (Chunked_vector::size_): New data member.
1aa37384
DK
10744 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10745 (Stringpool_template::new_key_offset): New method declaration.
10746 (Stringpool_template::offset_): New data member.
10747
b672b057
RÁE
107482010-03-15 Rafael Espindola <espindola@google.com>
10749
10750 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10751 Add_symbols' constructor.
10752 * readsyms.h (Add_symbols): Remove the input_group member.
10753
b6848d3c
ILT
107542010-03-10 Ian Lance Taylor <iant@google.com>
10755
10756 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10757 target to ask whether a reference to a symbol requires a stack
10758 split.
10759 * target.h (Target::is_call_to_non_split): New function.
10760 (Target::do_is_call_to_non_split): Declare virtual function.
10761 * target.cc: Include "symtab.h".
10762 (Target::do_is_call_to_non_split): New function.
10763 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10764
a2a5469e
CC
107652010-03-10 Cary Coutant <ccoutant@google.com>
10766
10767 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10768 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10769 (File_read::open[2]): Add whole_file_view_ to list of views.
10770 (File_read::make_view): Remove test of whole_file_view_.
10771 (File_read::find_or_make_view): Create whole_file_view_ if
10772 necessary.
10773 (File_read::clear_views): Replace bool parameter with enum;
10774 adjust all callers. Don't delete views with permanent data;
10775 do delete cached views and views from archives if
10776 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10777 if clearing the corresponding view.
10778 * fileread.h (File_read::Clear_views_mode): New enum.
10779 (File_read::View::is_permanent_view): New method.
10780 (File_read::clear_views): Replace bool parameter
10781 with enum; adjust all callers.
10782 * options.h (General_options): Change keep_files_mapped option;
10783 add map_whole_files.
10784 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10785 releasing the file.
10786 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10787 the file.
10788
8861f32b
DM
107892010-03-10 David S. Miller <davem@davemloft.net>
10790
10791 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10792
d62d0f5f
ST
107932010-03-09 Sriraman Tallam <tmsriram@google.com>
10794
10795 * icf.cc (get_section_contents): Add '@' marker after processing the
10796 merge reloc.
10797
9177756d
DK
107982010-03-08 Doug Kwan <dougkwan@google.com>
10799
10800 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10801 due to a conversion warning.
10802 (Arm_relobj::update_output_local_symbol_count): Check for local
10803 symbol with unset output index.
10804
9e9e071b
ILT
108052010-03-05 Ian Lance Taylor <iant@google.com>
10806
10807 * options.h (class General_options): Add --spare-dynamic-tags.
10808 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10809 --spare-dynamic-tags.
10810
a81ee015
ILT
108112010-03-05 Ian Lance Taylor <iant@google.com>
10812
10813 * incremental.cc: Include "libiberty.h".
10814
44ec90b9
RO
108152010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10816
10817 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10818 function, is_info_ member.
10819 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10820 (Versions::Versions): Update caller.
10821 (Versions::define_base_version): Likewise.
10822 (Versions::add_def): Likewise.
10823
0897ed3b
ST
108242010-03-03 Sriraman Tallam <tmsriram@google.com>
10825
10826 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10827 (Scan::possible_function_pointer_reloc): New function.
10828 (Scan::local_reloc_may_be_function_pointer): Change to call
10829 possible_function_pointer_reloc.
10830 (Scan::global_reloc_may_be_function_pointer): Ditto.
10831 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10832 relocations in ".data.rel.ro._ZTV" section.
10833 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10834 * testsuite/icf_safe_so_test.cc: Ditto.
10835 * testsuite/icf_safe_test.cc: Ditto.
10836 * testsuite/icf_safe_test.sh: Ditto.
10837
d3bbad62
ILT
108382010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10839 Ian Lance Taylor <iant@google.com>
10840
10841 * target-reloc.h (relocate_section): Check the symbol table index
10842 for -1U before setting the local symbol index.
10843 (scan_relocatable_relocs): If copying the relocation, record that
10844 the local symbol is required.
10845 * object.h (Symbol_value::is_output_symtab_index_set): New
10846 function.
10847 (Symbol_value::may_be_discarded_from_output_symtab): New
10848 function.
10849 (Symbol_value::has_output_symtab_entry): New function.
10850 (Symbol_value::needs_output_symtab_entry): Remove.
10851 (Symbol_value::output_symtab_index): Make sure the symbol index is
10852 set.
10853 (Symbol_value::set_output_symtab_index): Make sure the symbol
10854 index is not set. Make sure the new index is valid.
10855 (Symbol_value::set_must_have_output_symtab_entry): New function.
10856 (Symbol_value::has_output_dynsym_entry): New function.
10857 (Symbol_value::set_output_dynsym_index): Make sure the new index
10858 is valid.
10859 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10860 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10861 local symbol if permitted.
10862 (Sized_relobj::do_finalize_local_symbols): Call
10863 is_output_symtab_index_set rather than needs_output_symtab_entry.
10864 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10865 rather than needs_output_symtab_entry. Call
10866 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10867 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10868 is_output_symtab_index_set rather than needs_output_symtab_entry.
10869 * testsuite/discard_locals_relocatable_test.c: New file.
10870 * testsuite/discard_locals_test.sh: Test -r.
10871 * testsuite/Makefile.am (check_DATA): Add
10872 discard_locals_relocatable_test1.syms,
10873 discard_local_relocatable_test2.syms.
10874 (MOSTLYCLEANFILES): Likewise. Also add
10875 discard_locals_relocatable_test1.lout and
10876 discard_locals_relocatable_test2.out.
10877 (discard_locals_relocatable_test1.syms): New target.
10878 (discard_locals_relocatable_test.o): New target.
10879 (discard_locals_relocatable_test1.out): New target.
10880 (discard_locals_relocatable_test2.syms): New target.
10881 (discard_locals_relocatable_test2.out): New target.
10882 (various): Add missing ../ld-new dependencies.
10883 * testsuite/Makefile.in: Rebuild.
10884
7e8ccf26
NC
108852010-03-03 Nick Clifton <nickc@redhat.com>
10886
10887 * po/fi.po: New Finnish translation.
10888
2a0ff005
DK
108892010-03-01 Doug Kwan <dougkwan@google.com>
10890
10891 * layout.cc (Layout::Layout): Force section types of .init_array*,
10892 .preinit_array* and .fini_array* sections.
10893 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10894 Fix check of return value of std::string::find.().
10895 (Output_section::Input_section_sort_compare::operator()): Remove
10896 comment about .init_array.
10897 (Output_section::Input_section_sort_init_fini_compare::operator()):
10898 New method.
10899 (Output_section::sort_attached_input_sections): Handle .init_array
10900 and .fini_array specially.
10901 * output.h (Output_section::Inut_section_sort_compare): Update
10902 comment.
10903 (Output_section::Input_section_sort_init_fini_compare): New struct.
10904
c3e4ae29
DK
109052010-02-26 Doug Kwan <dougkwan@google.com>
10906
10907 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10908 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10909 * testsuite/debug_msg.sh: Avoid matching source line number for
10910 use of global variable undef_int.
10911
2fd9ae7a
DK
109122010-02-26 Doug Kwan <dougkwan@google.com>
10913
10914 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10915 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10916 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10917 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10918 * options.cc (General_options::General_options): Initialize member
10919 fix_v4bx_.
10920 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10921 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10922 and rm_no_fix_v4bx.stdout
10923 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10924 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10925 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10926 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10927 and arm_no_fix_v4bx.
10928 * Makefile.in: Regenerate.
10929 * testsuite/arm_fix_v4bx.s: New file.
10930 * testsuite/arm_fix_v4bx.sh: Ditto.
10931
67ec7d0b
DK
109322010-02-24 Doug Kwan <dougkwan@google.com>
10933
10934 * arm.cc (Target_arm::got_section): Make the .got section the first
10935 non RELRO section in the data segment.
10936 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10937 suffixes of section names.
10938
10165461
DK
109392010-02-24 Doug Kwan <dougkwan@google.com>
10940
10941 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10942 flags and attributes merging if an input file is a binary file.
10943 * fileread.cc (Input_file::open): Record format of original file.
10944 * fileread.h (Input_file::Format): New enum type.
2e702c99 10945 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10946 (Input_file::format): New method definition.
10947 (Input_file::format_):: New data member.
10948
4a54abbb
DK
109492010-02-24 Doug Kwan <dougkwan@google.com>
10950
10951 * arm.cc (Arm_output_data_got): New class.
10952 (ARM_TCB_SIZE): New constant
10953 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10954 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10955 If user uses a script with a SECTIONS clause, issue only a warning
10956 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10957 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10958 garbage collection.
10959 (Target_arm::got_mode_index_entry): Handle static linking.
10960 (Target_arm::Scan::local): Ditto.
10961 (Target_arm::Scan::global): Ditto.
10962 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10963 all incorrectly implemented relocations.
e1df38aa 10964 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10965 Arm_output_section::fix_exidx_coverage.
10966 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10967 from ".ARM.exidx." and ".ARM.extab.".
10968
ca419a6f
ILT
109692010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10970
10971 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10972 section if it does not already exist.
10973 * attributes.cc (Attributes_section_data::Attributes_section_data):
10974 Don't crash if size is zero.
10975
135b9c78
ILT
109762010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10977 Ian Lance Taylor <iant@google.com>
10978
10979 * gold.cc (queue_middle_tasks): If no input files were opened,
10980 exit.
10981 * workqueue.h (Task_function::Task_function): Assert that there is
10982 a blocker.
10983
bb0bfe4f
DK
109842010-02-22 Doug Kwan <dougkwan@google.com>
10985
10986 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10987 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10988 types to avoid warnings due to different uint64_t implementations
10989 on different hosts.
10990
2a2b6d42
DK
109912010-02-21 Doug Kwan <dougkwan@google.com>
10992
10993 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10994 handling of the maximum backward branch offset.
2e702c99 10995 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10996 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10997 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10998 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10999 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11000 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11001 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11002 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11003 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11004 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11005 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11006 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11007 thumb2_bl_out_of_range.o): New rules.
11008 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11009 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11010 thumb2_bl_out_of_range
11011 * testsuite/Makefile.in: Regenerate.
11012 * testsuite/arm_bl_in_range.s: New file.
11013 * testsuite/arm_bl_out_of_range.s: Ditto.
11014 * testsuite/arm_branch_in_range.sh: Ditto.
11015 * testsuite/arm_branch_range.t: Ditto.
11016 * testsuite/thumb2_branch_range.t: Ditto.
11017 * testsuite/thumb_bl_in_range.s: Ditto.
11018 * testsuite/thumb_bl_out_of_range.s: Ditto.
11019 * testsuite/thumb_branch_range.t: Ditto.
11020
b487ad64
ST
110212010-02-20 Sriraman Tallam <tmsriram@google.com>
11022
11023 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11024 Add reloc offset information.
11025 * icf.cc (get_section_contents): Change iterators to point to the new
11026 vectors. Add reloc offset information to the contents.
11027 * icf.h (Icf::Sections_reachable_info): New typedef.
11028 (Icf::Sections_reachable_list): New typedef.
11029 (Icf::Offset_info): New typedef.
11030 (Icf::Reloc_info): New struct typedef.
11031 (Icf::Reloc_info_list): New typedef.
11032 (Icf::symbol_reloc_list): Delete method.
11033 (Icf::addend_reloc_list): Delete method.
11034 (Icf::section_reloc_list): Delete method.
11035 (Icf::reloc_info_list): New method.
11036 (Icf::reloc_info_list_): New member.
11037
f96accdf
DK
110382010-02-19 Doug Kwan <dougkwan@google.com>
11039
11040 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11041 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11042 * arm.cc (Arm_relocation_functions): New forward declaration.
11043 (Target_arm::Target_arm): Initialize new data members
11044 got_mod_index_offset_ and tls_base_symbol_defined_.
11045 (Target_arm::Relocate::relocate_tls): New method.
11046 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11047 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11048 New methods.
2e702c99 11049 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
11050 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11051 (Target_arm::got_mod_index_offset_,
11052 Target_arm::tls_base_symbol_defined_): New data members.
11053 (Target_arm::Scan::local, Target::Scan::global,
11054 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11055 relocations.
11056
c8761b9a
DK
110572010-02-18 Doug Kwan <dougkwan@google.com>
11058
11059 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11060 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11061 text section as a parameter becuase some broken tools may not set
11062 the link in section header.
11063 (Target_arm::has_got_section): New method.
11064 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11065 without any mapping symbol as data only. Remove warning.
11066 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11067 link in its section header, try to discover the link by inspecting the
11068 REL31 relocation at the beginning of the section.
11069 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11070 in error message.
11071 (Target_arm::Scan::global): Treat any reference to the symbol
11072 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11073
21bb3914
ST
110742010-02-12 Sriraman Tallam <tmsriram@google.com>
11075
11076 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11077 (Scan::global_reloc_may_be_function_pointer): New function.
11078 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11079 (Scan::global_reloc_may_be_function_pointer): New function.
11080 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11081 (Scan::global_reloc_may_be_function_pointer): New function.
11082 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11083 (Scan::global_reloc_may_be_function_pointer): New function.
11084 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11085 (Scan::global_reloc_may_be_function_pointer): New function.
11086 (Scan::possible_function_pointer_reloc): New function.
11087 (Target_x86_64::can_check_for_function_pointers): New function.
11088 * gc.h (gc_process_relocs): Scan relocation types to determine if
11089 function pointers were taken for targets that support it.
11090 * icf.cc (Icf::find_identical_sections): Include functions for
11091 folding in safe ICF whose pointer is not taken.
11092 * icf.h (Secn_fptr_taken_set): New typedef.
11093 (fptr_section_id_): New member.
11094 (section_has_function_pointers): New function.
11095 (set_section_has_function_pointers): New function.
11096 (check_section_for_function_pointers): New function.
11097 * options.h: Fix comment for safe ICF option.
11098 * target.h (can_check_for_function_pointers): New function.
11099 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11100 Modify icf_safe_test for X86-64.
11101 * testsuite/Makefile.in: Regenerate.
11102 * testsuite/icf_safe_so_test.cc: New file.
11103 * testsuite/icf_safe_so_test.sh: New file.
11104 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11105 (main): Change to take pointer to function kept_func_3.
11106 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11107 folding is done correctly for X86-64.
11108
0da6fa6c
DM
111092010-02-12 David S. Miller <davem@davemloft.net>
11110
11111 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11112 is_symbolless parameter.
11113 (Output_reloc<SHT_REL>::is_symbolless): New.
11114 (Output_reloc<SHT_REL>::is_symbolless_): New.
11115 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11116 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11117 (Output_reloc<SHT_RELA>::is_symbolless): New.
11118 (Output_data_reloc::add_global): Handle is_symbolless.
11119 (Output_data_reloc::add_global_relative): Likewise.
11120 (Output_data_reloc::add_local): Likewise.
11121 (Output_data_reloc::add_local_relative): Likewise.
11122 (Output_data_reloc::add_symbolless_global_addend): New.
11123 (Output_data_reloc::add_symbolless_local_addend): New.
11124 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11125 is_symbolless.
11126 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11127 instead of ->is_relative_
11128 (Output_reloc::write): Likewise.
11129 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11130 (Output_reloc::write_rel): Simplify.
11131
11132 * sparc.cc (Target_sparc::Scan::local): Use
11133 ->add_symbolless_local_addend as needed.
11134 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11135 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11136 based upon relocation offset.
11137
e4782e83
DK
111382010-02-11 Doug Kwan <dougkwan@google.com>
11139
11140 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11141 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11142 beginning of function.
11143 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11144 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11145 parameter is_32bit in calls to should_apply_static_reloc.
11146 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11147 (check_DATA): Add arm_abs_global.stdout.
11148 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11149 arm_abs_global.stdout): New rules.
11150 (MOSTLLYCLEANFILES): Add arm_abs_global
11151 * Makefile.in: Regenerate.
11152 * testsuite/arm_abs_global.s: New file.
11153 * testsuite/arm_abs_global.sh: Ditto.
11154 * testsuite/arm_abs_lib.s: Ditto.
11155
93ceb764
ILT
111562010-02-11 Ian Lance Taylor <iant@google.com>
11157
11158 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11159 Read_relocs task.
11160 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11161 Allocate_commons_task first.
11162 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11163 task, rather than symtab_lock_.
11164 (Gc_process_relocs::~Gc_process_relocs): New function.
11165 (Gc_process_relocs::is_runnable): Check this_blocker_.
11166 (Gc_process_relocs::locks): Use next_blocker_ rather than
11167 blocker_.
11168 (Scan_relocs::~Scan_relocs): New function.
11169 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11170 symtab_lock_.
11171 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11172 next_blocker_.
11173 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11174 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11175 constructor accordingly.
11176 (class Gc_process_relocs): Likewise.
11177 (class Scan_relocs): Likewise.
11178 * common.h (class Allocate_commons_task): Remove symtab_lock_
11179 field, and corresponding constructor parameter.
11180 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11181 symtab_lock_.
11182 (Allocate_commons_task::locks): Likewise.
11183
114dfbe1
ILT
111842010-02-11 Ian Lance Taylor <iant@google.com>
11185
11186 * gold-threads.h (class Once): Define.
11187 (class Initialize_lock): Rewrite as child of Once.
11188 * gold-threads.cc (class Once_initialize): Define.
11189 (once_pointer_control): New static variable.
11190 (once_pointer, once_arg): New static variables.
11191 (c_run_once): New static function.
11192 (Once::Once, Once::run_once, Once::internal_run): New functions.
11193 (class Initialize_lock_once): Remove.
11194 (initialize_lock_control): Remove.
11195 (initialize_lock_pointer): Remove.
11196 (initialize_lock_once): Remove.
11197 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11198 (Initialize_lock::initialize): Rewrite.
11199 (Initialize_lock::do_run_once): New function.
11200 * archive.cc (Archive::interpret_header): Only clear name if it is
11201 not already empty.
11202 * fileread.cc: Include "gold-threads.h"
11203 (file_counts_lock): New static variable.
11204 (file_counts_initialize_lock): Likewise.
11205 (File_read::release): Only increment counts when using --stats.
11206 Use a lock around the increment.
11207 * parameters.cc (class Set_parameters_target_once): Define.
11208 (set_parameters_target_once): New static variable.
11209 (Parameters::Parameters): Move here from parameters.h.
11210 (Parameters::set_target): Rewrite.
11211 (Parameters::set_target_once): New function.
11212 (Parameters::clear_target): Move here and rewrite.
11213 * parameters.h (class Parameters): Update declarations. Add
11214 set_parameters_target_once_ field.
11215 (Parameters::Parameters): Move to parameters.cc.
11216 (Parameters::clear_target): Likewise.
11217 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11218 task.
11219 (Start_group::~Start_group): New function.
11220 (Start_group::is_runnable): New function.
11221 (Start_group::locks, Start_group::run): New functions.
11222 (Finish_group::run): Change saw_undefined to size_t.
11223 * readsyms.h (class Start_group): Define.
11224 (class Finish_group): Change saw_undefined_ field to size_t.
11225 (Finish_group::Finish_group): Remove saw_undefined and
11226 this_blocker parameters. Change all callers.
11227 (Finish_group::set_saw_undefined): New function.
11228 (Finish_group::set_blocker): New function.
11229 * symtab.h (class Symbol_table): Change saw_undefined to return
11230 size_t. Change saw_undefined_ field to size_t.
11231 * target-select.cc (Set_target_once::do_run_once): New function.
11232 (Target_selector::Target_selector): Initialize set_target_once_
11233 field. Don't initialize lock_ and initialize_lock_ fields.
11234 (Target_selector::instantiate_target): Rewrite.
11235 (Target_selector::set_target): New function.
11236 * target-select.h (class Set_target_once): Define.
11237 (class Target_selector): Update declarations. Make
11238 Set_target_once a friend. Remove lock_ and initialize_lock_
11239 fields. Add set_target_once_ field.
11240
fa17a3f4
ILT
112412010-02-10 Ian Lance Taylor <iant@google.com>
11242
11243 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11244 queueing any tasks.
11245 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11246 (queue_middle_tasks): Add all blockers before queueing any tasks.
11247 (queue_final_tasks): Likewise.
11248 * token.h (Task_token::add_blockers): New function.
11249 * object.h (Input_objects::number_of_relobjs): New function.
11250
c7177d31
ILT
112512010-02-10 Ian Lance Taylor <iant@google.com>
11252
5de0e392
ILT
11253 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11254 shared, not if not position independent.
11255 * x86_64.cc (Relocate::relocate_tls): Likewise.
11256 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11257 (tls_pie_pic_test): New target.
11258 * testsuite/Makefile.in: Rebuild.
11259
c7177d31
ILT
11260 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11261 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11262 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11263 * testsuite/Makefile.in: Rebuild.
11264
684b268a
DM
112652010-02-09 David S. Miller <davem@davemloft.net>
11266
11267 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11268 R_SPARC_RELATIVE using ->add_local_relative().
11269 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11270
612a8d3d
DM
11271 * output.h (Output_data_dynamic::add_section_size): New method
11272 that takes two Output_data objects.
11273 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11274 entry param. Handle it in initializers.
11275 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11276 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11277 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11278 arg.
11279 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11280 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11281 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11282 for dynrel_includes_plt.
11283 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11284 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11285 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11286 before .rela.plt
11287 (Target_sparc::do_finalize_sections): Update to pass true for
11288 dynrel_includes_plt.
11289 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11290 output before .rela.plt
11291 (Target_powerpc::do_finalize_sections): Update to pass true for
11292 dynrel_includes_plt when 32-bit.
11293
cb1be87e
DK
112942010-02-08 Doug Kwan <dougkwan@google.com>
11295
11296 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11297 method.
11298 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11299 Arm_relobj::scan_section_for_cortex_a8_stubs,
11300 Arm_relobj::do_relocation_section): Instead of calling
11301 Output_section::output_address, use faster
11302 Arm_relobj::simple_input_section_output_address.
11303
705b5121
DM
113042010-02-08 David S. Miller <davem@davemloft.net>
11305
11306 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11307 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11308 relocation helper function.
11309
024c4466
DM
11310 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11311 just like R_SPARC_GOT{10,13,22}.
11312 (Target_sparc::Scan::local): Likewise.
11313 (Target_sparc::Relocate:relocate): Likewise.
11314
9109c078
ILT
113152010-02-06 Ian Lance Taylor <iant@google.com>
11316
11317 * configure.ac: Rewrite targetobjs duplicate removal code to use
11318 only shell constructs.
11319 * configure: Rebuild.
11320
cf846138
DK
113212010-02-05 Doug Kwan <dougkwan@google.com>
11322
11323 PR 11247
11324 * arm.cc (Arm_relobj::section_is_scannable): New method.
11325 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11326 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11327
6cfaf60b
DK
113282010-02-04 Doug Kwan <dougkwan@google.com>
11329
11330 PR 11247
11331 * arm-reloc-property.cc (cstdio): Include.
11332 * configure.ac (targetobjs): Remove duplicates.
11333 * configure: Regenerate.
11334 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11335 big and little endian version for a given address size.
11336
5c57f1be
DK
113372010-02-03 Doug Kwan <dougkwan@google.com>
11338
11339 * arm-reloc-property.cc
11340 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11341 definition.
11342 * arm-reloc-property.h
11343 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11344 New method definition.
11345 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11346 declaration.
11347 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11348 overflow to N.
11349 (GOT_PREL): Change implemented to Y.
11350 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11351 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11352 (Arm_relocate_functions::movw_abs_nc): Remove method.
11353 (Arm_relocate_functions::movt_abs): Ditto.
11354 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11355 (Arm_relocate_functions::thm_movt_abs): Ditto.
11356 (Arm_relocate_functions::movw_rel_nc): Ditto.
11357 (Arm_relocate_functions::movw_rel): Ditto.
11358 (Arm_relocate_functions::movt_rel): Ditto.
11359 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11360 (Arm_relocate_functions:thm_movw_rel): Ditto.
11361 (Arm_relocate_functions:thm_movt_rel): Ditto.
11362 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11363 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11364 New method definitions.
11365 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11366 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11367 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11368 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11369 (Target_arm::Relocate::relocate): Check for non-static or
11370 unimplemented relocation code and exit early. Change calls to
11371 Target_arm::reloc_uses_thumb_bit and
11372 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11373 instead. Refactor code to handle similar relocations to increase
11374 code sharing. Remove check for unsupported relocation code in switch
11375 statement.
11376 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11377 relocation property table to find out size. Change error message to
11378 print out the name of a relocation code instead of the numeric value.
11379 (Target_arm::scan_reloc_for_stub): Use relocation property table
11380 instead of calling Target_arm::reloc_uses_thumb_bit().
11381
218c5831
DK
113822010-02-02 Doug Kwan <dougkwan@google.com>
11383
11384 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11385 types of relaxed input section.
11386
0d31c79d
DK
113872010-02-02 Doug Kwan <dougkwan@google.com>
11388
11389 * Makefile.am (HFILES): Add arm-reloc-property.h.
11390 (DEFFILES): New.
2e702c99
RM
11391 (TARGETSOURCES): Add arm-reloc-property.cc
11392 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11393 (libgold_a_SOURCES): $(DEFFILES)
11394 * Makefile.in: Regenerate.
11395 * arm-reloc-property.cc: New file.
11396 * arm-reloc-property.h: New file.
11397 * arm-reloc.def: New file.
11398 * arm.cc: Update comments.
11399 (arm-reloc-property.h): New included header.
11400 (arm_reloc_property_table): New global variable.
11401 (Target_arm::do_select_as_default_target): New method definition.
11402 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11403 arm-reloc-property to targ_extra_obj.
11404 * parameters.cc (set_parameters_target): Call
11405 Target::select_as_default_target().
11406 * target.h (Target::select_as_default_target): New method definition.
11407 (Target::do_select_as_default_target): Same.
11408
546c7457
DK
114092010-02-01 Doug Kwan <dougkwan@google.com>
11410
11411 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11412 first_output_text_section_.
11413 (Arm_exidx_fixup::first_output_text_section): New method definition.
11414 (Arm_exidx_fixup::first_output_text_section_): New data member.
11415 (Arm_exidx_fixup::process_exidx_section): Record the first text
11416 output section seen.
11417 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11418 and entsize in output section header.
11419
11b861d5
DK
114202010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11421
11422 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11423 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11424 (Arm_relocate_functions::thm_alu11): New Method.
11425 (Arm_relocate_functions::thm_pc8): New Method.
11426 (Arm_relocate_functions::thm_pc12): New Method.
11427 (Target_arm::Scan::local): Handle the relocations.
11428 (Target_arm::Scan::global): Likewise.
11429 (Target_arm::Relocate::relocate): Likewise.
11430 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11431
c9a2c125
DK
114322010-01-29 Doug Kwan <dougkwan@google.com>
11433
11434 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11435 of relocation types as ld.
11436
1521477a
DK
114372010-01-29 Doug Kwan <dougkwan@google.com>
11438
11439 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11440 to public.
11441 (Arm_relocate_functions::thumb_branch_common): Ditto.
11442 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11443 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11444 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11445 Arm_relocate_functions::jump24): Remove.
11446 (Target_arm::Relocate::relocate): Adjust code to call
11447 Arm_relocation_functions::arm_branch_common and
11448 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11449 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11450
e7eca48c
DK
114512010-01-29 Doug Kwan <dougkwan@google.com>
11452
11453 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11454 output_local_symbol_count_needs_update_.
11455 (Arm_relobj::output_local_symbol_count_needs_update,
11456 Arm_relobj::set_output_local_symbol_count_needs_update,
11457 Arm_relobj::update_output_local_symbol_count): New methods.
11458 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11459 member.
11460 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11461 of pointed function as in a R_ARM_PREL31 relocation.
11462 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11463 for output local symbol count updating.
11464 (Target_arm::do_relax): Update output local symbol counts in objects
11465 if necessary.
11466 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11467
02961d7e
ILT
114682010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11469
11470 * arm.cc: Added support for the ARM relocations:
11471 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11472 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11473 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11474 movw_prel_nc).
11475 (Arm_relocate_functions::movw_rel): New method.
11476 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11477 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11478 thm_movw_prel_nc).
11479 (Arm_relocate_functions::thm_movw_rel): New method.
11480 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11481 thm_movt_prel).
11482 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11483 relocations.
11484 (Target_arm::Scan::global): Likewise.
11485 (Target_arm::Relocate::relocate): Likewise.
11486 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11487 Likewise.
11488
b10d2873
ILT
114892010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11490
11491 * arm.cc: Added support for ARM group relocations.
11492 (Target_arm::reloc_needs_sym_origin): New method.
11493 (Arm_relocate_functions::calc_grp_kn): New method.
11494 (Arm_relocate_functions::calc_grp_residual): New method.
11495 (Arm_relocate_functions::calc_grp_gn): New method.
11496 (Arm_relocate_functions::arm_grp_alu): New Method.
11497 (Arm_relocate_functions::arm_grp_ldr): New Method.
11498 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11499 (Arm_relocate_functions::arm_grp_ldc): New Method.
11500 (Target_arm::Scan::local): Handle the ARM group relocations.
11501 (Target_arm::Scan::global): Likewise.
11502 (Target_arm::Relocate::relocate): Likewise.
11503 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11504 Likewise.
11505
2b328d4e
DK
115062010-01-26 Doug Kwan <dougkwan@google.com>
11507
11508 * arm.cc (set): Include.
11509 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11510 pointer type.
2e702c99 11511 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11512 (Arm_output_section::append_text_sections_to_list): New method.
11513 (Arm_output_section::fix_exidx_coverage): Ditto.
11514 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11515 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11516 Relobj::set_section_offset() instead of
11517 Sized_relobj::invalidate_section_offset().
2e702c99 11518 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11519 parameter for section headers. Ignore relocation sections for
11520 unallocated sections and EXIDX sections.
11521 (Target_arm::fix_exidx_coverage): New method.
11522 (Target_arm::output_section_address_less_than): New type.
11523 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11524 linked text section instead of the EXIDX section.
11525 (Arm_output_section::create_stub_group): Add an assertion to check
11526 that this is not an EXIDX output section.
11527 (Arm_output_section::append_text_sections_to_list): New method.
11528 (Arm_output_section::fix_exidx_coverage): Ditto.
11529 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11530 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11531 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11532 first pass.
11533 (Target_arm::fix_exidx_coverage): New method.
11534 * object.h (Relobj::set_output_section): New method.
11535 (Sized_relobj::invalidate_section_offset): Remove method.
11536 (Sized_relobj::do_invalidate_section_offset): Remove method.
11537 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11538
c7f3c371
DK
115392010-01-25 Doug Kwan <dougkwan@google.com>
11540
11541 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11542 Fix warning due to signed and unsigned comparison on a 32-bit host.
11543
8923b24c
DK
115442010-01-22 Doug Kwan <dougkwan@google.com>
11545
11546 * arm.cc (Target_arm::do_relax): Record an output section for section
11547 offset adjustment it contains any stub table that has changed.
11548 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11549 offsets in an output section if necessary.
11550 * output.cc (Output_section::Output_section): Initialize
11551 section_offsets_need_adjustments_.
11552 (Output_section::add_input_section_for_script): Renamed to
11553 Output_section::add_simple_input_section.
11554 (Output_section::save_states): Add a comment.
11555 (Output_section::discard_states): New method defintion.
11556 (Output_section::adjust_section_offsets): Same.
11557 * output.h (Output_section::add_input_section_for_script): Renamed to
11558 Output_section::add_simple_input_section.
11559 (Output_section::discard_states): New method declaration.
11560 (Output_section::adjust_section_offsets): Same.
11561 (Output_section::section_offsets_need_adjustment,
11562 Output_section::set_section_offsets_need_adjustment): New method
11563 definitions.
11564 (Output_section::section_offsets_need_adjustment_): New data member.
11565 * script-sections.cc
11566 (Output_section_element_input::set_section_address): Adjust code for
11567 renaming of Output_section::add_input_section_for_script.
11568 (Orphan_output_section::set_section_address): Same.
11569
9b2fd367
DK
115702010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11571
11572 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11573 Fix_v4bx enum values .
11574 * gold/options.h (General_options): New option definitions.
11575 (General_options::fix_v4bx): New method.
11576 (General_options::Fix_v4bx): New enum.
11577 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11578 (General_options::parse_fix_v4bx_interworking): New method.
11579
80d0d023
DK
115802010-01-22 Doug Kwan <dougkwan@google.com>
11581
11582 * arm.cc (Arm_exidx_fixup): New class.
11583
af2cdeae
DK
115842010-01-21 Doug Kwan <dougkwan@google.com>
11585
11586 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11587 classes.
11588 (Arm_exidx_section_offset_map): New type.
11589
993d07c1
DK
115902010-01-21 Doug Kwan <dougkwan@google.com>
11591
11592 * arm.cc (Arm_exidx_input_section): New class.
11593 (Arm_relobj::exidx_input_section_by_link,
11594 Arm_relobj::exidx_input_section_by_shndx,
11595 Arm_relobj::make_exidx_input_section): New methods.
11596 (read_arm_attributes_section): Remove.
11597 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11598 information about them.
11599 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11600 to here.
11601
5ac169d4
DK
116022010-01-20 Doug Kwan <dougkwan@google.com>
11603
11604 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11605 Input_section_specifier to Section_id.
11606 (Target_arm::new_arm_input_section: Adjust code for change of key
11607 type.
11608 (Target_arm::find_arm_input_section): Ditto.
11609 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11610 (Section_id): Remove.
11611 (Garbage_collection::Section_id_hash): Remove.
11612 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11613 (Section_id): Remove.
11614 (Icf::Section_id_hash): Remove.
11615 * object.h (Section_id, Const_section_id, Section_id_hash,
11616 Const_section_id_hash): New type definitions.
11617 * output.cc (Output_section::add_relaxed_input_section): Change to
11618 use Const_section_id instead of Input_section_specifier as key type.
11619 (Output_section::add_merge_input_section): Ditto.
11620 (Output_section::build_relaxation_map): Change to use Section_id
11621 instead of Input_section_specifier as key type.
2e702c99 11622 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11623 Ditto.
11624 (Output_section::convert_input_sections_to_relaxed_sections): Change
11625 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11626 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11627 (Output_section::find_relaxed_input_section): Ditto.
11628 * output.h (Input_section_specifier): Remove class.
11629 (Output_section::Output_section_data_by_input_section_map): Change
11630 key type to Const_section_id.
11631 (Output_section::Output_relaxed_input_section_by_input_section_map):
11632 Ditto.
11633 (Output_section::Relaxation_map): Change key type to Section_id.
11634
a2162063
ILT
116352010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11636
11637 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11638 (class Arm_v4bx_stub): New class.
11639 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11640 (Stub_factory::make_arm_v4bx_stub): New method.
11641 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11642 (Stub_table::empty): Handle v4bx stubs.
11643 (Stub_table::add_arm_v4bx_stub): New method.
11644 (Stub_table::find_arm_v4bx_stub): New method.
11645 (Arm_relocate_functions::v4bx): New method.
11646 (Target_arm::fix_v4bx): New method.
11647 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11648 (Stub_table::relocate_stubs): Likewise.
11649 (Stub_table::do_write): Likewise.
11650 (Stub_table::update_data_size_and_addralign): Likewise.
11651 (Stub_table::finalize_stubs): Likewise.
11652 (Target_arm::Scan::local): Likewise.
11653 (Target_arm::Scan::global): Likewise.
11654 (Target_arm::do_finalize_sections): Likewise.
11655 (Target_arm::Relocate::relocate): Likewise.
11656 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11657 Likewise.
11658 (Target_arm::scan_reloc_for_stub): Likewise.
11659 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11660
5696ab0b
ILT
116612010-01-19 Ian Lance Taylor <iant@google.com>
11662
11663 * output.cc (Output_section_headers::do_sized_write): Write large
11664 segment count to sh_info field.
11665 (Output_file_header::do_sized_write): For large segment count,
11666 write PN_XNUM to e_phnum field.
11667
800d0f56
ILT
116682010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11669
11670 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11671 (Arm_relocate_functions::thm_jump8): New function.
11672 (Arm_relocate_functions::thm_jump11): New function.
11673 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11674 R_ARM_THM_JUMP11.
11675 (Target_arm::Scan::global): Likewise.
11676 (Target_arm::Relocate::relocate): Likewise.
11677 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11678 Likewise.
11679
41263c05
DK
116802010-01-14 Doug Kwan <dougkwan@google.com>
11681
11682 * arm.cc (map, utility): Include headers.
11683 (Target_arm::apply_cortex_a8_workaround): New method.
11684 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11685 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11686 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11687 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11688 the --[no-]fix-cortex-a8 command line options.
11689 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11690 (Target_arm::relocate_stub): Use addend in instruction template.
11691 * options.h (DEFINE_bool): Set the user-set flag.
11692 (General_options): Add --[no-]-fix-cortex options.
11693 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11694 : Update fast look-up map after conversion.
41263c05 11695
459e9b03
ST
116962010-01-14 Sriraman Tallam <tmsriram@google.com>
11697
11698 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11699 in the first pass of do_layout.
11700
b521dfe4
DK
117012010-01-13 Doug Kwan <dougkwan@google.com>
11702
11703 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11704 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11705 apparent compiler problem of not folding static constant integral
11706 data members of elfcpp::Elf_sizes<32>.
11707
44272192
DK
117082010-01-13 Doug Kwan <dougkwan@google.com>
11709
11710 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11711 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11712 Arm_relobj::scan_section_for_cortex_a8_erratum,
11713 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11714 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11715 sections to scan for relocation stubs into a new method
11716 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11717 relocation and Cortex-A8 stub scanning.
11718 (Target_arm::do_relax): Force stubs to be after stubbed sections
11719 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11720 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11721 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11722
44b71ece
ILT
117232010-01-12 Ian Lance Taylor <iant@google.com>
11724
11725 * target-reloc.h (visibility_error): New inline function.
11726 (relocate_section): Call visibility_error.
11727 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11728 (MOSTLYCLEANFILES): Likewise.
11729 (protected_4_pic.o, protected_3.err): New targets.
11730 * testsuite/protected_4.cc: New file.
11731
a120bc7f
DK
117322010-01-12 Doug Kwan <dougkwan@google.com>
11733
11734 * arm.cc (Cortex_a8_reloc): New class.
11735 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11736 and cortex_a8_relocs_info_.
11737 (Target_arm::fix_cortex_a8): New method definition.
11738 (Target_arm::Cortex_a8_relocs_info): New type.
11739 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11740 New data member declarations.
11741 (Target_arm::scan_reloc_for_stub): Record information about
11742 relocations for THUMB branches that might be exempted from the
11743 Cortex-A8 workaround.
11744 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11745 at the beginning of a relaxation pass.
11746
20138696
DK
117472010-01-12 Doug Kwan <dougkwan@google.com>
11748
11749 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11750 (Arm_relobj::Mapping_symbol_position,
11751 Arm_reloj::Mapping_symbol_position_less,
11752 Arm_relobj::Mapping_symbols_info): New types.
11753 (Target_arm::is_mapping_symbol_name): New method definition.
11754 (Arm_relobj::do_count_local_symbols): Save information about mapping
11755 symbols.
11756
089d69dc
DK
117572010-01-11 Doug Kwan <dougkwan@google.com>
11758
11759 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11760 Arm_relocate_functions::thumb32_branch_upper,
11761 Arm_relocate_functions::thumb32_branch_lower,
11762 Arm_relocate_functions::thumb32_cond_branch_offset,
11763 Arm_relocate_functions::thumb32_cond_branch_upper,
11764 Arm_relocate_functions::thumb32_cond_branch_lower,
11765 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11766 branch offset encoding.
11767 (Arm_relocate_functions::thumb_branch_common): Use new branch
11768 offset encoding methods to avoid code duplication.
11769 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11770 (Stub_addend_reader::operator()): Use new branch encoding method
11771 to avoid code duplication.
11772
99e5bff2
DK
117732010-01-11 Doug Kwan <dougkwan@google.com>
11774
11775 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11776 (Target_arm::do_finalize_sections): Define special EXIDX section
11777 symbols only if referenced.
11778 * gc.h (Garbage_collection::add_reference): New method.
11779 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11780 code duplication.
11781
98e090bd
ILT
117822010-01-11 Ian Lance Taylor <iant@google.com>
11783
d0a91bd8
ILT
11784 * script.cc (Version_script_info::build_expression_list_lookup):
11785 Change complaing about duplicate wildcard match from error to
11786 warning.
11787
98e090bd
ILT
11788 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11789 of 2009-12-30.
11790 (Version_script_info::Version_script_info): Initialize globs_,
11791 default_version_, default_is_global_, and exact_. Don't
11792 initialize globals_ or locals_.
11793 (Version_script_info::build_lookup_tables): Build local symbols
11794 first.
11795 (Version_script_info::unquote): New function.
11796 (Version_script_info::add_exact_match): New function.
11797 (Version_script_info::build_expression_list_lookup): Remove lookup
11798 parameter. Add is_global parameter. Change all callers. Handle
11799 wildcard pattern specially. Unquote pattern. Call
11800 add_exact_match.
11801 (Version_script_info::get_name_to_match): New function.
11802 (Version_script_info::get_symbol_version): New function.
11803 (Version_script_info::get_symbol_version_helper): Remove.
11804 (Version_script_info::check_unmatched_names): Call unquote.
11805 * script.h (class Version_script_info): Change get_symbol_version
11806 to be non-inline and add is_global parameter; change all callers.
11807 Rewrite symbol_is_local. Update declarations. Define struct
11808 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11809 Remove globals_ and locals_ members. Add exact_, globs_,
11810 default_version_, is_global_.
11811 (Version_script_info::Glob): Remove pattern, add expression and
11812 is_global. Update constructor. Change all callers.
11813 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11814 default version.
11815 (Versions::symbol_section_contents): If a symbol is undefined, or
11816 defined in a dynamic object, set the version index to
11817 VER_NDX_LOCAL.
11818 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11819 symbol_is_local.
11820 (Symbol_table::add_from_pluginobj): Likewise.
11821 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11822
d56962d3
DK
118232010-01-11 Doug Kwan <dougkwan@google.com>
11824
11825 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11826 (incremental_dump_LDADD): Add linking option for libintl.
11827 * Makefile.in: Regenerate.
11828
94e6ee91
L
118292010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11830
11831 PR gold/11144
11832 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11833 instead of -Ds.
11834 * testsuite/Makefile.in: Regenerated.
11835
e96c574b
DK
118362010-01-10 Doug Kwan <dougkwan@google.com>
11837
11838 * options.h (DEFINE_var): Use parentheses around argument varname__
11839 in macro body to avoid any unintended subsequent substitutions.
11840
7198066b
ILT
118412010-01-10 Ian Lance Taylor <iant@google.com>
11842
ba4d53bf
ILT
11843 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11844 candidates before doing symbol resolution.
11845
7198066b
ILT
11846 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11847 ODR candidates if only one is weak.
11848
a2beed37
ILT
118492010-01-08 Ian Lance Taylor <iant@google.com>
11850
11851 * script.cc (Version_script_info::build_expression_list_lookup):
11852 Don't warn about ambiguous version, just record the ambiguity.
11853 (Version_script_info::get_symbol_version_helper): Give error if
11854 version is ambiguous.
11855
2fb7225c
DK
118562010-01-08 Doug Kwan <dougkwan@google.com>
11857
11858 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11859 prev_data_size_ and prev_addralign_. Remove initializer for
11860 deleted data member has_been_changed_.
11861 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11862 to determine if the table is empty.
11863 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11864 Remove.
11865 (Stub_table::add_reloc_stub): Define method in class definition
11866 instead of just declaring it there.
11867 (Stub_table::add_cortex_a8_stub): New method definition.
11868 (Stub_table::update_data_size_and_addralign): Ditto.
11869 (Stub_table::finalize_stubs): Ditto.
11870 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11871 (Stub_table::do_addralign_): Return address alignment in the
11872 (Stub_table::do_reset_address_and_file_offset): Define method in
11873 class definition instead of declaring it there. Set current data
11874 size to be the data size of the previous pass.
11875 (Stub_table::set_final_data_size): Use current data size as the
11876 final data size.
11877 (Stub_table::relocate_stub): Change parameter type of stub from
11878 Reloc_stub pointer to Stub pointer.
11879 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11880 (Stub_table::Cortex_a8_stub_list): New typedef.
11881 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11882 Stub_table::prev_addralign_): New data member.
11883 (Arm_relobj::Arm_relobj): Initialize data member
11884 section_has_cortex_a8_workaround_.
11885 (Arm_relobj::section_has_cortex_a8_workaround,
11886 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11887 definitions.
11888 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11889 declarations.
11890 (Target_arm::relocate_stub): Change parameter type of stub from
11891 Reloc_stub pointer to Stub pointer.
11892 (Insn_template::size, Insn_template::alignment): Handle
11893 THUMB16_SPECIAL_TYPE.
11894 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11895 Stub_table::update_data_size_and_addralign,
11896 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11897 definitions.
11898 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11899 (Stub_table::do_write): Ditto.
11900 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11901
880cd20d
ILT
119022010-01-08 Ian Lance Taylor <iant@google.com>
11903
11904 PR 11108
11905 * symtab.h (class Symbol): Remove fields is_target_special_ and
11906 has_plt_offset_. Add field is_defined_in_discarded_section_.
11907 (Symbol::is_defined_in_discarded_section): New function.
11908 (Symbol::set_is_defined_in_discarded_section): New function.
11909 (Symbol::has_plt_offset): Rewrite.
11910 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11911 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11912 Don't initialize is_target_special_ or has_plt_offset_.
11913 Initialize is_defined_in_discarded_section_.
11914 (Symbol_table::add_from_relobj): If appropriate, set
11915 is_defined_in_discarded_section.
11916 * resolve.cc (Symbol::override_base_with_special): Don't test
11917 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11918 * target-reloc.h (relocate_section): Do special handling for
11919 symbols defined in discarded sections for global symbols as well
11920 as local symbols.
11921
2703e3eb
ILT
119222010-01-08 Ian Lance Taylor <iant@google.com>
11923
11924 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11925 the SHT_SYMTAB case.
11926
339d40a3
ILT
119272010-01-08 Ian Lance Taylor <iant@google.com>
11928
11929 * object.cc (Sized_relobj::do_layout): Don't get confused if
11930 layout_eh_frame returns NULL.
11931
abecea76
ILT
119322010-01-08 Ian Lance Taylor <iant@google.com>
11933
11934 PR 11084
11935 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11936 dynamic symbol table, use the normal symbol table.
11937 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11938 symbol table.
11939
6b7dd3f3
ILT
119402010-01-08 Ian Lance Taylor <iant@google.com>
11941
11942 PR 11072
11943 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11944 sections.
11945
36c50e63
L
119462010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11947
11948 * version.cc (print_version): Change to "Copyright 2010".
11949
e291e7b9
ILT
119502010-01-08 Ian Lance Taylor <iant@google.com>
11951
11952 PR 10287
11953 PR 11063
11954 * i386.cc (class Target_i386): Change return type of plt_section
11955 to be non-const.
11956 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11957 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11958 tls_desc_rel_ field.
11959 (Output_data_plt_i386::rel_tls_desc): New function.
11960 (Target_i386::rel_tls_desc_section): New function.
11961 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11962 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11963 R_386_TLS_DESC reloc in rel_tls_desc_section.
11964 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11965 Define struct Tlsdesc_info.
11966 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11967 (Target_x86_64::do_reloc_symbol_index): New function.
11968 (Target_x86_64::add_tlsdesc_info): New function.
11969 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11970 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11971 tlsdesc_rel_ field.
11972 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11973 all callers.
11974 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11975 (Target_x86_64::rela_tlsdesc_section): New function.
11976 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11977 handling.
11978 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11979 (Target_x86_64::do_reloc_addend): New function.
11980 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11981 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11982 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11983 (Output_reloc::type): New function.
11984 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11985 (Output_reloc::is_target_specific): New function.
11986 (Output_reloc::target_arg): New function.
11987 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11988 absolute relocs and target specific relocs.
11989 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11990 add_target_specific.
11991 (class Output_data_reloc) [SHT_RELA]: Likewise.
11992 * output.cc (Output_reloc::Output_reloc): Add four new versions
11993 for absolute relocs and target specific relocs.
11994 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11995 (Output_reloc::get_symbol_index): Likewise.
11996 (Output_reloc::local_section_offset): Check that local_sym_index_
11997 is not TARGET_CODE or 0.
11998 (Output_reloc::symbol_value): Likewise.
11999 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12000 reloc.
12001 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12002 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12003 functions.
12004 * layout.cc (add_target_dynamic_tags): Use output section for
12005 DT_PLTRELSZ and DT_JMPREL.
12006
3a44184e
ILT
120072010-01-07 Ian Lance Taylor <iant@google.com>
12008
12009 PR 11061
12010 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12011 function.
12012 (class Output_data_reloc_generic): Define.
12013 (class Output_data_reloc_base): Change base class to
12014 Output_data_reloc_generic. Change add() method to call
12015 bump_relative_reloc_count for a relative reloc. Remove
12016 sort_relocs_ field.
12017 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12018 to sort_relocs().
12019 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12020 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12021 appropriate.
12022 * layout.h (class Layout): Update declaration.
12023
ea715a34
ILT
120242010-01-07 Ian Lance Taylor <iant@google.com>
12025
12026 * output.h (class Output_data): Add const version of
12027 output_section and do_output_section.
12028 (class Output_section_data): Add const version of
12029 do_output_section.
12030 (class Output_section): Likewise.
12031 * layout.cc (Layout::add_target_dynamic_tags): New function.
12032 * layout.h (class Layout): Update declarations.
12033 * arm.cc (Target_arm::do_finalize_sections): Use
12034 add_target_dynamic_tags.
12035 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12036 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12037 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12038 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12039
659948a4
ILT
120402010-01-07 Ian Lance Taylor <iant@google.com>
12041
12042 PR 11042
12043 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12044 object as needed.
12045
9d3b86f6
ILT
120462010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12047 Ian Lance Taylor <iant@google.com>
12048
12049 PR 11019
12050 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12051 Xindex::read_symtab_xindex.
12052
bb0d3eb0
DK
120532010-01-07 Doug Kwan <dougkwan@google.com>
12054
12055 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12056 (Insn_template::thumb16_bcond_insn): New method declaration.
12057 (Insn_template): Fix spelling.
12058 (Stub::thumb16_special): New method declaration.
12059 (Stub::do_write): Define virtual method which was previously pure
12060 virtual.
12061 (Stub::do_thumb16_special): New method declaration.
12062 (Stub::do_fixed_endian_write): New template member.
12063 (Reloc_stub::do_write): Remove.
12064 (Reloc_stub::do_fixed_endian_write): Remove.
12065 (Cortex_a8_stub): New class definition.
12066 (Stub_factory::make_cortex_a8_stub): New method definition.
12067 (Stub_factory::Stub_factory): Add missing static storage class
12068 qualifier for elf32_arm_stub_a8_veneer_blx.
12069
ffeef7df
ILT
120702010-01-07 Ian Lance Taylor <iant@google.com>
12071
dc3f80fe
ILT
12072 PR 10980
12073 * options.h (class General_options): Add --warn-unresolved-symbols
12074 and --error-unresolved-symbols.
12075 * errors.cc (Errors::undefined_symbol): Implement
12076 --warn-unresolved-symbols.
12077
ffeef7df
ILT
12078 * options.h (class General_options): Add -z text and -z textoff.
12079 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12080
f1ec9ded
ST
120812010-01-06 Sriraman Tallam <tmsriram@google.com>
12082
12083 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12084 (Garbage_collection::cident_sections): New function.
12085 (Garbage_collection::add_cident_section): New function.
12086 (Garbage_collection::cident_sections_): New member.
12087 (gc_process_relocs): Add references to sections whose names are C
12088 identifiers.
12089 * gold.h (cident_section_start_prefix): New constant.
12090 (cident_section_stop_prefix): New constant.
12091 (is_cident): New function.
12092 * layout.cc (Layout::define_section_symbols): Replace string constants
12093 with the newly defined constants.
12094 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12095 C identifiers.
12096 * testsuite/Makefile.am: Add gc_orphan_section_test.
12097 * testsuite/Makefile.in: Regenerate.
12098 * testsuite/gc_orphan_section_test.cc: New file.
12099 * testsuite/gc_orphan_section_test.sh: New file.
12100
6eda8c29
ILT
121012010-01-06 Ian Lance Taylor <iant@google.com>
12102
b9674e17
ILT
12103 PR 10980
12104 * options.h (class General_options): Add --warn-shared-textrel.
12105 * layout.cc (Layout::finish_dynamic_section): Implement
12106 --warn-shared-textrel.
12107
6eda8c29
ILT
12108 PR 10980
12109 * options.h (class General_options): Add --warn-multiple-gp.
12110
32dcd44e
ILT
121112010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12112
12113 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12114 $(THREADSLIB) and $(LIBDL).
12115 * Makefile.in: Rebuild.
12116
a192ba05
ILT
121172010-01-06 Ian Lance Taylor <iant@google.com>
12118
12119 PR 10980
12120 * options.cc (General_options::parse_section_start): New function.
12121 (General_options::section_start): New function.
12122 (General_options::General_options): Initialize all members.
12123 * options.h: Include <map>
12124 (class General_options): Add --section-start. Add section_starts_
12125 member.
12126 * layout.cc (Layout::attach_allocated_section_to_segment): If
12127 --section-start was used, set the address of the segment. Remove
12128 local sort_sections.
12129 (Layout::relaxation_loop_body): If the address of the load segment
12130 has been set by --section-start, don't use it.
12131 * output.h (Output_segment::update_flags_for_output_section): New
12132 function.
12133 * output.cc (Output_segment::add_output_section): Call
12134 update_flags_for_output_section.
12135
dde3f402
ILT
121362010-01-05 Ian Lance Taylor <iant@google.com>
12137
62dfdd4d
ILT
12138 PR 10980
12139 * options.h (class General_options): Add --undefined-version.
12140 * script.cc (struct Version_expression): Add was_matched_by_symbol
12141 field.
12142 (Version_script_info::matched_symbol): New function.
12143 (Version_script_info::get_symbol_version_helper): Call
12144 matched_symbol.
12145 (Version_script_info::check_unmatched_names): New function.
12146 * script.h (class Version_script_info): Update declarations.
12147 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12148
9c4ae156
ILT
12149 * options.h (class General_options): Use DEFINE_bool_alias for
12150 allow_multiple_definition.
12151 * resolve.cc (Symbol_table::should_override): Don't test
12152 allow_multiple_definition.
12153
dde3f402
ILT
12154 PR 10980
12155 * options.h (class General_options): Add --cref.
12156 * main.cc (main): Print cref table if --cref. Don't close mapfile
12157 until after printing cref table.
12158 * cref.cc: Include "symtab.h".
12159 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12160 (Cref_table_compare::operator()): New function.
12161 (Cref_inputs::gather_cref): New function.
12162 (filecol): New static const.
12163 (Cref_inputs::print_cref): New function.
12164 (Cref::print_cref): New function.
12165 * cref.h: Include <cstdio>.
12166 (class Cref): Update declarations.
12167 * mapfile.h (Mapfile::file): New function.
12168 * object.h (class Object): Define Symbols. Declare virtual
12169 do_get_global_symbols.
12170 (Object::get_global_symbols): New function.
12171 * object.cc (Input_objects::add_object): Pass object to cref_ if
12172 --cref.
12173 (Input_objects::archive_start): Likewise.
12174 (Input_objects::archive_stop): Likewise.
12175 (Input_objects::print_cref): New function.
12176 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12177 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12178 --cref.
12179 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12180 function.
12181 * plugin.h (class Sized_pluginobj): Update declarations.
12182
8781f709
ILT
121832010-01-05 Ian Lance Taylor <iant@google.com>
12184
12185 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12186 to is_default_version. Rename insdef to insdefault.
12187 (Symbol_table::add_from_relobj): Rename def to is_default_version
12188 and local to is_forced_local.
12189 (Symbol_table::add_from_pluginobj): Likewise.
12190 (Symbol_table::add_from_dynobj): Likewise.
12191 (Symbol_table::define_special_symbol): Rename insdef to
12192 insdefault.
12193
fe35d28d
ILT
121942010-01-04 Ian Lance Taylor <iant@google.com>
12195
30bc8c46
ILT
12196 PR 10980
12197 * options.h (class General_options): Add
12198 --allow-multiple-definition and -z muldefs.
12199 * resolve.cc (Symbol_table::should_override): Don't warn about a
12200 multiple symbol definition if --allow-multiple-definition or -z
12201 muldefs.
12202
7eaea549
ILT
12203 PR 10980
12204 * options.h (class General_options): Add --add-needed and
12205 --copy-dt-needed-entries. Tweak --as-needed help entry.
12206 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12207 error if --copy-dt-needed-entries aka --add-needed is used and
12208 would cause a change in behaviour.
12209
fe35d28d
ILT
12210 PR 10980
12211 * options.h (class General_options): Add -G as a short version of
12212 --shared. Add no-op options -assert, -g, and -i.
12213
55a2bb35
ST
122142010-01-04 Sriraman Tallam <tmsriram@google.com>
12215
12216 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12217 check for .text or .gnu.linkonce.t sections.
12218 * icf.cc (Icf::find_identical_sections): Ditto.
12219 Change the detection for mangled function name within the section
12220 name.
12221 * icf.h (is_section_foldable_candidate): New function.
12222
719328e1
ILT
122232009-12-30 Ian Lance Taylor <iant@google.com>
12224
12225 PR 10980
12226 * options.h (class General_options): Permit two dashes with
12227 --retain-symbols-file.
12228
d7bb5745
ILT
122292009-12-30 Ian Lance Taylor <iant@google.com>
12230
403a15dd
ILT
12231 PR 10979
12232 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12233 don't put the file header and segment headers in the text
12234 segment.
12235
eda294df
ILT
12236 PR 10979
12237 * common.cc (Sort_commons::operator()): Stabilize sort when both
12238 entries are NULL.
12239 (Symbol_table::do_allocate_commons_list): When allocating common
12240 symbols, skip a symbol which is no longer common.
12241 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12242 an object before checking its type.
12243 * testsuite/common_test_2.c: New file.
12244 * testsuite/common_test_3.c: New file.
12245 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12246 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12247 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12248 (common_test_2_pic.o, common_test_2.so): New targets.
12249 (common_test_3_pic.o, common_test_3.so): New targets.
12250 * testsuite/Makefile.in: Rebuild.
12251
d7bb5745
ILT
12252 PR 10979
12253 * script.cc (read_input_script): If we see a new SECTIONS clause,
12254 and we have added an input section, give an error.
12255 * layout.h (class Layout): Add have_added_input_section function.
12256 Add have_added_input_section_ field.
12257 * layout.cc (Layout::Layout): Initialize
12258 have_added_input_section_.
12259 (Layout::layout): Set have_added_input_section_.
12260 (Layout::layout_eh_frame): Likewise.
12261
fc59c572
ILT
122622009-12-30 Ian Lance Taylor <iant@google.com>
12263
12264 PR 10931
12265 * options.h (class General_options): Add --sort-common option.
12266 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12267 * common.cc (Sort_common): Add sort_order parameter to
12268 constructor. Add sort_order_ field.
12269 (Sort_commons::operator): Check sort_order_.
12270 (Symbol_table::allocate_commons): Determine the sort order.
12271 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12272 Change all callers.
12273 (Symbol_table::do_allocate_commons_list): Likewise.
12274
1c74fab0
ILT
122752009-12-30 Ian Lance Taylor <iant@google.com>
12276
12277 PR 10916
12278 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12279 symbols from this object, don't change the visibility of an
12280 undefined symbol.
12281 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12282
6affe781
ILT
122832009-12-30 Ian Lance Taylor <iant@google.com>
12284
12285 PR 10861
12286 * script.h (class Version_script_info): Define Language enum.
12287 Update declarations. Define Glob, Exact, and Lookup types. Add
12288 new fields globals_, locals_, and is_finalized_.
12289 * script.cc: Various formatting fixes.
12290 (class Parser_closure): Change language_stack_ from a vector of
12291 std::string to one of Version_script_info::Language. Adjust all
12292 uses accordingly.
12293 (class Lazy_demangler): Remove.
12294 (struct Version_expression): Change language from std::string to
12295 Version_script_info::Language.
12296 (Version_script_info::Version_script_info): New function.
12297 (Version_script_info::~Version_script_info): Don't call clear.
12298 (Version_script_info::finalize): New function.
12299 (Version_script_info::build_lookup_tables): New function.
12300 (Version_script_info::build_expression_list_lookup): New
12301 function.
12302 (Version_script_info::get_symbol_version_helper): Rewrite to use
12303 lookup tables.
12304 (Version_script_info::print_expression_list): Adjust to use
12305 Version_script_info::Language.
12306 (script_push_lex_into_version_mode): Check that the version script
12307 has not been finalized.
12308 (version_script_push_lang): Change language string to
12309 Version_script_info::Language.
12310 * options.cc (Command_line::version_script): New function.
12311 * options.h (class General_options): Add finalize_dynamic_list
12312 function. Change version_script from declaration to definition.
12313 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12314 * testsuite/version_script.map: Remove duplicate def of foo.
12315 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12316 version_script.map.
12317 * testsuite/Makefile.in: Rebuild.
12318
818bf354
ILT
123192009-12-30 Ian Lance Taylor <iant@google.com>
12320
12321 PR 10843
12322 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12323 if the input symbol index is 0, make the output symbol index 0.
12324
ebcc8304
ILT
123252009-12-30 Ian Lance Taylor <iant@google.com>
12326
12327 PR 10670
12328 * options.h (class General_options): Add -x/--discard-all.
12329 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12330 --discard-all. If the local symbol needs a dynamic entry, check
12331 that before handling --discard-locals.
12332
176fe33f
ILT
123332009-12-30 Ian Lance Taylor <iant@google.com>
12334
bb321bb1
ILT
12335 PR 10450
12336 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12337 flags to PF_R.
12338 (Output_segment::add_output_section): Don't change the flags if
12339 the type is PT_TLS.
12340
176fe33f
ILT
12341 PR 10450
12342 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12343 GNU hash table if they need a dynamic value. Otherwise, don't add
12344 them if they are defined in a dynamic object or are forced local.
12345
e8cd95c7
ILT
123462009-12-29 Ian Lance Taylor <iant@google.com>
12347
1b81fb71
ILT
12348 PR 10450
12349 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12350 .gnu.hash table for a 32-bit target.
12351
8d6d383d
ILT
12352 PR 10450
12353 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12354 regular and a dynamic object only needs a dynamic symbol table
12355 entry if it is externally visible.
12356
e785ec03
ILT
12357 PR 10450
12358 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12359 constructor. Add global_offset_table_ field.
12360 (Target_i386::got_section): Set global_offset_table_.
12361 (Target_i386::do_finalize_sections): Set global_offset_table_
12362 size.
12363 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12364 in constructor. Add global_offset_table_ field.
12365 (Target_x86_64::got_section): Set global_offset_table_.
12366 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12367 size.
12368
1a2dff53
ILT
12369 * layout.cc (Layout::Layout): Initialize increase_relro_.
12370 (Layout::get_output_section): Add is_relro, is_last_relro, and
12371 is_first_non_relro parameters. Change all callers.
12372 (Layout::choose_output_section): Likewise.
12373 (Layout::add_output_section_data): Likewise.
12374 (Layout::make_output_section): Likewise.
12375 (Layout::set_segment_offsets): Clear increase_relro when using a
12376 linker script.
12377 * layout.h (class Layout): Add increase_relro method. Add
12378 increase_relro_ field. Update declarations.
12379 * output.cc (Output_section::Output_section): Initialize
12380 is_last_relro_ and is_first_non_relro_.
12381 (Output_segment::add_output_section): Group relro sections is
12382 do_sort is true. Handle is_last_relro and is_first_non_relro.
12383 (Output_segment::maximum_alignment): Remove relro handling.
12384 (Output_segment::set_section_addresses): Add increase_relro
12385 parameter. Change all callers. Add initial alignment to align
12386 relro sections on separate page. Remove old relro handling.
12387 (Output_segment::set_section_list_addresses): Remove in_relro
12388 parameter. Change all callers.
12389 (Output_segment::set_offset): Add increase parameter. Change all
12390 callers. Remove old relro handling.
12391 * output.h (class Output_section): Add new methods: is_last_relro,
12392 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12393 Add is_last_relro_ and is_first_non_relro_ fields.
12394 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12395 Create separate .got.plt section. Call increase_relro.
12396 * x86_64.cc (Target_x86_64::got_section): Likewise.
12397 * testsuite/relro_script_test.t: Add .got.plt.
12398
f0ba79e2
ILT
12399 PR 10450
12400 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12401 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12402 (Layout::finalize): Call set_dynamic_symbol_size.
12403 (Layout::set_dynamic_symbol_size): New function.
12404 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12405 set_dynamic_symbol_size.
12406
e8cd95c7
ILT
12407 PR 10450
12408 * output.h (class Output_section): Add is_entsize_zero_ field.
12409 * output.cc (Output_section::Output_section): Initialize
12410 is_entsize_zero_.
12411 (Output_section::set_entsize): If two different entsizes are
12412 requested, force it to zero.
12413 (Output_section::add_input_section): Set flags for .debug_str
12414 before updating section flags. Set entsize.
12415 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12416 and SHF_STRING if all input sections have those flags.
12417
3e1b9a8a
RÁE
124182009-12-29 Rafael Espindola <espindola@google.com>
12419
12420 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12421 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12422 reporting.
3e1b9a8a 12423
3dcad376
ST
124242009-12-29 Sriraman Tallam <tmsriram@google.com>
12425
12426 * options.cc (General_options::parse_version): Allow -v to exit
12427 without an error if there is nothing to link.
12428
084e2665
ILT
124292009-12-29 Ian Lance Taylor <iant@google.com>
12430
12431 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12432 using a version of gcc before 4.1.
12433 * configure: Rebuild.
12434
250acde3
CD
124352009-12-28 Chris Demetriou <cgd@google.com>
12436
12437 * attributes.cc (Output_attributes_section_data::do_write): Use
12438 std::vector::front rather than std::vector::data.
12439
99fff23b
ILT
124402009-12-28 Ian Lance Taylor <iant@google.com>
12441
12442 * symtab.h (class Symbol_table): Add enum Defined.
12443 * resolve.cc (Symbol_table::should_override): Add defined
12444 parameter. Change all callers. Test whether object is NULL
12445 before calling a method on it.
12446 (Symbol_table::report_resolve_problem): Add defined parameter.
12447 Change all callers.
12448 (Symbol_table::should_override_with_special): Likewise.
12449 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12450 parameter. Change all callers.
12451 (Symbol_table::do_define_in_output_data): Likewise.
12452 (Symbol_table::define_in_output_segment): Likewise.
12453 (Symbol_table::do_define_in_output_segment): Likewise.
12454 (Symbol_table::define_as_constant): Likewise.
12455 (Symbol_table::do_define_as_constant): Likewise.
12456 * script.h (class Symbol_assignment): Add is_defsym parameter to
12457 constructor; change all callers.
12458 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12459 parameter. Change all callers. Add is_defsym_ field.
12460 (class Parser_closure): Add parsing_defsym parameter to
12461 constructor; change all callers. Add parsing_defsym accessor
12462 function. Add parsing_defsym_ field.
12463
556bd683
ILT
124642009-12-28 Ian Lance Taylor <iant@google.com>
12465
12466 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12467 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12468
1782c879
ILT
124692009-12-23 Ian Lance Taylor <iant@google.com>
12470
12471 * i386.cc (Target_i386::do_calls_non_split): Recognize
12472 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12473 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12474 -fsplit-stack prologue when using %r11.
1782c879 12475
329ca2b1
ST
124762009-12-21 Sriraman Tallam <tmsriram@google.com>
12477
12478 * options.cc (General_options::parse_version): Make -v continue and do
12479 the link like GNU ld does.
12480
d675ff46
RÁE
124812009-12-17 Rafael Avila de Espindola <espindola@google.com>
12482
12483 * Makefile.am (CCFILES): Add timer.cc.
12484 (HFILES): Add timer.h.
12485 * configure.ac: Check for sysconf and times.
12486 * main.cc: include timer.h.
12487 (main): Use Timer instead of get_run_time.
12488 * timer.cc: New.
12489 * timer.h: New.
12490 * workqueue.cc: include timer.h.
12491 (Workqueue::find_and_run_task):
12492 Report user, sys and wall time.
12493 * Makefile.in: Regenerate.
12494 * config.in: Regenerate.
12495 * configure: Regenerate.
12496
d6344fb5
DK
124972009-12-16 Doug Kwan <dougkwan@google.com>
12498
12499 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12500 sections.
12501 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12502 relaxed input sections.
12503 * output.cc (Output_section::find_relaxed_input_section): Change
12504 return type to Output_relaxed_input_section pointer. Adjust code
12505 for new type of relaxed_input_section_map_.
12506 * output.h (Output_section::find_relaxed_input_section): Change
12507 return type to Output_relaxed_input_section pointer.
12508 (Output_section::Output_relaxed_input_section_by_input_section_map):
12509 New type.
12510 (Output_section::relaxed_input_section_map_): Change type to
12511 Output_section::Output_relaxed_input_section_by_input_section_map.
12512 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12513 input section.
12514
0e0d5469
ILT
125152009-12-15 Ian Lance Taylor <iant@google.com>
12516
12517 * layout.cc (Layout::create_shstrtab): Only write out after input
12518 sections if we are compressing debug sections.
12519
0649a889
ILT
125202009-12-15 Ian Lance Taylor <iant@google.com>
12521
12522 * archive.cc (Archive::add_symbols): Only look up a symbol without
12523 a version if there is, in fact, a version.
12524
2ea97941
ILT
125252009-12-14 Ian Lance Taylor <iant@google.com>
12526
12527 Revert -Wshadow changes, all changes from:
12528 2009-12-11 Doug Kwan <dougkwan@google.com>
12529 2009-12-11 Nick Clifton <nickc@redhat.com>
12530 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12531
b0eec2cc
DK
125322009-12-11 Doug Kwan <dougkwan@google.com>
12533
12534 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12535 due to -Wshadow.
12536 * attributes.cc (Object_attribute::size): Ditto.
12537 (Attributes_section_data::size): Ditto.
12538 (Attributes_section_data::Attributes_section_data): Ditto.
12539 (Output_attributes_section_data::do_write): Ditto.
12540 * attributes.h (Object_attribute::set_type): Ditto.
12541 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12542
91d6fa6a
NC
125432009-12-11 Nick Clifton <nickc@redhat.com>
12544
12545 * archive.cc: Fix shadowed variable warnings.
12546 * arm.cc: Likewise.
12547 * compressed_output.cc: Likewise.
12548 * compressed_output.h: Likewise.
12549 * configure: Likewise.
12550 * dwarf_reader.cc: Likewise.
12551 * dynobj.cc: Likewise.
12552 * dynobj.h: Likewise.
12553 * ehframe.cc: Likewise.
12554 * ehframe.h: Likewise.
12555 * errors.cc: Likewise.
12556 * expression.cc: Likewise.
12557 * fileread.cc: Likewise.
12558 * fileread.h: Likewise.
12559 * freebsd.h: Likewise.
12560 * i386.cc: Likewise.
12561 * icf.cc: Likewise.
12562 * incremental.h: Likewise.
12563 * layout.cc: Likewise.
12564 * layout.h: Likewise.
12565 * mapfile.cc: Likewise.
12566 * merge.cc: Likewise.
12567 * merge.h: Likewise.
12568 * object.cc: Likewise.
12569 * object.h: Likewise.
12570 * options.h: Likewise.
12571 * output.cc: Likewise.
12572 * output.h: Likewise.
12573 * parameters.cc: Likewise.
12574 * plugin.cc: Likewise.
12575 * powerpc.cc: Likewise.
12576 * reduced_debug_output.cc: Likewise.
12577 * reduced_debug_output.h: Likewise.
12578 * reloc.cc: Likewise.
12579 * reloc.h: Likewise.
12580 * resolve.cc: Likewise.
12581 * script-sections.cc: Likewise.
12582 * script.cc: Likewise.
12583 * script.h: Likewise.
12584 * sparc.cc: Likewise.
12585 * symtab.cc: Likewise.
12586 * symtab.h: Likewise.
12587 * target-select.cc: Likewise.
12588 * target-select.h: Likewise.
12589 * token.h: Likewise.
12590 * workqueue.cc: Likewise.
12591 * workqueue.h: Likewise.
12592 * x86_64.cc: Likewise.
12593
a0351a69
DK
125942009-12-10 Doug Kwan <dougkwan@google.com>
12595
12596 * arm.cc (attributes.h): New include.
12597 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12598 (Arm_relobj::~Arm_relobj): Delete object pointed by
12599 attributes_section_data_.
12600 (Arm_relobj::attributes_section_data): New method definition.
12601 (Arm_relobj::attributes_section_data_): New data member declaration.
12602 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12603 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12604 attributes_section_data_.
12605 (Arm_dynobj::attributes_section_data): New method definition.
12606 (Arm_dynobj::attributes_section_data_): New data member declaration.
12607 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12608 initialization value of may_use_blx_ to false.
2e702c99 12609 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12610 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12611 object attributes to compute results instead of hard-coding.
12612 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12613 Target_arm::get_secondary_compatible_arch,
12614 Target_arm::set_secondary_compatible_arch
12615 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12616 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12617 New method declarations.
12618 (Target_arm::get_aeabi_object_attribute): New method definition.
12619 (Target_arm::attributes_section_data_): New data member declaration.
12620 (read_arm_attributes_section): New template definition.
12621 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12622 (Arm_dynobj::do_read_symbols): Ditto.
12623 (Target_arm::do_finalize_sections): Merge attributes sections from
12624 input. Check for BLX use after attributes section merging.
12625 Fix __exidx_start and __exidx_end visibility. Create an
12626 .ARM.attributes section if necessary.
12627 (Target_arm::get_secondary_compatible_arch,
12628 Target_arm::set_secondary_compatible_arch,
12629 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12630 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12631 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12632 New method definitions.
12633
b59befec
ILT
126342009-12-09 Ian Lance Taylor <iant@google.com>
12635
12636 * plugin.cc (Plugin::load): Don't cast from void* to a function
12637 pointer.
12638
1276bc89
ILT
126392009-12-09 Ian Lance Taylor <iant@google.com>
12640
12641 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12642 information fields.
12643
2f2de248
L
126442009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12645
12646 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12647 Replace two_file_shared_1.so with two_file_shared_2.so.
12648 * testsuite/Makefile.in: Regenerated.
12649
4f787271
DK
126502009-12-08 Doug Kwan <dougkwan@google.com>
12651
12652 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12653 (HFILES): Add attributes.h and int_encoding.h.
12654 * Makefile.in: Regenerate.
12655 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12656 function definitions to int_encoding.cc
12657 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12658 prototypes to int_encoding.h
12659 * reduced_debug_output.cc (int_encoding.h): New include.
12660 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12661 function definitions to int_encoding.cc
12662 (insert_into_vector, read_from_pointer): Move template definitions to
12663 int_encoding.h
12664 * attributes.cc: New file.
12665 * attributes.h: New file.
12666 * int_encoding.cc: New file.
12667 * int_encoding.h: New file.
12668
20b52f1a
RÁE
126692009-12-07 Rafael Avila de Espindola <espindola@google.com>
12670
12671 PR gold/11055
12672 * incremental-dump.cc (dump_incremental_inputs): New.
12673 (main): Use dump_incremental_inputs.
12674
53d7974c
L
126752009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12676
12677 PR gold/10893
12678 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12679 checking elfcpp::STT_FUNC.
12680 (Target_i386::Relocate::relocate): Likewise.
12681 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12682
12683 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12684 symbols from shared libraries into normal FUNC symbols.
12685
12686 * symtab.h (Symbol): Add is_func and use it.
12687
05a352e6
DK
126882009-12-05 Doug Kwan <dougkwan@google.com>
12689
12690 * arm.cc (Target_arm::arm_info): Initialize new fields
12691 attributes_section and attributes_vendor.
12692 * i386.cc (Target_i386::i386_info): Same.
12693 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12694 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12695 fields attributes_section and attributes_vendor.
53d7974c 12696 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12697 * target.h (Target::attributes_section, Target::attributes_vendor,
12698 Target::is_attributes_section, Target::attribute_arg_type,
12699 Target::attributes_order): New method definitions.
12700 (Target::Target_info::attributes_section,
12701 Target::Target_info::attributes_vendor): New fields.
12702 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12703 virtual method definitions.
12704 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12705 attributes_section and attributes_vendor.
12706 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12707
f4e5969c
DK
127082009-12-05 Doug Kwan <dougkwan@google.com>
12709
12710 * arm.cc: Update comments about interworking and stub generation.
12711 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12712 considered as non-PIC.
12713 (Arm_relocate_functions::base_abs): Fix formatting.
12714 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12715 of function to use GOT entry address instead of offset.
12716 (Target_arm::Scan::global): Issue an error if a symbol would need a
12717 PLT does not get one because it is untyped. Remove code to create
12718 dynamic symbols for relative branches.
12719 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12720 takes unsigned integer instead of boolean.
12721
1abce4a6
L
127222009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12723
12724 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12725 (two_file_test_LDADD): Likewise.
12726 (common_test_1_LDADD): Likewise.
12727 (exception_test_LDADD) Likewise.
12728 (weak_test_LDADD): Likewise.
12729 (many_sections_test_LDADD): Likewise.
12730 (initpri1_LDADD): Likewise.
12731 (script_test_1_LDADD): Likewise.
12732 (script_test_2_LDADD): Likewise.
12733 (justsyms_LDADD): Likewise.
12734 (binary_test_LDADD): Likewise.
12735 (large_LDADD): Likewise.
12736 * testsuite/Makefile.in: Regenerated.
12737
adcf2816 127382009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12739
adcf2816
L
12740 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12741 (Symbol_table::override_with_special): Likewise.
12742 (Symbol_table::add_from_object): Likewise.
12743
28e67f5d
RÁE
127442009-12-04 Rafael Avila de Espindola <espindola@google.com>
12745
12746 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12747 Don't set the data_offset twice.
12748
ae10a101
RÁE
127492009-12-04 Rafael Avila de Espindola <espindola@google.com>
12750
12751 * testsuite/Makefile.in: Regenerate.
12752
f59f41f3
DK
127532009-12-03 Doug Kwan <dougkwan@google.com>
12754
12755 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12756 (Target_arm::do_finalize_sections): Add parameter for symbol table
12757 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12758 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12759 parameter for symbol table pointer.
12760 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12761 an additional parameter for a pointer to symbol table.
12762 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12763 parameter for a symbol table pointer.
12764 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12765 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12766 Ditto.
12767 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12768 parameter for a symbol table pointer.
12769
ca55d848
RÁE
127702009-12-03 Rafael Avila de Espindola <espindola@google.com>
12771
12772 * incremental.cc (Incremental_inputs_header)
12773 (Incremental_inputs_header_write, Incremental_inputs_entry)
12774 (Incremental_inputs_entry_write): Move ...
12775 * incremental.h (Incremental_inputs_header)
12776 (Incremental_inputs_header_write, Incremental_inputs_entry)
12777 (Incremental_inputs_entry_write): here.
12778
3aec4f9c
RÁE
127792009-12-02 Rafael Avila de Espindola <espindola@google.com>
12780
12781 * incremental.cc (make_sized_incremental_binary): Set the target.
12782 Error if it is incompatible.
12783 * output.h (Output_file): Add filename method.
12784
9c0ae74d
RÁE
127852009-12-02 Rafael Avila de Espindola <espindola@google.com>
12786
12787 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12788 from the get_* methods.
12789
a45500ae
RÁE
127902009-12-02 Rafael Avila de Espindola <espindola@google.com>
12791
12792 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12793 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12794 Write 0 for the data_offset of scripts.
12795
325e6408
RÁE
127962009-12-02 Rafael Avila de Espindola <espindola@google.com>
12797
12798 * testsuite/Makefile.am: Add the incremental_test.sh test.
12799 * testsuite/incremental_test.sh: New.
12800 * testsuite/incremental_test_1.c: New.
12801 * testsuite/incremental_test_2.c: New.
12802
954c3e2e
RÁE
128032009-12-01 Rafael Avila de Espindola <espindola@google.com>
12804
703d02da 12805 * incremental-dump.cc (main): Fix typos.
954c3e2e 12806
f8086623
RÁE
128072009-11-27 Rafael Avila de Espindola <espindola@google.com>
12808
12809 PR gold/11025
12810 * incremental-dump.cc (main): Use llu to print 64 bit values.
12811
3b0dd6ac
L
128122009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12813 H.J. Lu <hongjiu.lu@intel.com>
12814
12815 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12816 $(LIBDL).
12817 (incremental_dump_LDADD): Likewise.
12818 * Makefile.in: Regenerated.
12819
a6d1ef57 128202009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12821
a6d1ef57
DK
12822 Revert:
12823
12824 2009-11-25 Doug Kwan <dougkwan@google.com>
12825
12826 * arm.cc (Target_arm::Target_arm): Move method definition
12827 outside of class definition. Add code to handle
12828 --target1-rel, --target1-abs and --target2= options.
12829 (Target_arm::get_reloc_reloc_type): Change method to be
12830 non-static and const.
12831 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12832 New data member declaration.
12833 (Target_arm::Scan::local, Target_arm::Scan::global,
12834 Target_arm::Relocate::relocate,
12835 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12836 Adjust call to Target_arm::get_real_reloc_type.
12837 (Target_arm::get_real_reloc_type): Use command line options
12838 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12839 * options.h (--target1-rel, --target1-abs, --target2): New
12840 ARM-only options.
12841
50aeb7d4
DK
128422009-11-25 Doug Kwan <dougkwan@google.com>
12843
12844 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12845 class definition. Add code to handle --target1-rel, --target1-abs
12846 and --target2= options.
12847 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12848 and const.
12849 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12850 member declaration.
12851 (Target_arm::Scan::local, Target_arm::Scan::global,
12852 Target_arm::Relocate::relocate,
12853 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12854 call to Target_arm::get_real_reloc_type.
12855 (Target_arm::get_real_reloc_type): Use command line options to
12856 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12857 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12858 options.
12859
51938283
DK
128602009-11-25 Doug Kwan <dougkwan@google.com>
12861
12862 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12863 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12864 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12865 formatting.
12866 (Arm_relocate_functions::thm_call): Replace body with a call to
12867 Arm_relocate_functions::thumb_branch_common.
12868 (Arm_relocate_functions::thm_jump24,
12869 Arm_relocate_functions::thm_xpc22): New method definitions.
12870 (Arm_relocate_functions::thumb_branch_common): New method definition.
12871 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12872 operator.
12873 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12874 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12875
e2b8f3c4
RÁE
128762009-11-24 Rafael Avila de Espindola <espindola@google.com>
12877
12878 * Makefile.am: Build incremental-dump
12879 * Makefile.in: Regenerate.
12880 * incremental-dump.cc: New.
12881 * incremental.cc (Incremental_inputs_header_data,
12882 Incremental_inputs_entry_data): Move to incremental.h
12883 * incremental.h: (Incremental_inputs_header_data,
12884 Incremental_inputs_entry_data): Move from incremental.cc
12885
bcba9aec
RÁE
128862009-11-24 Rafael Avila de Espindola <espindola@google.com>
12887
12888 * incremental.cc (Incremental_inputs_header,
12889 Incremental_inputs_header_write, Incremental_inputs_entry,
12890 Incremental_inputs_entry_write): Add a typedef with the data type.
12891
7c3afe08
RÁE
128922009-11-24 Rafael Avila de Espindola <espindola@google.com>
12893
12894 * incremental.cc (Incremental_inputs_header,
12895 Incremental_inputs_header_write, Incremental_inputs_entry,
12896 Incremental_inputs_entry_write): Update comment about which
12897 type has the filed descriptions.
12898
d204b6e9
DK
128992009-11-15 Doug Kwan <dougkwan@google.com>
12900
12901 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12902 (Arm_relocate_functions::arm_branch_common): Change method defintion
12903 in class definition to a method declaration and update list of formal
12904 parameters.
12905 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12906 Arm_relocation_functions::jump24): Adjust call to
12907 Arm_relocate_functions::arm_branch_common. Update list of formal
12908 parameters.
12909 (Arm_relocate_functions::xpc25): New method definition.
12910 (Arm_relocate_functions::arm_branch_common): Move method defintion
12911 out from class definition. Use stubs for mode-switching and extending
12912 branch ranges.
12913 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12914 specially. Change code to enable use of stubs in ARM branches.
12915
43d12afe
DK
129162009-11-10 Doug Kwan <dougkwan@google.com>
12917
12918 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12919 in method declaration.
12920 (Target_arm::relocate_stub): New method declaration.
12921 (Target_arm::default_target): Change to return a pointer instead of
12922 a const reference.
12923 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12924 Target_arm::default_target.
12925 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12926 method definition.
12927 (Target_arm::relocate_section): Adjust view.
12928 (Target_arm::relocate_stub): New method definition.
12929
ac33a407
DK
129302009-11-10 Doug Kwan <dougkwan@google.com>
12931
12932 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12933 a format warning.
12934 * incremental.cc (open_incremental_binary): Initialized local
12935 variables to avoid warnings.
12936 * object.cc (make_elf_object): Ditto.
12937 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12938 a format warning.
e1df38aa 12939
88ee28e9
L
12940009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12941
12942 PR gold/10930
12943 * testsuite/plugin_test.c: Include "config.h".
12944
2daedcd6
DK
129452009-11-09 Doug Kwan <dougkwan@google.com>
12946
12947 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12948 (arm_symbol_value): Remove.
12949 (Arm_relocate_functions::arm_branch_common,
12950 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12951 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12952 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12953 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12954 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12955 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12956 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12957 Arm_relocate_functions::thm_mobw_abs_nc,
12958 Arm_relocate_functions::thm_mov_abs,
12959 Arm_relocate_functions::movw_prel_nc,
12960 Arm_relocate_functions::thm_movt_abs,
12961 Arm_relocate_functions::movt_prel,
12962 Arm_relocate_functions::thm_movw_prel_nc,
12963 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12964 (Target_arm::Relocate::relocate): Only decompose address into two
12965 parts if relocation type uses the thumb-bit and pass the actual
12966 bit instead of a flag indicating that the thumb-bit is used. Adjust
12967 calls to methods in Arm_relocate_functions for this change.
12968
1276bc89 129692009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12970
12971 PR 10925
12972 * reloc.cc: Instantiate
12973 Sized_relobj::initialize_input_to_output_maps and
12974 Sized_relobj:free_input_to_output_maps.
12975
e53ad1b5
ILT
129762009-11-06 Ian Lance Taylor <iant@google.com>
12977
12978 PR 10876
12979 * defstd.cc (in_segment): Set only_if_ref true for "end".
12980
eb44217c
DK
129812009-11-06 Doug Kwan <dougkwan@google.com>
12982
12983 * arm.cc (class Reloc_stub): Correct a comment.
12984 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12985 (Target_arm::scan_section_for_stubs): New method declaration.
12986 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12987 Change methods from private to protected.
12988 (Target_arm::do_may_relax): New method definition.
12989 (Target_arm::do_relax, Target_arm::group_sections,
12990 Target_arm::scan_reloc_for_stub,
12991 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12992 (Target_arm::arm_input_section_map_): New data member declaration.
12993 (Target_arm::scan_reloc_for_stub,
12994 Target_arm::scan_reloc_section_for_stubs,
12995 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12996 Target_arm::do_relax): New method definitions.
12997
5d329b7d
ILT
129982009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12999
13000 * configure.ac: Check for (struct stat)::st_mtim
13001 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13002 * config.in: Regenerate.
13003 * configure: Regenerate.
13004
96a0d71b
ILT
130052009-11-05 Ian Lance Taylor <iant@google.com>
13006
13007 PR 10910
13008 * output.cc (Output_segment::add_output_section): Add missing
13009 return statement.
13010
594c8e5e
ILT
130112009-11-04 Ian Lance Taylor <iant@google.com>
13012
13013 PR 10880
13014 * object.h (class Object): Add is_needed and set_is_needed
13015 methods. Add is_needed_ field. Make bool fields into bitfields.
13016 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13017 defined in a dynamic object and referenced by a regular object,
13018 set is_needed for the dynamic object.
13019 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13020 if the file is marked with as_needed and it is not needed.
13021
22b127cc
ILT
130222009-11-04 Ian Lance Taylor <iant@google.com>
13023
13024 PR 10887
13025 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13026 tags if data is discarded by linker script.
13027 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13028 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13029 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13030 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13031
f5c870d2
ILT
130322009-11-04 Ian Lance Taylor <iant@google.com>
13033
13034 * layout.cc (Layout::get_output_section): Add is_interp and
13035 is_dynamic_linker_section parameters. Change all callers.
13036 (Layout::choose_output_section): Likewise.
13037 (Layout::make_output_section): Likewise.
13038 (Layout::add_output_section_data): Add is_dynamic_linker_section
13039 parameter. Change all callers.
13040 * layout.h (class Layout): Update declarations.
13041 * output.h (class Output_section): Add is_interp, set_is_interp,
13042 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13043 Add is_interp_, is_dynamic_linker_section_ fields. Change
13044 generate_code_fills_at_write_ to a bitfield.
13045 * output.cc (Output_section::Output_sections): Initialize new
13046 fields.
13047 (Output_segment::add_output_section): Add do_sort parameter.
13048 Change all callers.
13049
1ae4d23b
ILT
130502009-11-03 Ian Lance Taylor <iant@google.com>
13051
13052 PR 10860
13053 * options.h (class General_options): Add --warn-common.
13054 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13055 merging two common symbols.
13056 (Symbol_table::should_override): Handle --warn-common when merging
13057 a common symbol with a defined symbol. Use report_resolve_problem
13058 for multiple definitions.
13059 (Symbol_table::report_resolve_problem): New function.
13060 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13061
55da9579
DK
130622009-11-03 Doug Kwan <dougkwan@google.com>
13063
13064 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13065 stub_factory_.
13066 (Target_arm::stub_factory): New method definition.
13067 (Target_arm::new_arm_input_section,
13068 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13069 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 13070 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
13071 New type definitions.
13072 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13073 member declarations.
13074 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13075 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13076 New method definitions.
13077
37a9ac43
ILT
130782009-11-03 Ian Lance Taylor <iant@google.com>
13079
13080 * options.h (class General_options): Add --warn_constructors.
13081
b3d6a3d4
ILT
130822009-11-03 Ian Lance Taylor <iant@google.com>
13083
13084 PR 10893
13085 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13086 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13087
934b01dd
ILT
130882009-11-03 Ian Lance Taylor <iant@google.com>
13089
13090 PR 10895
13091 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13092 --msgid-bugs-address.
13093 (install-pdf): New target.
13094 (install-data_yes): Look up one directory to find mkinstalldirs.
13095
03c1939b
L
130962009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13097
13098 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13099 tree.
13100
ebd95253
DK
131012009-10-30 Doug Kwan <dougkwan@google.com>
13102
13103 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13104
e9bbb538
DK
131052009-10-30 Doug Kwan <dougkwan@google.com>
13106
13107 * arm.cc (Stub_addend_reader): New struct template definition
13108 and partial specializations.
13109 (Stub_addend_reader::operator()): New method definition for a
13110 partially specialized template.
13111
d5b40221
DK
131122009-10-30 Doug Kwan <dougkwan@google.com>
13113
13114 * arm.cc (Arm_relobj::processor_specific_flags): New method
13115 definition.
13116 (Arm_relobj::do_read_symbols): New method declaration.
13117 (Arm_relobj::processor_specific_flags_): New data member declaration.
13118 (Arm_dynobj): New class definition.
13119 (Target_arm::do_finalize_sections): Add input_objects parameter.
13120 (Target_arm::do_adjust_elf_header): New method declaration.
13121 (Target_arm::are_eabi_versions_compatible,
13122 (Target_arm::merge_processor_specific_flags): New method declaration.
13123 (Target_arm::do_make_elf_object): New overloaded method definitions
13124 and declaration.
13125 (Arm_relobj::do_read_symbols): New method definition.
13126 (Arm_dynobj::do_read_symbols): Ditto.
13127 (Target_arm::do_finalize_sections): Add input_objects parameters.
13128 Merge processor-specific flags from all input objects.
13129 (Target_arm::are_eabi_versions_compatible,
13130 Target_arm::merge_processor_specific_flags,
13131 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13132 New method definitions.
13133 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13134 Input_objects pointer type parameter.
13135 * layout.cc (Layout::finalize): Pass input objects to target's.
13136 finalize_sections function.
13137 * output.cc (Output_file_header::do_sized_write): Set ELF file
13138 header's processor-specific flags.
13139 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13140 Input_objects pointer type parameter.
13141 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13142 * target.h (Input_objects): New forward class declaration.
13143 (Target::processor_specific_flags,
13144 Target::are_processor_specific_flags_sect): New method definitions.
13145 (Target::finalize_sections): Add input_objects parameter.
13146 (Target::Target): Initialize processor_specific_flags_ and
13147 are_processor_specific_flags_set_.
13148 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13149 parameter.
13150 (Target::set_processor_specific_flags): New method definition.
13151 (Target::processor_specific_flags_,
13152 Target::are_processor_specific_flags_set_): New data member
13153 declarations.
13154 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13155 Input_objects pointer type parameter.
13156
ebabffbd
DK
131572009-10-30 Doug Kwan <dougkwan@google.com>
13158
13159 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13160
ad0f2072
ILT
131612009-10-28 Ian Lance Taylor <iant@google.com>
13162
13163 * object.h (class Relobj): Drop options parameter from
13164 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13165 do_scan_relocs, do_relocate. Change all callers.
13166 (class Sized_relobj): Drop options parameters from
13167 do_gc_process_relocs, do_scan_relocs, do_relocate,
13168 do_relocate_sections, relocate_sections, emit_relocs_scan,
13169 emit_relocs_scan_reltype. Change all callers.
13170 (struct Relocate_info): Remove options field and all references to
13171 it.
13172 * reloc.h (class Read_relocs): Remove options constructor
13173 parameter and options_ field. Change all callers.
13174 (class Gc_process_relocs, class Scan_relocs): Likewise.
13175 (class Relocate_task): Likewise.
13176 * target-reloc.h (scan_relocs): Remove options parameter. Change
13177 all callers.
13178 (scan_relocatable_relocs): Likewise.
13179 * target.h (class Sized_target): Remove options parameter from
13180 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13181 all callers.
13182 * gc.h (gc_process_relocs): Remove options parameter. Change all
13183 callers.
13184 * arm.cc: Update functions to remove options parameters.
13185 * i386.cc: Likewise.
13186 * powerpc.cc: Likewise.
13187 * sparc.cc: Likewise.
13188 * x86_64.cc: Likewise.
13189 * testsuite/testfile.cc: Likewise.
13190
8ffa3667
DK
131912009-10-28 Doug Kwan <dougkwan@google.com>
13192
13193 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13194 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13195 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13196 New method definitions.
13197
40f36857
CC
131982009-10-28 Cary Coutant <ccoutant@google.com>
13199
13200 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13201 (Plugin::cleanup_done_): New member.
13202 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13203 (Plugin_manager::cleanup_done_): Remove.
13204 (Plugin_manager::add_input_file): Edit error message.
13205 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13206 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13207
2c849493
ILT
132082009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13209
13210 * fileread.cc: (File_read::View::~View): Use the new
13211 data_ownership_ filed.
13212 (File_read::~File_read): Dispose the new whole_file_view_.
13213 (File_read::open): Mmap the whole file if needed.
13214 (File_read::open): Use whole_file_view_ instead of contents_.
13215 (File_read::find_view): Use whole_file_view_ if applicable.
13216 (File_read::do_read): Use whole_file_view_ instead of contents_.
13217 (File_read::make_view): Use whole_file_view_ instead of contents_,
13218 update File_read::View::View call.
13219 (File_read::find_or_make_view): Update File_read::View::View
13220 call.
13221 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13222 remove contents_
13223 (File_read::View::Data_ownership): New enum.
13224 (File_read::View::View): Replace bool mapped_ with Data_ownership
13225 argument.
13226 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13227 (File_read::View::data_ownership_): New field.
13228 (File_read::contents_): Remove (replaced by whole_file_view_).
13229 (File_read::whole_file_view_): New field.
13230 * options.h (class General_options): Add --keep-files-mapped.
13231
24998053
CC
132322009-10-27 Cary Coutant <ccoutant@google.com>
13233
13234 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13235 * testsuite/Makefile.am (plugin_test_5): New test case.
13236 * testsuite/Makefile.in: Regenerate.
13237
72adc4fa
DK
132382009-10-25 Doug Kwan <dougkwan@google.com>
13239
13240 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13241 from private to protected to allow access by child class.
13242 (Sized_relobj::do_relocate_sections): New method declaration.
13243 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13244 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13245 Sized_relobj::relocate_sections. Instantiate template explicitly
13246 for different target sizes and endianity.
13247
07f508a2
DK
132482009-10-24 Doug Kwan <dougkwan@google.com>
13249
13250 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13251 (Arm_input_section::as_arm_input_section): New method.
13252 (Arm_output_section): New class definition.
13253 (Arm_output_section::create_stub_group,
13254 Arm_output_section::group_sections): New method definitions.
13255
10ad9fe5
DK
132562009-10-22 Doug Kwan <dougkwan@google.com>
13257
13258 * arm.cc (Arm_input_section): New class definition.
13259 (Arm_input_section::init, Arm_input_section:do_write,
13260 Arm_input_section::set_final_data_size,
13261 Arm_input_section::do_reset_address_and_file_offset): New method
13262 definitions.
13263
56ee5e00
DK
132642009-10-21 Doug Kwan <dougkwan@google.com>
13265
13266 * arm.cc (Stub_table, Arm_input_section): New forward class
13267 declarations.
13268 (Stub_table): New class defintion.
13269 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13270 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13271 New method definition.
13272
b569affa
DK
132732009-10-21 Doug Kwan <dougkwan@google.com>
13274
13275 * arm.cc: Update copyright comments.
13276 (Target_arm): New forward class template declaration.
13277 (Arm_address): New type.
13278 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13279 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13280 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13281 constants.
13282 (Insn_template): Same.
13283 (DEF_STUBS): New macro.
13284 (Stub_type): New enum type.
13285 (Stub_template): New class definition.
13286 (Stub): Same.
13287 (Reloc_stub): Same.
13288 (Stub_factory): Same.
13289 (Target_arm::Target_arm): Initialize may_use_blx_ and
13290 should_force_pic_veneer_.
13291 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13292 Target_arm::should_force_pic_veneer,
13293 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13294 Target_arm::using_thumb_only, Target_arm:;default_target): New
13295 method defintions.
13296 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13297 New data member declarations.
13298 (Insn_template::size, Insn_template::alignment): New method defintions.
13299 (Stub_template::Stub_template): New method definition.
13300 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13301 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13302 (Stub_factory::Stub_factory): New method definition.
13303 * gold.h (string_hash): New template.
13304 * output.h (Input_section_specifier::hash_value): Use
13305 gold::string_hash.
13306 (Input_section_specifier::string_hash): Remove.
13307 * stringpool.cc (Stringpool_template::string_hash): Use
13308 gold::string_hash.
13309
6c172549
DK
133102009-10-20 Doug Kwan <dougkwan@google.com>
13311
13312 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13313 symbols of relaxed input sections.
13314 * output.h (Output_section::find_relaxed_input_section): Make
13315 method public.
13316
c5617f2f
DK
133172009-10-16 Doug Kwan <dougkwan@google.com>
13318
13319 * dynobj.cc (Versions::Versions): Initialize version_script_.
13320 Only insert base version symbol definition for a shared object
13321 if version script defines any version versions.
13322 (Versions::define_base_version): New method definition.
13323 (Versions::add_def): Check that base version is not needed.
13324 (Versions::add_need): Define base version lazily.
13325 * dynobj.h (Versions::define_base_version): New method declaration.
13326 (Versions::needs_base_version_): New data member declaration.
13327 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13328 (check_DATA): Add no_version_test.stdout.
13329 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13330 New make rules.
13331 * testsuite/Makefile.in: Regenerate.
13332 * testsuite/no_version_test.c: New file.
13333 * testsuite/no_version_test.sh: Ditto.
13334
3c12dcdb
DK
133352009-10-16 Doug Kwan <dougkwan@google.com>
13336
13337 * expression.cc (class Segment_start_expression): New class definition.
13338 (Segment_start_expression::value): New method definition.
13339 (script_exp_function_segment_start): Return a new
13340 Segment_start_expression.
13341 * gold/script-c.h (script_saw_segment_start_expression): New function
13342 prototype.
13343 * script-sections.cc (Script_sections::Script_sections): Initialize
13344 SAW_SEGMENT_START_EXPRESSION_ to false.
13345 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13346 and -Tbbs options to specify section addresses if given in
13347 command line and no SEGMENT_START expression is seen in a script.
13348 * script-sections.h (Script_sections::saw_segment_start_expression,
13349 Script_sections::set_saw_segment_start_expression): New method
13350 definition.
13351 (Script_sections::saw_segment_start_expression_): New data member
13352 declaration.
13353 * script.cc (script_saw_segment_start_expression): New function.
13354 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13355 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13356 script_test_7.sh and script_test_8.sh.
13357 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13358 script_test_8.stdout.
13359 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13360 (script_test_6, script_test_6.stdout, script_test_7,
13361 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13362 * Makefile.in: Regenerate.
13363 * testsuite/script_test_6.sh: New file.
13364 * testsuite/script_test_6.t: Same.
13365 * testsuite/script_test_7.sh: Same.
13366 * testsuite/script_test_7.t: Same.
13367 * testsuite/script_test_8.sh: Same.
13368
64b1ae37
DK
133692009-10-16 Doug Kwan <dougkwan@google.com>
13370
13371 * output.cc (Output_segment::set_section_list_address): Cast
13372 expressions to unsigned long long type to avoid format warnings.
13373
661be1e2
ILT
133742009-10-15 Ian Lance Taylor <iant@google.com>
13375
12edd763 13376 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13377 dot assignment to script_sections_.
12edd763
ILT
13378 * script-sections.cc (Script_sections::add_dot_assignment):
13379 Initialize if necessary.
13380
68b6574b
ILT
13381 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13382 program headers with no load segment if there is a linker script.
13383
661be1e2
ILT
13384 * layout.cc (Layout::set_segment_offsets): Align the file offset
13385 to the segment aligment for -N or -n with no load segment.
13386 * output.cc (Output_segment::add_output_section): Don't crash if
13387 the first section is a TLS section.
13388 (Output_segment::set_section_list_addresses): Print an error
13389 message if the address moves backward in a linker script.
13390 * script-sections.cc
13391 (Output_section_element_input::set_section_addresses): Don't
13392 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13393 (Orphan_output_section::set_section_addresses): Likewise.
13394
f15f61a7
DK
133952009-10-15 Doug Kwan <dougkwan@google.com>
13396
13397 * layout.cc (Layout::finish_dynamic_section): Generate tags
13398 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13399 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13400 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13401
82bb573a
ILT
134022009-10-14 Ian Lance Taylor <iant@google.com>
13403
13404 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13405 fields.
13406 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13407 data_shdr fields of relinfo.
13408 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13409 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13410 R_386_TLS_LDO_32, adjust based on section flags.
13411 (Target_i386::Relocate::fix_up_ldo): Remove.
13412
374ad285
ILT
134132009-10-13 Ian Lance Taylor <iant@google.com>
13414
13415 Add support for -pie.
13416 * options.h (class General_options): Add -pie and
13417 --pic-executable.
13418 (General_options::output_is_position_independent): Test -pie.
13419 (General_options::output_is_executable): Return true if not shared
13420 and not relocatable.
13421 (General_options::output_is_pie): Remove.
13422 * options.cc (General_options::finalize): Reject incompatible uses
13423 of -pie.
13424 * gold.cc (queue_middle_tasks): A -pie link is not static.
13425 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13426 * symtab.cc (Symbol::final_value_is_known): Return false if
13427 output_is_position_independent.
13428 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13429 output_is_position_independent.
13430 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13431 output_is_position_independent.
13432 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13433 output_is_position_independent.
13434 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13435 two_file_pie_test.
13436 (basic_pie_test.o, basic_pie_test): New targets.
13437 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13438 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13439 (two_file_pie_test): New target.
13440 * testsuite/Makefile.in: Rebuild.
13441 * README: Remove note saying that -pie is not supported.
13442
c6585162
ILT
134432009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13444
13445 * options.h (class General_options): Add -init and -fini.
13446 * layout.cc (Layout::finish_dynamic_section): Emit
13447 given init and fini functions.
13448
032ce4e9
ST
134492009-10-13 Sriraman Tallam <tmsriram@google.com>
13450
13451 * gc.h (gc_process_relocs): Check if icf is enabled using new
13452 function.
13453 * gold.cc (queue_initial_tasks): Likewise.
13454 (queue_middle_tasks): Likewise.
13455 * object.cc (do_layout): Likewise.
13456 * symtab.cc (is_section_folded): Likewise.
13457 * main.cc (main): Likewise.
13458 * reloc.cc (Read_relocs::run): Likewise.
13459 (Sized_relobj::do_scan_relocs): Likewise.
13460 * icf.cc (is_function_ctor_or_dtor): New function.
13461 (Icf::find_identical_sections): Check if function is ctor or dtor when
13462 safe icf is chosen.
13463 * options.h (General_options::icf): Change option to be an enum.
13464 (Icf_status): New enum.
13465 (icf_enabled): New method.
13466 (icf_safe_folding): New method.
13467 (set_icf_status): New method.
13468 (icf_status_): New variable.
13469 * (options.cc) (General_options::finalize): Set icf_status_.
13470 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13471 icf_test and icf_keep_unique_test to use the --icf enum flag.
13472 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13473 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13474
f345227a
ST
134752009-10-12 Sriraman Tallam <tmsriram@google.com>
13476
13477 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13478 includes to gc.h and icf.h.
13479 * arm.cc: Include gc.h.
13480 * gold.cc: Likewise.
13481 * i386.cc: Likewise.
13482 * powerpc.cc: Likewise.
13483 * sparc.cc: Likewise.
13484 * x86_64.cc: Likewise.
13485 * gc.h: Include icf.h.
13486
1c7814ed
ILT
134872009-10-11 Ian Lance Taylor <iant@google.com>
13488
13489 * plugin.cc: Include "gold.h" before other header files.
13490
ae3b5189
CD
134912009-10-10 Chris Demetriou <cgd@google.com>
13492
13493 * options.h (Input_file_argument::Input_file_type): New enum.
13494 (Input_file_argument::is_lib_): Replace with...
13495 (Input_file_argument::type_): New member.
13496 (Input_file_argument::Input_file_argument): Take Input_file_type
13497 'type' rather than boolean 'is_lib' as second argument.
13498 (Input_file_argument::is_lib): Use type_.
13499 (Input_file_argument::is_searched_file): New function.
13500 (Input_file_argument::may_need_search): Handle is_searched_file.
13501 * options.cc (General_options::parse_library): Support -l:filename.
13502 (General_options::parse_just_symbols): Update for Input_file_argument
13503 changes.
13504 (Command_line::process): Likewise.
13505 * archive.cc (Archive::get_file_and_offset): Likewise.
13506 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13507 * script.cc (read_script_file, script_add_file): Likewise.
13508 * fileread.cc (Input_file::Input_file): Likewise.
13509 (Input_file::will_search_for): Handle is_searched_file.
13510 (Input_file::open): Likewise.
13511 * readsyms.cc (Read_symbols::get_name): Likewise.
13512 * testsuite/Makefile.am (searched_file_test): New test.
13513 * testsuite/Makefile.in: Regenerate.
13514 * testsuite/searched_file_test.cc: New file.
13515 * testsuite/searched_file_test_lib.cc: New file.
13516
f3048a1d
ILT
135172009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13518 Ian Lance Taylor <iant@google.com>
13519
13520 * descriptor.cc: Include <cstdio> and "binary-io.h".
13521 (Descriptors::open): Open the files in binary mode always.
13522 * script.cc (Lex::get_token): Treat \r as whitespace.
13523
d4780e57
ILT
135242009-10-09 Ian Lance Taylor <iant@google.com>
13525
13526 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13527
d9a893b8
ILT
135282009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13529 Ian Lance Taylor <iant@google.com>
13530
13531 * configure.ac: Check for readv function also.
13532 * fileread.cc (readv): Define if not HAVE_READV.
13533 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13534 does not exist.
13535 * config.in: Regenerate.
13536 * configure: Regenerate.
13537
c0a62865
DK
135382009-10-09 Doug Kwan <dougkwan@google.com>
13539
13540 * layout.cc (Layout::make_output_section): Call target hook to make
13541 ordinary output section.
13542 (Layout::finalize): Adjust parameter list of call the
13543 Target::may_relax().
13544 * layout.h (class Layout::section_list): New method.
13545 * merge.h (Output_merge_base::entsize): Change visibility to public.
13546 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13547 New methods.
13548 (Output_merge_string::do_is_string): New method.
13549 * object.cc (Sized_relobj::do_setup): renamed from
13550 Sized_relobj::set_up.
13551 * object.h (Sized_relobj::adjust_shndx,
13552 Sized_relobj::initializ_input_to_output_maps,
13553 Sized_relobj::free_input_to_output_maps): Change visibilities to
13554 protected.
13555 (Sized_relobj::setup): Virtualize.
13556 (Sized_relobj::do_setup): New method declaration.
13557 (Sized_relobj::invalidate_section_offset,
13558 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13559 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13560 * options.cc (parse_int): New function.
13561 * options.h (parse_int): New declaration.
13562 (DEFINE_int): New macro.
13563 (stub_group_size): New option.
13564 * output.cc (Output_section::Output_section): Initialize memebers
13565 merge_section_map_, merge_section_by_properties_map_,
13566 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13567 (Output_section::add_input_section): Handled deferred code-fill
13568 generation and remove an old comment.
13569 (Output_section::add_relaxed_input_section): New method definition.
13570 (Output_section::add_merge_input_section): Use merge section by
13571 properties map to speed to search. Update merge section maps
13572 as appropriate.
13573 (Output_section::build_relaxation_map): New method definition.
13574 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13575 Same.
13576 (Output_section::relax_input_section): Renamed to
13577 Output_section::convert_input_sections_to_relaxed_sections and change
13578 interface to take a vector of pointers to relaxed sections.
13579 (Output_section::find_merge_section,
13580 Output_section::find_relaxed_input_section): New method definitions.
13581 (Output_section::is_input_address_mapped,
13582 Output_section::output_offset, Output_section::output_address):
13583 Use output section data maps to speed up searching.
13584 (Output_section::find_starting_output_address): Add comments.
13585 (Output_section::do_write,
13586 Output_section::write_to_postprocessing_buffer): Do code-fill
13587 generation as appropriate.
13588 (Output_section::get_input_sections): Invalidate relaxed input section
13589 map.
13590 (Output_section::restore_states): Adjust type of checkpoint .
13591 Invalidate relaxed input section map.
13592 * output.h (Output_merge_base): New class declaration.
13593 (Input_section_specifier): New class defintion.
13594 (class Output_relaxed_input_section) Change base class to
13595 Output_section_data_build.
13596 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13597 base class initializer.
13598 (Output_section::add_relaxed_input_section): New method declaration.
13599 (Output_section::Input_section): Change visibility to protected.
2e702c99 13600 (Output_section::Input_section::relobj,
c0a62865
DK
13601 Output_section::Input_section::shndx): Handle relaxed input sections.
13602 Output_section::input_sections) Change visibility to protected. Also
13603 define overload to return a non-const pointer.
13604 (Output_section::Merge_section_properties): New class defintion.
13605 (Output_section::Merge_section_by_properties_map,
13606 Output_section::Output_section_data_by_input_section_map,
13607 Output_section::Relaxation_map): New types.
13608 (Output_section::relax_input_section): Rename method to
13609 Output_section::convert_input_sections_to_relaxed_sections and change
13610 interface to take a vector of relaxed section pointers.
13611 (Output_section::find_merge_section,
13612 Output_section::find_relaxed_input_section,
13613 Output_section::build_relaxation_map,
13614 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13615 New method declarations.
13616 (Output_section::merge_section_map_
13617 Output_section::merge_section_by_properties_map_,
13618 Output_section::relaxed_input_section_map_,
13619 Output_section::is_relaxed_input_section_map_valid_,
13620 Output_section::generate_code_fills_at_write_): New data members.
13621 * script-sections.cc
13622 (Output_section_element_input::set_section_addresses): Call
13623 current_data_size and addralign methods of relaxed input sections.
13624 (Orphan_output_section::set_section_addresses): Call current_data_size
13625 and addralign methods of relaxed input sections.
13626 * symtab.cc (Symbol_table::compute_final_value): Extract template
13627 from the body of Symbol_table::sized_finalize_symbol.
13628 (Symbol_table::sized_finalized_symbol): Call
13629 Symbol_table::compute_final_value.
13630 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13631 (Symbol_table::compute_final_value): New templated method declaration.
13632 * target.cc (Target::do_make_output_section): New method defintion.
13633 * target.h (Target::make_output_section): New method declaration.
13634 (Target::relax): Add more parameters for input objects, symbol table
13635 and layout. Adjust call to do_relax.
13636 (Target::do_make_output_section): New method declaration.
13637 (Target::do_relax): Add parameters for input objects, symbol table
13638 and layout.
13639
d446d6c4
ILT
136402009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13641
13642 * pread.c: Include stdio.h.
13643
bc06c745
ILT
136442009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13645
13646 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13647 defined.
13648
75aea3d0
ILT
136492009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13650
13651 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13652 Change read_shndx type to unsigned int.
13653 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13654 int.
13655 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13656 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13657 Change read_shndx type to unsigned int.
13658 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13659 int.
13660 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13661 * layout.cc (Layout::create_symtab_sections): Cast the result of
13662 local_symcount * symsize to off_t in the gold_assert.
13663
be8fcb75
ILT
136642009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13665
13666 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13667 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13668 R_ARM_BASE_ABS.
13669 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13670 (Arm_relocate_functions::thm_abs5): New function.
13671 (Arm_relocate_functions::abs12): New function.
13672 (Arm_relocate_functions::abs16): New function.
13673 (Arm_relocate_functions::base_abs): New function.
13674 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13675 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13676 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13677 R_ARM_BASE_ABS.
13678 (Scan::global): Likewise.
13679 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13680 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13681 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13682 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13683 R_ARM_BASE_ABS.
13684
c2a122b6
ILT
136852009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13686
13687 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13688 (Arm_relocate_functions::movt_prel): New function.
13689 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13690 (Arm_relocate_functions::thm_movt_prel): New function.
13691 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13692 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13693 (Scan::global, Relocate::relocate): Likewise.
13694 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13695
c4aa1e2d
ILT
136962009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13697
13698 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13699 Incremental_checker.
13700 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13701 unsigned int.
13702 (class Incremental_inputs_header): New class.
13703 (Incremental_inputs_header_writer): Edit comment.
13704 (Incremental_inputs_entry): New class.
13705 (Incremental_inputs_entry_writer): Edit comment.
13706 (Sized_incremental_binary::do_find_incremental_inputs_section):
13707 Add *strtab_shndx parameter, fill it.
13708 (Sized_incremental_binary::do_check_inputs): New method.
13709 (Incremental_checker::can_incrementally_link_output_file): Use
13710 Sized_incremental_binary::check_inputs.
13711 (Incremental_inputs::report_command_line): Save command line in
13712 command_line_.
13713 * incremental.h:
13714 (Incremental_binary::find_incremental_inputs_section): New
13715 method.
13716 (Incremental_binary::do_find_incremental_inputs_section): Add
13717 strtab_shndx parameter.
13718 (Incremental_binary::do_check_inputs): New pure virtual method.
13719 (Sized_incremental_binary::do_check_inputs): Declare.
13720 (Incremental_checker::Incremental_checker): Add incremental_inputs
13721 parameter, use it to initialize incremental_inputs_.
13722 (Incremental_checker::incremental_inputs_): New field.
13723 (Incremental_checker::command_line): New method.
13724 (Incremental_checker::inputs): New method.
13725 (Incremental_checker::command_line_): New field.
13726
c549a694
ILT
137272009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13728
13729 * incremental.cc: Include <cstdarg> and "target-select.h".
13730 (vexplain_no_incremental): New function.
13731 (explain_no_incremental): New function.
13732 (Incremental_binary::error): New method.
13733 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13734 method.
13735 (make_sized_incremental_binary): New function.
13736 (open_incremental_binary): New function.
13737 (can_incrementally_link_file): Add checks if output is ELF and has
13738 inputs section.
13739 * incremental.h: Include "elfcpp_file.h" and "output.h".
13740 (Incremental_binary): New class.
13741 (Sized_incremental_binary): New class.
13742 (open_incremental_binary): Declare.
13743 * object.cc (is_elf_object): Use
13744 elfcpp::Elf_recognizer::is_elf_file.
13745 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13746 * output.h (Output_file::filesize): New method.
13747
fd3c5f0b
ILT
137482009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13749
13750 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13751 New function.
13752 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13753 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13754 function.
13755 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13756 function.
13757 (Arm_relocate_functions::movw_abs_nc): New function.
13758 (Arm_relocate_functions::movt_abs): New function.
13759 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13760 (Arm_relocate_functions::thm_movt_abs): New function.
13761 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13762 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13763 (Scan::global): Likewise.
13764 (Relocate::relocate): Likewise.
13765 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13766
7f5309a5
ILT
137672009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13768
13769 * arm.cc (Arm_relocate_functions::got_prel) New function.
13770 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13771 (Relocate::relocate): Likewise.
13772 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13773
364c7fa5
ILT
137742009-10-06 Ian Lance Taylor <iant@google.com>
13775
13776 * options.h (class General_options): Define
13777 split_stack_adjust_size parameter.
13778 * object.h (class Object): Add uses_split_stack_ and
13779 has_no_split_stack_ fields. Add uses_split_stack and
13780 has_no_split_stack accessor functions. Declare
13781 handle_split_stack_section.
13782 (class Reloc_symbol_changes): Define.
13783 (class Sized_relobj): Define Function_offsets. Declare
13784 split_stack_adjust, split_stack_adjust_reltype, and
13785 find_functions.
13786 * object.cc (Object::handle_split_stack_section): New function.
13787 (Sized_relobj::do_layout): Call handle_split_stack_section.
13788 * dynobj.cc (Sized_dynobj::do_layout): Call
13789 handle_split_stack_section.
13790 * reloc.cc (Sized_relobj::relocate_sections): Call
13791 split_stack_adjust for executable sections in split_stack
13792 objects. Pass reloc_map to relocate_section.
13793 (Sized_relobj::split_stack_adjust): New function.
13794 (Sized_relobj::split_stack_adjust_reltype): New function.
13795 (Sized_relobj::find_functions): New function.
13796 * target-reloc.h: Include "object.h".
13797 (relocate_section): Add reloc_symbol_changes parameter. Change
13798 all callers.
13799 * target.h (class Target): Add calls_non_split method. Declare
13800 do_calls_non_split virtual method. Declare match_view and
13801 set_view_to_nop.
13802 * target.cc: Include "elfcpp.h".
13803 (Target::do_calls_non_split): New function.
13804 (Target::match_view): New function.
13805 (Target::set_view_to_nop): New function.
13806 * gold.cc (queue_middle_tasks): Give an error if mixing
13807 split-stack and non-split-stack objects with -r.
13808 * i386.cc (Target_i386::relocate_section): Add
13809 reloc_symbol_changes parameter.
13810 (Target_i386::do_calls_non_split): New function.
13811 * x86_64.cc (Target_x86_64::relocate_section): Add
13812 reloc_symbol_changes parameter.
13813 (Target_x86_64::do_calls_non_split): New function.
13814 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13815 parameter.
13816 * powerpc.cc (Target_powerpc::relocate_section): Add
13817 reloc_symbol_changes parameter.
13818 * sparc.cc (Target_sparc::relocate_section): Add
13819 reloc_symbol_changes parameter.
13820 * configure.ac: Call AM_CONDITIONAL for the default target.
13821 * configure: Rebuild.
13822 * testsuite/Makefile.am (TEST_AS): New variable.
13823 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13824 (check_DATA): Add split_i386 and split_x86_64 files.
13825 (SPLIT_DEFSYMS): Define.
13826 (split_i386_[1234n].o): New targets.
13827 (split_i386_[124]): New targets.
13828 (split_i386_[1234r].stdout): New targets.
13829 (split_x86_64_[1234n].o): New targets.
13830 (split_x86_64_[124]): New targets.
13831 (split_x86_64_[1234r].stdout): New targets.
13832 (MOSTLYCLEANFILES): Add new executables.
13833 * testsuite/split_i386.sh: New file.
13834 * testsuite/split_x86_64.sh: New file.
13835 * testsuite/split_i386_1.s: New file.
13836 * testsuite/split_i386_2.s: New file.
13837 * testsuite/split_i386_3.s: New file.
13838 * testsuite/split_i386_4.s: New file.
13839 * testsuite/split_i386_n.s: New file.
13840 * testsuite/split_x86_64_1.s: New file.
13841 * testsuite/split_x86_64_2.s: New file.
13842 * testsuite/split_x86_64_3.s: New file.
13843 * testsuite/split_x86_64_4.s: New file.
13844 * testsuite/split_x86_64_n.s: New file.
13845 * testsuite/testfile.cc (Target_test): Update relocation_section
13846 function.
13847 * testsuite/Makefile.in: Rebuild.
13848
e8a9fcda
ILT
138492009-10-06 Ian Lance Taylor <iant@google.com>
13850
13851 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13852 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13853 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13854 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13855 the address on ldo_addrs_.
13856 (Target_i386::Relocate::fix_up_ldo): New function.
13857
e99daf92
ILT
138582009-10-06 Rafael Espindola <espindola@google.com>
13859
13860 * plugin.cc (add_input_library): New.
13861 (Plugin::load): Add add_input_library to tv.
13862 (Plugin_manager::add_input_file): Add the is_lib argument.
13863 (add_input_file): Update call to Plugin_manager::add_input_file.
13864 (add_input_library): New.
13865 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13866
966d4097
DK
138672009-09-30 Doug Kwan <dougkwan@google.com>
13868
13869 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13870 symbol and call Symbol::may_need_copy_reloc to determine if
13871 a copy reloc is needed.
13872 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13873 nocopyreloc is given in command line.
13874 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13875 given in command line.
13876 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13877 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13878 of the removed Target_i386::may_need_copy_reloc.
13879 * options.h (copyreloc): New option with default value false.
13880 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13881 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13882 instead of the removed Target_powerpc::may_need_copy_reloc.
13883 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13884 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13885 instead of the removed Target_sparc::may_need_copy_reloc.
13886 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13887 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13888 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13889 instead of the removed Target_x86_64::may_need_copy_reloc.
13890
029ba973
ILT
138912009-09-30 Ian Lance Taylor <iant@google.com>
13892
13893 * object.h (class Object): Remove target_ field, and target,
13894 sized_target, and set_target methods.
13895 (Object::sized_target): Remove.
13896 (class Sized_relobj): Update declarations. Remove sized_target.
13897 * object.cc (Sized_relobj::setup): Remove target parameter.
13898 Change all callers.
13899 (Input_objects::add_object): Don't do anything with the target.
13900 (make_elf_sized_object): Add punconfigured parameter. Change all
13901 callers. Set or test parameter target.
13902 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13903 Change all callers.
13904 * parameters.cc (Parameters::set_target): Change parameter type to
13905 be non-const.
13906 (Parameters::default_target): Remove.
13907 (set_parameters_target): Change parameter type to be non-const.
13908 (parameters_force_valid_target): New function.
13909 (parameters_clear_target): New function.
13910 * parameters.h (class Parameters): Update declarations. Remove
13911 default_target method. Add sized_target and clear_target
13912 methods. Change target_ to be non-const.
13913 (set_parameters_target): Update declaration.
13914 (parameters_force_valid_target): Declare.
13915 (parameters_clear_target): Declare.
13916 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13917 as NULL if we aren't searching.
13918 (Add_symbols::run): Don't check for compatible target.
13919 * fileread.cc (Input_file::open_binary): Call
13920 parameters_force_valid_target.
13921 * gold.cc (queue_middle_tasks): Likewise.
13922 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13923 set_target on object.
13924 * dynobj.h (class Sized_dynobj): Update declarations.
13925 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13926 make_elf_object returns NULL.
13927 (Archive::include_member): Don't check whether object target is
13928 compatible.
13929 * output.cc (Output_section::add_input_section): Get target from
13930 parameters.
13931 (Output_section::relax_input_section): Likewise.
13932 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13933 parameters.
13934 (Sized_relobj::do_scan_relocs): Likewise.
13935 (Sized_relobj::relocate_sections): Likewise.
13936 * resolve.cc (Symbol_table::resolve): Likewise.
13937 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13938 parameter. Change all callers.
13939 (Symbol_table::add_from_object): Get target from parameters.
13940 (Symbol_table::add_from_relobj): Don't check object target.
13941 (Symbol_table::add_from_dynobj): Likewise.
13942 (Symbol_table::define_special_symbol): Get target from
13943 parameters.
13944 * symtab.h (class Symbol_table): Update declaration.
13945 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13946 parameter. Change all callers. Clear parameter target.
13947 (Binary_test): Test target here.
13948 * testsuite/object_unittest.cc (gold_testsuite): Remove
13949 target_test_pointer parameter. Change all callers.
13950 (Object_test): Test target here.
13951
a6a22b83
ILT
139522009-09-26 Ian Lance Taylor <iant@google.com>
13953
13954 * testsuite/initpri1.c: Don't try to use constructor priorities if
13955 compiling with gcc before 4.3.
13956
6a8f49fe
ILT
139572009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13958
13959 * testsuite/retain_symbols_file_test.sh (check_present): Change
13960 output file name to retain_symbols_file_test.stdout.
13961 (check_absent): Likewise.
13962
8c604651
CS
139632009-09-18 Craig Silverstein <csilvers@google.com>
13964
13965 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13966 * options.cc: Include <cerrno> and <fstream>.
13967 (General_options::finalize): Parse -retain-symbols-file tag.
13968 * options.h: New flag.
13969 (General_options): New method should_retain_symbol, new
13970 variable symbols_to_retain.
13971 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13972 should_retain_symbol map.
13973 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13974 * testsuite/Makefile.in: Regenerate.
13975 * testsuite/retain_symbols_file_test.sh: New file.
13976
ca58b19f
NC
139772009-09-18 Nick Clifton <nickc@redhat.com>
13978
13979 * po/es.po: Updated Spanish translation.
13980
20e6d0d6
DK
139812009-09-17 Doug Kwan <dougkwan@google.com>
13982
13983 * debug.h (DEBUG_RELAXATION): New constant.
13984 (DEBUG_ALL): Add DEBUG_RELAXATION.
13985 (debug_string_to_enum): Add relaxation debug option.
13986 * layout.cc
13987 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13988 Layout::Relaxation_debug_check::read_sections,
13989 Layout::Relaxation_debug_check::read_sections): New method definitions.
13990 (Layout::Layout): Initialize data members
13991 record_output_section_data_from_scrips_,
13992 script_output_section_data_list_ and relaxation_debug_check_.
13993 (Layout::save_segments, Layout::restore_segments,
13994 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13995 Layout::relaxation_loop_body): New method definitions.
13996 (Layout::finalize): Support relaxation. Move section layout code to
13997 Layout::relaxation_loop_body.
13998 (Layout::set_asection_address_from_script): Move code for orphan
13999 section placement out.
14000 (Layout::place_orphan_sections_in_script): New method definition.
14001 * layout.h (Output_segment_headers, Output_file_header):
14002 New forward class declarations.
14003 (Layout::~Layout): Define.
14004 (Layout::new_output_section_data_from_script): New method definition.
14005 (Layout::place_orphan_sections_in_script): New method declaration.
14006 (Layout::Segment_states): New type declaration.
14007 (Layout::save_segments, Layout::restore_segments,
14008 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14009 Layout::relaxation_loop_body): New method declarations.
14010 (Layout::Output_section_data_list): New type declaration.
14011 (Layout::Relaxation_debug_check): New class definition.
14012 (Layout::record_output_section_data_from_script_,
14013 Layout::script_output_section_data_list_, Layout::segment_states_,
14014 Layout::relaxation_debug_check_): New data members.
14015 * output.cc: (Output_section_headers::do_size): New method definition.
14016 (Output_section_headers::Output_section_headers): Move size
14017 computation to Output_section_headers::do_size.
14018 (Output_segment_headers::do_size): New method definition.
e1df38aa 14019 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
14020 Output_file_header::do_size and call it.
14021 (Output_file_header::do_size): New method definition.
14022 (Output_data_group::Output_data_group): Adjust call to
14023 Output_section_data.
14024 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14025 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 14026 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
14027 RELAXED_INPUT_SECTION_CODE.
14028 (Output_section::Output_section): Initialize data member checkpoint_.
14029 (Output_section::~Output_section): Delete checkpoint object pointed
14030 by checkpoint_.
14031 (Output_section::add_input_section): Always add an Input_section if
14032 relaxing.
14033 (Output_section::add_merge_input_section): Add assert.
14034 (Output_section::relax_input_section): New method definition.
14035 (Output_section::set_final_data_size): Set load address to zero for
14036 an unallocated section.
14037 (Output_section::do_address_and_file_offset_have_reset_values):
14038 New method definition.
14039 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14040 Handle relaxed input section.
14041 (Output_section::sort_attached_input_sections): Checkpoint input
14042 section list lazily.
14043 (Output_section::get_input_sections): Change type of input_sections to
14044 list of Simple_input_section pointers. Checkpoint input section list
14045 lazily. Also handle relaxed input sections.
14046 (Output_section::add_input_section_for_script): Take a reference to
14047 a Simple_input_section object instead of Relobj pointer and section
14048 index as parameter. Handle relaxed input sections.
14049 (Output_section::save_states, Output_section::restore_states): New
14050 method definitions.
14051 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14052 (Output_data::is_data_size_fixed): New method definition.
14053 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14054 if it is fixed.
14055 (Output_data::address_and_file_offset_have_reset_values): New method
14056 definition.
14057 (Output_data::do_address_and_file_offset_have_reset_values): New method
14058 definition.
14059 (Output_data::set_data_size): Check that data size is not fixed.
14060 (Output_data::fix_data_size): New method definition.
14061 (Output_data::is_data_size_fixed_): New data member.
14062 (Output_section_headers::set_final_data_size): New method definition.
14063 (Output_section_headers::do_size): New method declaration.
14064 (Output_segment_headers::set_final_data_size): New method definition.
14065 (Output_segment_headers::do_size): New method declaration.
14066 (Output_file_header::set_final_data_size)::New method definition.
14067 (Output_file_header::do_size)::New method declaration.
14068 (Output_section_data::Output_section_data): Add new parameter
14069 is_data_size_fixed and use it to fix data size.
14070 (Output_data_const::Output_data_const): Adjust call to base class
14071 constructor and fix data size.
14072 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14073 base class constructor and fix data size.
14074 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14075 base class constructor and fix data size.
14076 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14077 class constructor and fix data size.
14078 (Output_data_group::set_final_data_size): New method definition.
14079 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14080 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14081 class constructor and fix data size.
14082 (Output_relaxed_input_section): New class definition.
14083 (Output_section::Simple_input_section): New class definition.
14084 (Output_section::get_input_sections): Adjust parameter list.
14085 (Output_section::add_input_section_for_script): Same.
14086 (Output_section::save_states, Output_section::restore_states,
14087 Output_section::do_address_and_file_offset_have_reset_values,
14088 (Output_section::Input_section::Input_section): Handle
14089 RELAXED_INPUT_SECTION_CODE. Add new overload for
14090 Output_relaxed_input_section.
14091 (Output_section::Input_section::is_input_section,
14092 Output_section::Input_section::set_output_section): Handle relaxed
14093 input section.
14094 (Output_section::Input_section::is_relaxed_input_section,
14095 Output_section::Input_section::output_section_data,
14096 Output_section::Input_section::relaxed_input_section): New method
14097 definitions.
14098 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14099 value.
14100 (Output_section::Input_section::u1_): Update comments.
14101 (Output_section::Input_section::u2_): Add new union member poris.
14102 (Output_section::Checkpoint_output_section): New classs definition.
14103 (Output_section::relax_input_section): New method declaration.
14104 (Output_section::checkpoint_): New data member.
14105 (Output_segment): Update comments.
14106 (Output_segment::Output_segment): Un-privatize copy constructor.
14107 (Output_segment::operator=): Un-privatize.
14108 * script-sections.cc (Output_section_element::Input_section_list):
14109 Change element type to Output_section::Simple_input_section.
14110 (Output_section_element_dot_assignment::set_section_addresses):
14111 Register output section data for relaxation clean up.
14112 (Output_data_exression::Output_data_expression): Adjust call to base
14113 constructor to fix data size.
14114 (Output_section_element_data::set_section_addresses): Register
14115 Output_data_expression object for relaxation clean up.
14116 (struct Input_section_info): Replace Relobj pointer and section index
14117 pair with Output_section::Simple_input_section and Convert struct to a
14118 class.
14119 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14120 Input_section_info data member to use accessors.
20e6d0d6
DK
14121 (Output_section_element_input::set_section_addresses): Use layout
14122 parameter. Adjust code to use Output_section::Simple_input_section
14123 and Input_secction_info classes. Register filler for relaxation
14124 clean up.
14125 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14126 and section index pair with Output_section::Simple_input_section
14127 class. Adjust code accordingly.
14128 (Phdrs_element::release_segment): New method definition.
14129 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14130 segment list.
14131 (Script_sections::release_segments): New method definition.
14132 * gold/script-sections.h (Script_sections::release_segments): New
14133 method declaration.
14134 * gold/target.h (Target::may_relax, Target::relax,
14135 Target::do_may_relax, Target::do_relax): New method definitions.
14136
5e445df6
ILT
141372009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14138
14139 * arm.cc (has_signed_unsigned_overflow): New function.
14140 (Arm_relocate_functions::abs8): New function.
14141 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14142 (Target_arm::Scan::global): Likewise.
14143 (Target_arm::relocate::relocate): Likewise.
14144 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14145 Likewise.
14146
8c604651 141472009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14148
14149 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14150 * testsuite/Makefile.in: Regenerate.
14151
1e9cc1c2
NC
141522009-09-11 Nick Clifton <nickc@redhat.com>
14153
14154 * po/gold.pot: Updated by the Translation project.
14155
6a89f575
CC
141562009-09-08 Cary Coutant <ccoutant@google.com>
14157
14158 * output.cc (Output_file::open): Add execute permission to empty file.
14159 * testsuite/Makefile.am (permission_test): New test.
14160 * testsuite/Makefile.in: Regenerate.
14161
fdcac5af
ILT
141622009-09-02 Ian Lance Taylor <iant@google.com>
14163
14164 * output.cc (Output_file::resize): Call map_no_anonymous rather
14165 than map.
14166
44453f85
ILT
141672009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14168
14169 * gold.cc: Include "incremental.h".
14170 (queue_initial_tasks): Call Incremental_checker methods.
14171 * incremental.cc: Include "output.h".
14172 (Incremental_checker::can_incrementally_link_output_file): New
14173 method.
14174 * incremental.h (Incremental_checker): New class.
14175
14176 * output.cc (Output_file::open_for_modification): New method.
14177 (Output_file::map_anonymous): Changed return type to bool. Record
14178 map in base_ field.
14179 (Output_file::map_no_anonymous): New method, broken out of map.
14180 (Output_file::map): Use map_no_anonymous and map_anonymous.
14181 * output.h (class Output_file): Update declarations.
14182
293c1386
CC
141832009-08-24 Cary Coutant <ccoutant@google.com>
14184
14185 * options.h (Command_line::Pre_options): New class.
14186 (Command_line::pre_options): New member.
14187 * options.cc (gold::options::ready_to_register): New variable.
14188 (One_option::register_option): Do nothing if not registering options.
14189 Assert if same short option registered twice.
14190 (General_options::General_options): Turn off option registration when
14191 done constructing.
14192 (Command_line::Pre_options::Pre_options): New constructor.
14193
f773f3d2
CC
141942009-08-24 Cary Coutant <ccoutant@google.com>
14195
06a73cfe
CC
14196 * options.h (General_options::no_keep_memory): Remove incorrect
14197 short option.
f773f3d2 14198
a15af8e2
RW
141992009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14200
14201 * Makefile.am (am__skiplex, am__skipyacc): New.
14202 * Makefile.in: Regenerate.
14203
c462b41b
RW
142042009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14205
14ec8efd
RW
14206 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14207 (INCLUDES): ... this.
14208 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14209 (AM_CPPFLAGS): Renamed from ...
14210 (INCLUDE): ... this.
14211 * Makefile.in, testsuite/Makefile.in: Regenerate.
14212
81ecdfbb
RW
14213 * Makefile.in: Regenerate.
14214 * aclocal.m4: Likewise.
14215 * config.in: Likewise.
14216 * configure: Likewise.
14217 * testsuite/Makefile.in: Likewise.
14218
c462b41b
RW
14219 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14220 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14221 * Makefile.in: Regenerate.
14222 * testsuite/Makefile.in: Regenerate.
14223
2da73f13
CC
142242009-08-19 Cary Coutant <ccoutant@google.com>
14225
14226 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14227 symbols in shared libraries overridden by hidden or internal symbols
14228 in the main program.
14229
2db70501
CD
142302009-08-19 Chris Demetriou <cgd@google.com>
14231
14232 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14233 checking source file names in error messages.
14234
f733487b
DK
142352009-08-18 Doug Kwan <dougkwan@google.com>
14236
14237 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14238 an elcpp::Ehdr as parameter. Adjust call to set_target.
14239 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14240 an elfcpp::Ehdr as parameter.
14241 * object.cc (Object::set_target): Remove the version that looks up
14242 a target and sets it.
14243 (Sized_relobj::setup): Take a Target object instead of
14244 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14245 (make_elf_sized_object): Find target and ask target to
14246 make an ELF object.
14247 * object.h: (Object::set_target): Remove the version that looks up
14248 a target and sets it.
14249 (Sized_relobj::setup): Take a Target object instead of
14250 an elfcpp:Ehdr as parameter.
14251 * target.cc: Include dynobj.h.
14252 (Target::do_make_elf_object_implementation): New.
2e702c99 14253 (Target::do_make_elf_object): New.
f733487b
DK
14254 * target.h (Target::make_elf_object): New template declaration.
14255 (Target::do_make_elf_object): New method declarations.
14256 (Target::do_make_elf_object_implementation): New template declaration.
14257
cc70f101
ILT
142582009-08-14 Ian Lance Taylor <iant@google.com>
14259
14260 * gold.h (FUNCTION_NAME): Define.
14261 (gold_unreachable): Use FUNCTION_NAME.
14262
ef5e0cb1
ST
142632009-08-12 Sriraman Tallam <tmsriram@google.com>
14264
14265 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14266 symbol in the --keep-unique list is not found.
14267
48c187ce
ST
142682009-08-12 Sriraman Tallam <tmsriram@google.com>
14269
14270 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14271 been maked as --keep-unique.
14272 (Icf::unfold_section): New function.
14273 * icf.h (Icf::unfold_section): New function.
14274 * options.h (General_options::keep_unique): New option.
14275 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14276 * testsuite/Makefile.in: Regenerate.
14277 * testsuite/icf_keep_unique_test.sh: New file.
14278 * testsuite/icf_keep_unique_test.cc: New file.
14279
645afe0c
CC
142802009-08-12 Cary Coutant <ccoutant@google.com>
14281
14282 PR 10471
14283 * resolve.cc (Symbol_table::resolve): Check for references from
14284 dynamic objects to hidden and internal symbols.
14285 * testsuite/Makefile.am (hidden_test.sh): New test.
14286 * testsuite/Makefile.in: Regenerate.
14287 * testsuite/hidden_test.sh: New script.
14288 * testsuite/hidden_test_1.c: New test source.
14289 * testsuite/hidden_test_main.c: New test source.
14290
11af873f
DK
142912009-08-11 Doug Kwan <dougkwan@google.com>
14292
14293 * arm.cc: Update comments.
14294 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14295 segment to locate the .ARM.exidx section if present.
14296
b9f7d72d
DK
142972009-08-09 Doug Kwan <dougkwan@google.com>
14298
14299 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14300 patch.
14301
ddd3c53c
ST
143022009-08-07 Sriraman Tallam <tmsriram@google.com>
14303 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14304 compiler warnings.
14305
27721062
ST
143062009-08-06 Sriraman Tallam <tmsriram@google.com>
14307
14308 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14309 valid tls_segment only for non-debug-section relocations.
14310 * testsuite/Makefile.am: Add gc_tls_test.
14311 * testsuite/Makefile.in: Regenerate.
14312 * testsuite/gc_tls_test.cc: New file.
14313 * testsuite/gc_tls_test.sh: New file.
14314
ef15dade 143152009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14316
ef15dade
ST
14317 * icf.cc: New file.
14318 * icf.h: New file.
14319 * Makefile.am (CCFILES): Add icf.cc.
14320 (HFILES): Add icf.h
14321 * Makefile.in: Regenerate.
14322 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14323 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14324 section, symbol and addend information for the relocs.
14325 * gold.cc (queue_middle_tasks): Call identical code folding.
14326 * gold.h: Add defines for multimap.
14327 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14328 to the call of finalize_local_symbols.
14329 * main.cc (main): Create object of class Icf.
14330 * object.cc (Sized_relobj::do_layout): Allow this function to be
14331 called twice during icf.
14332 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14333 to sections marked as identical by icf.
14334 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14335 when available.
14336 (Sized_relobj::do_section_entsize): New function.
14337 * object.h (Object::section_entsize): New function.
14338 (Object::do_section_entsize): New pure virtual function.
14339 (Relobj::finalize_local_symbols): Add new parameter.
14340 (Relobj::do_section_entsize): New function.
14341 * options.h (General_options::icf): New option.
14342 (General_options::icf_iterations): New option.
14343 (General_options::print_icf_sections): New option.
14344 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14345 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14346 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14347 icf.
14348 * symtab.cc (Symbol_table::is_section_folded): New function.
14349 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14350 to sections marked as identical by icf.
14351 * symtab.h (Symbol_table::set_icf): New function.
14352 (Symbol_table::icf): New function.
14353 (Symbol_table::is_section_folded): New function.
14354 (Symbol_table::icf_): New data member.
14355 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14356 * testsuite/Makefile.am: Add commands to build icf_test.
14357 * testsuite/Makefile.in: Regenerate.
14358 * testsuite/icf_test.sh: New file.
14359 * testsuite/icf_test.cc: New file.
14360
c3b65ac4
CD
143612009-07-24 Chris Demetriou <cgd@google.com>
14362
14363 * layout.cc (is_compressible_debug_section): Fix incorrect
14364 comment about compressed section names.
14365
1caf2c51
ILT
143662009-07-20 Ian Lance Taylor <ian@airs.com>
14367
14368 PR 10419
14369 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14370
1ef4d87f
ILT
143712009-07-16 Ian Lance Taylor <iant@google.com>
14372
14373 PR 10400
14374 * layout.h: #include <map>.
14375 (class Kept_section): Change from struct to class. Add accessors
14376 and setters. Add section size to Comdat_group mapping. Change
14377 Comdat_group to std::map. Add is_comdat_ field. Add
14378 linkonce_size field in union.
14379 (class Layout): Update declaration of find_or_add_kept_section.
14380 Don't declare find_kept_object.
14381 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14382 parameter. Add object, shndx, is_comdat, and is_group_name
14383 parameters. Change all callers. Adjust for new Kept_section.
14384 (Layout::find_kept_object): Remove.
14385 * object.cc (Sized_relobj::include_section_group): Update use of
14386 Kept_section. Rename secnum to shndx. Only record
14387 Kept_comdat_section if sections are the same size.
14388 (Sized_relobj::include_linkonce_section): Update use of
14389 Kept_section. Only record Kept_comdat_section if sections are the
14390 same size. Set size of linkonce section.
14391 (Sized_relobj::map_to_kept_section): Update call to
14392 get_kept_comdat_section.
14393 * object.h (class Sized_relobj): Rename fields in
14394 Kept_comdat_section to drop trailing underscores; change object
14395 field to Relobj*. Change Kept_comdat_section_table to store
14396 struct rather than pointer.
14397 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14398 Add kept_object and kept_shndx parameters. Change all callers.
14399 (Sized_relobj::get_kept_comdat_section): Change return type to
14400 bool. Add kept_object and kept_shndx parameters. Change all
14401 callers.
14402 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14403 Layout::find_or_add_kept_section.
14404
37c3b7b0
ILT
144052009-07-09 Ian Lance Taylor <iant@google.com>
14406
14407 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14408 Reserve space in the hash table.
14409
98fa85cb
ILT
144102009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14411
14412 * fileread.cc (File_read::get_mtime): New method.
14413 * fileread.h (Timespec): New structure.
14414 (File_read::get_mtime): New method.
14415 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14416 Renamed from timestamp_nsec.
14417 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14418 Elf_Xword.
e1df38aa 14419 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14420 timestamp_nsec.
e1df38aa 14421 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14422 (Incremental_inputs::report_obejct): Save mtime; style fix.
14423 (Incremental_inputs::report_script): Save mtime; style fix.
14424 (Incremental_inputs::finalize_inputs): Style fix.
14425 (Incremental_inputs::finalize): Style fix.
14426 (Incremental_inputs::create_input_section_data): Store inputs
14427 mtime.
14428 * incremental.h (Incremental_inputs::report_script): Add mtime
14429 argument.
14430 (Incremental_inputs::Input_info::Input_info): Intialize only one
14431 union member.
14432 (Incremental_inputs::Input_info::archive): Move to nameless
14433 union.
14434 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14435 (Incremental_inputs::Input_info::script): Move to nameless union.
14436 (Incremental_inputs::mtime): New field.
14437 * script.cc (read_input_script): Pass file mtime to
14438 Incremental_input.
14439 * script.h (Script_info::inputs): Style fix.
14440
c9d70757
ILT
144412009-07-01 Ian Lance Taylor <ian@airs.com>
14442
14443 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14444 instead of 32.
14445
9c547ec3
ILT
144462009-06-24 Ian Lance Taylor <iant@google.com>
14447
14448 PR 10156
14449 * layout.cc (Layout::choose_output_section): If we find an
14450 existing section, update the flags.
14451 (Layout::create_notes): New function, broken out of
14452 Layout::finalize.
14453 (Layout::finalize): Don't create note sections.
14454 (Layout::create_note): Don't crash if linker script discards
14455 section.
14456 (Layout::create_gold_note): Likewise.
14457 (Layout::create_build_id): Likewise. Don't set
14458 after_input_sections on the section.
14459 (Layout::create_executable_stack_info): Remove target parameter.
14460 Change caller.
14461 * layout.h (class Layout): Declare create_notes. Update
14462 declaration of create_executable_stack_info.
14463 * gold.cc (queue_middle_tasks): Call create_notes.
14464 * output.cc (Output_section::update_flags_for_input_section): Move
14465 here from output.h. If SHF_ALLOC flag is newly set, mark address
14466 invalid.
14467 * output.h (Output_data::mark_address_invalid): New function.
14468 (class Output_section): Only declare, not define,
14469 update_flags_for_input_section. Remove set_flags.
14470
55458500
ILT
144712009-06-24 Ian Lance Taylor <iant@google.com>
14472
14473 * script-sections.cc (Output_section_definition::
14474 set_section_addresses): Rename shadowing local load_address to
14475 laddr.
14476
1307d6cd
ILT
144772009-06-24 Ian Lance Taylor <iant@google.com>
14478
14479 PR 10244
14480 * reloc.cc (relocate_sections): Skip empty relocation sections.
14481
ec3f783e
ILT
144822009-06-23 Ian Lance Taylor <iant@google.com>
14483
14484 PR 10156
14485 * layout.cc (Layout::create_note): Use choose_output_section
14486 rather than make_output_section.
14487
459c9f1c
ILT
144882009-06-23 Ian Lance Taylor <iant@google.com>
14489
14490 PR 10237
14491 * options.cc (General_options::parse_V): Set printed_version_.
14492 (General_options::General_options): Initialize printed_version_.
14493 * options.h (class General_options): Add printed_version_ field.
14494 * gold.cc (queue_initial_tasks): If there are no input files,
14495 don't give a fatal error if we printed the version information.
14496 (queue_middle_tasks): If using -r with a shared object, give a
14497 fatal error rather than an ordinary error.
14498
1518dc8f
ILT
144992009-06-23 Ian Lance Taylor <iant@google.com>
14500
14501 PR 10219
14502 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14503 (Layout::make_output_section): Set have_stabstr_section_ if we see
14504 a .stab*str section.
14505 (Layout::finalize): Call link_stabs_sections.
14506 (Layout::link_stabs_sections): New file.
14507 * layout.h (class Layout): Add have_stabstr_section_ field.
14508 Declare link_stabs_sections.
14509
3d857b98
DK
145102009-06-23 Doug Kwan <dougkwan@google.com>
14511
14512 * Makefile.am (libgold_a_LIBADD): New.
14513 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14514 * Makefile.in: Regenerate.
3d857b98
DK
14515 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14516 * configure: Regenerate.
14517 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14518 * fileread.cc: Include sys/state.h
14519 * gold.h: Declare memmem and strndup if found missing.
14520 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14521
0639a6f6
ILT
145222009-06-23 Ian Lance Taylor <iant@google.com>
14523
14524 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14525 * configure: Rebuild.
14526
8d63875c
ILT
145272009-06-23 Ian Lance Taylor <iant@google.com>
14528
14529 PR 10147
14530 * object.cc (Object::section_contents): Don't try to get a view if
14531 the section has length zero.
14532 (Object::handle_gnu_warning_section): If the section is empty, use
14533 the name of the section as the warning.
14534
f7c8a183
ILT
145352009-06-23 Ian Lance Taylor <iant@google.com>
14536
14537 PR 10133
14538 * stringpool.h (class Stringpool_template): Add optimize_ field.
14539 (Stringpool_template::set_optimize): New function.
14540 * stringpool.cc (Stringpool_template::Stringpool_template):
14541 Initialize optimize_ field.
14542 (Stringpool_template::set_string_offsets): Test local optimize
14543 fild rather than parameter.
14544 * layout.cc (Layout::Layout): Call set_optimize on the section
14545 name stringpool.
14546
e6a307ba
ILT
145472009-06-22 Ian Lance Taylor <iant@google.com>
14548
14549 PR 10030
14550 * yyscript.y: Parse TARGET.
14551 * script.cc (script_set_target): New function.
14552 * script-c.h (script_set_target): Declare.
14553 * options.cc (General_options::string_to_object_format): Rename
14554 from string_to_object_format in anonymous namespace. Change
14555 callers.
14556 * options.h (class General_options): Declare
14557 string_to_object_format.
14558
3ee173de
ILT
145592009-06-22 Ian Lance Taylor <iant@google.com>
14560
14561 * script-sections.cc (Script_sections::create_segments): Don't put
14562 program headers in a PT_LOAD segment if -n or -N.
14563
145642009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14565
14566 PR 10141
14567 * options.h (class General_options): Add -z lazy and -z now. Sort
14568 -z options into alphabetical order.
14569 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14570
cd6739a1 145712009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14572
14573 * layout.cc (Layout::make_output_section): Call
14574 Target::new_output_section.
14575 (Layout::attach_allocated_section_to_segment): Put large section
14576 sections in a separate load segment with the large segment flag
14577 set.
14578 (Layout::segment_precedes): Sort large data segments after other
14579 load segments.
14580 (align_file_offset): New static function.
14581 (Layout::set_segment_offsets): Use align_file_offset.
14582 * output.h (class Output_section): Add is_small_section_ and
14583 is_large_section_ fields.
14584 (Output_section::is_small_section): New function.
14585 (Output_section::set_is_small_section): New function.
14586 (Output_section::is_large_section): New function.
14587 (Output_section::set_is_large_section): New function.
14588 (Output_section::is_large_data_section): New function.
14589 (class Output_segment): Add is_large_data_segment_ field.
14590 (Output_segment::is_large_data_segment): New function.
14591 (Output_segment::set_is_large_data_segment): New function.
14592 * output.cc (Output_section::Output_section): Initialize new
14593 fields.
14594 (Output_segment::Output_segment): Likewise.
14595 (Output_segment::add_output_section): Add assertion that large
14596 data sections always go in large data segments. Force small data
14597 sections to the end of the list of data sections. Force small BSS
14598 sections to the start of the list of BSS sections. For large BSS
14599 sections to the end of the list of BSS sections.
14600 * symtab.h (class Symbol): Declare is_common_shndx.
14601 (Symbol::is_defined): Check Symbol::is_common_shndx.
14602 (Symbol::is_common): Likewise.
14603 (class Symbol_table): Define enum Commons_section_type. Update
14604 declarations. Add small_commons_ and large_commons_ fields.
14605 * symtab.cc (Symbol::is_common_shndx): New function.
14606 (Symbol_table::Symbol_table): Initialize new fields.
14607 (Symbol_table::add_from_object): Put small and large common
14608 symbols in the right list.
14609 (Symbol_table::sized_finalized_symbol): Check
14610 Symbol::is_common_shndx.
14611 (Symbol_table::sized_write_globals): Likewise.
14612 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14613 common symbol lists. Don't call do_allocate_commons_list if the
14614 list is empty.
14615 (Symbol_table::do_allocate_commons_list): Remove is_tls
14616 parameter. Add comons_section_type parameter. Change all
14617 callers. Handle small and large common symbols.
14618 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14619 Symbol::is_common_shndx.
14620 * resolve.cc (symbol_to_bits): Likewise.
14621 * target.h (Target::small_common_shndx): New function.
14622 (Target::small_common_section_flags): New function.
14623 (Target::large_common_shndx): New function.
14624 (Target::large_common_section_flags): New function.
14625 (Target::new_output_section): New function.
14626 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14627 small_common_section_flags, and large_common_section_flags
14628 fields.
14629 (Target::do_new_output_section): New virtual function.
14630 * arm.cc (Target_arm::arm_info): Initialize new fields.
14631 * i386.cc (Target_i386::i386_info): Likewise.
14632 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14633 Likewise.
14634 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14635 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14636 (Target_x86_64::do_new_output_section): New function.
14637 * configure.ac: Define conditional MCMODEL_MEDIUM.
14638 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14639 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14640 (large_LDFLAGS): Define.
14641 * testsuite/large.c: New file.
14642 * testsuite/testfile.cc (Target_test::test_target_info):
14643 Initialize new fields.
14644 * configure, testsuite/Makefile.in: Rebuild.
14645
bb04269c
DK
146462009-06-05 Doug Kwan <dougkwan@google.com>
14647
14648 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14649 * Makefile.in: Regenerate.
bb04269c
DK
14650 * i386.cc (class Target_i386): Define new virtual method to
14651 override do_is_local_label_name in parent.
14652 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14653 local symbols if --discard-locals or -X is given.
14654 * options.h (class General_options): Declare new options
14655 '--discard-locals' and '-X' for discarding locals.
14656 * target.h (class Target): Define new methods is_local_label_name.
14657 Declare new virtual method do_is_local_label_name.
14658 * target.cc: New file.
14659 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14660 (check_SCRIPTS): Add discard_locals_test.sh.
14661 (check_DATA): Add discard_local_tests.syms.
14662 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14663 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14664 * testsuite/Makefile.in: Regenerate.
14665 * testsuite/discard_locals_test.c: New file.
14666 * testsuite/discard_locals_test.sh: Same.
14667
805bb01c
DK
146682009-06-05 Doug Kwan <dougkwan@google.com>
14669
14670 * object.cc (Sized_relobj::Sized_relobj): Initialize
14671 discarded_eh_frame_shndx_ to -1U.
14672 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14673 section.
14674 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14675 a discarded .eh_frame section.
14676 (Sized_relobj::do_finalize_local_symbols): Ditto.
14677 * object.h (class Sized_relobj): Declare new member
14678 discarded_eh_frame_shndx_.
14679 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14680 (local_labels_test.o, local_labels_test): New rules.
14681 * testsuite/Makefile.in: Regenerate.
14682
1dcd334d
DK
146832009-06-04 Doug Kwan <dougkwan@google.com>
14684
14685 * layout.cc (Layout::section_name_mapping): Add mapping for
14686 special ARM sections.
14687
96d49306
DK
146882009-06-03 Doug Kwan <dougkwan@google.com>
14689
14690 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14691 (utils::has_overflow): Same.
14692
dff16297
ILT
146932009-06-03 Ian Lance Taylor <iant@google.com>
14694
14695 * layout.cc (Layout::section_name_mapping): New array, replacing
14696 Layout::linkonce_mapping.
14697 (Layout::section_name_mapping_count): New variable, replacing
14698 Layout::linkonce_mapping_count.
14699 (Layout::linkonce_output_name): Remove.
14700 (Layout::output_section_name): Rewrite.
14701 * layout.h (class Layout): Rename Linkonce_mapping to
14702 Section_name_mapping, linkonce_mapping to section_name_mapping,
14703 linkonce_mapping_count to section_name_mapping_count. Don't
14704 declare linkonce_output_name.
14705
c121c671
DK
147062009-06-03 Doug Kwan <dougkwan@google.com>
14707
14708 * gold/arm.cc (namespace utils): New.
14709 (Target_arm::reloc_is_non_pic): Define new method.
14710 (class Arm_relocate_functions): New.
14711 (Target_arm::Relocate::relocate): Handle relocation types used by
14712 Android.
14713
07800fab
ILT
147142009-06-03 Ian Lance Taylor <iant@google.com>
14715
14716 * arm.cc (Target_arm::scan::global): Use || instead of |.
14717
c121c671
DK
147182009-06-02 Doug Kwan <dougkwan@google.com>
14719
14720 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14721 issued_non_pic_error_.
14722 (class Target_arm::Scan): Declare new method check_non_pic.
14723 Define new method symbol_needs_plt_entry.
14724 Declare new data member issued_non_pic_error_.
14725 (class Target_arm::Relocate): Declare new method
14726 should_apply_static_reloc.
14727 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14728 (Target_arm::Scan::check_non_pic): Define new method.
14729 (Target_arm::Scan::local): Handle a small subset of reloc types used
14730 by Android.
14731 (Target_arm::Scan::local): Same.
14732 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14733
b19b0c6d
ILT
147342009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14735
14736 * incremental.cc (Incremental_inputs::report_command_line): Filter
14737 out --incremental-* options.
14738
94cdfcff
DK
147392009-05-29 Doug Kwan <dougkwan@google.com>
14740
14741 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14742 template class.
14743 (class Target_arm): Update comment.
14744 (Target_arm::Target_arm): Initialize new data members GOT_,
14745 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14746 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14747 and Target_arm::rel_dyn_section.
14748 Declare new_enum Target_arm::Got_type.
14749 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14750 and DYNBSS_.
14751 Update commments for member do_dynsym_value.
14752 (Target_arm::got_size, Target_arm::plt_section,
14753 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14754 new methods inside class defintion.
14755 (Target_arm::got_section): Define new method.
14756 (Target_arm::rel_dyn_section): Same.
14757 (Output_data_plt_arm): New template class.
14758 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14759 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14760 (Output_data_plt_arm::add_entry): Same.
14761 (Output_data_plt_arm::first_plt_entry): Define new
14762 static data member for PLT instruction template.
14763 (Output_data_plt_arm::plt_entry): Same.
14764 (Output_data_plt_arm::do_write): Define new method.
14765 (Target_arm::make_plt_entry): Same.
14766 (Target_arm::do_finalize_sections): Same.
14767 (Target_arm::do_dynsym_value): Same.
14768
4a657b0d
DK
147692009-05-28 Doug Kwan <dougkwan@google.com>
14770
14771 * Makefile.am (TARGETSOURCES): Add arm.cc.
14772 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14773 * Makefile.in: Regenerate.
14774 * arm.cc: New file.
14775 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14776
e7ae8c36
DK
147772009-05-26 Doug Kwan <dougkwan@google.com>
14778
14779 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14780 (General_options::check_excluded_libs): Strip off directories in
14781 archive name before matching like GNU ld does.
14782 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14783 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14784 (exclude_libs_test_LDFLAGS): Add linker option
14785 -Wl,--exclude-libs,libexclude_libs_test_3
14786 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14787 an explicit archive without using -l.
14788 (alt/libexclude_libs_test_3.a): New make rule.
14789 * testsuite/Makefile.in: Regenerate.
14790 * testsuite/exclude_libs_test.c : Declare lib3_default().
14791 (main): Call it.
14792 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14793 * exclude_libs_test_3.c: New file.
14794
f12e7348
NC
147952009-05-26 Nick Clifton <nickc@redhat.com>
14796
14797 * po/id.po: New Indonesian translation.
14798 * po/gold.pot: Updated template file.
14799
4daadc0d
ST
148002009-05-22 Sriraman Tallam <tmsriram@google.com>
14801
e1df38aa 14802 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14803 gc_comdat_test files. Add -Wl,--gc-sections to build
14804 gc_comdat_test.
14805 * testsuite/Makefile.in: Regenerate.
14806 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14807
531813ad
ST
148082009-05-21 Sriraman Tallam <tmsriram@google.com>
14809
14810 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14811 kept comdat section was garbage collected.
14812 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14813 * testsuite/Makefile.in: Regenerate.
14814 * testsuite/gc_comdat_test.sh: New file.
14815 * testsuite/gc_comdat_test_1.cc: New file.
14816 * testsuite/gc_comdat_test_2.cc: New file.
14817
65514900
CC
148182009-05-19 Doug Kwan <dougkwan@google.com>
14819
14820 * archive.cc (Archive::Archive): Move constructor from archive.h
14821 to here. Initialize no_export_.
14822 (Archive::get_elf_object_for_member): Set no_export flag of object.
14823 * archive.h (Archive::Archive): Move constructor body to
14824 archive.cc.
14825 (Archive::no_export): New method.
14826 (Archive::no_export_): New field.
14827 * object.h (Object::Object): Initialize no_export_ to false.
14828 (Object::no_export, Object::set_no_export): New methods.
14829 (Object::no_export_): New field.
14830 * options.cc (General_options::parse_exclude_libs): New method.
14831 (General_options::check_excluded_libs) Same.
14832 * options.h (exclude_libs): New option.
14833 (General_options::check_excluded_libs): New method declaration.
14834 (General_options::excluded_libs_): New field.
14835 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14836 default or protected visibility if an object has no-export flag set.
14837 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14838 (check_SCRIPTS): Add exclude_libs_test.sh.
14839 (check_DATA): Add exclude_libs_test.syms.
14840 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14841 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14842 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14843 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14844 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14845 libexclude_libs_test_2.a): New rules.
14846 * testsuite/Makefile.in: Regenerate.
14847 * testsuite/exclude_libs_test.c: New file.
14848 * testsuite/exclude_libs_test.sh: Ditto.
14849 * testsuite/exclude_libs_test_1.c: Ditto.
14850 * testsuite/exclude_libs_test_2.c: Ditto.
14851
1b77ea50
ILT
148522009-05-15 Ian Lance Taylor <iant@google.com>
14853
14854 * configure.ac: Check for declarations for cases where libiberty.h
14855 checks HAVE_DECL_xxx.
14856 * configure, config.in: Rebuild.
14857
072fe7ce
ILT
148582009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14859
14860 * gold.h (Incremental_argument_list): Remove (invalid) forward
14861 declaration.
14862 * incremental.cc (Incremental_inputs::report_achive): New method.
14863 (Incremental_inputs::report_object): New method.
14864 (Incremental_inputs::report_script): New method.
14865 (Incremental_inputs::finalize_inputs): New method.
14866 (Incremental_inputs::finalize): Call finalize_inputs().
14867 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14868 Create inputs entries.
14869 * incremental.h (Incremental_input_type): New enum.
14870 (Incremental_inputs::Incremental_input): Initialize new fields.
14871 (Incremental_inputs::report_inputs): New method.
14872 (Incremental_inputs::report_achive): New method.
14873 (Incremental_inputs::report_object): New method.
14874 (Incremental_inputs::report_script): New method.
14875 (Incremental_inputs::finalize_inputs): New method.
14876 (Incremental_inputs::Input_info): New struct.
14877 (Incremental_inputs::Input_info_map): New typedef.
14878 (Incremental_inputs::lock_): New field.
14879 (Incremental_inputs::Inputs_): New field.
14880 (Incremental_inputs::Inputs_map): New field.
14881 * main.cc (main): Call Incremental_input::report_inputs.
14882 * options.h (Input_argument_list): Typedef moved from
14883 Input_arguments.
14884 (Input_file_group::Files): Remove, use ::Input_argument_list.
14885 (Input_file_group::Input_argument_list): Remove, use
14886 ::Input_argument_list.
14887 * plugin.cc (Plugin_manager::add_input_file): Add error in
14888 incremental build.
14889 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14890 functions.
14891 * script.cc (read_input_script): Call
14892 Incremental_input::report_script.
14893 * script.h (Script_info): New class.
14894
b0481b0b
ILT
148952009-04-27 Ian Lance Taylor <iant@google.com>
14896
14897 * x86_64.cc (do_adjust_output_section): Set entsize to
14898 plt_entry_size.
14899
b22a5a41 149002009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14901
14902 * output.cc (Output_file::close): After short writes, continue
14903 writing from the correct offset in the buffer being written.
14904
40fde488
CD
149052009-04-23 Chris Demetriou <cgd@google.com>
14906
14907 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14908 * configure: Regenerate.
14909 * config.in: Regenerate.
14910 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14911 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14912
3ce2c28e
ILT
149132009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14914
14915 * incremental.cc (Incremental_inputs_header_data): Renamed from
14916 Incremental_input_header_data.
14917 (Incremental_inputs_header_data::data_size): New field.
14918 (Incremental_inputs_header_data::put_input_file_count): Renamed
14919 from input_file_count.
14920 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14921 from command_line_offset.
14922 (Incremental_inputs_header_data::put_reserved): Renamed from
14923 put_reserved.
14924 (Incremental_inputs_entry_data): Renamed from
14925 Incremental_input_entry_data.
14926 (Incremental_inputs_entry_data::data_size): New field.
14927 (Incremental_inputs::report_command_line): New method.
14928 (Incremental_inputs::finalize): New method.
14929 (Incremental_inputs::create_incremental_inputs_data): New method.
14930 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14931 * incremental.h: New file.
14932 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14933 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14934 incremental builds.
703d02da 14935 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14936 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14937 (Layout::create_incremental_info_sections): New method.
14938 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14939 * main.cc (main): Notify Incremental_input of the command line.
14940
e55bde5e
ILT
149412009-04-01 Ian Lance Taylor <iant@google.com>
14942 Mikolaj Zalewski <mikolajz@google.com>
14943
14944 * gold.h (reserve_unordered_map): Define, three versions, one for
14945 each version of Unordered_map.
14946 * layout.cc (Layout::Layout): Remove options parameter. Add
14947 number_of_input_files parameter. Don't initialize options_.
14948 Initialize number_of_input_files_ and resized_signatures_. Move
14949 sections_are_attached_.
14950 (Layout::layout_group): Reserve space for group_signatures_.
14951 (Layout::find_or_add_kept_section): Change name parameter to be a
14952 reference. Resize signatures_ map when it gets large enough.
14953 (Layout::layout_eh_frame): Use parameters->options() instead of
14954 this->options_.
14955 (Layout::make_output_section): Likewise.
14956 (Layout::attach_allocated_section_to_segment): Likewise.
14957 (Layout::finalize, Layout::create_executable_stack): Likewise.
14958 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14959 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14960 * layout.h (class Layout): Update declarations. Remove options_
14961 field. Add number_of_input_files_ and resized_signatures_
14962 fields. Move sections_are_attached_ field.
14963 * main.cc (main): Pass number of input files to Layout
14964 constructor. Don't pass options.
14965
154b857c
ILT
149662009-03-30 Ian Lance Taylor <iant@google.com>
14967
14968 * ffsll.c (ffsll): Correct implementation.
14969
2f35ab9b
ILT
149702009-03-27 Ian Lance Taylor <iant@google.com>
14971
fd03461a
ILT
14972 * ffsll.c: New file.
14973 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14974 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14975 * ftruncate.c (ftruncate): Declare before definition.
14976 * mremap.c (mremap): Likewise.
14977 * pread.c (pread): Likewise.
14978 * configure, Makefile.in, config.in: Rebuild.
14979
2f35ab9b
ILT
14980 * mremap.c: New file.
14981 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14982 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14983 (mremap): Declare if HAVE_MREMAP is not defined.
14984 * configure, Makefile.in, config.in: Rebuild.
14985
33aea2fd
CC
149862009-03-27 Cary Coutant <ccoutant@google.com>
14987
14988 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14989 position independent.
14990 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14991 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14992
6d479619
CC
149932009-03-24 Cary Coutant <ccoutant@google.com>
14994
14995 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14996 an executable.
14997 (needs_dynamic_reloc): Likewise.
14998
afc06bb8
ILT
149992009-03-24 Ian Lance Taylor <iant@google.com>
15000
15001 * yyscript.y (file_cmd): Recognize EXTERN.
15002 (extern_name_list, extern_name_list_body): New nonterminals.
15003 * script.cc (script_add_extern): Define.
15004 * script-c.h (script_add_extern): Declare.
15005
f6060a4d
ILT
150062009-03-24 Rafael Avila de Espindola <espindola@google.com>
15007
15008 * object.cc (is_elf_object): Define.
15009 * object.h (is_elf_object): Declare.
15010 * archive.cc (Archive::get_elf_object_for_member): Call
15011 is_elf_object.
33aea2fd 15012 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 15013
26736d8e
ILT
150142009-03-24 Elliott Hughes <enh@google.com>
15015
15016 * output.cc (Output_file::map_anonymous): Define.
15017 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15018 try an anonymous one. Report the size if the mmap fails.
15019 * output.h (class Output_file): Declare map_anonymous.
15020
22fd9730
ILT
150212009-03-24 Ian Lance Taylor <iant@google.com>
15022
15023 * target-select.cc (instantiate_target): Don't acquire the lock if
15024 the instantiated_target_ field has already been set.
15025
cb010894
ILT
150262009-03-23 Ian Lance Taylor <iant@google.com>
15027
7f055c20
ILT
15028 * gold-threads.h (class Initialize_lock): Define.
15029 * gold-threads.cc (class Initialize_lock_once): Define.
15030 (initialize_lock_control): New static variable.
15031 (initialize_lock_pointer): New static variable.
15032 (initialize_lock_once): New static function.
15033 (Initialize_lock::Initialize_lock): Define.
15034 (Initialize_lock::initialize): Define.
15035 * target-select.h: Include "gold-threads.h".
15036 (class Target_selector): Add lock_ and initialize_lock_ fields.
15037 Don't define instantiate_target, just declare it.
15038 * target-select.cc (Target_selector::Target_selector): Initialize
15039 new fields.
15040 (Target_selector::instantiate_target): Define.
15041 * descriptors.h: Include "gold-threads.h".
15042 (class Descriptors): Add initialize_lock_ field.
15043 * descriptors.cc (Descriptors::Descriptors): Initialize new
15044 field.
15045 (Descriptors::open): Use initialize_lock_ field
15046 * errors.h (class Errors): Add initialize_lock_ field.
15047 * errors.cc (Errors::Errors): Initialize new field.
15048 (Errors::initialize_lock): Use initialize_lock_ field.
15049 * powerpc.cc (class Target_selector_powerpc): Remove
15050 instantiated_target_ field. In do_recognize call
15051 instantiate_target rather than do_instantiate_target. In
15052 do_instantiate_target just allocate a new target.
15053 * sparc.cc (class Target_selector_sparc): Likewise.
15054
36959681
ILT
15055 * freebsd.h: New file.
15056 * i386.cc: Include "freebsd.h".
15057 (Target_i386): Derive from Target_freebsd rather than
15058 Sized_target.
15059 (Target_selector_i386): Derive from Target_selector_freebsd rather
15060 than Target_selector.
15061 * x86_64.cc: Include "freebsd.h".
15062 (Target_x86_64): Derive from Target_freebsd rather than
15063 Sized_target.
15064 (Target_selector_x86_64): Derive from Target_selector_freebsd
15065 rather than Target_selector.
15066 * target.h (class Target): Add adjust_elf_header and
15067 do_adjust_elf_header.
15068 * output.cc (Output_file_header:: do_sized_write): Call target
15069 adjust_elf_header routine.
15070 * configure.tgt: Set targ_osabi.
15071 * configure.ac: Define GOLD_DEFAULT_OSABI.
15072 * parameters.cc (Parameters::default_target): Pass
15073 GOLD_DEFAULT_OSABI to select_target.
15074 * target-select.h (class Target_selector): Make instantiate_target
15075 protected rather than private.
15076 * Makefile.am (HFILES): Add freebsd.h.
15077 * configure, Makefile.in, config.in: Rebuild.
15078
cb010894
ILT
15079 * merge.cc (do_add_input_section): Correct pend value. Change
15080 message about last entry not being null terminated from error to
15081 warning.
15082
0e879927
ILT
150832009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15084
15085 * incremental.cc: New file.
15086 * Makefile.am (CCFILES): Add incremental.cc.
15087 * Makefile.in: Rebuild.
15088
41105937
PP
150892009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15090
15091 * layout.cc (Layout::output_section_name): Preserve names
15092 of '.note.' sections.
e1df38aa 15093
60439920
ILT
150942009-03-19 Ian Lance Taylor <iant@google.com>
15095
15096 * descriptors.cc (Descriptors::open): Check that the options are
15097 valid before using them.
15098
0d371ad3
ILT
150992009-03-18 Ian Lance Taylor <iant@google.com>
15100
15101 * script-sections.h: Include <list>.
15102 (class Script_sections): Change Sections_elements from std::vector
15103 to std::list. Typedef public Elements_iterator. Add
15104 orphan_section_placement_, data_segment_align_start_, and
15105 saw_data_segment_align_ fields. Remove data_segment_align_index_
15106 field.
15107 * script-sections.cc (class Orphan_section_placement): New class.
15108 (class Sections_element): Add virtual functions is_relro and
15109 orphan_section_init. Remove virtual function place_orphan_here.
15110 (class Output_section_definition): Add is_relro and
15111 orphan_section_init. Remove place_orphan_here.
15112 (class Orphan_output_section): Likewise.
15113 (Script_sections::Script_sections): Update for field changes.
15114 (Script_sections::data_segment_align): Set saw_data_segment_align_
15115 and data_segment_align_start_, not data_segment_align_index.
15116 (Script_sections::data_segment_relro_end): Check
15117 saw_data_segment_align_. Use data_segment_align_start_ rather
15118 than data_segment_align_index_.
15119 (Script_sections::place_orphan): Rewrite to use
15120 Orphan_section_placement.
15121
9201d894
ILT
151222009-03-17 Ian Lance Taylor <iant@google.com>
15123
9c5b8369
ILT
15124 * archive.cc (Archive::add_symbols): Check for a version attached
15125 to the symbol name in the archive map.
15126 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15127 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15128 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15129 (ver_test_11.a): New target.
15130 * testsuite/Makefile.in: Rebuild.
15131
9201d894
ILT
15132 * configure.ac: Check for chsize and posix_fallocate. Replace
15133 ftruncate.
15134 * ftruncate.c: New file, from gnulib.
15135 * output.cc (posix_fallocate): Define dummy version if not
15136 HAVE_POSIX_FALLOCATE.
15137 (Output_file::map): Call posix_fallocate rather than lseek and
15138 write.
15139 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15140 * configure, Makefile.in, config.in: Rebuild.
15141
ef4ab7a8 151422009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15143
ef4ab7a8
PP
15144 * layout.h (Layout::create_note): Add section_name parameter.
15145 * layout.cc (Layout::create_note): Likewise.
15146 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15147
8c500701
ILT
151482009-03-17 Ian Lance Taylor <iant@google.com>
15149
e85b18e1
ILT
15150 * descriptors.cc: Include "options.h".
15151 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15152 (Descriptors::open): Always use O_CLOEXEC when opening a new
15153 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15154 then set FD_CLOEXEC.
15155
9efe6174
ILT
15156 * sparc.cc (class Target_sparc): Add has_got_section.
15157 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15158 make sure we have a GOT section.
15159
15160 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15161 (Target_sparc::Scan::local): Likewise.
15162 (Target_sparc::Scan::global): Likewise.
15163 (Target_sparc::Relocate::relocate): Likewise.
15164 (Target_sparc::Relocate::relocate_tls): Likewise.
15165
8c500701
ILT
15166 * symtab.cc (Symbol_table::define_default_version): New function,
15167 broken out of add_from_object.
15168 (Symbol_table::add_from_object): Call define_default_version.
15169 (Symbol_table::define_special_symbol): Add resolve_oldsym
15170 parameter. Change all callers. If the version for a symbol comes
15171 from a version script, resolve it with the symbol with the same
15172 name with no version. Also add the symbol without a version if
15173 appropriate.
15174 (do_define_in_output_data): If resolving with oldsym, don't delete
15175 sym.
15176 (do_define_in_output_segment): Likewise.
15177 (do_define_as_constant): Likewise.
15178 * symtab.h (class Symbol_table): Update declarations.
15179
f1ed28fb
ILT
151802009-03-13 Ian Lance Taylor <iant@google.com>
15181
15f8229b
ILT
15182 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15183 (Read_symbols::requeue): New function.
15184 (Read_symbols::do_read_symbols): If make_elf_object fails because
15185 the target type is not configured, and the file was searched for,
15186 issue a warning and retry with the next directory.
15187 (Add_symbols::run): If the file has an incompatible format, and
15188 it was searched for, requeue the Read_symbols task. On error,
15189 release the object.
15190 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15191 dirindex parameter to constructor. Change all callers. Declare
15192 incompatible_warning and requeue.
15193 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15194 input_argument_ and input_group_ fields. Add them to
15195 constructor. Change all callers.
15196 (class Read_script): Add dirindex_ field. Add it to constructor.
15197 Change all callers.
15198 * archive.cc (Archive::setup): Remove input_objects parameter.
15199 Change all callers.
15200 (Archive::get_file_and_offset): Likewise.
15201 (Archive::read_all_symbols): Likewise.
15202 (Archive::read_symbols): Likewise.
15203 (Archive::get_elf_object_for_member): Remove input_objects
15204 parameter. Add punconfigured parameter. Change all callers.
15205 (Archive::add_symbols): Change return type to bool. Check return
15206 value of include_member.
15207 (Archive::include_all_members): Likewise.
15208 (Archive::include_member): Change return type to bool. Return
15209 false if first included object has incompatible target. Set
15210 included_member_ field.
15211 (Add_archive_symbols::run): If add_symbols returns false, requeue
15212 Read_symbols task.
15213 * archive.h (class Archive): Add included_member_ field.
15214 Initialize it in constructor. Add input_file and searched_for
15215 methods. Update declarations.
15216 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15217 input_argument_ fields. Add them to constructor. Change all
15218 callers.
15219 * script.cc: Include "target-select.h".
15220 (class Parser_closure): Add skip_on_incompatible_target_ and
15221 found_incompatible_target_ fields. Add
15222 skip_on_incompatible_target parameter to constructor. Change all
15223 callers. Add methods skip_on_incompatible_target,
15224 clear_skip_on_incompatible_target, found_incompatible_target, and
15225 set_found_incompatible_target.
15226 (read_input_script): Add dirindex parameter. Change all callers.
15227 If parser finds an incompatible target, requeue Read_symbols
15228 task.
15229 (script_set_symbol): Clear skip_on_incompatible_target in
15230 closure.
15231 (script_add_assertion, script_parse_option): Likewise.
15232 (script_start_sections, script_add_phdr): Likewise.
15233 (script_check_output_format): New function.
15234 * script.h (read_input_script): Update declaration.
15235 * script-c.h (script_check_output_format): Declare.
15236 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15237 (ignore_cmd): Remove OUTPUT_FORMAT.
15238 * fileread.cc (Input_file::Input_file): Add explicit this.
15239 (Input_file::will_search_for): New function.
15240 (Input_file::open): Add pindex parameter. Change all callers.
15241 * fileread.h (class Input_file): Add input_file_argument method.
15242 Declare will_search_for. Update declarations.
15243 * object.cc (make_elf_object): Add punconfigured parameter.
15244 Change all callers.
15245 * object.h (class Object): Make input_file public. Add
15246 searched_for method.
15247 (make_elf_object): Update declaration.
15248 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15249 restart search.
15250 * dirsearch.h (class Dirsearch): Update declaration.
15251 * options.h (class General_options): Add --warn-search-mismatch.
15252 * parameters.cc (Parameters::is_compatible_target): New function.
15253 * parameters.h (class Parameters): Declare is_compatible_target.
15254 * workqueue.cc (Workqueue::add_blocker): New function.
15255 * workqueue.h (class Workqueue): Declare add_blocker.
15256
f1ed28fb
ILT
15257 * fileread.cc (Input_file::open): Remove options parameter.
15258 Change all callers.
15259 (Input_file::open_binary): Likewise.
15260 * script.cc (read_input_script): Likewise.
15261 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15262 options parameter from constructor. Change all callers.
15263 (class Read_script): Likewise.
15264 * fileread.h (class Input_file): Update declarations.
15265 * script.h (read_input_script): Update declaration.
15266
34dd024a
NC
152672009-03-10 Nick Clifton <nickc@redhat.com>
15268
15269 * po/es.po: New Spanish translation.
15270
6d71b17c
CC
152712009-03-06 Cary Coutant <ccoutant@google.com>
15272
15273 * options.cc (parse_short_option): Keep dash_z from registering itself.
15274
031cdbed
ILT
152752009-03-03 Ian Lance Taylor <iant@google.com>
15276
15277 PR 9918
15278 * target-reloc.h (relocate_section): Pass output_section to
15279 relocate.
15280 * i386.cc (Target_i386::should_apply_static_reloc): Add
15281 output_section parameter. Change all callers.
15282 (Target_i386::Relocate::relocate): Add output_section parameter.
15283 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15284 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15285 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15286 * testsuite/two_file_shared.sh: New script.
15287 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15288 (check_DATA): Add two_file_shared.dbg.
15289 (two_file_shared.dbg): New target.
15290 * testsuite/Makefile.in: Rebuild.
15291
15d5fa16
ILT
152922009-03-01 Ian Lance Taylor <iant@google.com>
15293
15294 * configure.ac: Check for byteswap.h.
15295 * configure: Rebuild.
15296 * config.in: Rebuild.
15297
8a4c0b0d
ILT
152982009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15299
15300 * layout.cc (Layout::find_or_add_kept_section): New function.
15301 (Layout::add_comdat): Removed.
15302 * layout.h (struct Kept_section): Move out of class Layout.
15303 Remove trailing underscores from field names. Add group_sections
15304 field. Rename group_ field to is_group. Change all uses.
15305 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15306 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15307 comdat_groups_ field.
15308 (Sized_relobj::include_section_group): Use
15309 find_or_add_kept_section and Kept_section::group_sections.
15310 (Sized_relobj::include_linkonce_section): Likewise.
15311 * object.cc (class Sized_relobj): Don't define Comdat_group or
15312 Comdat_group_table. Remove find_comdat_group and
15313 add_comdat_group. Remove comdat_groups_ field.
15314 * plugin.cc (include_comdat_group): Use
15315 Layout::find_or_add_kept_section.
15316
b4ecf66b
ILT
153172009-02-28 Ian Lance Taylor <iant@google.com>
15318
14359ca0
ILT
15319 * README: --gc-sections and map files are now supported. Document
15320 some build requirements.
15321
b4ecf66b
ILT
15322 PR 6992
15323 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15324 relocatable link set the value of the section symbol to zero.
15325 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15326 relocatable link don't include the section address in the local
15327 symbol value.
15328
0602e05a
ILT
153292009-02-27 Ian Lance Taylor <iant@google.com>
15330
fd9d194f
ILT
15331 PR 6811
15332 * options.h (class Search_directory): Add is_system_directory.
15333 (class General_options): Declare is_in_system_directory.
15334 * options.cc (get_relative_sysroot): Make static.
15335 (get_default_sysroot): Make static.
15336 (General_optoins::is_in_system_directory): New function.
15337 * fileread.cc (Input_file::is_in_system_directory): New function.
15338 * fileread.h (class Input_file): Declare is_in_system_directory.
15339 * object.h (class Object): Add is_in_system_directory.
15340 (class Input_objects): Remove system_library_directory_ field.
15341 * object.cc (Input_objects::add_object): Don't set
15342 system_library_directory_.
15343 (input_objects::found_in_system_library_directory): Remove.
15344 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15345 parameter. Change all callers.
15346 (Symbol_table::sized_write_globals): Likewise.
15347 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15348 Call Object::is_in_system_directory.
15349 * symtab.h (class Symbol_table): Update declarations.
15350
61edd21f
ILT
15351 PR 5990
15352 * descriptors.h (Open_descriptor): Add is_on_stack field.
15353 * descriptors.cc (Descriptors::open): If the descriptor is on the
15354 top of the stack, remove it. Initialize is_on_stack field.
15355 (Descriptors::release): Only add pod to stack if it is not on the
15356 stack already.
15357 (Descriptors::close_some_descriptor): Clear stack_next and
15358 is_on_stack fields.
15359
e29e076a
ILT
15360 PR 7091
15361 * output.cc (Output_section::find_starting_output_address): Rename
15362 from starting_output_address; add PADDR parameter; change return
15363 type.
15364 * output.h (class Output_section): Declare
15365 find_starting_output_address instead of starting_output_address.
15366 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15367 section symbol for which we can't find a merge section.
15368
0602e05a
ILT
15369 PR 9836
15370 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15371 hidden or internal, force the symbol to be local.
15372 * resolve.cc (Symbol::override_visibility): Define.
15373 (Symbol::override_base): Use override_visibility.
15374 (Symbol_table::resolve): Likewise.
15375 (Symbol::override_base_with_special): Likewise.
15376 (Symbol_table::override_with_special): If the visibility is hidden
15377 or internal, force the symbol to be local.
15378 * symtab.h (class Symbol): Add set_visibility and
15379 override_visibility.
15380 * testsuite/ver_test_1.sh: New file.
15381 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15382 (check_DATA): Add ver_test_1.syms.
15383 (ver_test_1.syms): New target.
15384 * testsuite/Makefile.in: Rebuild.
15385
401a9a73
CC
153862009-02-25 Cary Coutant <ccoutant@google.com>
15387
15388 * layout.cc (Layout::choose_output_section): Don't rename sections
15389 when using a linker script that has a SECTIONS clause.
15390 * Makefile.in: Regenerate.
15391
15392 * testsuite/Makefile.am (script_test_5.sh): New test case.
15393 * testsuite/Makefile.in: Regenerate.
15394 * testsuite/script_test_5.cc: New file.
15395 * testsuite/script_test_5.sh: New file.
15396 * testsuite/script_test_5.t: New file.
15397
f488e4b0
CC
153982009-02-13 Rafael Avila de Espindola <espindola@google.com>
15399
15400 * archive.cc (Archive::include_member): Update calls to add_symbols.
15401 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15402 the Layout argument.
15403 * dynobj.h (do_add_symbols): Add the Layout argument.
15404 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15405 Layout argument.
15406 * object.h (Object::add_symbols): Add the Layout argument.
15407 (Object::do_add_symbols): Add the Layout argument.
15408 (Sized_relobj::do_add_symbols): Add the Layout argument.
15409 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15410 Unify the two versions.
15411 (Add_plugin_symbols): Remove.
15412 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15413 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15414 (Add_plugin_symbols): Remove.
15415 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15416 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15417 (Add_symbols::run): Make it work with Pulginobj.
15418
89dd1680
ILT
154192009-02-06 Ian Lance Taylor <iant@google.com>
15420
15421 * object.cc (Sized_relobj::do_layout): Make info message start
15422 with lower case letter.
15423
266d0a74
ILT
154242009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15425
602b464e
ILT
15426 * binary.cc: Fix file comment.
15427
266d0a74
ILT
15428 * options.h (enum Incremental_disposition): Define.
15429 (class General_options): Add new options: --incremental,
15430 --incremental_changed, --incremental_unchanged,
15431 --incremental_unknown. Add incremental_disposition_ and
15432 implicit_incremental_ fields.
15433 (General_options::incremental_disposition): New function.
15434 (class Position_dependent_options): Add incremental_disposition
15435 option.
15436 (Position_dependent_options::copy_from_options): Set incremental
15437 dispositions.
15438 * options.cc (General_options::parse_incremental_changed): New
15439 function.
2e702c99
RM
15440 (General_options::parse_incremental_unchanged): New function.
15441 (General_options::parse_incremental_unknown): New function.
15442 (General_options::General_options): Initialize new fields
266d0a74 15443 incremental_disposition_ and implicit_incremental_.
2e702c99 15444 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15445 without --incremental.
15446
f073bbf7
CD
154472009-02-06 Chris Demetriou <cgd@google.com>
15448
15449 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15450 pointer and to report location as the file name associated with
15451 the symbol.
15452 (gold_undefined_symbol_at_location): New function to replace the
15453 old gold_undefined_symbol functionality.
15454 * target-reloc.h (relocate_section): Update to use
15455 gold_undefined_symbol_at_location.
15456 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15457 Call gold_undefined_symbol function rather than gold_error.
15458 * errors.h (Errors::undefined_symbol): Take location as a
15459 string, rather than calculating it from a relocation.
15460 * errors.cc (Errors::fatal): Print "fatal error:" before the
15461 formatted message.
15462 (Errors::error, Errors::error_at_location): Print "error: "
15463 before the formatted message.
15464 (Errors::undefined_symbol): Take location as a string, rather
15465 than calculating it from a relocation.
15466 (gold_undefined_symbol_at_location): New function akin to
15467 old gold_undefined_symbol, calculates location from relocation.
15468 (gold_undefined_symbol): Change to take only a Symbol pointer
15469 and to report location as the file name associated with the symbol.
15470 * testsuite/debug_msg.sh: Update for changed error messages.
15471 * testsuite/undef_symbol.sh: Likewise.
15472
8e94a90c
ILT
154732009-02-04 Duncan Sands <baldrick@free.fr>
15474
15475 PR 9812
15476 * reduced_debug_output.h
15477 (Output_reduced_debug_abbrev_section::failed): Use format for
15478 gold_warning.
15479 (Output_reduced_debug_info_section::faild): Likewise.
15480
88a0e15b
ILT
154812009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15482
15483 * script.cc (Lazy_demangler): New class.
2e702c99 15484 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15485 symbol only once.
15486
5efc7cd2
CC
154872009-01-29 Cary Coutant <ccoutant@google.com>
15488
15489 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15490 to __tls_get_addr.
15491 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15492
e0ebcf42
ILT
154932009-01-28 Ian Lance Taylor <iant@google.com>
15494
5efc7cd2 15495 * version.cc (version_string): Bump to 1.9.
75fe7426 15496
e0ebcf42
ILT
15497 * gold.h: Include <cstring> and <stdint.h>.
15498 * version.cc: Include <cstdio>.
15499 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15500 warning.
15501 * reduced_debug_output.cc (insert_into_vector): Rename from
15502 Insert_into_vector; change all callers. Use Swap_unaligned to
15503 avoid aliasing issue; remove union since it is unnecessary.
15504
8e2813be 155052009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15506
15507 * Makefile.am (CCFILES): Add gc.cc.
15508 (HFILES): Add gc.h.
15509 * Makefile.in: Regenerate.
15510 * gold.cc (Gc_runner): New class.
15511 (queue_initial_tasks): Call garbage collection related tasks
15512 when corresponding options are invoked.
15513 (queue_middle_gc_tasks): New function.
15514 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15515 processed early before laying out sections during garbage collection.
15516 * gold.h (queue_middle_gc_tasks): New function.
15517 (is_prefix_of): Move from "layout.cc".
15518 * i386.cc (Target_i386::gc_process_relocs): New function.
15519 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15520 * main.cc (main): Create object of class "Garbage_collection".
15521 * object.cc (Relobj::copy_symbols_data): New function.
15522 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15523 (Sized_relobj::do_layout): Allow this function to be called twice
15524 during garbage collection and defer layout of section during the
6d03d481
ST
15525 first call.
15526 * object.h (Relobj::get_symbols_data): New function.
15527 (Relobj::is_section_name_included): New function.
15528 (Relobj::copy_symbols_data): New function.
15529 (Relobj::set_symbols_data): New function.
15530 (Relobj::get_relocs_data): New function.
15531 (Relobj::set_relocs_data): New function.
15532 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15533 (Relobj::gc_process_relocs): New function.
15534 (Relobj::do_gc_process_relocs): New pure virtual function.
15535 (Relobj::sd_): New data member.
15536 (Sized_relobj::is_output_section_offset_invalid): New function.
15537 (Sized_relobj::do_gc_process_relocs): New function.
15538 * options.h (General_options::gc_sections): Modify to not be a no-op.
15539 (General_options::print_gc_sections): New option.
15540 * plugin.cc (Plugin_finish::run): Remove function call to
15541 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15542 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15543 * reloc.cc (Read_relocs::run): Add task to process relocs and
15544 determine unreferenced sections when doing garbage collection.
15545 (Gc_process_relocs): New class.
15546 (Sized_relobj::do_gc_process_relocs): New function.
15547 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15548 sections that are garbage collected.
15549 * reloc.h (Gc_process_relocs): New class.
15550 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15551 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15552 symbols whose corresponding sections are garbage collected.
15553 (Symbol_table::Symbol_table): Add new parameter for the garbage
15554 collection object.
15555 (Symbol_table::gc_mark_undef_symbols): New function.
15556 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15557 (Symbol_table::gc_mark_dyn_syms): New function.
15558 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15559 as garbage.
15560 (Symbol_table::add_from_object): Likewise.
15561 (Symbol_table::add_from_relobj): When building shared objects, do not
15562 treat externally visible symbols as garbage.
15563 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15564 table information for static and relocatable links.
15565 * symtab.h (Symbol_table::set_gc): New function.
15566 (Symbol_table::gc): New function.
15567 (Symbol_table::gc_mark_undef_symbols): New function.
15568 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15569 (Symbol_table::gc_mark_dyn_syms): New function.
15570 (Symbol_table::gc_): New data member.
e1df38aa 15571 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15572 function.
15573 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15574 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15575
3b293544
CF
155762009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15577
15578 * options.h (General_options::gc_sections): Define as a no-op for now.
15579 (General_options::no_keep_memory): Ditto.
15580 (General_options::Bshareable): Define.
15581 * options.cc (General_options::finalize): Honor -Bshareable.
15582
83d22aa8
AS
155832009-01-20 Andreas Schwab <schwab@suse.de>
15584
15585 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15586 read the value in the contents, since we don't use it. Use the
15587 template endianness when writing.
15588 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15589
cd536b21
AS
155902009-01-19 Andreas Schwab <schwab@suse.de>
15591
15592 * configure.tgt (powerpc64-*): Fix targ_obj.
15593
99e9a495
ILT
155942009-01-15 Ian Lance Taylor <iant@google.com>
15595
15596 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15597 local symbols when stripping all symbols.
15598
bbbfea06
CC
155992009-01-14 Cary Coutant <ccoutant@google.com>
15600
99e9a495 15601 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15602
0f7c0701
CC
156032009-01-14 Cary Coutant <ccoutant@google.com>
15604
15605 * archive.cc (Archive::get_elf_object_for_member): Remove call
15606 to File_read::claim_for_plugin.
15607 * descriptors.cc (Descriptors::open): Remove reference to
15608 is_claimed.
15609 (Descriptors::claim_for_plugin): Remove.
15610 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15611 (Descriptors::is_claimed): Remove.
15612 (claim_descriptor_for_plugin): Remove.
15613 * fileread.cc (File_read::claim_for_plugin): Remove.
15614 * fileread.h (File_read::claim_for_plugin): Remove.
15615 (File_read::descriptor): Reopen descriptor if necessary.
15616 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15617 (Plugin_manager::all_symbols_read): Add task parameter. Change
15618 all callers.
15619 (Plugin_manager::get_input_file): New function.
15620 (Plugin_manager::release_input_file): New function.
15621 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15622 corresponding data member.
15623 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15624 and pass to base constructor. Change all callers.
15625 (get_input_file, release_input_file): New functions.
15626 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15627 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15628 (Plugin_manager::all_symbols_read): Add task parameter.
15629 (Plugin_manager::get_input_file): New function.
15630 (Plugin_manager::release_input_file): New function.
15631 (Plugin_manager::task_): New data member.
15632 (Pluginobj::Pluginobj): Add filesize parameter.
15633 (Pluginobj::filename): New function.
15634 (Pluginobj::descriptor): New function.
15635 (Pluginobj::filesize): New function.
15636 (Pluginobj::filesize_): New data member.
15637 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15638 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15639 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15640
15641 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15642 with archive libraries.
15643 * testsuite/Makefile.in: Regenerate.
15644 * testsuite/plugin_test.c (struct sym_info): New type.
15645 (get_input_file, release_input_file): New static variables.
15646 (onload): Capture new transfer vector entries.
15647 (claim_file_hook): Stop reading at end of file according to filesize.
15648 Factor out parsing of readelf output into separate function.
15649 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15650 APIs and get the source file name from the symbol table. Convert
15651 source file name to corresponding object file name. Print info
15652 message when adding new input files.
15653 (parse_readelf_line): New function.
15654 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15655 * testsuite/plugin_test_2.sh: Likewise.
15656 * testsuite/plugin_test_3.sh: Likewise.
15657 * testsuite/plugin_test_4.sh: New test case.
15658
62a6d109
ILT
156592009-01-07 Ian Lance Taylor <iant@google.com>
15660
15661 * version.cc (version_string): Bump to 1.8.
15662
483620e8
CC
156632008-12-23 Cary Coutant <ccoutant@google.com>
15664
15665 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15666 * plugin.cc (Plugin_manager::finish): Rename as
15667 layout_deferred_objects. Move cleanup to separate function.
15668 (Plugin_manager::cleanup): New function.
15669 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15670 separately.
15671 * plugin.h (Plugin_manager::finish): Rename as
15672 layout_deferred_objects.
15673 (Plugin_manager::cleanup): New function.
15674 (Plugin_manager::cleanup_done): New field.
15675
d66a9eb3
CC
156762008-12-23 Cary Coutant <ccoutant@google.com>
15677
15678 * plugin.cc (is_visible_from_outside): New function.
15679 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15680 so we don't return "IR only" status for exported symbols or -r links.
15681
15682 * testsuite/Makefile.am (plugin_test_3): New test case.
15683 * testsuite/Makefile.in: Regenerate.
15684 * testsuite/plugin_test_3.sh: New file.
15685
5995b570
CC
156862008-12-22 Cary Coutant <ccoutant@google.com>
15687
15688 * object.cc (Sized_relobj::layout_section): New function.
15689 (Sized_relobj::do_layout): Defer layout of input sections until after
15690 plugin has provided replacement files.
15691 (Sized_relobj::do_layout_deferred_sections): New function.
15692 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15693 (Relobj::layout_deferred_sections): New function.
15694 (Relobj::do_layout_deferred_sections): New function.
15695 (Sized_relobj::do_layout_deferred_sections): New function.
15696 (Sized_relobj::layout_section): New function.
15697 (Sized_relobj::Deferred_layout): New structure.
15698 (Sized_relobj::deferred_layout_): New field.
15699 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15700 Change all callers. Layout deferred sections.
15701 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15702 references.
15703 (Plugin_hook::run): Move code from do_plugin_hook inline.
15704 (Plugin_hook::do_plugin_hook): Remove.
15705 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15706 (Plugin_manager::finish): Renamed, was cleanup.
15707 (Plugin_manager::should_defer_layout): New function.
15708 (Plugin_manager::add_deferred_layout_object): New function.
15709 (Plugin_manager::Deferred_layout_list): New type.
15710 (Plugin_manager::deferred_layout_objects_): New field.
15711 (Plugin_hook::do_plugin_hook): Remove.
15712
ee769c88
ILT
157132008-12-17 Ian Lance Taylor <iant@google.com>
15714
15715 * options.h (class General_options): Add --no case for
15716 --export-dynamic.
15717
abc8dcba
CC
157182008-12-16 Cary Coutant <ccoutant@google.com>
15719
15720 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15721 vector.
15722 (Plugin_manager::claim_file): Create plugin object even if
15723 plugin did not call the add_symbols callback.
15724 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15725 asking for more symbols than were added.
15726 * testsuite/Makefile.am (plugin_test_1): Add test case with
15727 no global symbols.
15728 (empty.syms): New target.
15729 * testsuite/Makefile.in: Regenerate.
15730 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15731 message. Don't call add_symbols if no globals.
15732 (all_symbols_read_hook): Don't provide replacement for empty
15733 claimed file.
15734
b0074644
ILT
157352008-12-12 Ian Lance Taylor <iant@google.com>
15736
68943102
ILT
15737 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15738 r_type == 0 for a local symbol with r_sym == 0.
15739 (scan_relocatable_relocs): Pass r_sym to
15740 local_non_section_strategy.
15741 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15742 r_sym parameter.
15743
b0074644
ILT
15744 * configure.ac: Update test for TLS descriptors: they are
15745 supported as of glibc 2.9.
15746 * configure: Rebuild.
15747
c2508178
ILT
157482008-12-11 Ian Lance Taylor <iant@google.com>
15749
15750 PR 7091
15751 * target-reloc.h (Default_scan_relocatable_relocs): For each
15752 function, map r_type == 0 to RELOC_DISCARD.
15753
2756a258
CC
157542008-12-10 Cary Coutant <ccoutant@google.com>
15755
15756 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15757 object to override a kept COMDAT group from a plugin object.
15758
bb6f53d3
ILT
157592008-12-09 Ian Lance Taylor <iant@google.com>
15760
fbc558e1
ILT
15761 PR 7088
15762 * yyscript.y (file_cmd): Handle INPUT.
15763
bb6f53d3
ILT
15764 * testsuite/initpri1.c: Change all declarations to be full
15765 prototypes by adding void, to avoid compiler warnings.
15766
4674ecfc
CC
157672008-12-05 Rafael Avila de Espindola <espindola@google.com>
15768
15769 * options.cc (General_options::parse_plugin_opt): New.
15770 (General_options::add_plugin): The argument now is just the filename.
15771 (General_options::add_plugin_option): New.
15772 * options.h (plugin_opt): New.
15773 (add_plugin): Change argument name.
15774 (add_plugin_option): New.
15775 * plugin.cc (Plugin::load): Don't parse the plugin option.
15776 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15777 (Plugin::add_option): New.
15778 (Plugin::args_): Change type.
15779 (Plugin::filename_): New.
15780 (Plugin_manager::add_plugin_option): New.
15781 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15782 * testsuite/Makefile.in: Regenerate.
15783
fd06b4aa
CC
157842008-12-05 Cary Coutant <ccoutant@google.com>
15785
15786 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15787 Handle --strip-lto-sections option.
15788 * options.h (strip_lto_sections): New option.
15789
6c52134c
CC
157902008-12-01 Cary Coutant <ccoutant@google.com>
15791
15792 * plugin.cc (ld_plugin_message): Change format parameter to const.
15793 Fix mismatch between new[] and delete.
15794
a45248e0
CC
157952008-11-14 Cary Coutant <ccoutant@google.com>
15796
15797 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15798 instead of -1U.
15799
c82fbeee
CS
158002008-11-05 Craig Silverstein <csilvers@google.com>
15801
15802 * options.cc (General_options::parse_dynamic_list): New function.
15803 * options.h (General_options): New flags dynamic_list,
15804 dynamic_list_data, dynamic_list_cpp_new, and
15805 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15806 (General_options::in_dynamic_list): New function.
15807 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15808 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15809 (Lex::can_continue_name): Likewise.
15810 (yylex): Likewise.
15811 (read_script_file): New parameter script_options.
15812 (read_dynamic_list): New function.
15813 (Script_options::define_dynamic_list): New function.
15814 (dynamic_list_keyword_parsecodes): New variable.
15815 (dynamic_list_keywords): New variable.
15816 * script.h (Script_options::define_dynamic_list): New function
15817 prototype.
15818 (read_dynamic_list): New function prototype.
15819 * symtab.cc (strprefix): New macro.
15820 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15821 dynamic_list_data, dynamic_list_cpp_new, and
15822 dynamic_list_cpp_typeinfo.
15823 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15824 (dynamic_list_expr): New rule.
15825 (dynamic_list_nodes): Likewise.
15826 (dynamic_list_node): Likewise.
15827 * testsuite/Makefile.am (dynamic_list): New test.
15828 * testsuite/Makefile.in: Regenerated.
15829 * testsuite/dynamic_list.t: New file.
15830 * testsuite/dynamic_list.sh: New file.
15831
e0bb29a5
CS
158322008-11-05 Craig Silverstein <csilvers@google.com>
15833
15834 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15835 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15836 (t11_last): Likewise.
15837 * testsuite/ver_test_6.c (main): Likewise.
15838
4e1e25e0
CC
158392008-10-07 Cary Coutant <ccoutant@google.com>
15840
15841 * options.c (General_options::finalize): Add check for -static and
15842 -shared.
15843 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15844 is not empty.
15845
92f03fcb
CC
158462008-10-02 Cary Coutant <ccoutant@google.com>
15847
15848 * plugin.cc (make_sized_plugin_object): Fix conditional
15849 compilation to work when not all targets are enabled.
15850
fbd8a257
CC
158512008-09-29 Cary Coutant <ccoutant@google.com>
15852
15853 * archive.cc (Archive::get_file_and_offset): Use filename instead
15854 of name to get library path.
15855 (Archive::include_member): Unlock external member of a thin archive.
15856
15857 * testsuite/Makefile.am (TEST_AR): New variable.
15858 (thin_archive_test_1): New test.
15859 (thin_archive_test_2): New test.
81636b3f
CC
15860 * testsuite/Makefile.in: Regenerate.
15861 * testsuite/thin_archive_main.cc: New file.
15862 * testsuite/thin_archive_test_1.cc: New file.
15863 * testsuite/thin_archive_test_2.cc: New file.
15864 * testsuite/thin_archive_test_3.cc: New file.
15865 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15866
eff45813
CC
158672008-09-29 Cary Coutant <ccoutant@google.com>
15868
15869 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15870 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15871 instead of -1U.
15872 (Sized_relobj::do_finalize_local_symbols): Likewise.
15873 (Sized_relobj::map_to_kept_section): Likewise.
15874 * object.h (Sized_relobj::invalid_address): New constant.
15875 (Sized_relobj::do_output_section_offset): Check for invalid_address
15876 and return -1ULL.
15877 * output.cc (Output_reloc::local_section_offset): Use constant
15878 invalid_address instead of -1U.
15879 (Output_reloc::get_address): Likewise.
15880 (Output_section::output_address): Change -1U to -1ULL.
15881 * output.h (Output_reloc::invalid_address): New constant.
15882 * reloc.cc (Sized_relobj::write_sections): Use constant
15883 invalid_address instead of -1U.
15884 (Sized_relobj::relocate_sections): Likewise.
15885 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15886 values for merge sections.
15887 * target-reloc.h (relocate_for_relocatable): Use constant
15888 invalid_address instead of -1U.
15889
89fc3421
CC
158902008-09-19 Cary Coutant <ccoutant@google.com>
15891
15892 Add plugin functionality for link-time optimization (LTO).
15893 * configure.ac (plugins): Add --enable-plugins option.
15894 * configure: Regenerate.
15895 * config.in: Regenerate.
15896 * Makefile.am (LIBDL): New variable.
15897 (CCFILES): Add plugin.cc.
15898 (HFILES): Add plugin.h.
15899 (ldadd_var): Add LIBDL.
15900 * Makefile.in: Regenerate.
15901
15902 * archive.cc: Include "plugin.h".
15903 (Archive::setup): Don't preread archive symbols when using a plugin.
15904 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15905 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15906 files.
15907 (Archive::include_member): Add symbols from plugin objects.
15908 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15909 * descriptors.cc (Descriptors::open): Check for file descriptors
15910 abandoned by plugins.
15911 (Descriptors::claim_for_plugin): New function.
15912 * descriptors.h (Descriptors::claim_for_plugin): New function.
15913 (Open_descriptor::is_claimed): New field.
15914 (claim_descriptor_for_plugin): New function.
15915 * fileread.cc (File_read::claim_for_plugin): New function.
15916 * fileread.h (File_read::claim_for_plugin): New function.
15917 (File_read::descriptor): New function.
15918 * gold.cc: Include "plugin.h".
15919 (queue_initial_tasks): Add task to call plugin hooks for generating
15920 new object files.
15921 * main.cc: Include "plugin.h".
15922 (main): Load plugin libraries.
15923 * object.h (Pluginobj): Declare.
15924 (Object::pluginobj): New function.
15925 (Object::do_pluginobj): New function.
15926 (Object::set_target): New function.
15927 * options.cc: Include "plugin.h".
15928 (General_options::parse_plugin): New function.
15929 (General_options::General_options): Initialize plugins_ field.
15930 (General_options::add_plugin): New function.
15931 * options.h (Plugin_manager): Declare.
15932 (General_options): Add --plugin option.
15933 (General_options::has_plugins): New function.
15934 (General_options::plugins): New function.
15935 (General_options::add_plugin): New function.
15936 (General_options::plugins_): New field.
15937 * plugin.cc: New file.
15938 * plugin.h: New file.
15939 * readsyms.cc: Include "plugin.h".
15940 (Read_symbols::do_read_symbols): Check for archive before checking
15941 for ELF file. Call plugin hooks to claim files.
15942 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15943 from a real object file; force override when processing replacement
15944 files.
15945 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15946 (Symbol::init_base_object): Likewise.
15947 (Symbol::init_base_output_data): Likewise.
15948 (Symbol::init_base_output_segment): Likewise.
15949 (Symbol::init_base_constant): Likewise.
15950 (Symbol::init_base_undefined): Likewise.
15951 (Symbol::output_section): Assert that object is not a plugin.
15952 (Symbol_table::add_from_pluginobj): New function.
15953 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15954 undefined.
15955 (Symbol_table::sized_write_globals): Likewise.
15956 (Symbol_table::add_from_pluginobj): Instantiate template.
15957 * symtab.h (Sized_pluginobj): Declare.
15958 (Symbol::in_real_elf): New function.
15959 (Symbol::set_in_real_elf): New function.
15960 (Symbol::in_real_elf_): New field.
15961 (Symbol_table::add_from_pluginobj): New function.
15962
15963 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15964 (LIBDL): New variable.
15965 (LDADD): Add LIBDL.
15966 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15967 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15968 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15969 (MOSTLYCLEANFILES): Likewise.
15970 * testsuite/Makefile.in: Regenerate.
15971 * testsuite/plugin_test.c: New file.
15972 * testsuite/plugin_test_1.sh: New file.
15973 * testsuite/plugin_test_2.sh: New file.
15974
de31bda5
ILT
159752008-09-16 Ian Lance Taylor <iant@google.com>
15976
9c2d0ef9
ILT
15977 * target-reloc.h (relocate_section): Check whether a symbol is
15978 defined by the ABI before reporting an undefined symbol error.
15979 * target.h (Target::is_defined_by_abi): Make parameter const.
15980 (Target::do_is_defined_by_abi): Likewise.
15981 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15982 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15983 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15984 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15985 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15986 * testsuite/Makefile.in: Rebuild.
15987
de31bda5
ILT
15988 * fileread.cc (make_view): Add casts to avoid warning.
15989
9fa33bee
AO
159902008-09-16 Alexandre Oliva <aoliva@redhat.com>
15991
15992 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15993 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15994
183fd0e3
AO
159952008-09-16 Alexandre Oliva <aoliva@redhat.com>
15996
15997 * options.h (General_options::output_is_executable): New.
15998 (General_options::output_is_pie): New.
15999 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16000 for shared libraries.
16001 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16002
7be8330a
CD
160032008-09-11 Chris Demetriou <cgd@google.com>
16004
16005 * options.h (origin): New -z option.
16006 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16007 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16008 in DT_FLAGS_1.
16009
a9caad02
CC
160102008-09-05 Cary Coutant <ccoutant@google.com>
16011
16012 * fileread.cc (File_read::make_view): Add check for attempt to map
16013 beyond end of file.
16014
ae6dce4d
CC
160152008-09-05 Cary Coutant <ccoutant@google.com>
16016
16017 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16018 explicit instantiations.
16019
d7ab2a47
KVH
160202008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16021
16022 PR gold/6858
16023 * options.cc (General_options::finalize): Allow undefined symbols
16024 in shlibs if linking -shared.
16025
16026 PR gold/6859
16027 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16028 symbols as not needing a dynsym entry.
16029
1e52a9c1
CS
160302008-08-20 Craig Silverstein <csilvers@google.com>
16031
16032 * fileread.cc (File_read::open): Do not lock the file unless it
16033 was successfully opened.
16034
d85c80a3
CC
160352008-08-14 Cary Coutant <ccoutant@google.com>
16036
16037 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16038 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16039 * testsuite/tls_test.cc (struct int128): 128-bit struct
16040 for testing TLS relocs with non-zero addend.
16041 (v12): New TLS variable.
16042 (t12): New test.
16043 (t_last): Add check for v12.
16044 * testsuite/tls_test.h (t12): New function.
16045 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16046
2d924fd9
ILT
160472008-08-13 Ian Lance Taylor <iant@google.com>
16048
16049 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16050 set tls_segment_ or relro_segment_.
16051 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16052 when appropriate.
16053 * output.h (Output_section::clear_is_relro): New function.
16054 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16055 sections specially even when output_data_ is empty.
16056 (Output_segment::maximum_alignment): When first section is relro,
16057 only force alignment for PT_LOAD segments.
16058 * script.cc (script_data_segment_align): New function.
16059 (script_data_segment_relro_end): New function.
16060 * script-c.h (script_data_segment_align): Declare.
16061 (script_data_segment_relro_end): Declare.
16062 * script-sections.h (class Script_sections): Declare
16063 data_segment_align and data_segment_relro_end. Add fields
16064 segment_align_index_ and saw_relro_end_.
16065 * script-sections.cc (class Sections_element): Add set_is_relro
16066 virtual function. Add new bool* parameter to place_orphan_here.
16067 Add get_output_section virtual function.
16068 (class Output_section_definition): Add set_is_relro. Add new
16069 bool* parameter to place_orphan_here. Add get_output_section.
16070 Add is_relro_ field.
16071 (Output_section_definition::Output_section_definition): Initialize
16072 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16073 and is_relro_ fields.
16074 (Output_section_definition::place_orphan_here): Add is_relro
16075 parameter.
16076 (Output_section_definition::set_section_addresses): Set relro for
16077 output section.
16078 (Output_section_definition::alternate_constraint): Likewise.
16079 (class Orphan_output_section): Add new bool* parameter to
16080 place_orphan_here. Add get_output_section.
16081 (Orphan_output_section::place_orphan_here): Add is_relro
16082 parameter.
16083 (Script_sections::Script_sections): Initialize
16084 data_segment_align_index_ and saw_relro_end_.
16085 (Script_sections::data_segment_align): New function.
16086 (Script_sections::data_segment_relro_end): New function.
16087 (Script_sections::place_orphan): Set or clear is_relro.
16088 (Script_sections::set_section_addresses): Force alignment of first
16089 TLS section.
16090 * yyscript.y (exp): Call script_data_segment_align and
16091 script_data_segment_relro_end.
16092 * testsuite/relro_script_test.t: New file.
16093 * testsuite/relro_test.cc (using_script): Declare.
16094 (t1, t2): Test using_script.
16095 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16096 (relro_script_test_SOURCES): Define.
16097 (relro_script_test_DEPENDENCIES): Define.
16098 (relro_script_test_LDFLAGS): Define.
16099 (relro_script_test_LDADD): Define.
16100 (relro_script_test.so): New target.
16101 * testsuite/Makefile.in: Rebuild.
16102
f827c9a9
CC
161032008-08-06 Cary Coutant <ccoutant@google.com>
16104
16105 * archive.cc (Archive::total_archives, Archive::total_members)
16106 (Archive::total_members_loaded): New variables.
16107 (Archive::setup): Add parameter. Add option to preread
16108 archive symbols.
16109 (Archive::read_armap): Add counter.
16110 (Archive::get_file_and_offset): New function.
16111 (Archive::get_elf_object_for_member): New function.
16112 (Archive::read_all_symbols): New function.
16113 (Archive::read_symbols): New function.
16114 (Archive::add_symbols): Add counters.
16115 (Archive::include_all_members): Use armap to find members if it's
16116 already built.
16117 (Archive::include_member): Skip reading symbols if already read.
16118 Factored code into Archive::get_file_and_offset and
16119 Archive::get_elf_object_for_member. Changed call to
16120 Mapfile::report_include_archive_member.
16121 (Archive::print_stats): New function.
16122 * archive.h: Declare Object and Read_symbols_data classes.
16123 (Archive::Archive): Add initializers for new members.
16124 (Archive::setup): Add parameter.
16125 (Archive::print_stats): New function.
16126 (Archive::total_archives, Archive::total_members)
16127 (Archive::total_members_loaded): New variables.
16128 (Archive::get_file_and_offset): New function.
16129 (Archive::get_elf_object_for_member): New function.
16130 (Archive::read_all_symbols): New function.
16131 (Archive::read_symbols): New function.
16132 (Archive::Archive_member): New class.
16133 (Archive::members_): New member.
16134 (Archive::num_members_): New member.
16135 * main.cc: Include archive.h.
16136 (main): Call Archive::print_stats.
16137 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16138 archive parameter; member_name is now the fully-decorated name.
16139 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16140 * options.h: (General_options): Add --preread-archive-symbols option.
16141 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16142 Archive::setup.
16143
de4c45bd
ILT
161442008-08-04 Ian Lance Taylor <iant@google.com>
16145
16146 * symtab.h (Symbol::use_plt_offset): New function.
16147 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16148 * powerpc.cc (Relocate::relocate): Likewise.
16149 * sparc.cc (Relocate::relocate): Likewise.
16150 * x86_64.cc (Relocate::relocate): Likewise.
16151 * testsuite/weak_plt.sh: New test.
16152 * testsuite/weak_plt_main.cc: New test.
16153 * testsuite/weak_plt_shared.cc: New test.
16154 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16155 (check_PROGRAMS): Add weak_plt.
16156 (check_DATA): Add weak_plt_shared.so.
16157 (weak_plt_main_pic.o, weak_plt): New targets.
16158 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16159 * testsuite/Makefile.in: Rebuild.
16160
16161 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16162 gcctestdir/ld.
16163 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16164 * testsuite/Makefile.in: Rebuild.
16165
323ee3f4
AM
161662008-08-04 Alan Modra <amodra@bigpond.net.au>
16167
16168 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16169 * Makefile.in: Regenerate.
16170 * po/POTFILES.in: Regenerate.
16171
7c07ecec
ILT
161722008-07-29 Ian Lance Taylor <iant@google.com>
16173
16174 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16175 symbols before other symbols.
16176 * testsuite/script_test_2.cc (test_addr): Declare.
16177 (test_addr_alias): Declare.
16178 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16179 values.
7c07ecec
ILT
16180 * testsuite/script_test_2.t: Define test_addr_alias and
16181 test_addr.
16182
5778530e
ILT
161832008-07-24 Ian Lance Taylor <iant@google.com>
16184
2a00e4fb
ILT
16185 PR 5990
16186 * descriptors.cc: New file.
16187 * descriptors.h: New file.
16188 * gold-threads.h (class Hold_optional_lock): New class.
16189 * fileread.cc: Include "descriptors.h".
16190 (File_read::~File_read): Release descriptor rather than closing
16191 it.
16192 (File_read::open) [file]: Call open_descriptor rather than open.
16193 Set is_descriptor_opened_.
16194 (File_read::open) [memory]: Assert that descriptor is not open.
16195 (File_read::reopen_descriptor): New function.
16196 (File_read::release): Release descriptor.
16197 (File_read::do_read): Make non-const. Reopen descriptor.
16198 (File_read::read): Make non-const.
16199 (File_read::make_view): Reopen descriptor.
16200 (File_read::do_readv): Likewise.
16201 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16202 Update declarations.
16203 * layout.cc: Include "descriptors.h".
16204 (Layout::create_build_id): Use open_descriptor rather than open.
16205 * output.cc: Include "descriptors.h".
16206 (Output_file::open): Use open_descriptor rather than open.
16207 * archive.cc (Archive::const_iterator): Change Archive to be
16208 non-const.
16209 (Archive::begin, Archive::end): Make non-const.
16210 (Archive::count_members): Likewise.
16211 * archive.h (class Archive): Update declarations.
16212 * object.h (Object::read): Make non-const.
16213 * Makefile.am (CCFILES): Add descriptors.cc.
16214 (HFILES): Add descriptors.h.
16215 * Makefile.in: Rebuild.
16216
801647d1
ILT
16217 PR 6716
16218 * gold.h: Always include <clocale>. Add Solaris workarounds
16219 following code in binutils/sysdep.h.
16220
5edd166e
ILT
16221 PR 6048
16222 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16223 this->eh_frame_hdr_ is NULL before using it.
16224
c89ad728
ILT
16225 * dynobj.cc (Versions::Versions): Update comment.
16226
aa86f06b
ILT
16227 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16228 the base version name.
16229
5778530e
ILT
16230 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16231 array size plus one.
16232 (Stringpool_template::set_string_offsets): Subtract one from key
16233 before using it as an array index.
16234 (Stringpool_template::get_offset_with_length): Likewise.
16235 (Stringpool_template::write_to_buffer): Likewise.
16236 * stringpool.h (Stringpool_template::get_offset_from_key):
16237 Likewise.
16238
057ead22
ILT
162392008-07-23 Ian Lance Taylor <iant@google.com>
16240
7f649c59
ILT
16241 PR 6658
16242 * object.h (Merged_symbol_value::value): Do our best to handle a
16243 negative addend.
16244
057ead22
ILT
16245 PR 6647
16246 * script.cc (Version_script_info::get_versions): Don't add empty
16247 version tag to return value.
16248 (Version_script_info::get_symbol_version_helper): Change return
16249 type to bool. Add pversion parameter. Change all callers.
16250 (script_register_vers_node): Don't require a non-NULL tag.
16251 * script.h (class Version_script_info): Update declarations.
16252 (Version_script_info::get_symbol_version): Change return type to
16253 bool. Add version parameter. Change all callers.
16254 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16255 handling. Handle an empty version from a version script.
16256 (Symbol_table::define_special_symbol): Likewise.
16257 * testsuite/ver_test_10.script: New file.
16258 * testsuite/ver_test_10.sh: New file.
16259 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16260 (check_DATA): Add ver_test_10.syms.
16261 (ver_test_10.syms, ver_test_10.so): New target.
16262 * testsuite/Makefile.in: Rebuild.
16263
58e54ac2
CD
162642008-07-23 Simon Baldwin <simonb@google.com>
16265
16266 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16267 to zero for undefined symbols from dynamic libraries.
16268
95d14cd3
ILT
162692008-07-23 Ian Lance Taylor <iant@google.com>
16270
16271 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16272 Change all callers.
16273 * symtab.h (class Symbol_table): Update declaration.
16274 * testsuite/ver_test_9.cc: New file.
16275 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16276 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16277 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16278 (ver_test_9.so, ver_test_9.o): New targets.
16279 * testsuite/Makefile.in: Rebuild.
16280
92de84a6
ILT
162812008-07-22 Ian Lance Taylor <iant@google.com>
16282
34810851
ILT
16283 * options.h (class General_options): Define --check-sections.
16284 * layout.cc (Layout::set_segment_offsets): Handle
16285 --check-sections.
16286
af6156ef
ILT
16287 * options.h (class General_options): Define -n/--nmagic and
16288 -N/--omagic.
16289 * options.cc (General_options::finalize): For -n/--nmagic or
16290 -N/--omagic, set -static.
16291 * layout.cc (Layout::attach_allocated_section_to_segment): If
16292 -N/--omagic, don't put read-only and read-write sections in
16293 different segments.
16294 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16295 finding a read-only segment.
16296 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16297 don't set the minimum segment alignment to the common page size,
16298 and don't set the file offset to the address modulo the page size.
16299 * script-sections.cc (Script_sections::create_segments): If
16300 -n/--omagic, don't put read-only and read-write sections in
16301 different segments.
16302
92de84a6
ILT
16303 * cref.cc: New file.
16304 * cref.h: New file.
16305 * options.h (class General_options): Add --print-symbol-counts.
16306 * main.cc (main): Issue defined symbol report if requested.
16307 * archive.cc (Archive::interpret_header): Make into a const member
16308 function.
16309 (Archive::add_symbols): Call Input_objects::archive_start and
16310 archive_stop.
16311 (Archive::const_iterator): Define new class.
16312 (Archive::begin, Archive::end): New functions.
16313 (Archive::include_all_members): Rewrite to use iterator.
16314 (Archive::count_members): New function.
16315 * archive.h (class Archive): Update declarations.
16316 (Archive::filename): New function.
16317 * object.cc: Include "cref.h".
16318 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16319 (Sized_relobj::do_get_global_symbol_counts): New function.
16320 (Input_objects::add_object): Add object to cross-referencer.
16321 (Input_objects::archive_start): New function.
16322 (Input_objects::archive_stop): New function.
16323 (Input_objects::print_symbol_counts): New function.
16324 * object.h: Declare Cref and Archive.
16325 (Object::get_global_symbol_counts): New function.
16326 (Object::do_get_global_symbol_counts): New pure virtual function.
16327 (class Sized_relobj): Add defined_count_ field. Update
16328 declarations.
16329 (class Input_objects): Add cref_ field. Update constructor.
16330 Update declarations.
16331 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16332 defined_count_.
16333 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16334 symbol counts.
16335 (Sized_dynobj::do_get_global_symbol_counts): New function.
16336 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16337 defined_count_. Update declarations. Define Symbols typedef.
16338 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16339 parameter. Change all callers.
16340 (Symbol_table::add_from_dynobj): Add sympointers and defined
16341 parameters. Change all callers.
16342 * symtab.h (class Symbol_table): Update declarations.
16343 * Makefile.am (CCFILES): Add cref.cc.
16344 (HFILES): Add cref.h.
16345 * Makefile.in: Rebuild.
16346
3f7c5e1d
CD
163472008-07-22 Simon Baldwin <simonb@google.com>
16348
16349 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16350 to zero when writing undefined symbols.
16351
e0b64032
ILT
163522008-07-22 Ian Lance Taylor <iant@google.com>
16353
16354 * output.cc (Output_section::add_input_section): Don't try to
16355 merge empty merge sections.
16356
096b02cf
CS
163572008-07-21 Craig Silverstein <csilvers@google.com>
16358
16359 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16360 Include symbol version in error message.
cd536b21 16361
1d1f116d
CD
163622008-07-20 Chris Demetriou <cgd@google.com>
16363
cd536b21 16364 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16365 (RANDOM_SEED_CFLAGS): New substituted variable.
16366 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16367 * configure: Rebuild.
16368 * Makefile.in: Likewise.
16369 * testsuite/Makefile.in: Likewise.
16370
a18f591e
ILT
163712008-07-18 Ian Lance Taylor <iant@google.com>
16372
16373 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16374 where we see NAME/NULL and NAME/VERSION as separate symbols.
16375 * testsuite/ver_test_main.cc (main): Call t4.
16376 (t4, t4_2a): Define.
16377 * testsuite/ver_test_2.cc (t4_2): Define.
16378 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16379 * testsuite/ver_test_4.cc (t4_2a): Define.
16380 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16381 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16382
c6e3f6ed
ILT
163832008-07-17 Ian Lance Taylor <iant@google.com>
16384
16385 * dynobj.cc (Versions::add_def): If we give an error about a
16386 missing version, go ahead and create the version anyhow.
16387
ef9beddf
ILT
163882008-07-10 Ian Lance Taylor <iant@google.com>
16389
16390 Handle output sections with more than 0x7fffffff bytes.
16391 * object.h (class Relobj): Change map_to_output_ to
16392 output_sections_, and just keep a section pointer. Change all
16393 uses. Move comdat group support to Sized_relobj.
16394 (Relobj::is_section_specially_mapped): Remove.
16395 (Relobj::output_section): Remove poff parameter. Change all
16396 callers.
16397 (Relobj::output_section_offset): New function.
16398 (Relobj::set_section_offset): Rewrite.
16399 (Relobj::map_to_output): Remove.
16400 (Relobj::output_sections): New function.
16401 (Relobj::do_output_section_offset): New pure virtual function.
16402 (Relobj::do_set_section_offset): Likewise.
16403 (class Sized_relobj): Add section_offsets_ field. Add comdat
16404 group support from Relobj. Update declarations.
16405 (Sized_relobj::get_output_section_offset): New function.
16406 (Sized_relobj::do_output_section_offset): New function.
16407 (Sized_relobj::do_set_section_offset): New function.
16408 * object.cc (Relobj::output_section_address): Remove.
16409 (Sized_relobj::Sized_relobj): Initialize new fields.
16410 (Sized_relobj::include_section_group): Cast find_kept_object to
16411 Sized_relobj.
16412 (Sized_relobj::include_linkonce_section): Likewise.
16413 (Sized_relobj::do_layout): Use separate arrays for output section
16414 and output offset.
16415 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16416 output_sections.
16417 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16418 output_sections and section_offsets.
16419 (Sized_relobj::write_local_symbols): Likewise.
16420 (map_to_kept_section): Compute output address directly.
16421 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16422 output_sections and section_offsets.
16423 (Sized_relobj::write_sections): Likewise.
16424 (Sized_relobj::relocate_sections): Likewise.
16425 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16426 * output.h (class Output_reloc): Update declarations. Change
16427 u2_.relobj to Sized_relobj*.
16428 (class Output_data_reloc): Change add functions to use
16429 Sized_relobj*.
16430 * output.cc (Output_reloc::Output_reloc): Change relobj to
16431 Sized_relobj*.
16432 (Output_reloc::local_section_offset): Change return type to
16433 Elf_Addr. Use get_output_section_offset.
16434 (Output_reloc::get_address): Likewise.
16435 (Output_section::is_input_address_mapped): Don't call
16436 is_section_specially_mapped.
16437 (Output_section::output_offset): Likewise.
16438 (Output_section::output_address): Likewise.
16439 (Output_section::starting_output_address): Likewise.
16440 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16441 parameter to Sized_relobj*.
16442 (Copy_relocs::need_copy_reloc): Likewise.
16443 (Copy_relocs::save): Likewise.
16444 * copy-relocs.h (class Copy_relocs): Update declarations.
16445 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16446 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16447 * target-reloc.h (relocate_for_relocatable): Change
16448 offset_in_output_section type to Elf_Addr. Change code that uses
16449 it as well.
16450 * layout.cc (Layout::layout): Always set *off.
16451 * mapfile.cc (Mapfile::print_input_section): Use
16452 output_section_offset.
16453 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16454 Sized_relobj*.
16455 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16456 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16457 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16458
5cb66f97
ILT
164592008-07-03 Ian Lance Taylor <iant@google.com>
16460
16461 * layout.cc (Layout::include_section): Do not discard unrecognized
16462 SHT_STRTAB sections.
16463
afe47622
CS
164642008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16465
16466 * script.cc (Lex::can_continue_name): Make '?' allowable in
16467 version-script names.
16468 * testsuite/version_script.map: Change glob pattern to use '?'
16469
5adf9721
ILT
164702008-06-30 Manish Singh <yosh@gimp.org>
16471
16472 PR 6585
16473 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16474 Correct typo.
16475
e6fde208
ILT
164762008-06-30 Ian Lance Taylor <iant@google.com>
16477
16478 PR 6660
16479 PR 6682
16480 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16481 versions]: Don't try to read the value in the contents, since we
16482 don't use it. Use the template endianness when writing.
16483
3f2e6a2d
CC
164842008-06-25 Cary Coutant <ccoutant@google.com>
16485
16486 * fileread.cc (File_read::make_view): Assert on zero-length view.
16487 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16488 symbol table when there are no symbols to read.
16489
c43d3a48
CS
164902008-06-23 Craig Silverstein <csilvers@google.com>
16491
16492 * version.cc (version_string): Bump to 1.7
16493
5f494ea0
CS
164942008-06-18 Craig Silverstein <csilvers@google.com>
16495
16496 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16497 constant 0xFFFF to type Valtype.
16498 (Powerpc_relocate_functions::rel16_ha): Likewise.
16499
c42e122e
ILT
165002008-06-17 Ian Lance Taylor <iant@google.com>
16501
f34787f8
ILT
16502 * output.h (Output_section::Input_section): Initialize p2align_ to
16503 zero for Output_section_data constructors.
16504 (Output_section::Input_section::addralign): If not an input
16505 section, return the alignment of the Output_section_data.
16506 * testsuite/copy_test.cc: New file.
16507 * testsuite/copy_test_1.cc: New file.
16508 * testsuite/copy_test_2.cc: New file.
16509 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16510 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16511 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16512 (copy_test_1_pic.o, copy_test_1.so): New targets.
16513 (copy_test_2_pic.o, copy_test_2.so): New targets.
16514 * testsuite/Makefile.in: Rebuild.
16515
c42e122e
ILT
16516 * script-sections.cc (Script_sections::place_orphan): Initialize
16517 local variable exact.
16518
ce3ac18a
DE
165192008-06-13 David Edelsohn <edelsohn@gnu.org>
16520
16521 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16522
42cacb20
DE
165232008-06-12 David Edelsohn <edelsohn@gnu.org>
16524 David S. Miller <davem@davemloft.net>
16525
16526 * powerpc.cc: New file.
16527 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16528 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16529 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16530 * Makefile.in: Rebuild.
16531
7b308235
ILT
165322008-06-09 Ian Lance Taylor <iant@google.com>
16533
16534 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16535 <exception>.
16536 (throwing, orig_terminate): New static variables.
16537 (terminate_handler): New static function.
16538 (t2): Set terminate handler.
16539
f0b886e3
ILT
165402008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16541
16542 PR 6584
cd536b21 16543 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16544 alignment.
16545
3e90f135
CC
165462008-05-30 Cary Coutant <ccoutant@google.com>
16547
16548 * archive.cc (Archive::include_all_members) Correct to step
16549 over symbol table and extended name table in thin archives.
16550
e09ad04a
ILT
165512008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16552
16553 PR 6407
16554 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16555 calculation.
16556
62b01cb5
ILT
165572008-05-28 Caleb Howe <cshowe@google.com>
16558
16559 * reduced_debug_output.cc: New file.
16560 * reduced_debug_output.h: New file.
92de84a6 16561 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16562 * options.cc (General_options::finalize): Add strip_debug_non_line
16563 to the strip heirarchy.
16564 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16565 fields.
16566 * layout.cc: Include "reduced_debug_output.h".
16567 (Layout::Layout): Initialize new fields.
16568 (line_only_debug_sections): New static array.
16569 (is_lines_only_debug_sections): New static inline function.
16570 (Layout::include_section): Handle --strip-debug-non-line.
16571 (Layout::make_output_section): If --strip-debug-non-line, build
16572 new output sections for .debug_abbrev and .debug_info.
16573 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16574 gold. Warn about possible overflow.
16575 (read_signed_LEB_128): Likewise.
16576 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16577 (read_signed_LEB_128): Declare.
16578 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16579 (HFILES): Add reduced_debug_output.h.
16580 * Makefile.in: Rebuild.
16581
7d9e3d98
ILT
165822008-05-21 Ian Lance Taylor <iant@google.com>
16583
16584 * mapfile.cc: New file.
16585 * mapfile.h: New file.
16586 * options.h (class General_options): Add -M/--print-map and -Map.
16587 * options.cc (General_options::finalize): Make -M equivalent to
16588 -Map -.
16589 * main.cc: Include <cstdio> and "mapfile.h".
16590 (main): Open mapfile if requested.
16591 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16592 constructor. Change caller.
16593 (queue_initial_tasks): Add mapfile parameter. Change caller.
16594 (queue_middle_tasks): Likewise.
16595 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16596 declarations.
16597 * archive.cc: Include "mapfile.h".
16598 (Archive::add_symbols): Add mapfile parameter. Change all
16599 callers. Pass mapfile, symbol, and reason to include_member.
16600 (Archive::include_all_members): Add mapfile parameter. Change all
16601 callers.
16602 (Archive::include_member): Add mapfile, sym, and why parameters.
16603 Change all callers. Report inclusion to map file.
16604 * archive.h: Include "fileread.h".
16605 (class Archive): Update declarations.
16606 (Archive::file): New const method.
16607 (class Add_archive_symbols): Add mapfile_ field. Update
16608 constructor. Change all callers.
16609 * readsyms.h (class Read_symbols): Likewise.
16610 (class Finish_group): Likewise.
16611 (class Read_script): Likewise.
16612 * common.cc: Include "mapfile.h".
16613 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16614 all callers.
16615 (Symbol_table::do_allocate_commons): Likewise.
16616 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16617 symbol allocation to mapfile.
16618 * common.h (class Allocate_commons_task): Add mapfile_ field.
16619 Update constructor. Change all callers.
16620 * symtab.h (class Symbol_table): Update declarations.
16621 * layout.cc: Include "mapfile.h".
16622 (Layout_task_runner::run): Print information to mapfile.
16623 (Layout::create_gold_note): Change Output_data_fixed_space to
16624 Output_data_zero_fill.
16625 (Layout::create_build_id): Likewise.
16626 (Layout::print_to_mapfile): New function.
16627 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16628 constructor. Change caller.
16629 (class Layout): Declare print_to_mapfile.
16630 * output.cc (Output_section::Input_section::print_to_mapfile): New
16631 function.
16632 (Output_section::add_input_section): If producing a map, always
16633 add to input_sections_ list.
16634 (Output_section::do_print_to_mapfile): New function.
16635 (Output_segment::print_sections_to_mapfile): New function.
16636 (Output_segment::print_section_list_to_mapfile): New function.
16637 * output.h: Include "mapfile.h".
16638 (Output_data::print_to_mapfile): New function.
16639 (Output_data::do_print_to_mapfile): New virtual function.
16640 (Output_segment_headers::do_print_to_mapfile): New function.
16641 (Output_file_header::do_print_to_mapfile): New function.
16642 (Output_data_const::do_print_to_mapfile): New function.
16643 (class Output_data_const_buffer): Add map_name_ field. Update
16644 constructor. Change all callers. Add do_print_to_mapfile
16645 function.
16646 (class Output_data_fixed_space): Likewise.
16647 (class Output_data_space): Likewise.
16648 (class Output_data_zero_fill): New class.
16649 (Output_data_strtab::do_print_to_mapfile): New function.
16650 (Output_data_reloc_base::do_print_to_mapfile): New function.
16651 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16652 (Output_data_group::do_print_to_mapfile): New function.
16653 (Output_data_got::do_print_to_mapfile): New function.
16654 (Output_data_dynamic::do_print_to_mapfile): New function.
16655 (Output_symtab_xindex::do_print_to_mapfile): New function.
16656 (class Output_section): Declare do_print_to_mapflie. Declare
16657 print_to_mapfile in Input_section.
16658 (class Output_segment): Declare new functions.
16659 * object.h (Sized_relobj::symbol_count): New function.
16660 * script-sections.cc
16661 (Output_section_element_dot_assignment::set_section_addresses):
16662 Change Output_data_fixed_space to Output_data_zero_fill.
16663 (Output_data_expression::do_print_to_mapfile): New function.
16664 * script.cc (read_input_script): Add mapfile parameter. Change
16665 all callers.
16666 * script.h (read_input_script): Update declaration.
16667 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16668 (Eh_frame::do_print_to_mapfile): New function.
16669 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16670 (Output_merge_string::do_print_to_mapfile): New function.
16671 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16672 function.
16673 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16674 function.
16675 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16676 function.
16677 * Makefile.am (CCFILES): Add mapfile.cc.
16678 (HFILES): Add mapfile.h.
16679 * Makefile.in: Rebuild.
16680
9f1d377b
ILT
166812008-05-19 Ian Lance Taylor <iant@google.com>
16682
16683 * options.h (class General_options): Add -z relro.
16684 * layout.cc (Layout::Layout): Initialize relro_segment_.
16685 (Layout::add_output_section_data): Return the output section.
16686 (Layout::make_output_section): Rcognize relro sections and mark
16687 them appropriately.
16688 (Layout::attach_allocated_section_to_segment): Put relro sections
16689 in a PT_GNU_RELRO segment.
16690 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16691 section as relro.
16692 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16693 PT_TLS segments.
16694 (Layout::linkonce_mapping): Map d.rel.ro.local to
16695 .data.rel.ro.local.
16696 (Layout::output_section_name): Us .data.rel.ro.local for any
16697 section which begins with that.
16698 * layout.h (class Layout): Update add_output_section_data
16699 declaration. Add relro_segment_ field.
16700 * output.cc (Output_section::Output_section): Initialize is_relro_
16701 and is_relro_local_ fields.
16702 (Output_segment::add_output_section): Group relro sections.
16703 (Output_segment::is_first_section_relro): New function.
16704 (Output_segment::maximum_alignment): If there is a relro section,
16705 align the segment to the common page size.
16706 (Output_segment::set_section_addresses): Track whether we are
16707 looking at relro sections. If the last section is a relro
16708 section, align to the common page size.
16709 (Output_segment::set_section_list_addresses): Add in_relro
16710 parameter. Change all callers. Align to the page size when
16711 moving from relro to non-relro section.
16712 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16713 segment.
16714 * output.h (class Output_section): Add is_relro_ and
16715 is_relro_local_ fields.
16716 (Output_section::is_relro): New function.
16717 (Output_section::set_is_relro): New function.
16718 (Output_section::is_relro_local): New function.
16719 (Output_section::set_is_relro_local): New function.
16720 (class Output_segment): Update declarations.
16721 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16722 * sparc.cc (Target_sparc::got_section): Likewise.
16723 * x86_64.cc (Target_x86_64::got_section): Likewise.
16724 * testsuite/relro_test_main.cc: New file.
16725 * testsuite/relro_test.cc: New file.
16726 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16727 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16728 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16729 (relro_test.so, relro_test_pic.o): New targets.
16730 * testsuite/Makefile.in: Rebuild.
16731
a984ee1d
ILT
167322008-05-16 Ian Lance Taylor <iant@google.com>
16733
01676dcd
ILT
16734 * output.cc (Output_segment::add_output_section): Remove front
16735 parameter.
16736 * output.h (class Output_segment): Remove
16737 add_initial_output_section and overloaded add_output_section.
16738 Update declaration of remaining add_output_section.
16739 * layout.cc (Layout::create_interp): Call add_output_section
16740 rather than add_initial_output_section.
16741 (Layout::finish_dynamic_section): Likewise.
16742
497897f9
ILT
16743 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16744 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16745 know the dynamic type.
16746 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16747 field. Initialize it in constructor.
16748 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16749 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16750 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16751 reloc.
16752
a984ee1d
ILT
16753 * output.cc (Output_reloc::get_address): Change return type to
16754 Elf_Addr.
16755 * output.h (class Output_reloc): Update get_address declaration.
16756 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16757 for section addresses.
16758
55ba0940
ILT
167592008-05-09 Ian Lance Taylor <iant@google.com>
16760
16761 PR 6493
16762 * gold.cc (gold_nomem): Use return value of write.
16763
75517b77
ILT
167642008-05-08 Ian Lance Taylor <iant@google.com>
16765
16766 * symtab.c (Symbol::init_base_output_data): Add version
16767 parameter. Change all callers.
16768 (Symbol::init_base_output_segment): Likewise.
16769 (Symbol::init_base_constant): Likewise.
16770 (Symbol::init_base_undefined): Likewise.
16771 (Sized_symbol::init_output_data): Likewise.
16772 (Sized_symbol::init_output_segment): Likewise.
16773 (Sized_symbol::init_constant): Likewise.
16774 (Sized_symbol::init_undefined): Likewise.
16775 (Symbol_table::do_define_in_output_data): If the new symbol has a
16776 version, mark it as the default.
16777 (Symbol_table::do_define_in_output_segment): Likewise.
16778 (Symbol_table::do_define_as_constant): Likewise.
16779 * symtab.h (class Symbol): Update declarations.
16780 (class Sized_symbol): Likewise.
16781 * resolve.cc (Symbol::override_version): New function.
c42e122e 16782 (Symbol::override_base): Call override_version.
75517b77
ILT
16783 (Symbol::override_base_with_special): Likewise.
16784 * testsuite/ver_script_8.script: New file.
16785 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16786 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16787 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16788 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16789
f1f70eae
ILT
167902008-05-06 Ian Lance Taylor <iant@google.com>
16791
f3e9c5c5
ILT
16792 PR 6049
16793 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16794 functions.
16795 (class General_options): Remove existing --undefined, and add
16796 --no-undefined instead. Add new --undefined as synonym for -u.
16797 * archive.cc (Archive::add_symbols): Check whether symbol was
16798 named with -u.
16799 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16800 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16801 all uses. Add IS_UNDEFINED. Update declarations to split
16802 different versions of init_base. Declare init_base_undefined.
16803 (Symbol::is_defined): Handle IS_UNDEFINED.
16804 (Symbol::is_undefined): Likewise.
16805 (Symbol::is_weak_undefined): Call is_undefined.
16806 (Symbol::is_absolute): Handle IS_CONSTANT.
16807 (class Sized_symbol): Update declarations to split different
16808 versions of init. Declare init_undefined.
16809 (class Symbol_table): Declare new functions.
16810 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16811 Change all callers.
16812 (Symbol::init_base_output_data): Likewise.
16813 (Symbol::init_base_output_segment): Likewise.
16814 (Symbol::init_base_constant): Likewise.
16815 (Symbol::init_base_undefined): New function.
16816 (Sized_symbol::init_object): Rename from init. Change all
16817 callers.
16818 (Sized_symbol::init_output_data): Likewise.
16819 (Sized_symbol::init_output_segment): Likewise.
16820 (Sized_symbol::init_constant): Likewise.
16821 (Sized_symbol::init_undefined): New function.
16822 (Symbol_table::add_undefined_symbols_from_command_line): New
16823 function.
16824 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16825 function.
16826 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16827 (Symbol::output_section): Likewise.
16828 (Symbol::set_output_section): Likewise.
16829 (Symbol_table::sized_finalize_symbol): Likewise.
16830 (Symbol_table::sized_write_globals): Likewise.
16831 * resolve.cc (Symbol_table::should_override): Likewise.
16832 (Symbol::override_base_with_special): Likewise.
16833
8bdcdf2c
ILT
16834 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16835 symbol, change it to have default visibility.
16836 * testsuite/protected_1.cc: New file.
16837 * testsuite/protected_2.cc: New file.
16838 * testsuite/protected_3.cc: New file.
16839 * testsuite/protected_main_1.cc: New file.
16840 * testsuite/protected_main_2.cc: New file.
16841 * testsuite/protected_main_3.cc: New file.
16842 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16843 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16844 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16845 (protected_1.so): New target.
16846 (protected_1_pic.o, protected_2_pic.o): New targets.
16847 (protected_3_pic.o): New target.
16848 (check_PROGRAMS): Add protected_2.
16849 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16850 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16851 * testsuite/Makefile.in: Rebuild.
16852
2b706932
ILT
16853 * options.h (DEFINE_var): Add set_user_set_##varname__.
16854 (DEFINE_bool_alias): New macro.
16855 (class General_options): Define -Bstatic using DEFINE_bool_alias
16856 rather than DEFINE_special. Add --undefined as an alias for -z
16857 defs.
16858 * options.cc (General_options::parse_Bstatic): Remove.
16859
d82a5bcc
ILT
16860 * options.h (class General_options): Add --fatal-warnings.
16861 * main.cc (main): Implement --fatal-warnings.
16862 * errors.h (Errors::warning_count): New function.
16863
f1f70eae
ILT
16864 * options.h (class General_options): Add -Bsymbolic-functions.
16865 * symtab.h (Symbol::is_preemptible): Check for
16866 -Bsymbolic-functions.
16867
8825ac63
ILT
168682008-05-05 Ian Lance Taylor <iant@google.com>
16869
d98bc257
ILT
16870 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16871 as noVARNAME rather than no-VARNAME.
16872 (class General_options): Add option -z combreloc.
16873 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16874 get_address.
16875 (Output_reloc::sort_before) [SHT_REL]: New function.
16876 (Output_reloc::sort_before) [SHT_RELA]: New function.
16877 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16878 Sort_relocs_comparison.
16879 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16880 parameter. Change all callers.
16881 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16882 sort_relocs parameter. Change all callers.
16883 * output.cc (Output_reloc::get_address): New function, broken out
16884 of write_rel.
16885 (Output_reloc::write_rel): Call it.
16886 (Output_reloc::compare): New function.
16887 (Output_data_reloc_base::do_write): Optionally sort relocs.
16888
60b2b4e7
ILT
16889 * configure.ac: If targ_extra_obj is set, link it in.
16890 * configure.tgt: Initialize all variables.
16891 (x86_64*): Set targ_extra_obj and targ_extra_size.
16892 * configure: Rebuild.
16893
8825ac63
ILT
16894 * object.cc (Sized_relobj::include_section_group): Adjust section
16895 indexes read from group data. Build vector to pass to
16896 layout_group.
16897 * layout.cc (Layout::layout_group): Add flags and shndxes
16898 parameters. Remove contents parameter. Change caller. Update
16899 explicit instantiations.
16900 * layout.h (class Layout): Update layout_group declaration.
16901 * output.cc (Output_data_group::Output_data_group): Add flags and
16902 input_shndxes parameters. Remove contents parameter. Change
16903 caller.
16904 (Output_data_group::do_write): Change input_sections_ to
16905 input_shndxes_.
16906 * output.h (class Output_data_group): Update constructor
16907 declaration. Rename input_sections_ to input_shndxes_.
16908 * testsuite/many_sections_test.cc: Add template.
16909
e94cf127
CC
169102008-04-30 Cary Coutant <ccoutant@google.com>
16911
4418b2d5
CC
16912 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16913
e94cf127
CC
16914 * layout.cc (Layout::include_section): Refactored check for debug
16915 info section.
16916 (Layout::add_comdat): Add new parameters. Change type
16917 of signature parameter. Add object and shndx to signatures table.
16918 (Layout::find_kept_object): New function.
16919 * layout.h: Include <cstring>.
16920 (Layout::is_debug_info_section): New function.
16921 (Layout::add_comdat): Add new parameters.
16922 (Layout::find_kept_object): New function.
16923 (Layout::Kept_section): New struct.
16924 (Layout::Signatures): Change type of map range.
16925 * object.cc (Relobj::output_section_address): New function.
16926 (Sized_relobj::include_section_group): Add new parameters. Change
16927 calls to Layout::add_comdat. Change to build table of kept comdat
16928 groups and table mapping discarded sections to kept sections.
16929 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16930 (Sized_relobj::do_layout): Change calls to include_section_group and
16931 include_linkonce_section.
16932 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16933 value to zero when section is discarded.
16934 (Sized_relobj::map_to_kept_section): New function.
16935 * object.h (Relobj::output_section_address): New function.
16936 (Relobj::Comdat_group): New type.
16937 (Relobj::find_comdat_group): New function.
16938 (Relobj::Comdat_group_table): New type.
16939 (Relobj::Kept_comdat_section): New type.
16940 (Relobj::Kept_comdat_section_table): New type.
16941 (Relobj::add_comdat_group): New function.
16942 (Relobj::set_kept_comdat_section): New function.
16943 (Relobj::get_kept_comdat_section): New function.
16944 (Relobj::comdat_groups_): New field.
16945 (Relobj::kept_comdat_sections_): New field.
16946 (Symbol_value::input_value): Update comment.
16947 (Sized_relobj::map_to_kept_section) New function.
16948 (Sized_relobj::include_linkonce_section): Add new parameter.
16949 * target-reloc.h (Comdat_behavior): New type.
16950 (get_comdat_behavior): New function.
16951 (relocate_section): Add code to map a discarded section to the
16952 corresponding kept section when applying a relocation.
16953
e4e5049b
CS
169542008-04-30 Craig Silverstein <csilvers@google.com>
16955
16956 * dwarf_reader.cc (next_generation_count): New static var.
16957 (Addr2line_cache_entry): New struct.
16958 (addr2line_cache): New static var.
16959 (Dwarf_line_info::one_addr2line): Added caching.
16960 (Dwarf_line_info::clear_addr2line_cache): New function.
16961 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16962 cache-size parameter.
16963 (Dwarf_line_info::one_addr2line_cache): New function.
16964 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16965 new cache-size argument to one_addr2line(), and clear cache.
16966
d09e9154
CC
169672008-04-28 Cary Coutant <ccoutant@google.com>
16968
16969 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16970 R_386_PC8 relocations.
16971
7ef73768
ILT
169722008-04-23 Ian Lance Taylor <iant@google.com>
16973
55438702
ILT
16974 * object.cc (Sized_relobj::include_section_group): Check for
16975 invalid section group.
16976
c165fb93
ILT
16977 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16978 header size.
16979
7ef73768
ILT
16980 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16981 than read for file header.
16982 * archive.cc (Archive::include_member): Likewise.
16983
6194aaab
L
169842008-04-23 Paolo Bonzini <bonzini@gnu.org>
16985
16986 * aclocal.m4: Regenerate.
16987 * configure: Regenerate.
16988
d491d34e
ILT
169892008-04-19 Ian Lance Taylor <iant@google.com>
16990
5ea2bac6
ILT
16991 * version.cc (version_string): Bump to 1.6.
16992
7bc3e21a
ILT
16993 * testsuite/Makefile.am (many_sections_r_test): New target.
16994 (many_sections_r_test_SOURCES): Remove.
16995 (many_sections_r_test_DEPENDENCIES): Remove.
16996 (many_sections_r_test_LDFLAGS): Remove.
16997 (many_sections_r_test_LDADD): Remove.
16998
7fcd3aa9
ILT
16999 * object.cc (Sized_relobj::do_add_symbols): Always pass
17000 local_symbol_count_ to add_from_relobj.
17001
4c94d6ae
ILT
17002 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17003 every thousand variables.
17004 * testsuite/Makefile.in: Rebuild.
17005
d491d34e
ILT
17006 * object.cc (Xindex::initialize_symtab_xindex): New function.
17007 (Xindex::read_symtab_xindex): New function.
17008 (Xindex::sym_xindex_to_shndx): New function.
17009 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17010 available.
17011 (Sized_relobj::do_initialize_xindex): New function.
17012 (Sized_relobj::do_read_symbols): Adjust section links.
17013 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17014 parameter. Change all callers.
17015 (Sized_relobj::include_section_group): Adjust section links and
17016 symbol section indexes.
17017 (Sized_relobj::do_layout): Adjust section links.
17018 (Sized_relobj::do_count_local_symbols): Adjust section links and
17019 symbol section indexes.
17020 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17021 ordinary and special symbols.
17022 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17023 dynsym_xindex parameters. Change all callers. Adjust section
17024 links. Use SHN_XINDEX when needed.
17025 (Sized_relobj::get_symbol_location_info): Adjust section links.
17026 Don't get fooled by special symbols.
17027 * object.h (class Xindex): Define.
17028 (class Object): Add xindex_ parameter. Declare virtual functoin
17029 do_initialize_xindex.
17030 (Object::adjust_sym_shndx): New function.
17031 (Object::set_xindex): New protected function.
17032 (class Symbol_value): Add is_ordinary_shndx_ field.
17033 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17034 (Symbol_value::value): Assert ordinary section.
17035 (Symbol_value::initialize_input_to_output_map): Likewise.
17036 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17037 Change all callers.
17038 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17039 all callers.
17040 (class Sized_relobj): Update declarations.
17041 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17042 parameter. Change all callers.
17043 (Sized_relobj::adjust_shndx): New function.
17044 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17045 field.
17046 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17047 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17048 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17049 (Sized_dynobj::read_dynsym_section): Adjust section links.
17050 (Sized_dynobj::read_dynamic): Likewise.
17051 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17052 section links.
17053 (Sized_dynobj::do_initialize_xindex): New function.
17054 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17055 do_initialize_xindex.
17056 (Sized_dynobj::adjust_shndx): New function.
17057 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17058 dynsym_xindex_ fields.
17059 (Layout::finalize): Add a call to set_section_indexes before
17060 creating the symtab sections.
17061 (Layout::set_section_indexes): Don't do anything if the section
17062 already has a section index.
17063 (Layout::create_symtab_sections): Add shnum parameter. Change
17064 caller. Create .symtab_shndx section if needed.
17065 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17066 caller.
17067 (Layout::allocated_output_section_count): New function.
17068 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17069 needed.
17070 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17071 fields. Update declarations.
17072 (Layout::symtab_xindex): New function.
17073 (Layout::dynsym_xindex): New function.
17074 (class Write_symbols_task): Add layout_ field.
17075 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17076 Change caller.
17077 * output.cc (Output_section_headers::Output_section_headers): Add
17078 shstrtab_section parameter. Change all callers.
17079 (Output_section_headers::do_sized_write): Store overflow values
17080 for section count and section string table section index in
17081 section header zero.
17082 (Output_file_header::do_sized_write): Check for overflow of
17083 section count and section string table section index.
17084 (Output_symtab_xindex::do_write): New function.
17085 (Output_symtab_xindex::endian_do_write): New function.
17086 * output.h (class Output_section_headers): Add shstrtab_section_.
17087 Update declarations.
17088 (class Output_symtab_xindex): Define.
17089 (Output_section::has_out_shndx): New function.
17090 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17091 field.
17092 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17093 Change all callers.
17094 (Sized_symbol::init): Likewise.
17095 (Symbol::output_section): Check for ordinary symbol.
17096 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17097 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17098 callers.
17099 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17100 Change all callers. Simplify handling of symbols from sections
17101 not included in the link.
17102 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17103 distinction.
17104 (Weak_alias_sorter::operator()): Assert that symbols are
17105 ordinary.
17106 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17107 distinction.
17108 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17109 parameters. Change all callers.
17110 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17111 symbol distinction. Use SHN_XINDEX when needed.
17112 (Symbol_table::write_section_symbol): Add symtab_xindex
17113 parameter. Change all callers.
17114 (Symbol_table::sized_write_section_symbol): Likewise. Use
17115 SHN_XINDEX when needed.
17116 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17117 declarations.
17118 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17119 (Symbol::is_defined): Check is_ordinary.
17120 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17121 (Symbol::is_absolute, Symbol::is_common): Likewise.
17122 (class Sized_symbol): Update declarations.
17123 (class Symbol_table): Update declarations.
17124 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17125 parameters. Change all callers.
17126 (Sized_symbol::override): Likewise.
17127 (Symbol_table::override): Likewise.
17128 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17129 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17130 is_ordinary, and orig_st_shndx parameters. Change all callers.
17131 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17132 to be in an ordinary section.
17133 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17134 object and is_ordinary parameters. Change all callers.
17135 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17136 Change all callers. Don't add undefined or non-ordinary symbols
17137 to reloc_map_.
17138 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17139 Change all callers.
17140 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17141 declarations.
17142 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17143 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17144 (Sized_relobj::relocate_sections): Likewise.
17145 * target-reloc.h (scan_relocs): Adjust section symbol index.
17146 (scan_relocatable_relocs): Likewise.
17147 * i386.cc (Scan::local): Check for ordinary symbols.
17148 * sparc.cc (Scan::local): Likewise.
17149 * x86_64.cc (Scan::local): Likewise.
17150 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17151 to symbol_section_and_value.
17152 * testsuite/many_sections_test.cc: New file.
17153 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17154 (check_PROGRAMS): Add many_sections_test.
17155 (many_sections_test_SOURCES): Define.
17156 (many_sections_test_DEPENDENCIES): Define.
17157 (many_sections_test_LDFLAGS): Define.
17158 (BUILT_SOURCES): Add many_sections_define.h.
17159 (many_sections_define.h): New target.
17160 (BUILT_SOURCES): Add many_sections_check.h.
17161 (many_sections_check.h): New target.
17162 (check_PROGRAMS): Add many_sections_r_test.
17163 (many_sections_r_test_SOURCES): Define.
17164 (many_sections_r_test_DEPENDENCIES): Define.
17165 (many_sections_r_test_LDFLAGS): Define.
17166 (many_sections_r_test_LDADD): Define.
17167 (many_sections_r_test.o): New target.
17168 * testsuite/Makefile.in: Rebuild.
17169
c5818ff1
CC
171702008-04-17 Cary Coutant <ccoutant@google.com>
17171
17172 * errors.cc (Errors::info): New function.
17173 (gold_info): New function.
17174 * errors.h (Errors::info): New function.
17175 * gold.h (gold_info): New function.
17176 * object.cc (Input_objects::add_object): Print trace output.
17177 * options.cc (options::parse_set): New function.
17178 (General_options::parse_wrap): Deleted.
17179 (General_options::General_options): Deleted initializer.
17180 * options.h (options::String_set): New typedef.
17181 (options::parse_set): New function.
17182 (DEFINE_set): New macro.
17183 (General_options::wrap): Changed to use DEFINE_set. Changed
17184 callers of any_wrap_symbols and is_wrap_symbol.
17185 (General_options::trace, General_options::trace_symbol):
17186 New options.
17187 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17188 (General_options::wrap_symbols_): Deleted.
17189 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17190
b5be4a7c
DM
171912008-04-17 David S. Miller <davem@davemloft.net>
17192
17193 * options.cc (General_options::parse_V): New function.
17194 * options.h: Add entries for -V and -Qy.
17195
155a0dd7
ILT
171962008-04-17 Ian Lance Taylor <iant@google.com>
17197
17198 * common.cc (Symbol_table::allocate_commons): Remove options
17199 parameter. Change caller.
17200 (Symbol_table::do_allocate_commons): Remove options parameter.
17201 Change caller. Just call do_allocate_commons_list twice.
17202 (Symbol_table::do_allocate_commons_list): New function, broken out
17203 of do_allocate_commons.
17204 * common.h (class Allocate_commons_task): Remove options_ field.
17205 Update constructor.
17206 * symtab.cc (Symbol_table::Symbol_table): Initialize
17207 tls_commons_.
17208 (Symbol_table::add_from_object): Put TLS common symbols on
17209 tls_commons_ list.
17210 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17211 which are IN_OUTPUT_DATA.
17212 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17213 allocate_commons and do_allocate_commons declarations. Declare
17214 do_allocate_commons_list.
17215 * gold.cc (queue_middle_tasks): Update creation of
17216 Allocate_commons_task to not pass options.
17217 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17218 (TLS_TEST_C_FLAGS): New variable.
17219 (tls_test_c_pic.o): New target.
17220 (tls_test_shared.so): Link in tls_test_c_pic.o.
17221 (tls_test_c_pic_ie.o): New target.
17222 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17223 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17224 (tls_test_c.o): New target.
17225 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17226 (tls_pic_test_LDADD): Likewise.
17227 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17228 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17229 (tls_test_c_gnu2.o): New target.
17230 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17231 tls_test_c_gnu2.o.
17232 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17233 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17234 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17235 * testsuite/tls_test.cc: Include "config.h".
17236 (t_last): Call t11_last.
17237 * testsuite/tls_test.h (t11, t11_last): Declare.
17238 * testsuite/tls_test_c.c: New file.
17239 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17240 * configure.ac: Check for OpenMP support.
17241 * configure, config.in, Makefile.in: Rebuild.
17242 * testsuite/Makefile.in: Rebuild.
17243
edfbb029
CC
172442008-04-16 Cary Coutant <ccoutant@google.com>
17245
17246 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17247 (Target_i386::tls_base_symbol_defined_): New field.
17248 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17249 (Target_i386::Scan::global): Likewise.
17250 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17251 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17252 (Target_x86_64::tls_base_symbol_defined_): New field.
17253 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17254 (Target_x86_64::Scan::global): Likewise.
17255
f3c69fca
CC
172562008-04-16 Cary Coutant <ccoutant@google.com>
17257
17258 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17259 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17260 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17261 building shared libraries.
17262 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17263 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17264 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17265 * testsuite/Makefile.in: Rebuild.
17266 * testsuite/weak_undef.h: New file.
17267 * testsuite/weak_undef_file1.cc: Add extra test cases.
17268 * testsuite/weak_undef_file2.cc: Likewise.
17269 * testsuite/weak_undef_test.cc: Likewise.
17270
7c414435
DM
172712008-04-16 David S. Miller <davem@davemloft.net>
17272
32b769e1
DM
17273 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17274 Add issued_non_pic_error_ field. Declare check_non_pic.
17275 (Target_sparc::Scan::check_non_pic): New function.
17276 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17277 (Target_sparc::Scan::global): Likewise.
17278
11936fb1
DM
17279 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17280 * configure: Rebuild.
17281
7c414435
DM
17282 * options.h (DEFINE_enable): New macro.
17283 (new_dtags): New enable option.
17284 (initfirst, interpose, loadfltr, nodefaultlib,
17285 nodelete, nodlopen, nodump): New -z options.
17286 * layout.cc (Layout:finish_dynamic_section): If new
17287 dtags enabled, emit DT_RUNPATH. Also, emit a
17288 DT_FLAGS_1 containing any specified -z flags.
17289
85c7bf8b
ILT
172902008-04-16 Ian Lance Taylor <iant@google.com>
17291
12c0daef
ILT
17292 * copy-relocs.cc: New file.
17293 * copy-relocs.h: New file.
17294 * reloc.cc: Remove Copy_relocs code.
17295 * reloc.h: Likewise.
17296 * reloc-types.h (struct Reloc_types) [both versions]: Add
17297 get_reloc_addend_noerror.
17298 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17299 variants of add_global which take an addend which must be zero.
17300 * i386.cc: Include "copy-relocs.h".
17301 (class Target_i386): Change type of copy_relocs_ to variable,
17302 update initializer.
17303 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17304 Change all callers.
17305 (Target_i386::do_finalize_sections): Change handling of
17306 copy_relocs_.
17307 * sparc.cc: Include "copy-relocs.h".
17308 (class Target_sparc): Change type of copy_relocs_ to variable,
17309 update initializer.
17310 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17311 Change all callers.
17312 (Target_sparc::do_finalize_sections): Change handling of
17313 copy_relocs_.
17314 * x86_64.cc: Include "copy-relocs.h".
17315 (class Target_x86_64): Change type of copy_relocs_ to variable,
17316 update initializer.
17317 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17318 class. Change all callers.
17319 (Target_x86_64::do_finalize_sections): Change handling of
17320 copy_relocs_.
17321 * Makefile.am (CCFILES): Add copy-relocs.cc.
17322 (HFILES): Add copy-relocs.h.
17323
4f4995b6
ILT
17324 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17325
85c7bf8b
ILT
17326 * testsuite/script_test_4.sh: Permit leading zeroes.
17327
4f2a9edd
ILT
173282008-04-15 Ian Lance Taylor <iant@google.com>
17329
e6188289
ILT
17330 * script-sections.cc (Script_sections::create_segments): Use
17331 header_size_adjustment even when there is enough room for the
17332 headers.
17333 * testsuite/script_test_4.sh: New file.
17334 * testsuite/script_test_4.t: New file.
17335 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17336 (check_DATA): Add script_test_4.stdout.
17337 (MOSTLYCLEANFILES): Likewise.
17338 (script_test_4): New target.
17339 (script_test_4.stdout): New target.
17340 * testsuite/Makefile.in: Rebuild.
17341
4f2a9edd
ILT
17342 * sparc.cc: Add definitions for Output_data_plt_sparc class
17343 constants.
17344
f5314dd5
DM
173452008-04-14 David S. Miller <davem@davemloft.net>
17346
17347 * sparc.cc: New file.
17348 * Makefile.am (TARGETSOURCES): Add sparc.cc
17349 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17350 * configure.tgt: Document targ_extra_size and
17351 targ_extra_big_endian. Add entries for sparc-* and
17352 sparc64-*.
17353 * configure.ac: Handle targ_extra_size and
17354 targ_extra_big_endian.
17355 * Makefile.in: Rebuild.
17356 * configure: Likewise.
17357 * po/POTFILES.in: Likewise.
17358 * po/gold.pot: Likewise.
17359
154e0e9a
ILT
173602008-04-14 Ian Lance Taylor <iant@google.com>
17361
17362 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17363 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17364 in the name/type/flags to section mapping. Don't call
17365 allocate_output_section.
17366 (Layout::choose_output_section): Change parameter from adjust_name
17367 to is_input_section. Don't permit input sections after sections
17368 are attached to segments. Don't call allocate_output_section.
17369 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17370 not write_enable_output_section.
17371 (Layout::make_output_section): Don't push to
17372 unattached_section_list_ nor call attach_to_segment. Call
17373 attach_section_to_segment if sections are attached.
17374 (Layout::attach_sections_to_segments): New function.
17375 (Layout::attach_section_to_segment): New function.
17376 (Layout::attach_allocated_section_to_segment): Rename from
17377 attach_to_segment. Remove flags parameter.
17378 (Layout::allocate_output_section): Remove function.
17379 (Layout::write_enable_output_section): Remove function.
17380 * layout.h (class Layout): Update for above changes. Add new
17381 field sections_are_attached_.
17382 * output.h (Output_section::update_flags_for_input_section): New
17383 function.
17384 * output.cc (Output_section::add_input_section): Call
17385 update_flags_for_input_section.
17386 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17387
009a67a2
CC
173882008-04-11 Cary Coutant <ccoutant@google.com>
17389
17390 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17391 thought unnecessary.
17392 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17393
759b1a24
ILT
173942008-04-11 Ian Lance Taylor <iant@google.com>
17395
17396 * output.h (class Output_section_data): Remove inline definition
17397 of set_addralign.
17398 * output.cc (Output_section_data::set_addralign): New function.
17399
c2b45e22
CC
174002008-04-11 Cary Coutant <ccoutant@google.com>
17401
17402 Add support for TLS descriptors for i386 and x86_64.
17403 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17404 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17405 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17406 GOT_TYPE_TLS_DESC.
17407 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17408 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17409 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17410 relocations.
17411 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17412 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17413 Fix problem with initial-exec relocations.
17414 (Target_i386::Relocate::relocate_tls): Likewise.
17415 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17416 relaxation.
17417 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17418 support for section-plus-offset dynamic table entries.
17419 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17420 (Output_data_dynamic::Dynamic_entry): Add support for
17421 section-plus-offset dynamic table entries.
17422 (Output_data_dynamic::Classification): Likewise.
17423 (Output_data_dynamic::classification_): Renamed offset_.
17424 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17425 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17426 (Target_x86_64::make_plt_section): New function.
17427 (Target_x86_64::reserve_tlsdesc_entries): New function.
17428 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17429 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17430 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17431 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17432 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17433 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17434 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17435 add extra PLT entry for TLS descriptors.
17436 (Output_data_plt_x86_64::got_): New field.
17437 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17438 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17439 fields.
17440 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17441 descriptors.
17442 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17443 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17444 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17445 R_386_TLS_DESC_CALL relocations.
17446 (Target_x86_64::Scan::global): Likewise.
17447 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17448 for TLS descriptors.
17449 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17450 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17451 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17452 GD-to-IE relaxation.
17453 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17454 and TLS_DESCRIPTORS.
17455 * Makefile.in: Rebuild.
17456 * configure: Rebuild.
17457 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17458 (tls_test_shared2.so): New target.
17459 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17460 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17461 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17462 (tls_shared_gd_to_ie_test_LDADD): New variable.
17463 (tls_shared_gnu2_gd_to_ie_test): New target.
17464 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17465 New targets.
17466 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17467 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17468 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17469 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17470 (tls_shared_gnu2_test): New target.
17471 (tls_test_gnu2_shared.so): New target.
17472 (tls_shared_gnu2_test_SOURCES): New variable.
17473 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17474 (tls_shared_gnu2_test_LDFLAGS): New variable.
17475 (tls_shared_gnu2_test_LDADD): New variable.
17476 * testsuite/Makefile.in: Rebuild.
17477 * testsuite/Makefile.
17478
83bfb6b7
ILT
174792008-04-11 Ian Lance Taylor <iant@google.com>
17480
17481 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17482 justsyms.t.
17483 * testsuite/Makefile.in: Rebuild.
17484
17485 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17486 long.
17487 * testsuite/script_test_2.cc (main): Adjust test.
17488
706e1f5e
ILT
174892008-04-11 David S. Miller <davem@davemloft.net>
17490 Ian Lance Taylor <iant@google.com>
17491
17492 * options.h (General_options): Add entries for '-Y' and
17493 '-relax'.
17494 * options.cc (General_options:finalize): If -Y was used, add those
17495 entries to the library path instead of the default "/lib" and
17496 "/usr/lib".
17497
7c98e6bb
DM
174982008-04-11 David S. Miller <davem@davemloft.net>
17499
17500 * testsuite/justsyms.t: Start at 0x100.
17501 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17502 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17503 long.
17504 * testsuite/script_test_2.cc: Adjust string and section length
17505 checks.
7c98e6bb 17506
99a37bfd
ILT
175072008-04-09 Ian Lance Taylor <iant@google.com>
17508
2cefc357
ILT
17509 PR gold/5996
17510 * script-sections.cc (Sections_element::allocate_to_segment): Add
17511 orphan parameter.
17512 (Output_section_definition::allocate_to_segment): Likewise.
17513 (Orphan_output_section::allocate_to_segment): Likewise.
17514 (Script_sections::attach_sections_using_phdrs_clause): Don't
17515 propagate non-PT_LOAD segments to orphan sections.
17516 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17517 readelf rather than objdump.
17518 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17519 .interp section and PT_INTERP segment are the same size.
17520 * testsuite/Makefile.in: Rebuild.
17521
99a37bfd
ILT
17522 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17523 aliases for symbols defined in the same object.
17524 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17525 (weak_alias_test_SOURCES): New variable.
17526 (weak_alias_test_DEPENDENCIES): New variable.
17527 (weak_alias_test_LDFLAGS): New variable.
17528 (weak_alias_test_LDADD): New variable.
17529 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17530 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17531 (weak_alias_test_3.o): New target.
17532 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17533 * testsuite/weak_alias_test_main.cc: New file.
17534 * testsuite/weak_alias_test_1.cc: New file.
17535 * testsuite/weak_alias_test_2.cc: New file.
17536 * testsuite/weak_alias_test_3.cc: New file.
17537
780e49c5
ILT
175382008-04-08 Ian Lance Taylor <iant@google.com>
17539
cdb0b8f5
ILT
17540 * options.h (class General_options): Add --noinhibit-exec option.
17541 * main.cc (main): Check --noinhibit-exec.
17542
0864d551
ILT
17543 * options.h (class General_options): Define --wrap as a special
17544 option. Add wrap_symbols_ field.
17545 (General_options::any_wrap_symbols): New function.
17546 (General_options::is_wrap_symbol): New function.
17547 * options.cc (General_options::parse_wrap): New function.
17548 (General_options::General_options): Initialize wrap_symbols_.
17549 * symtab.cc (Symbol_table::wrap_symbol): New function.
17550 (Symbol_table::add_from_object): Handle --wrap.
17551 * symtab.h (class Symbol_table): Declare wrap_symbol.
17552 * target.h (Target::wrap_char): New function.
17553 (Target::Target_info): Add wrap_char field.
17554 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17555 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17556 * testsuite/testfile.cc (Target_test::test_target_info):
17557 Likewise.
17558
789aa6de
ILT
17559 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17560 there is one.
17561
2c38906f
ILT
17562 * layout.h (class Layout): Add added_eh_frame_data_ field.
17563 * layout.cc (Layout::Layout): Initialize new field.
17564 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17565 output section until we find a section we merged successfully.
17566 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17567 that the size be non-zero.
17568
780e49c5
ILT
17569 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17570 qualifier.
17571
7fcd0256
ILT
175722008-04-08 Craig Silverstein <csilvers@google.com>
17573
17574 * configure.ac: Export new conditional variable HAVE_ZLIB.
17575 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17576 on HAVE_ZLIB.
17577 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17578 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17579
6835af53
ILT
175802008-04-07 Ian Lance Taylor <iant@google.com>
17581
e24f324c
ILT
17582 * version.cc (version_string): Set to "1.5".
17583
a036edd8
ILT
17584 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17585 Add issued_non_pic_error_ field. Declare check_non_pic.
17586 (Target_x86_64::Scan::check_non_pic): New function.
17587 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17588 (Target_x86_64::Scan::global): Likewise.
17589
624f8810
ILT
17590 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17591 addend parameter. Change caller. Handle merge sections.
17592 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17593 Address to Addend. Don't add in the result of
17594 local_section_offset, pass down the addend and use the returned
17595 value.
17596 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17597 Update declarations of local_section_offset and symbol_value.
17598 * testsuite/two_file_test_1.cc (t18): New function.
17599 * testsuite/two_file_test_2.cc (f18): New function.
17600 * testsuite/two_file_test_main.cc (main): Call t18.
17601 * testsuite/two_file_test.h (t18, f18): Declare.
17602
6835af53
ILT
17603 * configure.ac: Don't test for objdump, c++filt, or readelf.
17604 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17605 conditionals.
17606 (TEST_READELF): New variable.
17607 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17608 (check_PROGRAMS): Add two_file_strip_test.
17609 (two_file_strip_test): New target.
17610 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17611 (two_file_same_shared_strip_test_SOURCES): New variable.
17612 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17613 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17614 (two_file_same_shared_strip_test_LDADD): New variable.
17615 (two_file_shared_strip.so): New target.
17616 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17617 (ver_test_5.syms, ver_test_7.syms): Likewise.
17618 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17619 (strip_test_3.stdout): Use TEST_OBJDUMP.
17620 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17621
86925eef
CC
176222008-04-04 Cary Coutant <ccoutant@google.com>
17623
17624 * symtab.h (Symbol::is_weak_undefined): New function.
17625 (Symbol::is_strong_undefined): New function.
17626 (Symbol::is_absolute): New function.
17627 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17628 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17629 absolute symbols.
17630 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17631 (weak_undef_test): New target.
17632 * testsuite/Makefile.in: Rebuild.
17633 * testsuite/weak_undef_file1.cc: New file.
17634 * testsuite/weak_undef_file2.cc: New file.
17635 * testsuite/weak_undef_test.cc: New file.
17636
126f3ece
ILT
176372008-04-03 Craig Silverstein <csilvers@google.com>
17638
17639 * compressed_output.h (class Output_compressed_section): Use
17640 unsigned buffer.
17641 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17642 add zlib header.
17643 (zlib_compressed_suffix): Removed.
17644 (Output_compressed_section::set_final_data_size): Use unsigned
17645 buffers.
17646 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17647 Fix linker invocation.
17648 (flagstest_o_specialfile_and_compress_debug_sections):
17649 Likewise.
17650 * testsuite/Makefile.in: Regenerated.
17651
deae2a14
DM
176522008-04-02 David S. Miller <davem@davemloft.net>
17653
17654 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17655 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17656
70752818
ILT
176572008-04-02 Craig Silverstein <csilvers@google.com>
17658
17659 * TODO: New file.
17660
39d0cb0e
ILT
176612008-04-02 Ian Lance Taylor <iant@google.com>
17662
17663 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17664 parameters. Update for new key type to views_. Change all
17665 callers.
17666 (File_read::read): Adjust for byteshift in returned view.
17667 (File_read::add_view): New function, broken out of
17668 find_and_make_view.
17669 (File_read::make_view): New function, broken out of
17670 find_and_make_view.
17671 (File_read::find_or_make_view): Add offset and aligned
17672 parameters. Rewrite accordingly. Change all callers.
17673 (File_read::get_view): Add offset and aligned parameters. Adjust
17674 for byteshift in return value.
17675 (File_read::get_lasting_view): Likewise.
17676 * fileread.h (class File_read): Update declarations.
17677 (class File_read::View): Add byteshift_ field. Add byteshift to
17678 constructor. Add byteshift method.
17679 * archive.h (Archive::clear_uncached_views): New function.
17680 (Archive::get_view): Add aligned parameter. Change all callers.
17681 * object.h (Object::get_view): Add aligned parameter. Change all
17682 callers.
17683 (Object::get_lasting_view): Likewise.
17684
17685 * fileread.cc (File_read::release): Don't call clear_views if
17686 there are multiple objects.
17687 * fileread.h (File_read::clear_uncached_views): New function.
17688 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17689 on the archive.
17690
a1207466
CC
176912008-03-31 Cary Coutant <ccoutant@google.com>
17692
17693 Add thin archive support.
17694 * archive.cc (Archive::armagt): New const.
17695 (Archive::setup): Remove task parameter and calls to unlock.
17696 (Archive::unlock_nested_archives): New function.
17697 (Archive::read_header): Add nested_off parameter. Change
17698 all callers.
17699 (Archive::interpret_header): Likewise.
17700 (Archive::include_all_members): Change to handle thin
17701 archives.
17702 (Archive::include_member): Likewise.
17703 * archive.h (Archive::Archive): Add new parameters and
17704 initializers.
17705 (Archive::armagt): New const.
17706 (Archive::setup): Remove task parameter.
17707 (Archive::unlock_nested_archives): New function.
17708 (Archive::read_header): Add nested_off parameter.
17709 (Archive::interpret_header): Likewise.
17710 (Archive::Nested_archive_table): New typedef.
17711 (Archive::is_thin_archive_): New field.
17712 (Archive::nested_archives_): New field.
17713 (Archive::options_): New field.
17714 (Archive::dirpath_): New field.
17715 (Archive::task_): New field.
17716 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17717 for thin archives. Pass additional parameters to
17718 Archive::Archive. Unlock the archive file after calling
17719 Archive::setup.
cd536b21 17720
479f6503
ILT
177212008-03-29 Ian Lance Taylor <iant@google.com>
17722
686c8caf
ILT
17723 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17724 version symbol to be local.
17725 * testsuite/ver_test_4.sh: New file.
17726 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17727 (check_DATA): Add ver_test_4.syms.
17728 (ver_test_4.syms): New target.
17729 * testsuite/Makefile.in: Rebuild.
17730
ab794b6b
ILT
17731 * output.cc
17732 (Output_section::Input_section_sort_entry::has_priority): New
17733 function.
17734 (Output_section::Input_section_sort_entry::match_file_name): New
17735 function.
17736 (Output_section::Input_section_sort_entry::match_section_name):
17737 Remove.
17738 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17739 Remove.
17740 (Output_section::Input_section_sort_entry::match_section_file):
17741 Remove.
17742 (Output_section::Input_section_sort_compare::operator()): Rewrite
17743 using new Input_section_sort_entry functions. Sort crtbegin and
17744 crtend first. Sort sections with no priority before sections with
17745 a priority.
17746 * testsuite/initpri1.c (d3): Check j != 4.
17747 (cd5): New constructor/destructor function.
17748 (main): Check j != 2.
17749
479f6503
ILT
17750 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17751 new symbol when resolving, don't call set_is_default.
17752 * testsuite/ver_test_7.cc: New file.
17753 * testsuite/ver_test_7.sh: New file.
17754 * testsuite/Makefile.am (ver_test_7.so): New target.
17755 (ver_test_7.o): New target.
17756 (check_SCRIPTS): Add ver_test_7.sh.
17757 (check_DATA): Add ver_test_7.syms.
17758 (ver_test_7.syms): New target.
17759
2fd32231
ILT
177602008-03-28 Ian Lance Taylor <iant@google.com>
17761
17762 * layout.cc (Layout::layout): If we see an input section with a
17763 name that needs sorting, set the must_sort flag for the output
17764 section.
17765 (Layout::make_output_section): If the name of the output section
17766 indicates that it might require sorting, set the may_sort flag.
17767 * output.h (Output_section::may_sort_attached_input_sections): New
17768 function.
17769 (Output_section::set_may_sort_attached_input_sections): New
17770 function.
17771 (Output_section::must_sort_attached_input_sections): New
17772 function.
17773 (Output_section::set_must_sort_attached_input_sections): New
17774 function.
17775 (class Output_section): Declare Input_section_sort_entry. Define
17776 Input_section_sort_compare. Declare
17777 sort_attached_input_sections. Add new fields:
17778 may_sort_attached_input_sections_,
17779 must_sort_attached_input_sections_,
17780 attached_input_sections_are_sorted_.
17781 * output.cc (Output_section::Output_section): Initialize new
17782 fields.
17783 (Output_section::add_input_section): Add an entry to
17784 input_sections_ if may_sort or must_sort are true.
17785 (Output_section::set_final_data_size): Call
17786 sort_attached_input_sections if necessary.
17787 (Output_section::Input_section_sort_entry): Define new class.
17788 (Output_section::Input_section_sort_compare::operator()): New
17789 function.
17790 (Output_section::sort_attached_input_sections): New function.
17791 * configure.ac: Check whether the compiler supports constructor
17792 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17793 * testsuite/initpri1.c: New file.
17794 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17795 CONSTRUCTOR_PRIORITY.
17796 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17797 (initpri1_LDFLAGS): New variable.
17798 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17799
18e6b24e
ILT
178002008-03-27 Ian Lance Taylor <iant@google.com>
17801
49bdd526
ILT
17802 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17803 * testsuite/common_test_1.c: New file.
17804 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17805 (common_test_1_SOURCES): New variable.
17806 (common_test_1_DEPENDENCIES): New variable.
17807 (common_test_1_LDFLAGS): New variable.
17808
18e6b24e
ILT
17809 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17810 and commons_ correctly when NAME/VERSION does not override
17811 NAME/NULL.
17812 * testsuite/ver_test_6.c: New file.
17813 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17814 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17815 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17816
04bf7072
ILT
178172008-03-26 Ian Lance Taylor <iant@google.com>
17818
5871526f
ILT
17819 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17820 of an undefined symbol from a version script.
17821 * testsuite/Makefile.am (ver_test_5.so): New target.
17822 (ver_test_5.o): New target.
17823 (check_SCRIPTS): Add ver_test_5.sh.
17824 (check_DATA): Add ver_test_5.syms.
17825 (ver_test_5.syms): New target.
17826 * testsuite/ver_test_5.cc: New file.
17827 * testsuite/ver_test_5.script: New file.
17828 * testsuite/ver_test_5.sh: New file.
17829 * Makefile.in, testsuite/Makefile.in: Rebuild.
17830
04bf7072
ILT
17831 PR gold/5986
17832 Fix problems building gold with gcc 4.3.0.
17833 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17834 (gold_error_at_location, gold_warning_at_location): Use it.
17835 * configure.ac: Check whether we can compile and use a template
17836 function with a printf attribute.
17837 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17838 when jumping over bytes.
17839 * object.cc: Instantiate Object::read_section_data.
17840 * debug.h: Include <cstring>
17841 * dwarf_reader.cc: Include <algorithm>
17842 * main.cc: Include <cstring>.
17843 * options.cc: Include <cstring>.
17844 * output.cc: Include <cstring>.
17845 * script.cc: Include <cstring>.
17846 * script.h: Include <string>.
17847 * symtab.cc: Include <cstring> and <algorithm>.
17848 * target-select.cc: Include <cstring>.
17849 * version.cc: Include <string>.
17850 * testsuite/testmain.cc: Include <cstdlib>.
17851 * configure, config.in: Rebuild.
17852
874c5b28
ILT
178532008-03-25 Ian Lance Taylor <iant@google.com>
17854
819d6c3a
ILT
17855 * options.cc: Include "../bfd/bfdver.h".
17856 (options::help): Print bug reporting address.
17857
f4b2c6f5
ILT
17858 * version.cc (print_version): Adjust output for current value of
17859 BFD_VERSION_STRING.
17860
17861 * NEWS: New file.
17862
e96caa79
ILT
17863 * options.cc (options::help): Print list of supported targets.
17864 * target-select.h: Include <vector>.
17865 (class Target_selector): Make machine_, size_, and is_big_endian_
17866 fields const. Add bfd_name_ and instantiated_target_ fields.
17867 (Target_selector::Target_selector): Add bfd_name parameter.
17868 (Target_selector::recognize): Make non-virtual, call
17869 do_recognize.
17870 (Target_selector::recognize_by_name): Make non-virtual, call
17871 do_recognize_by_name.
17872 (Target_selector::supported_names): New function.
17873 (Target_selector::bfd_name): New function.
17874 (Target_selector::do_instantiate_target): New pure virtual
17875 function.
17876 (Target_selector::do_recognize): New virtual function.
17877 (Target_selector::do_recognize_by_name): New virtual function.
17878 (Target_selector::instantiate_target): New private function.
17879 (supported_target_names): Declare.
17880 * target-select.cc (Target_selector::Target_selector): Update for
17881 new parameter and fields.
17882 (select_target_by_name): Check that the name matches before
17883 calling recognize_by_name.
17884 (supported_target_names): New function.
17885 * i386.cc (class Target_selector_i386): Update Target_selector
17886 constructor call. Remove recognize and recognize_by_name. Add
17887 do_instantiate_target.
17888 * x86_64.cc (class Target_selector_x86_64): Likewise.
17889 * testsuite/testfile.cc (class Target_selector_test): Update for
17890 changes to Target_selector.
17891
874c5b28
ILT
17892 * README: Rewrite, with some notes on unsupported features.
17893
0a65a3a7
CC
178942008-03-24 Cary Coutant <ccoutant@google.com>
17895
17896 * i386.cc (Target_i386::Got_type): New enum declaration.
17897 (Target_i386::Scan::local): Updated callers of Output_data_got
17898 member functions.
17899 (Target_i386::Scan::global): Likewise.
17900 (Target_i386::Relocate::relocate): Likewise.
17901 (Target_i386::Relocate::relocate_tls): Likewise.
17902 * object.h (Got_offset_list): New class.
17903 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17904 (Sized_relobj::local_got_offset): Likewise.
17905 (Sized_relobj::set_local_got_offset): Likewise.
17906 (Sized_relobj::local_has_tls_got_offset): Removed.
17907 (Sized_relobj::local_tls_got_offset): Removed.
17908 (Sized_relobj::set_local_tls_got_offset): Removed.
17909 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17910 * output.cc (Output_data_got::add_global): Added got_type parameter.
17911 (Output_data_got::add_global_with_rel): Likewise.
17912 (Output_data_got::add_global_with_rela): Likewise.
17913 (Output_data_got::add_global_pair_with_rel): New function.
17914 (Output_data_got::add_global_pair_with_rela): New function.
17915 (Output_data_got::add_local): Added got_type parameter.
17916 (Output_data_got::add_local_with_rel): Likewise.
17917 (Output_data_got::add_local_with_rela): Likewise.
17918 (Output_data_got::add_local_pair_with_rel): New function.
17919 (Output_data_got::add_local_pair_with_rela): New function.
17920 (Output_data_got::add_global_tls): Removed.
17921 (Output_data_got::add_global_tls_with_rel): Removed.
17922 (Output_data_got::add_global_tls_with_rela): Removed.
17923 (Output_data_got::add_local_tls): Removed.
17924 (Output_data_got::add_local_tls_with_rel): Removed.
17925 (Output_data_got::add_local_tls_with_rela): Removed.
17926 * output.h (Output_data_got::add_global): Added got_type parameter.
17927 (Output_data_got::add_global_with_rel): Likewise.
17928 (Output_data_got::add_global_with_rela): Likewise.
17929 (Output_data_got::add_global_pair_with_rel): New function.
17930 (Output_data_got::add_global_pair_with_rela): New function.
17931 (Output_data_got::add_local): Added got_type parameter.
17932 (Output_data_got::add_local_with_rel): Likewise.
17933 (Output_data_got::add_local_with_rela): Likewise.
17934 (Output_data_got::add_local_pair_with_rel): New function.
17935 (Output_data_got::add_local_pair_with_rela): New function.
17936 (Output_data_got::add_global_tls): Removed.
17937 (Output_data_got::add_global_tls_with_rel): Removed.
17938 (Output_data_got::add_global_tls_with_rela): Removed.
17939 (Output_data_got::add_local_tls): Removed.
17940 (Output_data_got::add_local_tls_with_rel): Removed.
17941 (Output_data_got::add_local_tls_with_rela): Removed.
17942 * resolve.cc (Symbol::override_base_with_special): Removed
17943 reference to has_got_offset_ field.
17944 * symtab.cc (Symbol::init_fields): Replaced initialization
17945 of got_offset_ with got_offsets_. Removed initialization
17946 of has_got_offset_
53fcba31 17947 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17948 (Symbol::got_offset): Likewise.
17949 (Symbol::set_got_offset): Likewise.
17950 (Symbol::has_tls_got_offset): Removed.
17951 (Symbol::tls_got_offset): Removed.
17952 (Symbol::set_tls_got_offset): Removed.
17953 (Symbol::got_offset_): Removed.
17954 (Symbol::tls_mod_got_offset_): Removed.
17955 (Symbol::tls_pair_got_offset_): Removed.
17956 (Symbol::got_offsets_): New field.
17957 (Symbol::has_got_offset): Removed.
17958 (Symbol::has_tls_mod_got_offset): Removed.
17959 (Symbol::has_tls_pair_got_offset): Removed.
17960 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17961 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17962 member functions.
17963 (Target_x86_64::Scan::global): Likewise.
17964 (Target_x86_64::Relocate::relocate): Likewise.
17965 (Target_x86_64::Relocate::relocate_tls): Likewise.
17966
bd52eafb
BE
179672008-03-25 Ben Elliston <bje@au.ibm.com>
17968
17969 * yyscript.y: Fix spelling error in comment.
17970
8b105e34
ILT
179712008-03-24 Ian Lance Taylor <iant@google.com>
17972
8ed814a9
ILT
17973 * options.h (class General_options): Define build_id option.
17974 * layout.h (class Layout): Declare write_build_id, create_note,
17975 create_build_id. Add build_id_note_ member.
17976 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17977 "libiberty.h", "md5.h", "sha1.h".
17978 (Layout::Layout): Initialize eh_frame_data_,
17979 eh_frame_hdr_section_, and build_id_note_.
17980 (Layout::finalize): Call create_build_id.
17981 (Layout::create_note): New function, broken out of
17982 Layout::create_gold_note.
17983 (Layout::create_gold_note): Call create_note.
17984 (Layout::create_build_id): New function.
17985 (Layout::write_build_id): New function.
17986 (Close_task_runner::run): Call write_build_id.
17987
8b105e34
ILT
17988 * x86_64.cc: Correct license to GPLv3.
17989
086a1841
ILT
179902008-03-23 Ian Lance Taylor <iant@google.com>
17991
17992 * options.cc: Include "demangle.h".
17993 (parse_optional_string): New function.
17994 (parse_long_option): Handle takes_optional_argument.
17995 (parse_short_option): Update dash_z initializer. Handle
17996 takes_optional_argument.
17997 (General_options::General_options): Initialize do_demangle_.
17998 (General_options::finalize): Set do_demangle_. Handle demangling
17999 style.
18000 * options.h (parse_optional_string): Declare.
18001 (struct One_option): Add optional_arg field. Update constructor.
18002 Update call constructor calls. Add takes_optional_argument
18003 function.
18004 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18005 (DEFINE_optional_string): Define.
18006 (General_options::demangle): Change from DEFINE_bool to
18007 DEFINE_optional_string.
18008 (General_options::no_demangle): New function.
18009 (General_options::do_demangle): New function.
18010 (General_options::set_do_demangle): New function.
18011 (General_options::execstack_status_): Move definition to end of
18012 class definition.
18013 (General_options::static_): Likewise.
18014 (General_options::do_demangle_): New field.
18015 * object.cc (big_endian>::get_symbol_location_info): Call
18016 Options::do_demangle, not Options::demangle.
18017 * symtab.cc (demangle): Likewise.
18018
cbb93e63
ILT
180192008-03-22 Ian Lance Taylor <iant@google.com>
18020
18021 * gold.h: Include <cstddef> and <sys/types.h>
18022 * options.h: Include <cstring>.
18023
ec531623
ILT
180242008-03-21 Ian Lance Taylor <iant@google.com>
18025
18026 * Added source code to GNU binutils.
752937aa 18027\f
b90efa5b 18028Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
18029
18030Copying and distribution of this file, with or without modification,
18031are permitted in any medium without royalty provided the copyright
18032notice and this notice are preserved.
18033
18034Local Variables:
18035mode: change-log
18036left-margin: 8
18037fill-column: 74
18038version-control: never
18039End:
This page took 1.207556 seconds and 4 git commands to generate.