Remove duplicate arch/arm.h include in linux-arm-low.c.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
74b03b91
CC
12015-11-25 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/19291
4 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
5 subtract section address from symbol value.
6
751e4d66
AM
72015-11-25 Alan Modra <amodra@gmail.com>
8
9 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
10 to 256 byte boundary.
11
32d849b3
AM
122015-11-19 Alan Modra <amodra@gmail.com>
13
14 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
15 GOT16 and TOC16 relocs to RELATIVE_REF.
16
db1ff028
CC
172015-11-14 Cary Coutant <ccoutant@gmail.com>
18
19 PR gold/19244
20 PR gold/18548
21 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
22 local symbols only for predefined symbols.
23
a680de9a
PB
242015-11-11 Alan Modra <amodra@gmail.com>
25 Peter Bergner <bergner@vnet.ibm.com>
26
27 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
28 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
29 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
30 (Target_powerpc::Scan::global): Likewise.
31 (Target_powerpc::Relocate::relocate): Likewise.
32
cc203475
VR
332015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
34
35 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
36 sections.
37
859d7987
CC
382015-11-09 Cary Coutant <ccoutant@gmail.com>
39 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
40
41 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
42 with type, offset, addend.
43 (Copy_relocs::save): Likewise.
44 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
45 (Copy_relocs::save): Likewise.
46 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
47 and r_addend to Copy_relocs::copy_reloc.
48 * arm.cc (Target_arm::copy_reloc): Likewise.
49 * i386.cc (Target_i386::copy_reloc): Likewise.
50 * mips.cc (Target_mips::copy_reloc): Likewise.
51 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
52 * s390.cc (Target_s390::copy_reloc): Likewise.
53 * sparc.cc (Target_sparc::copy_reloc): Likewise.
54 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
55 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
56
96f9814d
CC
572015-11-05 Cary Coutant <ccoutant@gmail.com>
58
59 PR gold/19119
60 PR gold/19172
61 PR gold/19197
62 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
63 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
64 * options.h (General_options): Remove "obsolete" from -m.
65 * parameters.cc (set_parameters_target): Check if input target
66 is compatible with output emulation set by "-m emulation".
67
0eccf19f
CC
682015-11-05 Cary Coutant <ccoutant@gmail.com>
69
70 PR gold/19163
71 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
72 certain relocations if --no-apply-dynamic-relocs is set.
73 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
74
c1e7d6a8
AM
752015-11-03 Alan Modra <amodra@gmail.com>
76
77 * po/POTFILES.in: Regenerate.
78
26f187cd
NC
792015-10-30 Nick Clifton <nickc@redhat.com>
80
81 * po/zh_CN.po: New (simplified) Chinese translation.
82
41e83f2b
L
832015-10-29 H.J. Lu <hongjiu.lu@intel.com>
84
85 PR gold/19184
86 * incremental.cc (Got_plt_view_info): Add got_entry_size.
87 (Local_got_offset_visitor::visit): Replace got_entry_size_
88 with info_.got_entry_size.
89 (Local_got_offset_visitor::got_entry_size_): Removed.
90 (Global_got_offset_visitor::visit): Replace got_entry_size_
91 with info_.got_entry_size.
92 (Global_got_offset_visitor::got_entry_size_): Removed.
93 (Output_section_incremental_inputs::write_got_plt): Initialize
94 view_info.got_entry_size.
95 * target.h (Sized_target::got_entry_size): New virtual function.
96 * x86_64.cc (Target_x86_64::got_entry_size): New function.
97
238830c6
MK
982015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
99
100 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
101 * testsuite/script_test_12a.c: Likewise.
102 * testsuite/script_test_1a.cc: Likewise.
103 * testsuite/script_test_2.cc: Likewise.
104
bd890911
MK
1052015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
106
107 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
108
a817ff49
MK
1092015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
110
111 PR gold/18959
112 * stringpool.cc (Stringpool_template::new_key_offset): Align all
113 strings, even zero-length.
114 (Stringpool_template::set_string_offsets): Likewise.
115
e79a4bad
MK
1162015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
117
118 * s390.cc: New file.
119 * Makefile.am (TARGETSOURCES): Add s390.cc.
120 (ALL_TARGETOBJS): Add s390.o.
121 * Makefile.in: Regenerate.
122 * configure.ac: Add s390 support.
123 * configure: Regenerate.
124 * configure.tgt: Add s390-*-* and s390x-*-*.
125 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
126 support.
127
6f97897d
MK
1282015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
129
130 * archive.cc (Archive::sym64name): New const.
131 (Archive::setup): Add support for SYM64 armap.
132 (Archive::read_armap): Likewise.
133 (Archive::interpret_header): Likewise.
134 (Archive::const_iterator::read_next_header): Likewise.
135 * archive.h (Archive::sym64name): New const.
136 (Archive::read_armap): Add mapsize template parameter.
137
8d9743bd
MK
1382015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
139
140 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
141 target-specific entry size.
142 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
143 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
144 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
145 hash_entry_size.
146 * target.h (Target::hash_entry_size): New method.
147 (Target::Target_info::hash_entry_size): New data member.
148
149 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
150 * arm.cc (Target_arm::arm_info): Likewise.
151 (Target_arm_nacl::arm_nacl_info): Likewise.
152 * i386.cc (Target_i386::i386_info): Likewise.
153 (Target_i386_nacl::i386_nacl_info): Likewise.
154 (Target_iamcu::iamcu_info): Likewise.
155 * mips.cc (Target_mips::mips_info): Likewise.
156 (Target_mips_nacl::mips_nacl_info): Likewise.
157 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
158 * sparc.cc (Target_sparc::sparc_info): Likewise.
159 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
160 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
161 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
162 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
163
3043c1ab
L
1642015-10-28 H.J. Lu <hongjiu.lu@intel.com>
165
166 PR gold/19177
167 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
168 and R_386_GOT32X relocations without base register.
169
4d2f5d58
HS
1702015-10.27 Han Shen <shenhan@google.com>
171
172 PR gold/19042 - unsupported reloc 311/312.
173
174 * aarch64.cc (Target_aarch64::Scan::local): Add support for
175 reloc 311/312.
176
2891b491
L
1772015-10-22 H.J. Lu <hongjiu.lu@intel.com>
178
179 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
180 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
181 as R_X86_64_GOTPCREL.
182 (Target_x86_64<size>::Scan::local): Likewise.
183 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
184 Likewise.
185 (Target_x86_64<size>::Scan::global): Likewise.
186 (Target_x86_64<size>::Relocate::relocate): Likewise.
187 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
188 Likewise.
189
493d4b48
L
1902015-10-22 H.J. Lu <hongjiu.lu@intel.com>
191
192 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
193 R_386_GOT32X the same as R_386_GOT32.
194 (Target_i386::Scan::local): Likewise.
195 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
196 (Target_i386::Scan::global): Likewise.
197 (Target_i386::Relocate::relocate): Likewise.
198 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
199 Likewise.
200
0fd15345
L
2012015-10-20 H.J. Lu <hongjiu.lu@intel.com>
202
203 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
204 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
205 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
206 x86_64_mov_to_lea1.o.
207 * testsuite/Makefile.in: Regenerated.
208
64571972
L
2092015-10-16 H.J. Lu <hongjiu.lu@intel.com>
210
211 PR gold/19119
212 * options.h (General_options): Remove "obsolete" from -m.
213 * parameters.cc (set_parameters_target): Check if input target
214 is compatible with output emulation set by "-m emulation".
215
01f573ad
L
2162015-10-13 H.J. Lu <hongjiu.lu@intel.com>
217
218 PR gold/19118
219 * i386.cc (Target_iamcu): New class.
220 (Target_selector_iamcu): Likewise.
221 (Target_iamcu::iamcu_info): New variable.
222 (target_selector_iamcu): Likewise.
223
3b0357da
AS
2242015-10-07 Andreas Schwab <schwab@suse.de>
225
226 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
227
9eacb935
CC
2282015-10-06 Cary Coutant <ccoutant@gmail.com>
229
230 PR gold/18855
231 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
232 parameter.
233 (Sparc_relocate_functions::gdop_lox10): Likewise.
234 (Target_sparc::Relocate::relocate): Use addend when computing
235 symbol value for R_SPARC_GOTDATA_OP*.
236
3d4fde69
CC
2372015-09-07 Cary Coutant <ccoutant@gmail.com>
238
239 PR gold/18930
240 PR gold/18886
241 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
242 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
243
358de988
L
2442015-09-02 H.J. Lu <hongjiu.lu@intel.com>
245
246 PR gold/18886
247 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
248 shared libraries into normal FUNC symbols.
249 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
250 symbols aren't from shared libraries.
251
d49044c7
AM
2522015-09-02 Alan Modra <amodra@gmail.com>
253
254 PR 18878
255 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
256 (Target_powerpc::Branch_info::make_stub): Determine whether long
257 branch stub is for save/restore function.
258 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
259 (Stub_table): Add need_save_res_.
260 (Stub_table:clear_stubs): Clear need_save_res_.
261 (Stub_table:set_address_and_size): Add save/restore section size.
262 (Stub_table::add_long_branch_entry): Add save_res param. Set
263 need_save_res_, but don't add space for save/restore stubs.
264 (Stub_table::find_long_branch_entry): Return offset to local copy
265 of save/restore func.
266 (Stub_table::do_write): Don't output save/restore stubs. Instead
267 copy the save/restore functions.
268 (Output_data_save_res:contents): New accessor.
269 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
270
7c61d651
CC
2712015-08-25 Cary Coutant <ccoutant@gmail.com>
272
273 PR gold/18847
274 * script-sections.cc (Memory_region::set_address): New method.
275 (Script_sections::find_memory_region): Add explicit_only parameter.
276 (Output_section_definition::set_section_addresses): Handle case where
277 script specifies both address and vma region.
278 * script-sections.h (Script_sections::find_memory_region): Add
279 explicit_only parameter.
280
4bfacfd3
CC
2812015-08-25 Cary Coutant <ccoutant@gmail.com>
282
283 PR gold/18859
284 * object.cc (Input_objects::add_object): Store objects in a map,
285 indexed by soname; update as-needed flag when necessary.
286 * object.h (Object::clear_as_needed): New method.
287 (Input_objects::so_names_): Change from set to map.
288
1757d35c
CC
2892015-08-25 Cary Coutant <ccoutant@gmail.com>
290
291 PR gold/14746
292 * expression.cc (Expression::Expression_eval_info): Add
293 is_valid_pointer field.
294 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
295 Adjust all callers.
296 (Addr_expression::value_from_output_section): Check whether address
297 is valid.
298 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
299 if evaluation failed due to address that is not yet valid.
300 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
301 parameter.
302
3ac0a36c
CC
3032015-08-25 Cary Coutant <ccoutant@gmail.com>
304
305 PR gold/18866
306 PR gold/18703
307 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
308
9215b98b
AM
3092015-08-20 Alan Modra <amodra@gmail.com>
310
311 PR gold/18846
312 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
313 Subtract os->address() from addend.
314 * powerpc.cc (relocate_relocs): Likewise.
315
40fc1451
SD
3162015-08-12 Simon Dardis <simon.dardis@imgtec.com>
317
318 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
319 lazy_stub_normal_1, lazy_stub_normal_1_n64,
320 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
321 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
322 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
323 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
324 of 'addu/daddu'.
325
37a42ee9
L
3262015-07-27 H.J. Lu <hongjiu.lu@intel.com>
327
328 * configure: Regenerated.
329
ab3b14b0
DK
3302015-07-26 Doug Kwan <dougkwan@google.com>
331
332 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
333 disassembler output format.
334
cdb06167
HS
3352015-07-23 Ian Coolidge <icoolidge@google.com>
336 Plumb --pic-veneer option for gold.
337
338 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
339 generation.
340 * options.h (General_options): Add --pic-veneer option.
341
5b2af7dd
L
3422015-07-22 H.J. Lu <hongjiu.lu@intel.com>
343
344 PR gold/18663
345 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
346 script_test_1a.cc script_test_1b.cc.
347 (script_test_11_r.o): Replace script_test_11.o with
348 script_test_11a.o script_test_11b.o.
349 (script_test_11.o): Removed.
350 (script_test_11a.o): New.
351 (script_test_11b.o): Likewise.
352 * testsuite/Makefile.in: Regenerated.
353 * testsuite/script_test_1.h: New file.
354 * testsuite/script_test_1b.cc: Likewise.
355 * testsuite/script_test_11.h: Likewise.
356 * testsuite/script_test_11b.c: Likewise.
357 * testsuite/script_test_1.cc: Renamed to ...
358 * testsuite/script_test_1a.cc: This.
359 Include "script_test_1.h".
360 (main): Call check_int and check_ptr.
361 * testsuite/script_test_11.c: Renamed to ...
362 * testsuite/script_test_11a.c: This.
363 Include "script_test_11.h".
364 (main): Call ptr_equal.
365
cd78ea77
L
3662015-07-22 H.J. Lu <hongjiu.lu@intel.com>
367
368 PR gold/18628
369 * testsuite/ifuncdep2.c (global): Change protected to hidden.
370 * testsuite/ifuncmod1.c (global): Likewise.
371 * testsuite/ifuncmod5.c (global): Likewise.
372
f945ba50
AM
3732015-07-22 Alan Modra <amodra@gmail.com>
374
375 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
376
5417c94d
CC
3772015-07-21 Cary Coutant <ccoutant@gmail.com>
378
379 PR gold/18548
380 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
381 forced local symbol even when oldsym != NULL.
382 (Symbol_table::do_define_in_output_segment): Likewise.
383 (Symbol_table::do_define_as_constant): Likewise.
384
cb5cf5e2
CC
3852015-07-21 Cary Coutant <ccoutant@gmail.com>
386
b8c6c5ef 387 PR gold/18698
cb5cf5e2
CC
388 * archive.cc (Library_base::should_include_member): Don't use entry
389 point for relocatable links, or if target is not yet valid.
390 * parameters.cc (Parameters::entry): Check target_valid().
391
0ef3814f
HS
3922015-07-20 Han Shen <shenhan@google.com>
393
394 Optimize erratum 843419 fix.
395
396 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
397 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
398 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
399 (E843419_stub): New sub-class of Erratum_stub.
400 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
401 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
402 (AArch64_relobj::create_erratum_stub): Add 1 argument.
403 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
404
2bca0377
HS
4052015-07-20 Han Shen <shenhan@google.com>
406
407 Fix arm elf header flags wrt hardfp bit.
408
409 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
410
f54f5e31
L
4112015-07-20 H.J. Lu <hongjiu.lu@intel.com>
412
413 PR gold/18689
414 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
415 from input group section for relocatable link.
416 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
417 (check_DATA): Add pr18689.stdout.
418 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
419 (pr18689.stdout): New rule.
420 (pr18689a.o): Likewise.
421 (pr18689b.o): Likewise.
422 (pr18689.o): Likewise.
423 * testsuite/pr18689.c: New file.
424 * testsuite/pr18689.sh: Likewise.
425 * testsuite/Makefile.in: Regenerated.
426
c20ceeb2
YW
4272015-07-20 Yiran Wang <yiran@google.com>
428 Cary Coutant <ccoutant@gmail.com>
429
430 PR gold/15574
431 * resolve.cc (Symbol_table): Remove warning about references
432 from shared objects to hidden symbols.
433 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
434 * testsuite/Makefile.in: Regenerate.
435 * testsuite/hidden_test.sh: Check dynamic symbol table; update
436 expected error messages.
437
19a7fe52
L
4382015-07-14 H.J. Lu <hongjiu.lu@intel.com>
439
440 * compressed_output.cc (Output_compressed_section::set_final_data_size):
441 Make --compress-debug-sections=zlib the same as
442 --compress-debug-sections=zlib-gabi.
443 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
444 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
445 ".zdebug_".
446 * testsuite/Makefile.in: Regenerated.
447
fb8b9dbc
L
4482015-07-12 H.J. Lu <hongjiu.lu@intel.com>
449
450 PR gold/18322
451 * compressed_output.cc (zlib_compress): Add argument for
452 compression header size. Set header size to compression header
453 size if it isn't 0. Don't write out the zlib header here.
454 (Output_compressed_section::set_final_data_size): Support
455 zlib-gnu and zlib-gabi compressions. Pass compression header
456 size to zlib_compress and write out compression header. Set
457 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
458 clear the SHF_COMPRESSED bit
459 * options.h (compress_debug_sections): Add zlib-gnu and
460 zlib-gabi.
461 * output.h (Output_section::set_flags): New.
462 * testsuite/Makefile.am (check_PROGRAMS): Add
463 flagstest_compress_debug_sections_none,
464 flagstest_compress_debug_sections_gnu and
465 flagstest_compress_debug_sections_gabi.
466 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
467 flagstest_compress_debug_sections.stdout,
468 flagstest_compress_debug_sections.cmp,
469 flagstest_compress_debug_sections.check,
470 flagstest_compress_debug_sections_gnu.stdout,
471 flagstest_compress_debug_sections_gnu.cmp,
472 flagstest_compress_debug_sections_gnu.check,
473 flagstest_compress_debug_sections_gabi.stdout,
474 flagstest_compress_debug_sections_gabi.cmp and
475 flagstest_compress_debug_sections_gabi.check.
476 (flagstest_compress_debug_sections_none): New.
477 (flagstest_compress_debug_sections_none.stdout): Likewise.
478 (flagstest_compress_debug_sections.stdout): Likewise.
479 (flagstest_compress_debug_sections.check): Likewise.
480 (flagstest_compress_debug_sections.cmp): Likewise.
481 (flagstest_compress_debug_sections_gnu): Likewise.
482 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
483 (flagstest_compress_debug_sections_gnu.check): Likewise.
484 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
485 (flagstest_compress_debug_sections_gabi): Likewise.
486 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
487 (flagstest_compress_debug_sections_gnu.check): Likewise.
488 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
489 * testsuite/Makefile.in: Regenerated.
490
48058663
L
4912015-07-12 H.J. Lu <hongjiu.lu@intel.com>
492
493 PR gold/18321
494 * compressed_output.h (decompress_input_section): Add arguments
495 for ELF class, big endian and sh_flags.
496 * compressed_output.cc (decompress_input_section): Likewise.
497 Support the SHF_COMPRESSED section.
498 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
499 functions.
500 * plugin.h (Pluginobj): Likewise.
501 * layout.cc (Layout::get_output_section_flags): Also clear the
502 SHF_COMPRESSED bit.
503 * object.h (Compressed_section_info): Add flag to store sh_flags.
504 (Object): Add pure virtual elfsize and is_big_endian member
505 functions.
506 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
507 prefix here.
508 (build_compressed_section_map): Check SHF_COMPRESSED for
509 uncompressed size. Store sh_flags in Compressed_section_info.
510 Pass size, big_endian and sh_flags to decompress_input_section.
511 Skip the ".debug"/".zdebug" prefix when passing section name to
512 need_decompressed_section.
513 (Sized_relobj_file<size, big_endian>::do_find_special_section):
514 Don't check ".zdebug_*" sections.
515 (Object::decompressed_section_contents): Pass ELF class, big
516 endian and sh_flags to decompress_input_section.
517 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
518 Likewise.
519 * testsuite/Makefile.am (check_DATA): Add
520 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
521 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
522 gdb_index_test_2_gabi.stdout.
523 (debug_msg_cdebug_gabi.o): New.
524 (odr_violation1_cdebug_gabi.o): Likewise.
525 (odr_violation2_cdebug_gabi.o): Likewise.
526 (debug_msg_cdebug_gabi.err): Likewise.
527 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
528 (gdb_index_test_cdebug_gabi.o): Likewise.
529 (gdb_index_test_2_gabi): Likewise.
530 (gdb_index_test_2_gabi.stdout): Likewise.
531 * testsuite/gdb_index_test_2_gabi.sh: New file.
532 * testsuite/Makefile.in: Regenerated.
533
73854cdd
HS
5342015-07-09 Han Shen <shenhan@google.com>
535
536 Use "gold_info" instead of "gold_warning" for erratum fix.
537
538 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
539 'gold_info'.
540 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
541
61163dfa
HS
5422015-07-09 Han Shen <shenhan@google.com>
543
544 Drop missing symbol warning for arm/aarch64.
545
546 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
547 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
548 symbol warning.
549
b91deca9
HS
5502015-07-07 Han Shen <shenhan@google.com>
551
552 Make gold aarch64 accept long form of mapping symbols.
553
554 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
555 of mapping symbols.
556
15162bef
DK
5572015-06-29 Doug Kwan <dougkwan@google.com>
558
559 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
560 at address expected by test.
561 * testsuite/arm_cortex_a8_b.s: Ditto.
562 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
563 * testsuite/arm_cortex_a8_bl.s: Ditto.
564 * testsuite/arm_cortex_a8_blx.s: Ditto.
565 * testsuite/arm_cortex_a8_local.s: Ditto.
566 * testsuite/arm_fix_v4bx.s: Ditto.
567 * testsuite/arm_unaligned_reloc.s: Ditto.
568 * testsuite/thumb_bl_out_of_range.s: Ditto.
569 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
570 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 571
56b06706
HS
5722015-06-29 Han Shen <shenhan@google.com>
573
574 Patch for erratum 843419 internal error.
575
72f4393d
L
576 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
577 (Erratum_stub::update_erratum_insn): New method.
578 (Stub_table::relocate_stubs): Modified to place relocated insn.
579 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 580
2f0c79aa
HS
5812015-06-12 Han Shen <shenhan@google.com>
582
583 Fix erratum 835769.
584
72f4393d
L
585 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
586 defintion outside class definition.
587 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
588 (AArch64_insn_utilities::aarch64_op31): New member.
589 (AArch64_insn_utilities::aarch64_ra): New member.
590 (AArch64_insn_utilities::aarch64_mac): New member.
591 (AArch64_insn_utilities::aarch64_mlxl): New member.
592 (ST_E_835769): New global enum member.
593 (Stub_table::relocate_stubs): Add 835769 handler.
594 (Stub_template_repertoire::Stub_template_repertoire): Install new
595 stub type.
596 (AArch64_relobj::scan_errata): This func is renamed from
597 scan_erratum_843419.
598 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
599 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
600 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
601 (Target_aarch64::scan_erratum_835769_span): New method.
602 (Target_aarch64::create_erratum_stub): New method.
603 (Target_aarch64::is_erratum_835769_sequence): New method.
604 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
605 code into create_erratum_stub.
606 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 607
5d7908e0
CC
6082015-06-11 Cary Coutant <ccoutant@gmail.com>
609
610 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
611 outside class body.
612 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
613
dd68f8fa
CC
6142015-06-11 Cary Coutant <ccoutant@gmail.com>
615
616 PR gold/17731
617 * layout.cc (corresponding_uncompressed_section_name): New function.
618 (Layout::choose_output_section): Call it.
619 * layout.h (corresponding_uncompressed_section_name): New function.
620 * script-sections.cc (Input_section_info::set_section_name): Check
621 for compressed debug section (.zdebug style).
622
a3a0c391
JY
6232015-06-11 Jing Yu <jingyu@google.com>
624
625 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
626 * testsuite/Makefile.in: Regenerate.
627
970cdef2
DI
6282015-06-11 Davide Italiano <dccitaliano@gmail.com>
629
630 * gold.h (is_cident): Correct typo.
631
a48d0c12
HS
6322015-06-10 Han Shen <shenhan@google.com>
633 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
634
635 Now fixing for 843419 is fully functional.
636
637 The first part of the erratum fix CL is here -
638 https://sourceware.org/ml/binutils/2015-04/msg00229.html
639
640 * aarch64.cc(global enum): New constants representing stub types.
641 (Stub_template): New POD struct.
642 (Stub_template_repertoire): New class.
643 (Stub_base): New class.
644 (Erratum_stub): New class.
645 (Reloc_stub): Refactored to be a subclass of Stub_base.
646 (Reloc_stub::Stub_type): Removed.
647 (Reloc_stub::offset): Moved to Stub_base.
648 (Reloc_stub::set_offset): Moved to Stub_base.
649 (Reloc_stub::destination_address): Moved to Stub_base.
650 (Reloc_stub::set_destination_address): Moved to Stub_base.
651 (Reloc_stub::reset_destination_address): Moved to Stub_base.
652 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
653 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
654 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
655 (Reloc_stub::write): Moved to Stub_base.
656 (Reloc_stub::invalid_offset): Moved to Stub_base.
657 (Reloc_stub::invalid_address): Moved to Stub_base.
658 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
659 (Reloc_stub::stub_insns_): Moved to Stub_base.
660 (Reloc_stub::offset_): Moved to Stub_base.
661 (Reloc_stub::destination_address_): Moved to Stub_base.
662 (Stub_table::The_aarch64_relobj): New typedef.
663 (Stub_table::The_erratum_stub): New typedef.
664 (Stub_table::The_erratum_stub_less): New typedef.
665 (Stub_table::The_erratum_stub_set): New typedef.
666 (Stub_table::The_erratum_stub_set_iter): New typedef.
667 (Stub_table::empty): Added emptiness testing for erratum stubs.
668 (Stub_table::add_erratum_stub): New method to add an erratum stub.
669 (Stub_table::find_erratum_stub): New method.
670 (Stub_table::find_erratum_stubs_for_input_section): New method.
671 (Stub_table::erratum_stub_address): New method.
672 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
673 (Stub_table::do_addralign): Modified to handle erratum stubs.
674 (Stub_table::erratum_stubs_): New member.
675 (Stub_table::erratum_stub_size_): New member.
676 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
677 (Stub_table::do_write): Modified to handle erratum stubs.
678 (AArch64_relobj::The_erratum_stub): New typedef.
679 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
680 (AArch64_relobj::fix_errata): New method.
681 (Target_aarch64::The_reloc_stub_type): Removed.
682 (Target_aarch64::The_erratum_stub): New typede.
683 (AArch64_relocate_functions::construct_b): New method.
684
1e1b2efc
NC
6852015-06-08 Nick Clifton <nickc@redhat.com>
686
687 * po/fr.po: New French Translation.
688
b8cf5075
CC
6892015-06-07 Cary Coutant <ccoutant@gmail.com>
690
691 PR gold/18288
692 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
693 callers. Don't use STT_COMMON to check for common symbols.
694 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
695 symbol that's not in a common section.
696 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
697 common symbols.
698
bdd2d2b7
CC
6992015-06-04 Cary Coutant <ccoutant@gmail.com>
700
701 PR gold/18200
702 * Makefile.am (diststuff): Add target.
703 * Makefile.in: Regenerate.
704
cd3c333f
CC
7052015-06-04 Cary Coutant <ccoutant@gmail.com>
706
707 PR gold/17498
708 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
709 temporary locals in merge sections.
710 * options.cc (General_options::parse_discard_all): New method.
711 (General_options::parse_discard_locals): New method.
712 (General_options::parse_discard_none): New method.
713 (General_options::General_options): Initialize discard_locals_.
714 * options.h (--discard-all): Convert to special option.
715 (--discard-locals): Likewise.
716 (--discard-none): New option.
717 (General_options::discard_all): New method.
718 (General_options::discard_locals): New method.
719 (General_options::discard_sec_merge): New method.
720 (General_options::Discard_locals): New enum.
721 (General_options::discard_locals_): New data member.
722
8086551f
CC
7232015-06-03 Cary Coutant <cary@google.com>
724
725 * script-sections.cc (Script_sections::Script_sections): Initialize
726 segments_created_.
727 (Script_sections::create_note_and_tls_segments): Set flag when
728 segments are created.
729 (Script_sections::expected_segment_count): Count PT_INTERP.
730 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
731 segments are created.
732 * script-sections.h (Script_sections::segments_created_): New data
733 member.
734
374082df
CC
7352015-06-03 Cary Coutant <ccoutant@gmail.com>
736
737 PR gold/15370
738 * script-sections.cc
739 (Output_section_element_input::set_section_addresses): When there
740 are several patterns with no sort spec, put all sections in the same
741 bin.
742 * testsuite/Makefile.am (script_test_12): New testcase.
743 (script_test_12i): New testcase.
744 * testsuite/Makefile.in: Regenerate.
745 * testsuite/script_test_12.t: New test linker script.
746 * testsuite/script_test_12i.t: New test linker script.
747 * testsuite/script_test_12a.c: New test source file.
748 * testsuite/script_test_12b.c: New test source file.
749
775ed62e
CC
7502015-06-02 Cary Coutant <ccoutant@gmail.com>
751
752 * nacl.h (Sniff_file): Switch parameters to get_view to get an
753 aligned view.
754
9c7fe3c5
CC
7552015-06-03 Cary Coutant <ccoutant@gmail.com>
756
72f4393d
L
757 PR gold/17819
758 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
759 separate task to schedule the build id computation.
760 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
761 add Output_file and offset.
762 (Hash_task::run): Get and release the input views.
763 (Hash_task::is_runnable): Always return NULL (always runnable).
764 (Layout::queue_build_id_tasks): Remove.
765 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
766 parameters; use them instead of class members.
767 (Build_id_task_runner::run): New function.
768 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
769 to write_build_id.
770 * layout.h (Layout::queue_build_id_tasks): Remove.
771 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
772 parameters.
773 (Layout::array_of_hashes_): Remove.
774 (Layout::size_of_array_of_hashes_): Remove.
775 (Layout::input_view_): Remove.
776 (Build_id_task_runner): New class.
777 (Close_task_runner::Close_task_runner): Add array_of_hashes and
778 size_of_hashes parameters.
779 (Close_task_runner::array_of_hashes_): New data member.
780 (Close_task_runner::size_of_hashes_): New data member.
781 * testsuite/Makefile.am
782 (flagstest_compress_debug_sections_and_build_id_tree): New test.
783 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 784
400f8944
RÁE
7852015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
786
787 * merge.cc (get_input_merge_map): Update for data structure change.
788 (get_or_make_input_merge_map): Update for data structure change.
789 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
790 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
791
bbec1a5d
AM
7922015-05-16 Alan Modra <amodra@gmail.com>
793
794 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
795 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
796 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
797 (lis_0): Rename from lis_0_0.
798
efc6fa12
CC
7992015-04-29 Cary Coutant <cary@google.com>
800 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
801
802 * gc.h (Garbage_collection::is_section_garbage): Change Object*
803 to Relobj*.
804 (Garbage_collection::add_reference): Likewise.
805 (Garbage_collection::gc_process_relocs): Likewise. Don't push
806 object/shndx pair onto *secvec for dynamic objects. Don't follow
807 relocations pointing to dynamic objects for GC.
808 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
809 (Icf::unfold_section): Likewise.
810 (Icf::is_section_folded): Likewise.
811 (Icf::get_folded_section): Likewise.
812 * icf.h: (Icf::get_folded_section): Likewise.
813 (Icf::unfold_section): Likewise.
814 (Icf::is_section_folded): Likewise.
815 (Icf::section_has_function_pointers): Likewise.
816 (Icf::set_section_has_function_pointers): Likewise.
817 * object.h (Section_id): Likewise.
818 (Const_section_id): Likewise.
819 * output.cc (Output_section::update_section_layout): Likewise.
820 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
821 Likewise.
822 * plugin.cc (update_section_order): Likewise.
823 (unique_segment_for_sections): Likewise.
824 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
825 (Target_powerpc::do_gc_add_reference): Likewise.
826 (Target_powerpc::gc_process_relocs): Likewise.
827 (Target_powerpc::do_gc_add_reference): Likewise.
828 * symtab.cc (Symbol_table::is_section_folded): Likewise.
829 (Symbol_table::gc_mark_symbol): Likewise.
830 * symtab.h: (Symbol_table::is_section_folded): Likewise.
831 * target.h: (Sized_target::gc_add_reference): Likewise.
832 (Sized_target::do_gc_add_reference): Likewise.
833
f9d3ecaa
NC
8342015-04-29 Nick Clifton <nickc@redhat.com>
835
836 * po/fi.po: Updated Finnish translation.
837
faa2211d
AM
8382015-04-28 Alan Modra <amodra@gmail.com>
839
840 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
841 than unsigned int for find_global_entry result temp. Compare
842 against invalid_address.
843 (Target_powerpc::do_plt_address_for_global): Likewise.
844 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
845 on plt call stub existence for debug info. Do assert for plt
846 and global entry stub existence if an alloc section.
847
6ec65f28
AM
8482015-04-28 Alan Modra <amodra@gmail.com>
849
850 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
851 on missing global entry stub due to bogus debug info.
852
7a2a1c79
HS
8532015-04-27 Han Shen <shenhan@google.com>
854
855 * options.h (--fix-cortex-a53-843419): Rename option.
856 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
857 option.
858 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
859
cfbf0e3c
RÁE
8602015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
861
862 PR gold/18327
863 * output.cc (Output_section::is_input_address_mapped): Assume a missing
864 entry is mapped.
865 * testsuite/Makefile.am: Add the eh_test test.
866 * testsuite/Makefile.in: Regenerate.
867 * testsuite/eh_test_a.cc: New test.
868 * testsuite/eh_test_b.cc: New test.
869
6ec65f28
AM
8702015-04-23 Sriraman Tallam <tmsriram@google.com>
871
a100d66f
ST
872 * options.h (--weak-unresolved-symbols): New option.
873 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
874 binding to weak with new option.
875 * symtab.h (is_weak_undefined): Check for new option.
876 (is_strong_undefined): Check for new option.
877 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
878 * testsuite/Makefile.in: Regenerate.
879 * testsuite/weak_unresolved_symbols_test.cc: New file.
880
4b889c30
IC
8812015-04-20 Ian Coolidge <icoolidge@google.com>
882
883 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
884 GNU_UNIQUE.
885
4277535c
RÁE
8862015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
887
888 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
889 push_back.
890 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
891 * object.cc (Sized_relobj_file::do_layout): Use push_back.
892 * powerpc.cc (process_gc_mark): Use push_back.
893 (Target_powerpc::do_gc_mark_symbol): Use push_back.
894 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
895
7a2a1c79 8962015-04-16 Han Shen <shenhan@google.com>
5019d64a 897
6ec65f28
AM
898 * aarch64.cc (AArch64_insn_utilities): New utility class.
899 (AArch64_relobj::Mapping_symbol_position): New struct.
900 (AArch64_relobj::Mapping_symbol_info): New typedef.
901 (AArch64_relobj::do_count_local_symbols): New function overriding
902 parent's implementation.
903 (AArch64_relobj::mapping_symbol_info_): New member
904 (AArch64_relobj::scan_erratum_843419): New method.
905 (Target_aarch64::scan_erratum_843419_span): New method.
906 (Target_aarch64::is_erratum_843419_sequence): New method.
907 * options.h (fix_cortex_a53): New option.
5019d64a 908
a6a17750
CC
9092015-04-09 Cary Coutant <ccoutant@google.com>
910
911 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
912 in a PIE link.
913 * testsuite/Makefile.am (tls_pie_test.sh): New test.
914 * testsuite/Makefile.in: Regenerate.
915 * testsuite/tls_pie_test.sh: New.
916
437ddf0c
CC
9172015-04-09 Cary Coutant <ccoutant@google.com>
918
919 * debug.h (DEBUG_LOCATION): New.
920 (DEBUG_ALL): Include DEBUG_LOCATION.
921 (debug_string_to_enum): Add DEBUG_LOCATION.
922 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
923 output to print correct context.
924 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
925 up to 4 more locations at the beginning of the function.
926 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
927 result before sorting list of line numbers.
928 * testsuite/debug_msg.sh: Allow range of line numbers for
929 canonical results on optimized code.
930
24491327
HS
9312015-04-07 HC Yen <hc.yen@mediatek.com>
932
933 Add AArch32 support for gold linker.
934 gold/
935 * arm.cc: Add V8 arch combine table.
936
7fa5525f
RÁE
9372015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
938
939 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
940
5368dcf2
RÁE
9412015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
942
943 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
944 to find by using the return value of insert.
945
9dbb4b02
RÁE
9462015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
947
948 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
949 constructor call.
950
1fa29f10
IT
9512015-04-06 Ilya Tocar <ilya.tocar@intel.com>
952
953 PR gold/17641
954 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
955 (Target_x86_64::Scan::local): Don't create GOT entry, when we
956 can convert mov to lea.
957 (Target_x86_64::Scan::global): Ditto.
958 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
959 %reg to lea foo(%rip), %reg if possible.
960 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
961 * testsuite/x86_64_mov_to_lea1.s: New.
962 * testsuite/x86_64_mov_to_lea2.s: Ditto.
963 * testsuite/x86_64_mov_to_lea3.s: Ditto.
964 * testsuite/x86_64_mov_to_lea4.s: Ditto.
965 * testsuite/x86_64_mov_to_lea.sh: Ditto.
966
39f3de7c
L
9672015-04-02 H.J. Lu <hongjiu.lu@intel.com>
968
969 * configure: Regenerated.
970
c4fc4724
IT
9712015-04-01 Ilya Tocar <ilya.tocar@intel.com>
972
973 PR gold/17640
974 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
975 (Target_i386::Scan::local): Don't create GOT entry, when we
976 can convert GOT to GOTOFF.
977 (Target_i386::Scan::global): Ditto.
978 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
979 lea foo@GOTOFF(%reg), %reg if possible.
980 * testsuite/Makefile.am (i386_mov_to_lea): New test.
981 * testsuite/i386_mov_to_lea1.s: New.
982 * testsuite/i386_mov_to_lea2.s: Ditto.
983 * testsuite/i386_mov_to_lea3.s: Ditto.
984 * testsuite/i386_mov_to_lea4.s: Ditto.
985 * testsuite/i386_mov_to_lea5.s: Ditto.
986 * testsuite/i386_mov_to_lea.sh: Ditto.
987
918357b9
L
9882015-04-01 H.J. Lu <hongjiu.lu@intel.com>
989
990 * Makefile.am (ZLIB): New.
991 (ZLIBINC): Likewise.
992 (AM_CFLAGS): Add $(ZLIBINC).
993 (AM_CXXFLAGS): Likewise.
994 (ldadd_varldadd_var): Add $(ZLIB).
995 (incremental_dump_LDADD): Likewise.
996 (dwp_LDADD): Likewise.
997 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
998 <zlib.h>.
999 (zlib_compress): Don't check HAVE_ZLIB_H.
1000 (zlib_decompress): Likewise.
1001 * options.h (compress_debug_sections): Likewise.
1002 * configure.ac (AM_CONDITIONAL): Removed.
1003 * testsuite/Makefile.am (ZLIB): New.
1004 (LDADD): Add $(ZLIB).
1005 Don't check HAVE_ZLIB.
1006 * Makefile.in: Regenerated.
1007 * config.in: Likewise.
1008 * configure: Likewise.
1009 * testsuite/Makefile.in: Likewise.
1010
6b0ad2eb
JY
10112015-03-30 Jing Yu <jingyu@google.com>
1012
1013 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1014 TLSLD_ADD_DTPREL_LO12_NC.
1015 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1016 _TLS_MODULE_BASE_ point to the start of tls segment.
1017 (Target_aarch64::optimize_tls_reloc): Add cases for
1018 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1019 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1020 (Target_aarch64::Scan::local): Likewise.
1021 (Target_aarch64::Scan::global): Likewise.
1022 (Target_aarch64::Relocate::relocate): Likewise.
1023 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1024 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1025 relocations.
1026
0916f9e7
RÁE
10272015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1028
1029 * merge.cc (Object_merge_map::add_mapping): call
1030 Object_merge_map::Input_merge_map::add_mapping.
1031 (Object_merge_map::Input_merge_map::add_mapping): New.
1032 (Output_merge_data::do_add_input_section): Call
1033 get_or_make_input_merge_map before a loop.
1034 (Output_merge_string<Char_type>::finalize_merged_data): Call
1035 get_or_make_input_merge_map before a loop.
1036 * merge.h (Object_merge_map): Make Input_merge_map public.
1037 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1038 (Relobj::get_or_create_merge_map): New.
1039 * object.h (Relobj::get_or_create_merge_map): New.
1040
282c9750
AM
10412015-03-24 Alan Modra <amodra@gmail.com>
1042
1043 PR 18147
1044 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1045 relocation errors for branches to strong undefined symbols.
1046
67f95b96
RÁE
10472015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1048
1049 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1050 (Object_merge_map::is_merge_section_for): Remove.
1051 (Object_merge_map::find_merge_section): New.
1052 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1053 (Object_merge_map::find_merge_section): New.
1054 (Object_merge_map::get_input_merge_map): Add a const version.
1055 * object.cc (Relobj::is_merge_section_for): Remove.
1056 (Relobj::find_merge_section): New.
1057 * object.h (Relobj::is_merge_section_for): Remove.
1058 (Relobj::find_merge_section): New.
1059 * output.cc
1060 (Output_section::Input_section::is_merge_section_for): Remove.
1061 (Output_section::add_merge_input_section): Don't call
1062 add_merge_input_section.
1063 (Output_section::find_merge_section): Return const. Use
1064 object->find_merge_section.
1065 (Output_section::build_lookup_maps): Don't build a map for
1066 merge sections.
1067 (Output_section::is_input_address_mapped): Return false if
1068 section is not found.
1069 (Output_section::find_starting_output_address): Use
1070 find_merge_section instead of is_merge_section_for.
1071 (Output_section::add_script_input_section): Don't build a map for
1072 merge sections.
1073 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1074 (Output_section_lookup_maps::find_merge_section): Remove.
1075 (Output_section_lookup_maps::add_merge_input_section) Remove.
1076 (Output_section::find_merge_section): Return const.
1077
152f7024
CC
10782015-03-22 Cary Coutant <cary@google.com>
1079
1080 PR gold/18106
1081 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1082 non-SIB form of lea, with nop after the call.
1083
bccffdfd
CC
10842015-03-21 Cary Coutant <cary@google.com>
1085
1086 PR gold/14217
1087 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1088 .tdata section.
1089 (Output_segment::set_section_addresses): Don't align size of relro
1090 segment for .tbss.
1091
1c582fe7
CC
10922015-03-21 Cary Coutant <cary@google.com>
1093
1094 PR gold/18010
1095 * stringpool.cc (Stringpool_template): Don't optimize if section
1096 alignment is greater than sizeof(char).
1097
410da591
CC
10982015-03-21 Cary Coutant <cary@google.com>
1099
1100 PR gold/18048
1101 * script-c.h (script_include_directive): Add first_token parameter.
1102 * script.cc (script_include_directive): Add first_token parameter, and
1103 pass it to read_script_file.
1104 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1105 (PARSING_MEMORY_DEF): New tokens.
1106 (top): Add new productions for INCLUDE files.
1107 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1108 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1109 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1110 (section_cmd): Pass PARSING_SECTION_CMDS.
1111 (file_or_sections_cmd): Remove.
1112 (memory_def): Pass PARSING_MEMORY_DEF.
1113 * testsuite/Makefile.am (memory_test_2): New test.
1114 * testsuite/Makefile.in: Regenerate.
1115 * testsuite/memory_test_inc.t: New script file.
1116 * testsuite/memory_test_inc_1.t.src: New script file.
1117 * testsuite/memory_test_inc_2.t.src: New script file.
1118 * testsuite/memory_test_inc_3.t.src: New script file.
1119
0d5bbdb0
CC
11202015-03-21 Cary Coutant <cary@google.com>
1121
1122 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1123 (Sized_relobj_dwo::setup): Build compressed section map.
1124 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1125 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1126 section map.
1127 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1128 compressed_sections_ field.
1129 (build_compressed_section_map): Take Object instead of
1130 Sized_relobj_file parameter; add decompress_if_needed parameter.
1131 (Sized_relobj_file::do_find_special_sections): Store compressed
1132 section map in parent Object.
1133 (Sized_relobj_file::do_decompressed_section_contents): Move
1134 implementation to Object::decompressed_section_contents.
1135 (Sized_relobj_file::do_discard_decompressed_sections): Move
1136 implementation to Object::discard_decompressed_sections.
1137 * object.h (build_compressed_section_map): Declare.
1138 (Object::Object): Add compressed_sections_ field.
1139 (Object::section_is_compressed): Move implementation here.
1140 (Object::decompressed_section_contents): De-virtualize.
1141 (Object::discard_decompressed_sections): De-virtualize.
1142 (Object::do_section_is_compressed): Delete.
1143 (Object::do_decompressed_section_contents): Delete.
1144 (Object::set_compressed_sections): New method.
1145 (Object::compressed_sections): New method.
1146 (Object::compressed_sections_): New data member.
1147 (Compressed_section_info, Compressed_section_map): Move to top of file.
1148 (Sized_relobj_file::do_section_is_compressed): Delete.
1149 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1150 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1151 (Sized_relobj_file::compressed_sections_): Move to Object class.
1152
bd9e0d46
CC
11532015-03-21 Cary Coutant <ccoutant@google.com>
1154
1155 PR gold/18152
1156 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1157 deferred objects.
1158
943c8b43
CC
11592015-03-11 Cary Coutant <ccoutant@google.com>
1160
1161 * options.cc (General_options::finalize): Don't allow -z relro
1162 with incremental linking.
1163 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1164 (incremental_test_2): Likewise.
1165 (incremental_test_3): Likewise.
1166 (incremental_test_4): Likewise.
1167 (incremental_test_5): Likewise.
1168 (incremental_test_6): Likewise.
1169 (incremental_copy_test): Likewise.
1170 (incremental_common_test_1): Likewise.
1171 (incremental_comdat_test_1): Likewise.
1172 * testsuite/Makefile.in: Regenerate.
1173
e1663197
CC
11742015-03-09 Cary Coutant <ccoutant@google.com>
1175
1176 PR gold/14675
1177 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1178 return enum indicating whether .eh_frame section is empty, optimizable,
1179 unrecognized, or an end marker. Adjust explicit instantiations.
1180 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1181 (Eh_frame::add_ehframe_input_section): Change return type.
1182 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1183 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1184 to the .eh_frame output section until we see the end marker.
1185 (Layout::finalize_eh_frame_section): New.
1186 * layout.h: (Layout::finalize_eh_frame_section): New.
1187
beb8418f
L
11882015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1189
1190 * output.cc (Relobj::initialize_input_to_output_map<size>):
1191 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1192
48c73428
CC
11932015-03-04 Cary Coutant <ccoutant@google.com>
1194
1195 * parameters.cc (Parameters::set_target_once): Call
1196 Target::select_as_default_target just once from here...
1197 (set_parameters_target): ...instead of from here.
1198
11992015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1200
1201 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1202 Output_section_data instead of a Merge_map.
1203 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1204 (Eh_frame::read_cie): Use add_merge_mapping instead of
1205 Merge_map::add_mapping.
1206 (Eh_frame::read_fde): Ditto.
1207 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1208 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1209 merge_map_->get_output_offset.
1210 (Eh_frame::do_is_merge_section_for): Delete.
1211 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1212 instead of a Merge_map.
1213 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1214 Merge_map.
1215 (Eh_frame::do_is_merge_section_for): Delete.
1216 (Eh_frame::merge_map_): Delete.
1217 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1218 and use a Output_section_data instead of a Merge_map.
1219 (Object_merge_map::add_mapping): Ditto.
1220 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1221 (Object_merge_map::is_merge_section_for): Pass in and use a
1222 Output_section_data instead of a Merge_map.
1223 (Merge_map): Delete.
1224 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1225 of merge_map_.get_output_offset.
1226 (Output_merge_base::do_is_merge_section_for): Delete.
1227 (Output_merge_data::do_add_input_section): Use
1228 object->add_merge_mapping instead of add_mapping.
1229 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1230 * merge.h (Merge_map): Delete forward declaration.
1231 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1232 instead of a Merge_map.
1233 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1234 (Object_merge_map::is_merge_section_for): Pass in and use a
1235 Output_section_data instead of a Merge_map.
1236 (Input_merge_map::Object_merge_map::merge_map): Replace with
1237 output_data.
1238 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1239 Output_section_data instead of a Merge_map.
1240 (Merge_map): Delete.
1241 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1242 (Output_merge_base::do_is_merge_section_for): Delete.
1243 (Output_merge_base::add_mapping): Delete.
1244 (Output_merge_base::merge_map_): Delete.
1245 * object.cc (Relobj::initialize_input_to_output_map): New.
1246 (Relobj::initialize_input_to_output_map): New.
1247 (Relobj::merge_output_offset): New.
1248 (Relobj::is_merge_section_for): New.
1249 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1250 bits.
1251 * object.h (Relobj::merge_map): Delete.
1252 (initialize_input_to_output_map): New.
1253 (set_merge_map): Delete.
1254 (add_merge_mapping): New.
1255 (merge_output_offset): New.
1256 (is_merge_section_for): New.
1257 * output.cc (Output_section::Input_section::is_merge_section_for):
1258 Use object->is_merge_section_for.
1259 * output.h (Output_section_data::is_merge_section_for): Delete.
1260 (Output_section_data::do_is_merge_section_for): Delete.
1261 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1262 Use object->initialize_input_to_output_map.
1263 (Merged_symbol_value<size>::value_from_output_section): Use
1264 object->merge_output_offset.
1265
48c73428 12662015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1267 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1268
1269 * output.cc (Output_section::add_merge_input_section): Do not
1270 attempt to merge sections with an entsize of 0.
1271
48c73428 12722015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1273
1274 * attributes.h (class Output_attributes_section_data ): Add
1275 do_print_to_mapfile function.
1276
ec86f434
AM
12772015-02-24 Alan Modra <amodra@gmail.com>
1278
1279 PR 18010
1280 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1281 complain if value is not a multiple of four.
1282 (Target_powerpc::Relocate::relocate): Correct handling of
1283 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1284
be66981e
L
12852015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1286
1287 * configure.ac (default_size): Set to 32 for x32.
1288 * configure: Regenerated.
1289
e3ee8ed4
AM
12902015-02-18 Alan Modra <amodra@gmail.com>
1291
1292 PR 17954
1293 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1294 visibility.
1295
3a935c6c
RÁE
12962015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1297
1298 * gc.h (Garbage_collection::add_reference): Don't use find.
1299
e0a1e121
RÁE
13002015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1301
1302 * object.cc (write_local_symbols): avoid std::vector copy.
1303
45a4fb1a
RÁE
13042015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1305
1306 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1307
2d9afefe
MW
13082015-02-09 Mark Wielaard <mjw@redhat.com>
1309
1310 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1311 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1312
e9c1bdad
CC
13132015-02-16 Cary Coutant <ccoutant@google.com>
1314
1315 PR gold/13577
1316 PR gold/16992
1317 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1318 DF_SYMBOLIC if --dynamic-list option is used.
1319 * options.cc (General_options::finalize): --dynamic-list is not
1320 mutually exclusive with -Bsymbolic.
1321 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1322 listed in --dynamic-list.
1323 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1324 -Bsymbolic-functions.
1325 * testsuite/Makefile.in: Regenerate.
1326
0ed4b0bf
CC
13272015-02-16 Cary Coutant <ccoutant@google.com>
1328
1329 PR gold/17971
1330 * incremental.cc: Remove redundant include of "output.h".
1331
1a920511
JY
13322015-02-12 Jing Yu <jingyu@google.com>
1333
1334 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1335 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1336 New relocation.
1337 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1338 TLSLE_MOVW_* relocations.
1339 (Target_aarch64::Scan::global): Likewise.
1340 (Target_aarch64::Relocate::relocate): Likewise.
1341 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1342 for new TLSLE_MOVW_* relocations.
1343
07f107f3
WN
13442015-02-11 Will Newton <will.newton@linaro.org>
1345
1346 PR gold/13321
1347 * arm.cc (Target_arm::make_plt_section): Create an ARM
1348 state mapping symbol at the start of the PLT.
1349
e051a5b5
L
13502015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1351
1352 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1353 Replace two_file_shared_2.so with two_file_shared_1.so.
1354 * testsuite/Makefile.in: Regenerated.
1355
dddcc5b9
AM
13562015-02-09 Alan Modra <amodra@gmail.com>
1357
1358 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1359 plugin_test_thin.a and defsym_test.
1360 * testsuite/Makefile.in: Regenerate.
1361
b39b8b9d
RÁE
13622015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1363
1364 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1365 body.
1366
b66d1c52
CC
13672015-02-04 Peter Collingbourne <pcc@google.com>
1368
1369 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1370 forwarding symbols when computing symbol resolution info for plugins.
1371 * plugin.h (Plugin_manager::symtab): New method.
1372 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1373
23081de0
CC
13742015-02-03 Cary Coutant <ccoutant@google.com>
1375 Peter Collingbourne <pcc@google.com>
1376
1377 PR gold/15660
1378 * archive.cc (Thin_archive_object_unlocker): New class.
1379 (Archive::include_member): Unlock external members of thin archives.
1380 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1381 (plugin_test_2): Likewise.
1382 (plugin_test_3): Likewise.
1383 (plugin_test_4): Likewise.
1384 (plugin_test_5): Likewise.
1385 (plugin_test_6): Likewise.
1386 (plugin_test_7): Likewise.
1387 (plugin_test_8): Likewise.
1388 (plugin_test_9): Likewise.
1389 (plugin_test_10): Likewise.
1390 (plugin_test_11): New test case.
1391 * testsuite/Makefile.in: Regenerate.
1392 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1393 file to decide whether to claim file.
1394 (all_symbols_read_hook): Likewise.
1395 * testsuite/plugin_test_1.sh: Adjust expected output.
1396 * testsuite/plugin_test_2.sh: Likewise.
1397 * testsuite/plugin_test_3.sh: Likewise.
1398 * testsuite/plugin_test_6.sh: Likewise.
1399 * testsuite/plugin_test_tls.sh: Likewise.
1400 * testsuite/plugin_test_11.sh: New testcase.
1401
14022015-02-03 Cary Coutant <ccoutant@google.com>
1403
1404 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1405 file descriptors when debugging enabled. Add debug output.
1406 (Descriptors::release): Add debug output.
1407 (Descriptors::close_some_descriptor): Likewise.
1408 (Descriptors::close_all): Likewise.
1409 * fileread.cc (File_read::lock): Likewise.
1410 (File_read::unlock): Likewise.
1411
24dd5808
CC
14122015-02-02 Cary Coutant <ccoutant@google.com>
1413
1414 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1415 executable output file.
1416
fa89cc82
HS
14172015-01-22 Han Shen <shenhan@google.com>
1418
1419 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1420 (Target_arm::do_plt_address_for_global): New method.
1421 (Target_arm::do_plt_address_for_local): New method.
1422 (Target_arm::rel_irelative_section): New method.
1423 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1424 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1425 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1426 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1427 (Target_arm::Scan::check_non_pic): Add ifunc support.
1428 (Target_arm::Scan::local): Add ifunc support.
1429 (Target_arm::Scan::global): Add ifunc support.
1430 (Target_arm::make_plt_section): New method.
1431 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1432 (Target_arm::make_local_ifunc_plt_entry): New method.
1433 (Target_arm::got_irelative_): New member.
1434 (Target_arm::rel_irelative_): New member.
1435 (Target_arm::got_section): Add creation for got_irelative_.
1436 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1437 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1438 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1439 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1440 (Output_data_plt_arm::IRelative_data): New type.
1441 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1442 (Output_data_plt_arm::add_entry): Add more parameters.
1443 (Output_data_plt_arm::add_relocation): New method.
1444 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1445 (Output_data_plt_arm::rel_irelative): New method.
1446 (Output_data_plt_arm::entry_count): Modified.
1447 (Output_data_plt_arm::address_for_global): New method.
1448 (Output_data_plt_arm::address_for_local): New method.
23081de0 1449gold/
fa89cc82
HS
1450 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1451 (Output_data_plt_arm::insert_irelative_data): New method.
1452 (Output_data_plt_arm::irelative_rel_): New member.
1453 (Output_data_plt_arm::got_): New member.
1454 (Output_data_plt_arm::got_irelative_): New member.
1455 (Output_data_plt_arm::irelative_count_): New member.
1456 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1457 (Output_data_plt_arm::irelative_data_vec_): New member.
1458 (Output_data_plt_arm::do_write): Write out irelative entries.
1459 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1460 more parameters to ctor.
1461 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1462 more parameters to ctor.
1463 * output.h (Output_data_reloc::add_local_relative): New method.
1464 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1465
0f81d3f0
AM
14662015-01-29 Alan Modra <amodra@gmail.com>
1467
1468 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1469 and GOT_TLSGD to LE optimization.
1470
65d92137
CC
14712015-01-28 Cary Coutant <ccoutant@google.com>
1472
1473 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1474 for undef TLS symbols.
1475 (Target_x86_64::Relocate::relocate_tls): Likewise.
1476 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1477
5485698a
CC
14782015-01-25 Cary Coutant <ccoutant@google.com>
1479
1480 * output.cc (Output_segment::set_section_addresses): Fix calculation
1481 of size of relro segment.
1482
b01a4b04
AM
14832015-01-22 Alan Modra <amodra@gmail.com>
1484
1485 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1486 condition for need of ifunc plt entry.
1487 (Target_powerpc::Scan::global <got relocs>): Likewise.
1488
3d0064a9
CC
14892015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1490
1491 * mips.cc (reloc_high): Add r_sym.
1492 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1493 reloc_high constructor.
1494 (Mips_relocate_functions::relgot16_local): Likewise.
1495 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1496 r_type to decide whether LO16 matches HI16.
1497 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1498 rello16 and relgot16_local.
1499
a5cd8f05
CC
15002015-01-09 Cary Coutant <ccoutant@google.com>
1501
1502 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1503 unless alignment is larger than page size.
1504
4fc1b9d4
L
15052015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1506 Cary Coutant <ccoutant@google.com>
1507
1508 PR gold/17729
1509 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1510 (DEFAULT_TARGET_X32): Set for x32.
1511 * x86_64.cc (cmp_insn_32): New.
1512 (lea_r10_insn_32): Likewise.
1513 (lea_r11_insn_32): Likewise.
1514 (cmp_insn_64): Likewise.
1515 (lea_r10_insn_64): Likewise.
1516 (lea_r11_insn_64): Likewise.
1517 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1518 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1519 (check_DATA): Add split_x32 files.
1520 (split_x32_[1234n].o): New targets.
1521 (split_x32_[124]): New targets.
1522 (split_x32_[1234r].stdout): New targets.
1523 * testsuite/split_x32.sh: New file.
1524 * testsuite/split_x32_1.s: Likewise.
1525 * testsuite/split_x32_2.s: Likewise.
1526 * testsuite/split_x32_3.s: Likewise.
1527 * testsuite/split_x32_4.s: Likewise.
1528 * testsuite/split_x32_n.s: Likewise.
1529 * configure: Regenerated.
1530 * testsuite/Makefile.in: Likewise.
1531
e749cab8
L
15322015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1533
1534 PR gold/17809
1535 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1536 x32.
1537
af759df0
AM
15382015-01-02 Alan Modra <amodra@gmail.com>
1539
1540 * version.cc (print_version): Just print current year.
1541 * dwp.cc (print_version): Likewise.
1542
b90efa5b
AM
15432015-01-01 Alan Modra <amodra@gmail.com>
1544
1545 Update year range in copyright notice of all files.
1546
f12d1e8a
AM
15472014-12-25 Alan Modra <amodra@gmail.com>
1548
1549 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1550 new enums.
1551 (Target_arm::merge_object_attributes, ): Likewise.
1552
5c294fee
TG
15532014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1554
1555 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1556 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1557 AEABI_VFP_args_vfp to check that.
1558 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1559 value and replace hardcoded values by enum values.
1560
e30880c2
CC
15612014-12-22 Cary Coutant <ccoutant@google.com>
1562
1563 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1564
bd040da1
L
15652014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1566
1567 PR gold/14608
1568 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1569 to "return i * i * 3;".
1570
e02a4046
CC
15712014-12-16 Cary Coutant <ccoutant@google.com>
1572
1573 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1574 (Mapfile::print_output_data): Use current_data_size() to avoid
1575 assert for sections requiring postprocessing; if address is not valid,
1576 print 0.
1577 (Mapfile::print_output_section): Use current_data_size(); print note
1578 that addresses and sizes are before compression.
1579
add6016b
L
15802014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1581
1582 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1583 Cast current_group_size to unsigned long when reporting error.
1584
0bf32ea9
JY
15852014-12-10 Jing Yu <jingyu@google.com>
1586
1587 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1588 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1589 Update error message.
1590 (Target_aarch64::do_relax): Use absolute value of option
1591 stub_group_size. Replace local variable with class member
1592 stub_group_size_.
1593
cbcb23fa
AM
15942014-12-04 Alan Modra <amodra@gmail.com>
1595
1596 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1597 addend of PLTREL24 reloc when not generating a plt stub. Make
1598 max_branch_offset an "Address".
fbad6518 1599 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1600 (Target_powerpc::Relocate::relocate): Likewise.
1601
1611bc4a
AM
16022014-12-04 Alan Modra <amodra@gmail.com>
1603
1604 PR 17670
1605 * symtab.cc (Symbol::set_undefined): Remove assertion.
1606 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1607 on symbols defined in discarded sections, instead return false.
1608 Rearrange params, update all callers.
1609 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1610 branches to syms in discarded sections.
1611 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1612 undefined and flag as discarded.
1613 (Target_powerpc::Relocate::relocate): Localize variable.
1614
4759c34e
L
16152014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1616
1617 PR gold/17675
1618 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1619 * testsuite/Makefile.in: Regenerated.
1620
1f98a074
AM
16212014-12-03 Alan Modra <amodra@gmail.com>
1622
1623 PR 17566
1624 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1625 when adding dynamic relocations against section symbols.
1626
fb257835
DI
16272014-12-01 Dimitry Ivanov <dimitry@google.com>
1628
1629 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1630 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1631 * options.h (General_options): New -z option (global).
1632
d8e60314
CC
16332014-12-01 Cary Coutant <ccoutant@google.com>
1634
1635 PR gold/17578
1636 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1637 is given.
1638 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1639 given but some inputs require executable stack.
1640
982bbd97
CC
16412014-11-26 Cary Coutant <ccoutant@google.com>
1642
1643 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1644 .debug_str_offsets; strip .debug_gnu_pubnames and
1645 .debug_gnu_pubtypes.
1646 (lines_only_debug_sections): Strip all four new sections.
1647
bb779192
HS
16482014-11-26 Jing Yu <jingyu@google.com>
1649
1650 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1651 register to be x0 when to relax TLSDESC_LD64_LO12.
1652
a3e60ddb
AM
16532014-11-26 Alan Modra <amodra@gmail.com>
1654
1655 * powerpc.cc (struct Stub_table_owner): New.
1656 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1657 unsigned int vector. Update all references.
1658 (powerpc_relobj::set_stub_table): Take an unsigned int param
1659 rather than a Stub_table. Update callers.
1660 (Powerpc_relobj::clear_stub_table): New function.
1661 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1662 stub_group_size_ vars.
1663 (Target_powerpc::new_stub_table): Delete.
1664 (max_branch_delta): New function, extracted from..
1665 (Target_powerpc::Relocate::relocate): ..here..
1666 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1667 status on whether stub created successfully.
1668 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1669 default sizing to..
1670 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1671 reduce on relax failure.
1672 (Target_powerpc::group_sections): Add "no_size_errors" param.
1673 Use stub_group_size_. Set up group info in a temp vector,
1674 before building Stub_table vector. Account for input sections
1675 possibly already converted to relaxed sections.
1676 (Stub_table::init): Delete. Merge into..
1677 (Stub_table::Stub_table): ..here.
1678 (Stub_table::can_reach_stub): New function.
1679 (Stub_table::add_plt_call_entry): Add "from" parameter and
1680 return true iff stub could be reached.
1681 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1682 param too.
1683 (Stub_table::clear_stubs): Add "all" param.
1684
a20605cf
AM
16852014-11-26 Alan Modra <amodra@gmail.com>
1686
1687 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1688 (Target_powerpc::group_sections): Use it.
1689
43b64deb
CC
16902014-11-25 Cary Coutant <ccoutant@google.com>
1691
1692 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1693 (Binary_to_elf::write_symbol): Add st_size parameter.
1694 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1695
c924eb67
CC
16962014-11-25 Cary Coutant <ccoutant@google.com>
1697
1698 PR gold/17639
1699 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1700 (Sized_relobj_file::do_layout): Handle deferred sections properly
1701 during GC pass 1. Don't add reloc sections to deferred list twice.
1702 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1703 (Sized_relobj_file::is_deferred_layout_): New data member.
1704
9d585188
L
17052014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1706
1707 PR gold/17619
1708 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1709 Check PC-relative offset overflow in PLT entry.
1710
3ffaac20
AM
17112014-11-21 Alan Modra <amodra@gmail.com>
1712
1713 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1714 for undefined weaks.
1715
0cfb0717
AM
17162014-11-20 Alan Modra <amodra@gmail.com>
1717
1718 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1719 from --stub-group-size parameter divided by 1024.
1720 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1721 template parameter. Update all uses.
1722 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1723 has_stub_value. Set for long branches. Don't report overflow for
1724 branch to undefined weak symbols. Print info message on
1725 overflowing branch to stub.
1726
f9dffbf0
AM
17272014-11-20 Alan Modra <amodra@gmail.com>
1728
1729 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1730
e88ba8d5
L
17312014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1732
1733 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1734 entry for R_X86_64_GOTPLT64.
1735 (Target_x86_64<size>::Relocate::relocate): Update comments for
1736 R_X86_64_GOTPLT64.
1737
d37ffe25
ED
17382014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1739
1740 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1741 * plugin.h: add lock definition
1742
9726c3c1
HS
17432014-10-29 Han Shen <shenhan@google.com>
1744 Jing Yu <jingyu@google.com>
1745
1746 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1747 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1748 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1749 Symbol::TLS_REF.
1750 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1751 method.
1752 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1753 (Target_aarch64::tls_ld_to_le): New method.
1754 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1755 for 64bit targets.
1756 (Output_data_plt_aarch64::irelative_rel_): New data member.
1757 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1758 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1759 (Output_data_plt_aarch64::add_relocation): New method.
1760 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1761 offset. Add got_irelative size to got size.
1762 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1763 type string with the new typename.
1764 (AArch64_relocate_functions::update_adr): Replace parameter x with
1765 immed.
1766 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1767 (AArch64_relocate_functions::reloc_common): New method.
1768 (AArch64_relocate_funcsions::rela_general): Extract common part out
1769 into reloc_common method.
1770 (AArch64_relocate_functions::rela_general): Likewise.
1771 (AArch64_relocate_functions::pcrela_general): Likewise.
1772 (AArch64_relocate_functions::adr): New method.
1773 (AArch64_relocate_functions::adrp): Calculate immed before calling
1774 update_adr.
1775 (AArch64_relocate_functions::adrp): Likewise.
1776 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1777 comparing x to 0. Calculate immed from ~x when x < 0.
1778 (Target_aarch64::optimize_tls_reloc): Add new cases for
1779 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1780 TLSLD_MOVW_DTPREL_G0_NC.
1781 (Target_aarch64::possible_function_pointer_reloc): Implement this
1782 method.
1783 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1784 comment.
1785 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1786 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1787 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1788 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1789 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1790 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1791 (Target_aarch64::make_plt_entry): Call add_entry with two more
1792 parameters.
1793 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1794 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1795 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1796 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1797 (Target_aarch64::Relocate::relocate_tls): Add cases for
1798 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1799 TLSLD_MOVW_DTPREL_G0_NC.
1800 * testsuite/icf_safe_so_test.cc: Correct test comment.
1801 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1802
80272b8c
AM
18032014-10-22 Alan Modra <amodra@gmail.com>
1804
1805 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1806 thread_starter.
1807
998a69f4
AS
18082014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1809
1810 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1811
aed56ec5
CC
18122014-10-17 Cary Coutant <ccoutant@google.com>
1813
1814 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1815 Add "typename" keyword.
1816
bb779192 18172014-10-15 Han Shen <shenhan@google.com>
72f4393d 1818 Jing Yu <jingyu@google.com>
83a01957
HS
1819
1820 Patch for gold aarch64 backend to support relaxation.
1821 * aarch64-reloc.def: Change format.
1822 * aarch64.cc (class Reloc_stub): New class.
1823 (class Stub_table): New class.
1824 (class AArch64_relobj): New class.
1825 (class AArch64_input_section): New class.
1826 (class AArch64_output_section): New class.
1827 (Target_aarch64::new_stub_table): New method.
1828 (Target_aarch64::new_aarch64_input_section): New method.
1829 (Target_aarch64::find_aarch64_input_section): New method.
1830 (Target_aarch64::scan_section_for_stubs): New method.
1831 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1832 (Target_aarch64::relocate_stub): New method.
1833 (Target_aarch64::current_target): New method.
1834 (Target_aarch64::do_make_elf_object): New method.
1835 (Target_aarch64::do_may_relax): New method.
1836 (Target_aarch64::do_relax): New method.
1837 (Target_aarch64::group_sections): New method.
1838 (Target_aarch64::scan_reloc_for_stub): New method.
1839 (Target_aarch64::do_make_output_section): New method.
1840 (Target_aarch64::stub_tables_): New data member.
1841 (Target_aarch64::aarch64_input_section_map_): New data member.
1842 (AArch64_relocate_functions::maybe_apply_stub): New method.
1843
db4c9594
CC
18442014-09-30 Cary Coutant <ccoutant@google.com>
1845
1846 PR gold/17432
1847 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1848
cd6da036
KC
18492014-09-30 Kito Cheng <kito@0xlab.org>
1850
1851 PR gold/13597
1852 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1853 hash table before sysv-style hash table.
1854
5f772412
ST
18552014-09-29 Sriraman Tallam <tmsriram@google.com>
1856
1857 * options.h (--pic-executable): Add negative to alias to -no-pie.
1858
5efeedf6
CC
18592014-09-26 Cary Coutant <ccoutant@google.com>
1860
1861 PR gold/16773
1862 * object.cc (Sized_relobj_file): Compute value of section symbols
1863 for TLS sections the same as TLS symbols.
1864
1707f183
CC
18652014-09-25 Cary Coutant <ccoutant@google.com>
1866
1867 PR gold/17432
1868 * resolve.cc (Symbol_table::resolve): Override common placeholder
1869 symbols, but adjust sizes.
1870 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1871 symbols to common lists.
1872
00cac886
AM
18732014-09-24 Alan Modra <amodra@gmail.com>
1874
1875 * po/POTFILES.in: Regenerate.
1876
635aa30e 18772014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1878 Cary Coutant <ccoutant@google.com>
635aa30e 1879
71b9b91b 1880 PR gold/14860
635aa30e
CC
1881 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1882 on input_sections_blocker.
1883 * layout.cc (Write_sections_task::locks): Unblock
1884 input_sections_blocker_.
1885 * layout.h (Write_sections_task::Write_sections_task): Add
1886 input_sections_blocker.
1887 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1888 to DEPENDENCIES.
1889 * testsuite/Makefile.in: Regenerate.
1890
c0c71592
RÁE
18912014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1892
1893 * testsuite/Makefile.am (plugin_test_10): New test.
1894 * testsuite/Makefile.in: Regenerate
1895 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1896 * testsuite/plugin_test_10.sh: New file.
1897
6168c2a1
RÁE
18982014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1899
1900 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1901 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1902 during the replacement phase.
1903
3a531937
JY
19042014-09-17 Han Shen <shenhan@google.com>
1905 Jing Yu <jingyu@google.com>
1906
1907 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1908 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1909 * aarch64.cc (Target_aarch64): Add data members
1910 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1911 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1912 constructor.
1913 (Target_aarch64::do_reloc_symbol_index): New method.
1914 (Target_aarch64::do_reloc_addend): New method.
1915 (Target_aarch64::add_tlsdesc_info): New method.
1916 (Target_aarch64::do_dynsym_value): New method.
1917 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1918 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1919 (Target_aarch64::make_data_plt): Add new parameters: got,
1920 got_irelative. Pass them to do_make_data_plt.
1921 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1922 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1923 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1924 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1925 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1926 (Target_aarch64::got_tlsdesc_section): New method.
1927 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1928 (Target_aarch64::define_tls_base_symbol): New method.
1929 (Target_aarch64::reserve_tlsdesc_entries): New method.
1930 (Target_aarch64::got_mod_index_entry): New method.
1931 (Target_aarch64::rela_tlsdesc_section): New method.
1932 (Target_aarch64::rela_irelative_section): New method.
1933 (Target_aarch64::Tlsdesc_info): New struct.
1934 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1935 relocations and tlsdesc relocations.
1936 (Target_aarch64::optimize_tls_reloc): Implement method.
1937 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1938 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1939 in constructor.
1940 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1941 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1942 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1943 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1944 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1945 (Output_data_plt_aarch64::rela_irelative): New method.
1946 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1947 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1948 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1949 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1950 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1951 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1952 (Output_data_plt_aarch64_standard): New member variables:
1953 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1954 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1955 New parameter: got, got_irelative.
1956 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1957 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1958 (Output_data_plt_aarch64::do_write): Replace got_address with
1959 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1960 (AArch64_relocate_functions::update_movnz): New method.
1961 (AArch64_relocate_functions): Correct format.
1962 (AArch64_relocate_functions::movnz): New method.
1963 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1964 before the switch. Add new cases to switch.
00cac886 1965 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1966 tlsgd tlsdesc cases.
1967 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1968 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1969 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1970 Call reloc_name_in_error_message to print unsupported reloc.
1971 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1972 make_data_plt.
1973 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1974 relocs. Fill in some more dynamic tags.
1975 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1976 Skip call tls_get_addr when tlsgd is relaxed.
1977 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1978 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1979 tlsdesc->ie relaxation.
1980
62661c93
SS
19812014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1982
1983 * mips.cc (Target_mips_nacl): New class.
1984 (Target_selector_mips_nacl): New class.
1985 (target_selector_mips32): Rename from target_selector_mips32be and use
1986 Target_selector_mips_nacl instead of Target_selector_mips.
1987 (target_selector_mips32el): Rename from target_selector_mips32 and use
1988 Target_selector_mips_nacl instead of Target_selector_mips.
1989 (target_selector_mips64): Rename from target_selector_mips64be and use
1990 Target_selector_mips_nacl instead of Target_selector_mips.
1991 (target_selector_mips64el): Rename from target_selector_mips64 and use
1992 Target_selector_mips_nacl instead of Target_selector_mips.
1993 (Target_mips::mips_info): Add const attribute.
1994
54674d38
CC
19952014-09-02 Cary Coutant <ccoutant@google.com>
1996
1997 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1998 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1999 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2000 (Sized_incr_dynobj::do_section_name): Likewise.
2001 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2002 (Sized_incr_dynobj::do_section_name): Likewise.
2003 * object.h (Object::section_name): Likewise.
2004 (Object::do_section_name): Likewise.
2005 (Sized_relobj_file::do_section_name): Likewise.
2006 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2007 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2008
9860cbcf
CC
20092014-09-02 Cary Coutant <ccoutant@google.com>
2010
2011 PR gold/17005
2012 * ehframe.cc (Fde::write): Add output_offset parameter.
2013 (Cie::write): Likewise.
2014 (Eh_frame::set_final_data_size): Account for offset within output
2015 section.
2016 (Eh_frame::do_sized_write): Likewise.
2017 * ehframe.h (Fde::write): Add output_offset parameter.
2018 (Cie::write): Likewise.
2019 * output.cc (Output_section::Input_section_sort_entry): Remove
2020 section_has_name_; add output_section_name parameter. Use
2021 output section name for non-input sections.
2022 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2023 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2024 (Output_section::Input_section_sort_compare): Remove logic for
2025 sections without names.
2026 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2027 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2028 Likewise.
2029 (Output_section::Input_section_sort_section_name_compare): Likewise.
2030
8e33481e
HS
20312014-08-29 Han Shen <shenhan@google.com>
2032 Jing Yu <jingyu@google.com>
2033
2034 * aarch64-reloc-property.cc
2035 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2036 reference reloc property in the table.
2037 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2038 3 other entries.
2039 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2040 2 new overloaded methods.
2041 (Output_data_got_aarch64::do_write): Add code to write out
2042 static relocs.
2043 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2044 static relocs.
2045 (Output_data_got_aarch64::static_relocs): New vector to
2046 hold static relocs.
2047 (Target_aarch64::TCB_SIZE): New const static memeber.
2048 (Target_aarch64::tcb_size): New method.
2049 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2050 (Target_aarch64::Relocate::relocate_tls): New method.
2051 (Target_aarch64::Scan::local): Add code handling new reloc types.
2052 (Target_aarch64::Scan::global): Add code handling new reloc types.
2053
81233653
ST
20542014-08-13 Sriraman Tallam <tmsriram@google.com>
2055
2056 * options.h (-no-pie): Add option.
2057
9363c7c3
JY
20582014-08-08 Jing Yu <jingyu@google.com>
2059 Han Shen <shenhan@google.com>
2060
2061 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2062 (DEFFILES): add aarch64-reloc.def.
2063 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2064 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2065 * Makefile.in: Regenerate.
2066 * aarch64-reloc-property.cc: New file.
2067 * aarch64-reloc-property.h: New file.
2068 * aarch64-reloc.def: New file.
2069 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2070 with tab to make the format consistent.
2071 (Output_data_got_aarch64::symbol_table_): New method.
2072 (Target_aarch64::do_plt_address_for_global): New method.
2073 (Target_aarch64::do_plt_address_for_local): New method.
2074 (Target_aarch64::do_select_as_default_target): New method.
2075 (Target_aarch64::do_make_data_plt): New method.
2076 (Target_aarch64::make_data_plt): New method.
2077 (Output_data_plt_aarch64::has_irelative_section): New method.
2078 (Output_data_plt_aarch64::address_for_global): New method.
2079 (Output_data_plt_aarch64::address_for_local): New method.
2080 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2081 (Output_data_plt_aarch64::add_entry): Implement contents.
2082 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2083 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2084 the got_pov entry to plt0.
2085 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2086 Implement contents.
2087 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2088 (AArch64_howto): New struct.
2089 (aarch64_howto[]): New static const array.
2090 (AArch64_relocate_functions): New class.
2091 (Target_aarch64::Scan::get_reference_flags): Remove method.
2092 (Target_aarch64::Scan::local): Implement to support a few relocations.
2093 (Target_aarch64::Scan::global): Implement to support a few relocations.
2094 (Target_aarch64::make_plt_section): Implement contents.
2095 (Target_aarch64::make_plt_entry): Implement contents.
2096 (Target_aarch64::do_finalize_sections): Implement contents.
2097 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2098 (Target_aarch64::relocate_section): Implement contents.
2099
ad9fe6c1
AM
21002014-08-06 Alan Modra <amodra@gmail.com>
2101
2102 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2103
7cd4e5b7
AM
21042014-08-06 Alan Modra <amodra@gmail.com>
2105
2106 PR 13227
2107 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2108
5ad9b0a7
ST
21092014-07-21 Sriraman Tallam <tmsriram@google.com>
2110
2111 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2112 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2113
e051745c
CC
21142014-07-08 Cary Coutant <ccoutant@google.com>
2115
2116 * expression.cc (struct Expression::Expression_eval_info): Add
2117 new fields type_pointer, vis_pointer, and nonvis_pointer.
2118 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2119 nonvis_pointer parameters. Adjust all calls.
2120 (Symbol_expression::value): Update type, visibility, and nonvis bits
2121 in caller.
2122 * script.cc (Symbol_assignment::sized_finalize): Update type,
2123 visibility, and remaining st_other bits for new symbol.
2124 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2125 vis_pointer, and nonvis_pointer parameters.
2126 * symtab.h (Symbol::set_type): New method.
2127
2128 * testsuite/Makefile.am (defsym_test): New test.
2129 * testsuite/Makefile.in: Regenerate.
2130 * testsuite/defsym_test.c: New file.
2131 * testsuite/defsym_test.sh: New file.
2132
f35c4853
CC
21332014-07-08 Cary Coutant <ccoutant@google.com>
2134
2135 PR gold/15639
2136 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2137 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2138 (Sized_dynobj::base_read_symbols): ...new method.
2139 * object.h (Sized_relobj_file::base_read_symbols): New method.
2140 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2141 (Sized_relobj_file::base_read_symbols): ...new method.
2142 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2143 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2144 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2145
2900af2d
AM
21462014-07-04 Alan Modra <amodra@gmail.com>
2147
2148 * po/POTFILES.in: Regenerate.
2149
053a4d68
JY
21502014-07-02 Jing Yu <jingyu@google.com>
2151
2152 * aarch64.cc: New file
2153 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2154 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2155 * Makefile.in: Regenerate.
2156 * configure.tgt: Add entries for aarch64*.
2157 * configure.ac: Likewise.
2158 * configure: Likewise.
2159
7b549045
AM
21602014-06-27 Alan Modra <amodra@gmail.com>
2161
2162 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2163
cb818dbf
CC
21642014-06-24 Cary Coutant <ccoutant@google.com>
2165
2166 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2167 sections.
2168 (Dwo_file::sized_read_unit_index): Likewise.
2169
9810d34d
SS
21702014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2171
2172 * mips.cc: New file.
2173 * Makefile.am (TARGETSOURCES): Add mips.cc
2174 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2175 * configure.tgt: Add entries for mips*.
2176 * configure.ac: Likewise.
2177 * Makefile.in: Regenerate.
2178 * configure: Likewise.
2179
9baa787b
CC
21802014-06-09 Cary Coutant <ccoutant@google.com>
2181
2182 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2183 unit_length is within section bounds.
2184
8f89af0a
CC
21852014-06-09 Cary Coutant <ccoutant@google.com>
2186
2187 PR gold/16980
2188 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2189 map.
2190
a47622ac
AM
21912014-06-07 Alan Modra <amodra@gmail.com>
2192
2193 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2194
4320c691
CC
21952014-06-06 Cary Coutant <ccoutant@google.com>
2196
2197 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2198 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2199 (Dwarf_pubnames_table::read_header): Likewise.
2200 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2201 .debug_gnu_pubtypes.
2202
270c9937
JB
22032014-06-05 Joel Brobecker <brobecker@adacore.com>
2204
2205 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2206 * Makefile.in, configure: Regenerate.
2207
397998fc
AM
22082014-06-03 Alan Modra <amodra@gmail.com>
2209
2210 * powerpc.cc (addis_12_2): Define.
2211 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2212
61f5c66f
AM
22132014-06-03 Alan Modra <amodra@gmail.com>
2214
2215 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2216 st_other output.
2217
f6971787
AM
22182014-06-02 Alan Modra <amodra@gmail.com>
2219
2220 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2221 Only ignore relocs on ELFv1.
2222 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2223
f6fb8322
CC
22242014-05-30 Cary Coutant <ccoutant@google.com>
2225
2226 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2227 * testsuite/Makefile.in: Regenerate.
2228 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2229
c23dd342
L
22302014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2231
2232 PR gold/16945
2233 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2234 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2235
5fe7ffdc
AM
22362014-05-15 Alan Modra <amodra@gmail.com>
2237
2238 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2239 Compare FDE contents with DW_CFA_nop rather than 0.
2240
a82bef93
ST
22412014-05-13 Sriraman Tallam <tmsriram@google.com>
2242
2243 * symtab.h (may_need_copy_reloc): Remove check for position independent
2244 code.
2245 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2246 position independence before pc absolute may_need_copy_reloc call.
2247 Add check for executable output befor pc relative may_need_copy_reloc
2248 call.
2249 * i386.cc: Ditto.
2250 * arm.cc: Ditto.
2251 * sparc.cc: Ditto.
2252 * tilegx.cc: Ditto.
2253 * powerpc.cc: Add check for no position independence before
2254 may_need_copy_reloc calls.
2255 * testsuite/pie_copyrelocs_test.cc: New file.
2256 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2257 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2258 * Makefile.in: Regenerate.
a82bef93 2259
53c66605
ML
22602014-05-08 Martin Liška <mliska@suse.cz>
2261
2262 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2263
57b2284c
CC
22642014-05-06 Cary Coutant <ccoutant@google.com>
2265
2266 PR gold/16900
2267 * i386.cc (Output_data_got_plt_i386): New class.
2268 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2269 parameter. Change all callers.
2270 (Output_data_plt_i386::layout_): Remove.
2271 (Output_data_plt_i386::got_plt_): Change type.
2272 (Target_i386::got_plt_): Change type. Change all references.
2273 (Target_i386::got_section): Create instance of new class.
2274 (Output_data_got_plt_i386::do_write): New function.
2275 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2276 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2277 parameter. Change all callers.
2278 (Output_data_plt_x86_64::layout_): Remove.
2279 (Output_data_plt_x86_64::got_plt_): Change type.
2280 (Target_x86_64::got_plt_): Change type. Change all references.
2281 (Target_x86_64::got_section): Create instance of new class.
2282 (Output_data_got_plt_x86_64::do_write): New function.
2283 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2284 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2285 class.
2286
6b97515d 22872014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2288
6b97515d
CC
2289 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2290 if we have pubnames/pubtypes.
2291
d1bddd3c
CC
22922014-05-02 Cary Coutant <ccoutant@google.com>
2293
5fe7ffdc
AM
2294 * defstd.cc (in_segment): Define __ehdr_start here...
2295 * layout.cc (Layout::finalize): ...Instead of here. Set the
2296 output segment when known.
2297 * resolve.cc (Symbol::override_base_with_special): Remember
2298 the original binding.
2299 * symtab.cc (Symbol::set_output_segment): New function.
2300 (Symbol::set_undefined): New function.
2301 * symtab.h (Symbol::is_weak_undefined): Check original undef
2302 binding.
2303 (Symbol::is_strong_undefined): New function.
2304 (Symbol::set_output_segment): New function.
2305 (Symbol::set_undefined): New function.
2306 * target-reloc.h (is_strong_undefined): Remove.
2307 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2308 Check for hidden undefs.
2309 (relocate_section): Call Symbol::is_strong_undefined.
2310
2311 * testsuite/Makefile.am (ehdr_start_test_1)
2312 (ehdr_start_test_2, ehdr_start_test_3)
2313 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2314 * testsuite/Makefile.in: Regenerate.
2315 * testsuite/ehdr_start_def.cc: New source file.
2316 * testsuite/ehdr_start_test.cc: New source file.
2317 * testsuite/ehdr_start_test.t: New linker script.
2318 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2319
7849f6d8
CC
23202014-04-23 Cary Coutant <ccoutant@google.com>
2321
bf2cc635 2322 PR gold/16870
7849f6d8
CC
2323 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2324
99fd8cff
CC
23252014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2326
2327 * layout.cc (Layout::include_section): Allow a target to decide
2328 whether to include a section.
2329 * target.h (Target::should_include_section): New function.
2330 (Target::do_should_include_section): New function.
2331
91f43acd
CC
23322014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2333
2334 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2335 inline into ...
2336 (Copy_relocs::emit): ... here.
2337 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2338 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2339 (Copy_reloc_entry::entries_): Change from private to protected.
2340
c4eb27e1
ST
23412014-04-02 Sriraman Tallam <tmsriram@google.com>
2342
2343 * icf.cc (get_section_contents): Replace copies of reloc
2344 vectors with const references.
2345
ae447ddd
CC
23462014-04-02 Cary Coutant <ccoutant@google.com>
2347
2348 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2349 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2350 * configure: Regenerate.
2351 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2352 -fno-use-linker-plugin.
2353 (LINK1, CXXLINK1): Add it to the link command.
2354 * testsuite/Makefile.in: Regenerate.
2355
fa47fa92
AM
23562014-03-12 Alan Modra <amodra@gmail.com>
2357
2358 * Makefile.in: Regenerate.
2359
9b12c500
CC
23602014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2361
2362 * symtab.h (Symbol::set_nonvis): New function.
2363
beacaa96
CC
23642014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2365
2366 * symtab.cc (Sized_symbol<32>::init_output_data):
2367 Instantiate the template.
2368 (Sized_symbol<64>::init_output_data): Likewise.
2369
800d9823
CC
23702014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2371
2372 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2373 adjust dynamic symbol value.
2374 * target.h (Target::adjust_dyn_symbol): New function.
2375 (Target::do_adjust_dyn_symbol): New function.
2376
918fc1f8 23772014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2378
918fc1f8
CC
2379 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2380 Get the value of DYNAMIC_CUSTOM dynamic entry.
2381 * output.h (Output_data_dynamic::add_custom): New function.
2382 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2383 dynamic entry.
2384 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2385 * target.h (Target::dynamic_tag_custom_value): New function.
2386 (Target::do_dynamic_tag_custom_value): New function.
2387
98ff9231
CC
23882014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2389
2390 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2391 dynsym indexes.
2392 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2393 (Target::do_has_custom_set_dynsym_indexes): New function.
2394 (Target::set_dynsym_indexes): New function.
2395 (Target::do_set_dynsym_indexes): New function.
2396
b80eed39
AM
23972014-03-07 Alan Modra <amodra@gmail.com>
2398
2399 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2400 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2401 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2402 (Powerpc_relocate_functions::has_overflow_bitfield,
2403 overflowed): Use the above.
2404 (Target_powerpc::Relocate::relocate): Correct overflow checking
2405 for a number of relocations. Modify overflow test for 16-bit
2406 fields in instructions to signed/unsigned according to whether
2407 the field takes a signed or unsigned value.
2408
4b95cf5c
AM
24092014-03-05 Alan Modra <amodra@gmail.com>
2410
2411 Update copyright years.
2412
45965137
AM
24132014-03-05 Alan Modra <amodra@gmail.com>
2414
2415 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2416 R_PPC64_ADDR64_LOCAL.
2417 (Target_powerpc::Relocate::relocate): Likewise.
2418
2c80b753
AM
24192014-03-03 Alan Modra <amodra@gmail.com>
2420
2421 * dwp.cc (print_version): Update copyright year to current.
2422
c1c69e83
AM
24232014-02-10 Alan Modra <amodra@gmail.com>
2424
2425 * po/gold.pot: Regenerate.
2426
dd0c4e70
CC
24272014-02-06 Cary Coutant <ccoutant@google.com>
2428
2429 Fix problem where -u is ignored when a weak undef is seen.
2430
2431 * archive.cc (Library_base::should_include_member): Reorder
2432 code to check for -u option if a weak undef has already been seen.
2433 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2434 * testsuite/Makefile.in: Regenerate.
2435 * testsuite/weak_undef_file3.cc: New file.
2436 * testsuite/weak_undef_file4.cc: New file.
2437 * testsuite/weak_undef_test_2.cc: New file.
2438
1a221d3d
CC
24392014-02-05 Cary Coutant <ccoutant@google.com>
2440
2441 Fix issues with gold undefined symbol diagnostics.
2442
2443 PR binutils/15435
2444 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2445 check to here.
2446 * target-reloc.h (is_strong_undefined): New function.
2447 (relocate_section): Move undef vtable symbol check from here.
2448 Check for is_strong_undefined.
2449
e889f0a4 24502014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2451
e889f0a4
CC
2452 Fix problems with the --dynamic-list option.
2453
2454 PR gold/13577
2455 * options.cc (General_options::parse_dynamic_list):
2456 Set have_dynamic_list_.
2457 (General_options::General_options): Initialize have_dynamic_list_.
2458 (General_options::finalize): Turn off -Bsymbolic and
2459 -Bsymbolic-functions if --dynamic-list provided.
2460 * options.h (General_options::have_dynamic_list): New function.
2461 (General_options::have_dynamic_list_): New data member.
2462 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2463 correctly.
5fe7ffdc 2464
e889f0a4
CC
2465 PR gold/16530
2466 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2467 in --dynamic-list, mark it.
5fe7ffdc 2468
e889f0a4
CC
2469 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2470 (dynamic_list_2): New test case.
2471 * testsuite/Makefile.in: Regenerate.
2472 * testsuite/dynamic_list_2.cc: New file.
2473 * testsuite/dynamic_list_2.t: New file.
2474 * testsuite/dynamic_list_lib1.cc: New file.
2475 * testsuite/dynamic_list_lib2.cc: New file.
2476 * testsuite/gc_dynamic_list_test.c: New file.
2477 * testsuite/gc_dynamic_list_test.sh: New file.
2478 * testsuite/gc_dynamic_list_test.t: New file.
2479
ec673e64
CC
24802014-01-28 Cary Coutant <ccoutant@google.com>
2481
2482 Add .gdb_index version 7 support.
2483
2484 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2485 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2486 debug sections.
2487 (Dwarf_ranges_table::read_ranges_table): Likewise.
2488 (Dwarf_pubnames_table::read_section): Check for GNU-style
2489 sections, and for compressed debug sections.
2490 (Dwarf_pubnames_table::read_header): Compute end address of table.
2491 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2492 for end of list by offset, not by offset == 0.
2493 (Dwarf_info_reader::do_read_string_table): Check for compressed
2494 debug sections.
2495 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2496 Initialize new data members.
2497 (Dwarf_pubnames_table::next_name): return flag_byte.
2498 (Dwarf_pubnames_table::end_of_table_): New data member.
2499 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2500 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2501 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2502 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2503 read skeleton type unit DIEs.
2504 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2505 (Gdb_index::do_write): Write flag_byte.
2506 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2507 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2508 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2509 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2510
221fd5d5
L
25112014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2512
2513 * version.cc (print_version): Update copyright year to 2014.
2514
6c09fb0b
ILT
25152013-12-19 Dimitry Andric <dimitry@andric.com>
2516
2517 * stringpool.cc (Stringpool_template::reserve): Add
2518 HAVE_UNORDERED_MAP case.
2519 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2520
8356f2d0
CC
25212013-12-18 Cary Coutant <ccoutant@google.com>
2522
2523 * configure.ac: Check for <unordered_set> and <unordered_map>.
2524 * config.in: Regenerate.
2525 * configure: Regenerate.
2526 * system.h: Use <unordered_set> and <unordered_map> if available.
2527
f2c7d7ee
RM
25282013-12-10 Roland McGrath <mcgrathr@google.com>
2529
2530 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2531 with $(INSTALL_PROGRAM_ENV).
2532 * Makefile.in: Regenerate.
2533
6632e8cc
CC
25342013-11-22 Cary Coutant <ccoutant@google.com>
2535
2536 * configure.ac: Add check for which library is needed for
2537 dlopen.
2538 * configure: Regenerate.
2539
0c075858
CC
25402013-11-22 Cary Coutant <ccoutant@google.com>
2541
2542 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2543 assembler.
2544 * testsuite/Makefile.in: Regenerate.
2545
f49fe902
L
25462013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2547
2548 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2549 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2550 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2551 (Target_x86_64<size>::Scan::local): Likewise.
2552 (Target_x86_64<size>::Scan::global): Likewise.
2553 (Target_x86_64<size>::Relocate::relocate): Likewise.
2554 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2555 Likewise.
2556 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2557 R_X86_64_PC32_BND.
2558
2559 * testsuite/Makefile.am (check_PROGRAMS): Add
2560 exception_x86_64_bnd_test.
2561 (exception_x86_64_bnd_test_SOURCES): New macro.
2562 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2563 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2564 (exception_x86_64_bnd_test_LDADD): Likewise.
2565 (exception_x86_64_bnd_1.o): New rule.
2566 (exception_x86_64_bnd_2.o): Likewise.
2567 * testsuite/Makefile.in: Regenerated.
2568
9055360d
AM
25692013-11-15 Alan Modra <amodra@gmail.com>
2570
2571 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2572 accessor.
2573 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2574 Only call ppc64_local_entry_offset for 64-bit. Restrict
2575 symval_for_branch lookup to ELFv1.
2576 (Stub_table::add_plt_call_entry): Use unsigned int off.
2577 (Output_data_glink::Address, invalid_address): New.
2578 (Output_data_glink::add_eh_frame): Move out of line. Add
2579 support for ELFv2.
2580 (Output_data_glink::add_global_entry, find_global_entry,
2581 global_entry_address): New functions.
2582 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2583 ge_size): New variables.
2584 (Output_data_glink::set_final_data_size): Add global entry
2585 stub sizing.
2586 (Output_data_glink::do_write): Write global entry stubs.
2587 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2588 parameter. Return true for ELFv2. Adjust callers.
2589 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2590 ELFv1. Similarly for ifunc and dynamic relocation processing
2591 specific to ELFv1. Recognize that symbols are defined on
2592 their plt entries for ELFv2.
2593 (Target_powerpc::symval_for_branch): Assert if called for
2594 ELFv2 or ppc32.
2595 (Target_powerpc::Relocate::relocate): Use global entry plt
2596 stub for symbol value if such exists on ELFv2.
2597 (Target_powerpc::Relocate::relocate): Don't call
2598 symval_for_branch when ELFv2. Do adjust for local entry
2599 offset when ELFv2.
2600 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2601 plt stub for ELFv2.
2602 (Target_powerpc::do_plt_address_for_global): Similarly.
2603
cafdd569
CC
26042013-11-14 Cary Coutant <ccoutant@google.com>
2605
2606 Revert patch -- this did not fix the problem, and there is
2607 no race there.
2608
2609 2013-11-14 Cary Coutant <ccoutant@google.com>
2610
2611 PR gold/14860
2612 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2613 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2614 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2615 updating fde_offsets_.
2616 (Eh_frame_hdr::lock_): New data member.
2617
94e49e16
CC
26182013-11-14 Cary Coutant <ccoutant@google.com>
2619
2620 * dwp.cc (Dwo_file_entry): New type.
2621 (File_list): Use Dwo_file_entry.
2622 (Dwo_file::verify): New function.
2623 (Dwo_file::verify_dwo_list): New function.
2624 (Dwo_file::sized_verify_dwo_list): New function.
2625 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2626 list.
2627 (Dwp_options): New enum type.
2628 (dwp_options): Add --verify-only.
2629 (usage): Likewise.
2630 (main): Likewise.
2631 * dwp.h (gold_info): Add declaration.
2632
7cdd7d57
CC
26332013-11-14 Cary Coutant <ccoutant@google.com>
2634
2635 PR gold/14860
2636 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2637 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2638 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2639 updating fde_offsets_.
2640 (Eh_frame_hdr::lock_): New data member.
2641
1d946cb3
CC
26422013-11-06 Cary Coutant <ccoutant@google.com>
2643
2644 PR gold/15758
2645 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2646 before reloc sections.
2647
4f65b40e
AM
26482013-11-04 Alan Modra <amodra@gmail.com>
2649
2650 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2651 (Symbol::needs_dynamic_reloc): Test new flag.
2652 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2653 (Target_powerpc::Scan::get_reference_flags): Add target param.
2654 Return FUNC_DESC_ABI for 64-bit ELFv1.
2655 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2656 call.
2657 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2658 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2659
908794a9
CC
26602013-10-31 Cary Coutant <ccoutant@google.com>
2661
2662 Restore support for dwp v2 DWARF package file format.
2663
2664 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2665 tu_length parameter. Adjust all callers.
2666 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2667 * dwp.cc: Include dwarf.h.
2668 (Section_bounds): New struct type.
2669 (Unit_set): New struct type.
2670 (Dwo_file::Dwo_file): Initialize new data member.
2671 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2672 Combine and rename to...
2673 (Dwo_file::read_unit_index): ...this.
2674 (Dwo_file::sized_read_compunit_index)
2675 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2676 (Dwo_file::sized_read_unit_index): ...this.
2677 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2678 parameters; add section_id parameter.
2679 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2680 (Dwo_file::add_unit_set): ...this.
2681 (Dwo_file::shndx_map_): Remove.
2682 (Dwo_file::sect_offsets_): New data member.
2683 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2684 (Dwp_output_file::add_section): Rename to...
2685 (Dwp_output_file::add_contribution): ...this.
2686 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2687 (Dwp_output_file::add_tu_set): Likewise.
2688 (Dwp_output_file::Contribution): New type.
2689 (Dwp_output_file::Section::contributions): New data member.
2690 (Dwp_output_file::Cu_or_tu_set): Remove.
2691 (Dwp_output_file::Section::Section): New ctor.
2692 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2693 (Dwp_output_file::Dwp_index::Section_table): New type.
2694 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2695 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2696 parameter.
2697 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2698 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2699 (Dwp_output_file::Dwp_index::section_table): New member function.
2700 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2701 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2702 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2703 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2704 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2705 (Dwp_output_file::Dwp_index::section_table_): New data member.
2706 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2707 (Dwp_output_file::add_output_section): New member function.
2708 (Dwp_output_file::write_new_section): New member function.
2709 (Dwp_output_file::write_contributions): New member function.
2710 (Dwp_output_file::section_id_map_): New data member.
2711 (class Dwo_id_info_reader): Remove.
2712 (class Unit_reader): New class.
2713 (get_dwarf_section_name): New function.
2714 (Dwo_file::read_executable): Adjust initializations of class data.
2715 (Dwo_file::read): Add support for v2 package file format.
2716 (Dwo_file::read_unit_index): Likewise.
2717 (Dwo_file::sized_read_unit_index): Likewise.
2718 (Dwo_file::copy_section): Likewise.
2719 (Dwo_file::add_unit_set): Likewise.
2720 (Dwp_output_file::add_output_section): Likewise.
2721 (Dwp_output_file::add_contribution): Likewise.
2722 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2723 for empty slot.
2724 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2725 file format.
2726 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2727 slot.
2728 (Dwp_output_file::initialize): Remove unused function.
2729 (Dwp_output_file::finalize): Add support for v2 package file format.
2730 (Dwp_output_file::write_index): Likewise.
2731 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2732 function prototype.
2733
2500c017
CC
27342013-10-31 Cary Coutant <ccoutant@google.com>
2735
2736 * configure.ac: Fix check for -fmerge-constants.
2737 * configure.ac: Regenerate.
2738
dd0845d7
RM
27392013-10-30 Roland McGrath <mcgrathr@google.com>
2740
2741 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2742 Correct 9-byte nop sequence to match what the assembler generates.
2743
b4f7960d
AM
27442013-10-30 Alan Modra <amodra@gmail.com>
2745
2746 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2747 ppc64_local_entry_offset, ppc64_local_entry_offset,
2748 do_read_symbols): New functions.
2749 (Powerpc_relobj::e_flags_, st_other_): New vars.
2750 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2751 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2752 (Powerpc_relobj::e_flags_): New var.
2753 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2754 and adjust for ELFv2.
2755 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2756 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2757 (Powerpc_dynobj::do_find_special_sections): Likewise.
2758 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2759 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2760 to ELFv2 local entry.
2761 (Target_powerpc::do_relax): No thread safe barriers needed for
2762 ELFv2.
2763 (Output_data_plt_powerpc::initial_plt_entry_size_,
2764 plt_entry_size): Delete. Replace all uses with
2765 first_plt_entry_offset() and plt_entry_size().
2766 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2767 reserved_size parm. Update callers.
2768 (Output_data_plt_powerpc::entry_count): Update.
2769 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2770 and use Target_powerpc::first_plt_entry_offset().
2771 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2772 rename to plt_entry_size.
2773 (Output_data_plt_powerpc::add_ifunc_entry,
2774 add_local_ifunc_entry): Adjust reloc for ELFv2.
2775 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2776 (glink_eh_frame_fde_64v2): New.
2777 (Stub_table::plt_call_size): Support ELFv2 sizing.
2778 (Output_data_glink::add_eh_frame): Use the new FDE.
2779 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2780 (Stub_table::do_write): Write ELFv2 stubs and glink.
2781 (Target_powerpc::Relocate::relocate): Replaces nop after call
2782 with ld 2,24(1) and adjust local offset destination for ELFv2.
2783
f9c6b907
AM
27842013-10-30 Alan Modra <amodra@gmail.com>
2785
2786 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2787 (Target_powerpc::Scan::global, local): Likewise.
2788 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2789 on all ppc64 @h and @ha relocs.
2790
e84fe78f
AM
27912013-10-14 Alan Modra <amodra@gmail.com>
2792
2793 * output.h (Output_data_got::add_constant): Tidy.
2794 (Output_data_got::add_constant_pair): New function.
2795 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2796 methods used so as to first call reserve_ent().
2797
679e4abf
RM
27982013-10-11 Roland McGrath <mcgrathr@google.com>
2799
44dcb735
RM
2800 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2801 add_got_entry and add_got_entry_pair.
2802
13323c49
RM
2803 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2804 (HAVE_PUBNAMES): Likewise.
2805 * configure: Regenerate.
2806
1496b446
RM
2807 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2808 * testsuite/Makefile.in: Regenerate.
2809
cc84c10b
RM
2810 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2811 Remove const from declaration.
2812 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2813 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2814 * output.h (Output_file_header): Remove const from member target_
2815 and corresponding constructor argument.
2816 * output.cc (Output_file_header::Output_file_header): Update prototype.
2817 (Output_file_header::do_sized_write): Use this->target_ in place
2818 of parameters()->target().
2819
52f66a2c
RM
2820 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2821
2b64b551
RM
2822 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2823 * configure: Regenerate.
2824 * Makefile.in: Regenerate.
2825 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2826 * testsuite/merge_string_literals_2.c: Likewise.
2827 * testsuite/Makefile.am
2828 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2829 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2830 literal -fmerge-constants.
2831 * testsuite/Makefile.in: Regenerate.
2832
43819297
RM
2833 * i386.cc (Target_i386): Remove unused member dynbss_.
2834 * arm.cc (Target_arm): Likewise.
2835 * powerpc.cc (Target_powerpc): Likewise.
2836 * sparc.cc (Target_sparc): Likewise.
2837 * tilegx.cc (Target_tilegx): Likewise.
2838 * x86_64.cc (Target_x86_64): Likewise.
2839 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2840 type_signature_, type_offset_.
2841 * plugin.h (Plugin_hook): Remove unused member layout_.
2842 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2843 mapfile_.
2844 (Read_member): Remove unused members input_objects_, symtab_,
2845 mapfile_, layout_.
2846 (Check_library): Remove unused member symtab_.
2847 * archive.h (Lib_group): Remove unused member lib_.
2848 * archive.cc (Lib_group::Lib_group): Update initializer.
2849 * incremental.h (Incremental_binary): Remove unused member target_.
2850 (Incremental_script_entry): Removed unused member script_.
2851 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2852 * icf.h (Icf): Remove unused member num_tracked_relocs.
2853
39d9ead7
RM
2854 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2855 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2856 its only use.
2857 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2858
679e4abf
RM
2859 * archive.h: Use struct rather than class for forward declaration
2860 of Read_symbols_data.
2861
54de2ea6
CC
28622013-10-07 Cary Coutant <ccoutant@google.com>
2863
2864 PR gold/16010
2865 * testsuite/Makefile.am (icf_test): Fix dependencies.
2866 (icf_safe_test): Likewise.
2867 (icf_safe_so_test): Likewise.
2868 (large_symbol_alignment): Add empty _LDADD rule.
2869 * testsuite/Makefile.in: Regenerate.
2870
b14016f0
L
28712013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2872
2873 PR gold/15927
2874 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2875 relocation for R_X86_64_32 on x32.
2876
eb426534
RM
28772013-08-27 Roland McGrath <mcgrathr@google.com>
2878
2879 * output.cc (Output_segment::set_section_addresses): Take new
2880 Target* argument. If target->isolate_execinstr() and the segment
2881 is executable and starts at a target->abi_pagesize() boundary,
2882 pad its end out to a target->abi_pagesize() boundary with code fill.
2883 * output.h (Output_segment::set_section_addresses): Update decl.
2884 * layout.h (Layout::check_output_data_for_reset_values): Take new
2885 argument RELAX_OUTPUTS.
2886 (Layout): New member relax_output_list_.
2887 (Layout::add_relax_output): New method.
2888 * layout.cc (Layout::Layout): Update constructor.
2889 (Layout::reset_relax_output): New method.
2890 (Layout::clean_up_after_relaxation): Call it.
2891 (Layout::prepare_for_relaxation): Update caller.
2892 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2893 Call reset_relax_output before re-processing segments for
2894 isolate_execinstr case.
2895 (Layout::write_data): Handle relax_output_list_.
2896 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2897 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2898
9aff4b7a
NC
28992013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2900
2901 PR binutils/15834
2902 * object.h: Fix typos.
2903
93f8221c
RM
29042013-08-16 Roland McGrath <mcgrathr@google.com>
2905
2906 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2907 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2908
e44c3715
CC
29092013-08-07 Cary Coutant <ccoutant@google.com>
2910
2911 Revert support for v2 DWP files:
2912
2913 2013-03-01 Cary Coutant <ccoutant@google.com>
2914
2915 Add dwp support for v2 DWARF package file format.
2916 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2917 tu_length parameter. Adjust all callers.
2918 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2919 * dwp.cc: Include dwarf.h.
2920 (Section_bounds): New struct type.
2921 (Unit_set): New struct type.
2922 (Dwo_file::Dwo_file): Initialize new data member.
2923 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2924 Combine and rename to...
2925 (Dwo_file::read_unit_index): ...this.
2926 (Dwo_file::sized_read_compunit_index)
2927 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2928 (Dwo_file::sized_read_unit_index): ...this.
2929 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2930 parameters; add section_id parameter.
2931 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2932 (Dwo_file::add_unit_set): ...this.
2933 (Dwo_file::shndx_map_): Remove.
2934 (Dwo_file::sect_offsets_): New data member.
2935 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2936 (Dwp_output_file::add_section): Rename to...
2937 (Dwp_output_file::add_contribution): ...this.
2938 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2939 (Dwp_output_file::add_tu_set): Likewise.
2940 (Dwp_output_file::Contribution): New type.
2941 (Dwp_output_file::Section::contributions): New data member.
2942 (Dwp_output_file::Cu_or_tu_set): Remove.
2943 (Dwp_output_file::Section::Section): New ctor.
2944 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2945 (Dwp_output_file::Dwp_index::Section_table): New type.
2946 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2947 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2948 parameter.
2949 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2950 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2951 (Dwp_output_file::Dwp_index::section_table): New member function.
2952 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2953 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2954 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2955 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2956 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2957 (Dwp_output_file::Dwp_index::section_table_): New data member.
2958 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2959 (Dwp_output_file::add_output_section): New member function.
2960 (Dwp_output_file::write_new_section): New member function.
2961 (Dwp_output_file::write_contributions): New member function.
2962 (Dwp_output_file::section_id_map_): New data member.
2963 (class Dwo_id_info_reader): Remove.
2964 (class Unit_reader): New class.
2965 (get_dwarf_section_name): New function.
2966 (Dwo_file::read_executable): Adjust initializations of class data.
2967 (Dwo_file::read): Add support for v2 package file format.
2968 (Dwo_file::read_unit_index): Likewise.
2969 (Dwo_file::sized_read_unit_index): Likewise.
2970 (Dwo_file::copy_section): Likewise.
2971 (Dwo_file::add_unit_set): Likewise.
2972 (Dwp_output_file::add_output_section): Likewise.
2973 (Dwp_output_file::add_contribution): Likewise.
2974 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2975 for empty slot.
2976 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2977 file format.
2978 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2979 slot.
2980 (Dwp_output_file::initialize): Remove unused function.
2981 (Dwp_output_file::finalize): Add support for v2 package file format.
2982 (Dwp_output_file::write_index): Likewise.
2983 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2984 function prototype.
2985
c6905c28
CC
29862013-07-31 Cary Coutant <ccoutant@google.com>
2987
2988 * object.cc (Sized_relobj::do_output_section_address): New function.
2989 (Sized_relobj): Instantiate explicitly.
2990 * object.h (Object::output_section_address): New function.
2991 (Object::do_output_section_address): New function.
2992 (Sized_relobj::do_output_section_address): New function.
2993 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2994
29952013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2996 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2997
2998 * parameters.cc (Parameters::entry): Return target-specific entry
2999 symbol name.
3000 * target.h (Target::entry_symbol_name): New function.
3001 (Target_info::entry_symbol_name): New data member.
3002
3003 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3004 * i386.cc (Target_i386::i386_info): Likewise.
3005 (Target_i386_nacl::i386_nacl_info): Likewise.
3006 * sparc.cc (Target_sparc::sparc_info): Likewise.
3007 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3008 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3009 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3010 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3011
234d4ab8
SA
30122013-07-22 Sterling Augustine <saugustine@google.com>
3013
3014 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3015 Convert parameter shndx to local variable. Add parameters symtab
3016 and symtab_size. Scan over section names. Find relocation
3017 section corresponding to current section. Create and initialize
3018 reloc_mapper_ and reloc_type_.
3019 (Dwarf_pubnames_table::read_header): Add assertion. Change
3020 unit_length to off_t. Initialize member unit_length_. Fill in field
3021 cu_offset_.
3022 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3023 Initialize new fields unit_length_ and cu_offset_.
3024 (Dwarf_pubnames_table::read_section): Update prototype.
3025 (Dwarf_pubnames_table::cu_offset): New member function.
3026 (Dwarf_pubnames_table::subsection_size): Likewise.
3027 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3028 New fields.
3029 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3030 member functions public.
3031 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3032 Update comment. Rework logic. Move repeated parts to...
3033 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3034 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3035 pubtypes_table_, and stmt_list_offset.
3036 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3037 Gdb_index::find_pubtype_offset,
3038 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3039 (Gdb_index::pubnames_read): Update prototype and rework logic.
3040 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3041 Forward declare.
3042 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3043 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3044 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3045 Gdb_index::map_pubtable_to_dies):
3046 Declare functions.
3047 (Gdb_index::pubnames_read): Update declaration.
3048 (Gdb_index::Pubname_offset_map): New type.
3049 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3050 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3051 Gdb_index::stmt_list_offset): Declare.
3052 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3053 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3054 Gdb_index::pubtypes_offset_): Remove.
3055
a3ed37d8
RM
30562013-07-19 Roland McGrath <mcgrathr@google.com>
3057
3058 * options.h (General_options): Add -Trodata-segment option.
3059 * parameters.cc (Parameters::check_rodata_segment): New function.
3060 (Parameters::set_target_once): Call it.
3061 * parameters.h (Parameters): Declare it (private member function).
3062 * layout.cc (load_seg_unusable_for_headers): New function, broken
3063 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3064 then validate rodata segment rather than text segment.
3065 (relaxation_loop_body): Call that.
3066 (is_text_segment): New function. Don't admit a non-executable
3067 segment if TARGET->isolate_execinstr().
3068 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3069
eb5b4ded
CC
30702013-07-15 Shawn Landden <shawnlandden@gmail.com>
3071
3072 PR gold/15070
3073 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3074 * nacl.h (Sniff_file::View::View): Request aligned view.
3075
4d5effb9
CC
30762013-07-11 Cary Coutant <ccoutant@google.com>
3077
3078 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3079 correct BRLT entry size.
3080
ba8ca3e7
AM
30812013-07-03 Alan Modra <amodra@gmail.com>
3082
3083 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3084 comment.
3085
267257d2
CC
30862013-07-01 Cary Coutant <ccoutant@google.com>
3087
3088 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3089 reloc_type_.
3090 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3091 (Dwarf_ranges_table::lookup_reloc): New function.
3092 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3093 reloc_type_.
3094 (Dwarf_ranges_table::lookup_reloc): New function.
3095 (Dwarf_ranges_table::reloc_type_): New data member.
3096
06f30c9d
CC
30972013-06-27 Jing Yu <jingyu@google.com>
3098
3099 PR gold/15662
3100 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3101 function.
3102 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3103 (Target_powerpc::do_relax): Call the above.
3104
a2d7bf59
AM
31052013-06-27 Cary Coutant <ccoutant@google.com>
3106
3107 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3108 on garbage collected .opd section.
3109
31102013-06-27 Alan Modra <amodra@gmail.com>
3111
3112 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3113 is non-zero.
3114 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3115 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3116
32364e50
CC
31172013-06-14 Cary Coutant <ccoutant@google.com>
3118
3119 * resolve.cc (Symbol::override_base): Don't override st_type
3120 from plugin placeholder symbols.
3121 (Symbol_table::resolve): Likewise.
3122 (Symbol_table::should_override): Don't complain about TLS mismatch
3123 if the TO symbol is a plugin placeholder.
3124 * testsuite/Makefile.am (plugin_test_tls): New test.
3125 * testsuite/Makefile.in: Regenerate.
3126 * testsuite/plugin_test_tls.sh: New test script.
3127 * testsuite/two_file_test_2_tls.cc: New test source.
3128 * testsuite/two_file_test_tls.cc: New test source.
3129
7fb47cc9
CC
31302013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3131
3132 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3133 the maximum segment alignment is larger than the page size.
3134 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3135 correctly aligns the symbols with large alignemnt.
3136 * testsuite/Makefile.in: Regenerate.
3137 * testsuite/large_symbol_alignment.cc: New file.
3138
6934001a
CC
31392013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3140 Sriraman Tallam <tmsriram@google.com>
3141
3142 * options.h (sort_section): New option.
3143 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3144 Rename from Input_section_sort_section_name_special_ordering_compare.
3145 (Input_section_sort_section_name_compare): New struct.
3146 * output.cc (Output_section::Input_section_sort_section_name_compare::
3147 operator()): New function.
3148 (Output_section::sort_attached_input_sections): Use new sort function
3149 for .text if --sort-section=name is specified.
3150 * layout.cc (Layout::make_output_section):
3151 Add sorting by name when --sort-section=name is specified.
3152 * testsuite/Makefile.am (text_section_grouping): Test option
3153 --sort-section=name.
3154 * testsuite/Makefile.in: Regenerate.
3155 * testsuite/section_sorting_name.cc: New file.
3156 * testsuite/section_sorting_name.sh: New file.
3157
93acabad
CC
31582013-05-21 Cary Coutant <ccoutant@google.com>
3159
3160 * symtab.h (Symbol::is_cxx_vtable): New function.
3161 * target-reloc.h (relocate_section): Check for vtable symbol.
3162 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3163 * testsuite/Makefile.in: Regenerate.
3164 * testsuite/missing_key_func.cc: New test source.
3165 * testsuite/missing_key_func.sh: New test script.
3166
60e8b3fc
CC
31672013-05-21 Cary Coutant <ccoutant@google.com>
3168
2b64b551
RM
3169 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3170 type of enclosing symbol.
3171 (Relocate_info::location): Check symbol type when describing symbol.
3172 * object.h (Symbol_location_info): Remove unused line_number;
3173 add enclosing_symbol_type.
3174 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3175
9df9de2c
CC
31762013-05-13 Cary Coutant <ccoutant@google.com>
3177
2b64b551
RM
3178 * configure.ac: Export DEFAULT_TARGET.
3179 * configure: Regenerate.
3180 * Makefile.in: Regenerate.
3181 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3182 * testsuite/Makefile.in: Regenerate.
3183 * testsuite/debug_msg.sh: Delete duplicate tests.
3184 Don't check undef_int error message match for powerpc where the
3185 source file and line number aren't available.
9df9de2c 3186
bbc5ae17
RM
31872013-05-10 Roland McGrath <mcgrathr@google.com>
3188
3189 * options.h (General_options): Add --rosegment-gap option.
3190 * options.cc (finalize): --rosegment-gap implies --rosegment.
3191 * layout.cc (set_segment_offsets): Let user option override
3192 target->rosegment_gap().
3193
0c6e6c39
RM
31942013-05-10 Roland McGrath <mcgrathr@google.com>
3195
3196 * options.h (General_options): Remove leading space from help
3197 messages for -nostdlib and --rosegment.
3198
cde7cb01
MR
31992013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3200
3201 PR ld/15365
3202 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3203
f31ae5b8
AM
32042013-05-03 Alan Modra <amodra@gmail.com>
3205
3206 * merge.cc (Output_merge_string::do_add_input_section): Correct
3207 scan for number of strings. Rename vars to avoid shadowing.
3208 Include missing terminator in input_size_.
3209
d3a7cd45
L
32102013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3211
3212 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3213 Restore empty string handling.
3214
6ad3daba
CC
32152013-05-01 Cary Coutant <ccoutant@google.com>
3216
3217 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3218 uninitialized warning.
3219
e31908b6
CC
32202013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3221
3222 * output.cc (Output_section::add_merge_input_section): Allow
3223 to merge sections if the alignment is more than character size.
3224 * merge.h (Output_merge_string::Output_merge_string): Remove
3225 assert.
3226 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3227 only not-null strings. Check the alignment of strings.
3228 * stringpool.h
3229 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3230 alignment as the argument.
3231 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3232 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3233 Align non-zero length strings according to the addralign_.
3234 (Stringpool_template<Stringpool_char>::set_string_offsets):
3235 Updating offsets according to the given alignment.
3236 * testsuite/Makefile.am (text_section_grouping): Test if string
3237 literals are getting merged.
3238 * testsuite/Makefile.in: Regenerate.
3239 * testsuite/merge_string_literals_1.c: New file.
3240 * testsuite/merge_string_literals_2.c: Ditto.
3241 * testsuite/merge_string_literals.sh: Ditto.
3242
0e804863
ILT
32432013-04-26 Ian Lance Taylor <iant@google.com>
3244
3245 * target-reloc.h (relocate_section): If the reloc offset is out of
3246 range, pass VIEW as NULL to relocate.relocate.
3247 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3248 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3249 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3250 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3251 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3252 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3253
e7c5ea40
CC
32542013-04-26 Geoff Pike <gpike@chromium.org>
3255
3256 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3257 * layout.cc (Hash_task): New class.
3258 (Layout::queue_build_id_tasks): New function.
3259 (Layout::write_build_id): Handle single-thread portion of build ID
3260 computation. (In some cases, all of it is single-threaded.) Replace
3261 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3262 functionality in fewer lines of code.
3263 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3264 * options.h (General_options): make "--build-id" default to tree
3265 rather than sha1. Add two new options related to --build-id=tree:
3266 --build-id-chunk-size-for-treehash and
3267 --build-id-min-file-size-for-treehash.
3268 * Makefile.am: add testing of --build-id=tree and related new options
3269 (these tests will be invoked by "make check").
3270 * Makefile.in: Regenerate.
3271
49926cd0
AM
32722013-04-25 Alan Modra <amodra@gmail.com>
3273
3274 * configure.tgt: Add powerpcle and powerpc64le.
3275
a4034750
AM
32762013-04-22 Alan Modra <amodra@gmail.com>
3277
3278 PR gold/15355
3279 * layout.cc (Layout::segment_precedes): Allow more than one
3280 segment with the same type and flags.
3281
e79c84aa
CC
32822013-04-15 Cary Coutant <ccoutant@google.com>
3283
3284 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3285 allocate space in file for BSS sections.
3286
2199fbe7
CC
32872013-04-15 Cary Coutant <ccoutant@google.com>
3288
3289 * script-sections.cc (Orphan_output_section): Reset address
3290 to zero after each orphaned section for relocatable links.
3291
502e8a84
CC
32922013-04-15 Cary Coutant <ccoutant@google.com>
3293
a4034750
AM
3294 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3295 section starting address for relocatable link.
3296 * testsuite/Makefile.am (script_test_11): New test.
3297 * testsuite/Makefile.in: Regenerate.
3298 * testsuite/script_test_11.c: New source file.
3299 * testsuite/script_test_11.t: New linker script.
502e8a84 3300
0cfdc767
AM
33012013-04-13 Alan Modra <amodra@gmail.com>
3302
3303 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3304 owner when sections are not adjacent and exceed group size.
3305 (Target_powerpc::group_sections): Handle corner case.
3306 (Target_powerpc::Branch_info::make_stub): Handle case where
3307 stub table doesn't exist due to branches in non-exec sections.
3308 (Target_powerpc::Relocate::relocate): Likewise.
3309
6830ee24
AM
33102013-04-11 Alan Modra <amodra@gmail.com>
3311
3312 PR gold/15354
3313 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3314 .branch_lt to match bfd ld. Adjust comments throughout file.
3315
54a3d865
ILT
33162013-04-04 Ian Lance Taylor <iant@google.com>
3317
3318 GCC PR c++/56840
3319 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3320 sections before checking whether they are included in the link.
3321
9993ba11
ST
33222013-03-29 Sriraman Tallam <tmsriram@google.com>
3323
3324 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3325 object before calling the plugin claim_file handler. Pass the elf
3326 object of the archive to the plugin. Delete the elf object if the
3327 plugin claims the file.
3328
ebacd51e
AM
33292013-03-21 Alan Modra <amodra@gmail.com>
3330
3331 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3332 segment when omagic.
3333
117be58f
AM
33342013-03-21 Alan Modra <amodra@gmail.com>
3335
3336 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3337 comparison warning.
3338 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3339 uninitialized" warning.
3340
32e2b61d
AM
33412013-03-20 Alan Modra <amodra@gmail.com>
3342
3343 * symtab.h (Symbol::clear_version): New function.
3344 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3345 is_needed by weak references. Clear version for symbols defined
3346 in as-needed objects that are not needed.
3347
b3ccdeb5
AM
33482013-03-15 Alan Modra <amodra@gmail.com>
3349
3350 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3351 static and public. Add report_err param. Return false for data refs.
3352 (Target_powerpc::rela_dyn_section): New overloaded function.
3353 (Target_powerpc::plt_, iplt_): Elucidate.
3354 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3355 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3356 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3357 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3358 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3359 push_branch and make_plt_entry for ifunc syms when
3360 reloc_needs_plt_for_ifunc.
3361 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3362 for ifunc unless reloc_needs_plt_for_ifunc.
3363
ad3d8a2f
AM
33642013-03-15 Alan Modra <amodra@gmail.com>
3365
3366 * gc.h (gc_process_relocs): Don't look through function descriptors.
3367 * icf.cc (get_section_contents): Do so here instead.
3368
4d9aa155
AM
33692013-03-13 Alan Modra <amodra@gmail.com>
3370
3371 * powerpc.cc (is_branch_reloc): Forward declare.
3372 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3373 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3374 false for 64-bit, true for 32-bit non-branch relocs.
3375 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3376 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3377 nm output.
3378 (icf_safe_test): Generate linker map file as well as nm output.
3379 (icf_safe_so_test): Likewise.
3380 * testsuite/Makefile.in: Regenerate.
3381 * testsuite/icf_test.sh: Parse linker map file to determine
3382 section folding.
3383 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3384 * testsuite/icf_safe_so_test.sh: Likewise.
3385 (X86_32_or_ARM_specific_safe_fold): Merge into..
3386 (arch_specific_safe_fold): ..this.
3387 (X86_64_specific_safe_fold): Delete unused function.
3388
57420c20
AM
33892013-03-12 Alan Modra <amodra@gmail.com>
3390
3391 * gc.h (gc_process_relocs): Look through function descriptors
3392 to determine shndx, symvalue and addend used by ICF. Tidy
3393 variable duplication.
3394
dc3714f3
AM
33952013-03-11 Alan Modra <amodra@gmail.com>
3396
3397 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3398 * layout.cc (Layout_task_runner::run): ..to here.
3399 * symtab.h (struct Symbol_location): Extract from..
3400 (class Symbol_table): ..here.
3401 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3402 * target.h (class Target): Add function_location and
3403 do_function_location functions.
3404 (class Sized_target): Add do_function_location.
3405 * object.h (class Sized_relobj_file): Move find_shdr..
3406 (class Object): ..to here.
3407 * object.cc: Likewise. Update to suit. Instantiate.
3408 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3409 * powerpc.cc (class Powerpc_dynobj): New.
3410 (Target_powerpc::do_function_location): New function.
3411 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3412 (Powerpc_dynobj::do_read_symbols): New function.
3413 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3414
956b03bb
ILT
34152013-03-08 Ian Lance Taylor <iant@google.com>
3416
3417 * options.cc (General_options::string_to_object_format): Accept
3418 "default".
3419
4bead2d5
AM
34202013-03-08 Alan Modra <amodra@gmail.com>
3421
3422 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3423 pointer to Post_fde.
3424 (struct Post_fde): Move definition to here..
3425 * ehframe.cc (struct Post_fde): ..from here.
3426 (Cie::write): Don't alloc Post_fde.
3427 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3428
02e60bf7
AM
34292013-03-07 Alan Modra <amodra@gmail.com>
3430
3431 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3432 relocation referencing .LC0.
3433 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3434
8343f03a
AM
34352013-03-07 Alan Modra <amodra@gmail.com>
3436
3437 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3438 always_inline. Add assembly for powerpc to avoid GOT.
3439
3366d57c
AM
34402013-03-07 Alan Modra <amodra@gmail.com>
3441
3442 * testsuite/script_test_10.sh: Don't test .bss section
3443 header number.
3444
6c77229c
AM
34452013-03-06 Alan Modra <amodra@gmail.com>
3446
3447 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3448 (Target_powerpc::symval_for_branch): Add symtab param. Update
3449 all callers. Handle folded sections.
3450 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3451 to Powerpc_relobj.
3452 (Global_symbol_visitor_opd::operator()): Likewise.
3453
a39e4af6
AM
34542013-03-04 Alan Modra <amodra@gmail.com>
3455
3456 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3457 * testsuite/Makefile.in: Regenerate.
3458
d5834edb
CC
34592013-03-01 Cary Coutant <ccoutant@google.com>
3460
3461 Add dwp support for v2 DWARF package file format.
3462 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3463 tu_length parameter. Adjust all callers.
3464 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3465 * dwp.cc: Include dwarf.h.
3466 (Section_bounds): New struct type.
3467 (Unit_set): New struct type.
3468 (Dwo_file::Dwo_file): Initialize new data member.
3469 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3470 Combine and rename to...
3471 (Dwo_file::read_unit_index): ...this.
3472 (Dwo_file::sized_read_compunit_index)
3473 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3474 (Dwo_file::sized_read_unit_index): ...this.
3475 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3476 parameters; add section_id parameter.
3477 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3478 (Dwo_file::add_unit_set): ...this.
3479 (Dwo_file::shndx_map_): Remove.
3480 (Dwo_file::sect_offsets_): New data member.
3481 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3482 (Dwp_output_file::add_section): Rename to...
3483 (Dwp_output_file::add_contribution): ...this.
3484 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3485 (Dwp_output_file::add_tu_set): Likewise.
3486 (Dwp_output_file::Contribution): New type.
3487 (Dwp_output_file::Section::contributions): New data member.
3488 (Dwp_output_file::Cu_or_tu_set): Remove.
3489 (Dwp_output_file::Section::Section): New ctor.
3490 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3491 (Dwp_output_file::Dwp_index::Section_table): New type.
3492 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3493 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3494 parameter.
3495 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3496 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3497 (Dwp_output_file::Dwp_index::section_table): New member function.
3498 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3499 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3500 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3501 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3502 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3503 (Dwp_output_file::Dwp_index::section_table_): New data member.
3504 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3505 (Dwp_output_file::add_output_section): New member function.
3506 (Dwp_output_file::write_new_section): New member function.
3507 (Dwp_output_file::write_contributions): New member function.
3508 (Dwp_output_file::section_id_map_): New data member.
3509 (class Dwo_id_info_reader): Remove.
3510 (class Unit_reader): New class.
3511 (get_dwarf_section_name): New function.
3512 (Dwo_file::read_executable): Adjust initializations of class data.
3513 (Dwo_file::read): Add support for v2 package file format.
3514 (Dwo_file::read_unit_index): Likewise.
3515 (Dwo_file::sized_read_unit_index): Likewise.
3516 (Dwo_file::copy_section): Likewise.
3517 (Dwo_file::add_unit_set): Likewise.
3518 (Dwp_output_file::add_output_section): Likewise.
3519 (Dwp_output_file::add_contribution): Likewise.
3520 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3521 for empty slot.
3522 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3523 file format.
3524 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3525 slot.
3526 (Dwp_output_file::initialize): Remove unused function.
3527 (Dwp_output_file::finalize): Add support for v2 package file format.
3528 (Dwp_output_file::write_index): Likewise.
3529 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3530 function prototype.
3531
a68a081d
CC
35322013-03-01 Cary Coutant <ccoutant@google.com>
3533
3534 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3535 function into class definition in header file.
3536 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3537 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3538 New function.
3539 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3540
9d5781f8
AM
35412013-02-28 Alan Modra <amodra@gmail.com>
3542
3543 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3544 * target.cc (Target::do_plt_fde_location): New function.
3545 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3546 accessor function, and constructor param.
3547 (struct Post_fde, Post_fdes): Declare.
3548 (Cie::write): Add post_fdes param.
3549 * ehframe.cc (Fde::write): Use plt_fde_location.
3550 (struct Post_fde): Define.
3551 (Cie::write): Stash FDEs added post merge mapping.
3552 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3553 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3554 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3555 other FDEs.
3556 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3557 (Target_powerpc::has_glink): New function.
3558 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3559 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3560 glink_eh_frame_fde_32, default_fde): New data.
3561 (Stub_table::eh_frame_added_): New var.
3562 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3563 Make const.
3564 (Stub_table::add_eh_frame): New function.
3565 (Output_data_glink::add_eh_frame): New function.
3566 (Target_powerpc::make_glink_section): Call add_eh_frame.
3567
214383dd
ILT
35682013-02-15 Ian Lance Taylor <iant@google.com>
3569
3570 * options.h (DEFINE_uint64_alias): Define.
3571 (class General_options): Add -Ttext-segment as an alias for
3572 -Ttext.
3573
91c2b899
AM
35742013-02-15 Alan Modra <amodra@gmail.com>
3575
3576 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3577 (Stub_table::do_write): ..here, two places.
3578 (Stub_table::plt_call_size): Use it here too.
3579
20e2a8aa
ILT
35802013-02-11 Ian Lance Taylor <iant@google.com>
3581
3582 * descriptors.cc (Descriptors::close_all): New function.
3583 * descriptors.h (class Descriptors): Declare close_all.
3584 (close_all_descriptors): New inline function.
3585 * plugin.cc: Include "descriptors.h".
3586 (Plugin_manager::cleanup): Call close_all_descriptors.
3587
8952bc69
AM
35882013-02-06 Alan Modra <amodra@gmail.com>
3589
3590 * README: Update coding style link.
3591
29bd8b6b
CC
35922013-01-28 Cary Coutant <ccoutant@google.com>
3593
a4034750
AM
3594 * dwp.cc (File_list): New typedef.
3595 (Dwo_name_info_reader): New class.
3596 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3597 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3598 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3599 (Dwo_file::read_executable): New function.
3600 (Dwo_file::read): Move common setup code to ...
3601 (Dwo_file::make_object): ... here.
3602 (dwp_options): Add --exec/-e.
3603 (usage): Likewise.
3604 (main): Likewise.
29bd8b6b 3605
c6ac678d
ST
36062013-01-24 Sriraman Tallam <tmsriram@google.com>
3607
3608 * layout.cc (Layout::layout): Check for option text_reorder.
3609 (Layout::make_output_section): Ditto.
3610 * options.h (text_reorder): New option.
3611 * output.cc (Input_section_sort_compare): Remove special ordering
3612 of section names.
3613 (Output_section::
3614 Input_section_sort_section_name_special_ordering_compare::
3615 operator()): New function.
3616 (Output_section::sort_attached_input_sections): Use new sort function
3617 for .text.
3618 * output.h (Input_section_sort_section_name_special_ordering_compare):
3619 New struct.
3620 * testsuite/Makefile.am (text_section_grouping): Test option
3621 --no-text-reorder
3622 * testsuite/Makefile.in: Regenerate.
3623 * testsuite/text_section_grouping.sh: Check order of functions without
3624 default text reordering.
3625
50701cc1
MF
36262013-01-18 Mike Frysinger <vapier@gentoo.org>
3627
3628 * options.h (General_options): Change default to true for new_dtags.
3629
b1b00fcc
MF
36302013-01-18 Mike Frysinger <vapier@gentoo.org>
3631
3632 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3633 when enable_new_dtags is false. Only add DT_RUNPATH when
3634 enable_new_dtags is true.
3635
ec5b8187
AM
36362013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3637
3638 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3639 used in declaration and definition consistent.
3640 (Target_powerpc::symval_for_branch): Ditto.
3641
a880d4c4
ST
36422013-01-16 Sriraman Tallam <tmsriram@google.com>
3643
3644 * testsuite/plugin_final_layout.cc: Fix comment.
3645
7c381248
ST
36462013-01-16 Sriraman Tallam <tmsriram@google.com>
3647
3648 * layout.cc (Layout::layout): Do not do default sorting for
3649 text sections when section ordering is specified.
3650 (make_output_section): Ditto.
3651 * testsuite/plugin_final_layout.cc: Name the function sections
3652 to catch reordering issues.
3653
e2458743
AM
36542013-01-15 Alan Modra <amodra@gmail.com>
3655
3656 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3657 plt-thread-safe.
3658
431ed302
AM
36592013-01-15 Alan Modra <amodra@gmail.com>
3660
3661 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3662 * testsuite/Makefile.in: Regenerate.
3663
0ec6429b
AM
36642013-01-14 Alan Modra <amodra@gmail.com>
3665
3666 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3667 * testsuite/Makefile.in: Regenerate.
3668
0bf402d5
ILT
36692013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3670
36af3926 3671 PR bfd/14430
0bf402d5
ILT
3672 Fix mingw gold build with plugins enabled
3673 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3674 * configure.ac: Export DLOPEN_LIBS and add headers check.
3675 * plugin.cc: Handle non-dlfcn case.
3676 * Makefile.in: Regenerate.
3677 * config.in: Regenerate.
3678 * configure: Regenerate.
3679 * testsuite/Makefile.in: Regenerate.
3680
9e9143bc
ST
36812013-01-09 Sriraman Tallam <tmsriram@google.com>
3682
3683 * output.h (sort_attached_input_sections): Change to be public.
3684 * script-sections.cc
3685 (Output_section_definition::set_section_addresses): Sort
3686 attached input sections according to section order before linker
3687 script assigns section addresses.
3688 (Orphan_output_section::set_section_addresses): Sort
3689 attached input sections according to section order before linker
3690 script assigns section addresses.
3691 * Makefile.am (final_layout.sh): Use a simple linker script to
3692 check if section ordering still works.
3693 * Makefile.in: Regenerate.
3694
679af368
ILT
36952013-01-09 Ben Cheng <bccheng@google.com>
3696
3697 * arm.cc (Target_arm::attributes_accept_div): New function.
3698 (Target_arm::attributes_forbid_div): New function.
3699 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3700 attribute using the same new functions as what bfd/elf32_arm.c
3701 does.
3702
3136a00e
CC
37032013-01-07 Cary Coutant <ccoutant@google.com>
3704
3705 PR gold/14993
3706 * output.cc (Output_section::add_input_section): For incremental
3707 updates, don't track input sections that are allocated from patch
3708 space.
3709
f2a6224b
L
37102013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3711 Ian Lance Taylor <iant@google.com>
3712
3713 PR gold/14897
3714 * configure.ac (--enable-ld): Removed.
3715 (install_as_default): Set to yes only for --enable-gold=default
3716 or --disable-ld.
3717 * configure: Regenerated.
3718
4f46f626
L
37192013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3720
3721 * options.h (General_options): Add -fuse-ld= for GCC linker
3722 option compatibility.
3723
26e4ef59
CC
37242013-01-04 Cary Coutant <ccoutant@google.com>
3725
3726 * configure.ac: Fix typo restoring CXXFLAGS.
3727 * configure: Regenerate.
3728
3d587466
CC
37292013-01-04 Cary Coutant <ccoutant@google.com>
3730
4f46f626
L
3731 * testsuite/Makefile.am (CXXLINK_S): New macro.
3732 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3733 * testsuite/Makefile.in: Regenerate.
3d587466 3734
44db6695
L
37352013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3736
3737 * version.cc (print_version): Update copyright year to 2013.
3738
edcac0c1
ILT
37392012-12-20 Ian Lance Taylor <iant@google.com>
3740
3741 * layout.cc (Layout::special_ordering_of_input_section): New
3742 function.
3743 (Layout::layout): If input section requires special ordering, must
3744 sort input sections.
3745 (Layout::make_output_section): May sort .text input sections.
3746 (Layout::is_section_name_prefix_grouped): Remove.
3747 * layout.h (class Layout): Declare
3748 special_ordering_of_input_section. Don't declare
3749 is_section_name_prefix_grouped.
3750 * output.cc (Output_section::add_input_section): Revert last
3751 change.
3752 (Output_section::Input_section_sort::match_file_name): Don't crash
3753 if called on output section data.
3754 (Output_section::Input_section_sort_compare): Sort based on
3755 special ordering.
3756 (Output_section::Input_section_sort_section_order_index_compare):
3757 Revert last patch.
3758 (Output_section::sort_attached_input_sections): Likewise.
3759
28f2a4ac
ST
37602012-12-18 Sriraman Tallam <tmsriram@google.com>
3761
edcac0c1 3762 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3763 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3764 * output.cc (Output_section::add_input_section): Check if section
3765 name contains special prefix. Keep input sections to sort such
3766 sections.
3767 (Output_section::Input_section_sort_section_order_index_compare
3768 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3769 (Output_section::sort_attached_input_sections): Add condition to
3770 Input_section_entry constructor call.
28f2a4ac
ST
3771 * testsuite/Makefile.am (text_section_grouping): New test.
3772 * testsuite/Makefile.in: Regenerate.
3773 * testsuite/text_section_grouping.cc: New file.
3774 * testsuite/text_section_grouping.sh: New file.
3775
5bf135a7
NC
37762012-12-17 Nick Clifton <nickc@redhat.com>
3777
3778 * Makefile.am: Add copyright notice.
3779 * NEWS: Likewise.
3780 * README: Likewise.
3781 * configure.ac: Likewise.
3782 * ftruncate.c: Likewise.
3783 * Makefile.in: Regenerate.
3784
59965708
CC
37852012-12-14 Cary Coutant <ccoutant@google.com>
3786
a4034750
AM
3787 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3788 --no-as-needed flag.
3789 (exception_separate_shared_12_test): Likewise.
3790 (incremental_copy_test): Likewise.
3791 * testsuite/Makefile.in: Regenerate.
59965708 3792
2a77e2ab
CC
37932012-12-14 Cary Coutant <ccoutant@google.com>
3794
3795 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3796 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3797
e3deeb9c
AM
37982012-12-12 Alan Modra <amodra@gmail.com>
3799
3800 * powerpc.cc (class Track_tls): New.
3801 (class Relocate, class Scan): Inherit Track_tls.
3802 (Target_powerpc::Scan::local, global): Track tls optimization
3803 and avoid creating plt entry for __tls_get_addr if all uses
3804 are optimized away.
3805 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3806
d8f5a274
AM
38072012-12-12 Alan Modra <amodra@gmail.com>
3808
3809 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3810 Replace no_toc_optimize with toc_optimize.
3811 * output.h (Output_section::input_sections): Provide non-const variant.
3812 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3813 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3814 accessors.
3815 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3816 (class Sort_toc_sections): New.
3817 (Target_powerpc::do_finalize_sections): Sort toc sections.
3818 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3819
4c8a1de1
RM
38202012-12-10 Roland McGrath <mcgrathr@google.com>
3821
3822 * testsuite/binary_unittest.cc (read_all): New function.
3823 (Sized_binary_test): Use it instead of ::read.
3824 * fileread.cc (do_read): Don't assume pread always reads the whole
3825 amount in a single call.
3826
edc27beb
AM
38272012-12-10 Alan Modra <amodra@gmail.com>
3828
3829 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3830 Set EM_PPC64 or EM_PPC here.
3831 (Target_selector_powerpc::do_recognize): Delete.
3832
906b9150
AM
38332012-12-10 Alan Modra <amodra@gmail.com>
3834
3835 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3836 stub_table_.
3837 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3838
418c15ae
RM
38392012-12-07 Roland McGrath <mcgrathr@google.com>
3840
3841 * testsuite/binary_unittest.cc (Sized_binary_test):
3842 Use open_descriptor rather than ::open.
3843
decdd3bc
AM
38442012-12-07 Alan Modra <amodra@gmail.com>
3845
3846 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3847 typedef and invalid_address constant.
3848 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3849 instantiate constants.
3850
db399005
ILT
38512012-12-06 Roland McGrath <mcgrathr@google.com>
3852
3853 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3854 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3855 * aclocal.m4: Regenerate.
3856 * configure: Regenerate.
3857 * Makefile.in: Regenerate.
3858 * testsuite/Makefile.in: Regenerate.
3859
aba6bc71
AM
38602012-12-07 Alan Modra <amodra@gmail.com>
3861
3862 * options.h (General_options): Add no_toc_optimize.
3863 * powerpc.cc (ok_lo_toc_insn): New function.
3864 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3865
9e69ed50
AM
38662012-12-06 Alan Modra <amodra@gmail.com>
3867
3868 * options.h (General_options): Add plt_align, plt_static_chain,
3869 plt_thread_safe. Update stub_group_size help text.
3870 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3871 for new plt_thread_safe_ var.
3872 (use_plt_offset): Correct comments.
3873 (Target_powerpc::do_relax): Look for thread creation symbols to
3874 determine default plt_thread_safe value. Clear plt call stubs
3875 as well as branch stubs each iteration.
3876 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3877 insn constants.
3878 (l, hi, ha, write_insn): Move earlier.
3879 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3880 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3881 plt stubs too.
3882 (Stub_table::update_size): Adjust.
3883 (Stub_table::prev_size, set_prev_size): Delete.
3884 (Stub_table::stub_align): Let --plt-align affect result.
3885 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3886 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3887 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3888 (Stub_table::do_write): Support more stub variants.
3889
f43ba157
AM
38902012-12-04 Alan Modra <amodra@gmail.com>
3891
3892 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3893 (Target_powerpc::do_define_standard_symbols): New function.
3894
34171bc5
AM
38952012-12-03 Alan Modra <amodra@gmail.com>
3896
3897 * output.h: Formatting, whitespace.
3898
dc9589e9 38992012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3900
3901 * layout.h (Layout::get_executable_sections): Declare.
3902 * layout.cc (Layout::get_executable_sections): New function.
3903 * arm.cc (Target_arm::group_sections): Use it.
3904 (Arm_output_section::group_sections): Delete now redundant test.
3905 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3906 param to handle relative relocs.
3907 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3908 (Output_data_reloc::add_absolute): Adjust.
3909 (Output_data_reloc::add_relative): New function.
3910 (Output_data::reset_data_size): New function.
3911 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3912 (Output_section::set_addralign): New function.
3913 (Output_section::checkpoint_set_addralign): New function.
3914 (Output_section::clear_section_offsets_need_adjustment): New function.
3915 (Output_section::input_sections): Make public.
3916 * powerpc.cc (class Output_data_brlt_powerpc): New.
3917 (class Stub_table, class Stub_control): New.
3918 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3919 stub_table_, set_stub_table, stub_table): New vectors and accessor
3920 functions.
3921 (Target_powerpc::do_may_relax, do_relax, push_branch,
3922 new_stub_table, stub_tables, brlt_section, group_sections,
3923 add_branch_lookup_table, find_branch_lookup_table,
3924 write_branch_lookup_table, make_brlt_section): New functions.
3925 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3926 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3927 branch_info_): New vars.
3928 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3929 make call stubs here.
3930 (Output_data_glink): Remove all call stub handling from this class.
3931 (Target_powerpc::Scan::local, global): Save interesting branch
3932 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3933 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3934 functions on final link.
3935 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3936 Handle long branch destinations too.
3937 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3938 do_plt_address_for_local): Adjust lookup of plt call stubs.
3939
627b30b7
AM
39402012-11-30 Alan Modra <amodra@gmail.com>
3941
3942 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3943 relocs against protected symbols when building 32-bit shared libs.
3944
40b469d7
AM
39452012-11-30 Alan Modra <amodra@gmail.com>
3946
3947 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3948 param. Call got_section() to make .got. Update all callers
3949 and their callers and so on.
3950
bb66a627
AM
39512012-11-30 Alan Modra <amodra@gmail.com>
3952
3953 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3954 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3955 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3956 value if it already exists.
3957
d2cf1c6c
L
39582012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3959
3960 PR gold/14858
3961 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3962
edccdf7c
RM
39632012-11-14 Roland McGrath <mcgrathr@google.com>
3964
3965 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3966 than bfc instruction for data sandboxing.
3967
6febeb74
AM
39682012-11-08 Alan Modra <amodra@gmail.com>
3969
3970 * po/POTFILES.in: Regenerate.
3971
0a6f1bf2
AM
39722012-11-05 Alan Modra <amodra@gmail.com>
3973
3974 * configure.ac: Apply 2012-09-10 change to config.in here.
3975 * configure: Regenerate.
3976
26a4e9cb
AM
39772012-11-05 Alan Modra <amodra@gmail.com>
3978
3979 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3980 (struct Opd_ent): Use "Address" rather than "Offset".
3981 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3982 (Target_powerpc::got_section): Make public.
3983 (Target_powerpc::scan_relocs): Move code setting symbols..
3984 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3985 Create _SDA_BASE_ only when referenced.
3986
cc928013
RM
39872012-11-02 Roland McGrath <mcgrathr@google.com>
3988
3989 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3990 from last change.
3991
50ed5eb1
RM
39922012-11-01 Roland McGrath <mcgrathr@google.com>
3993
62fe925a
RM
3994 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3995 for offset_in_output_section parameter.
3996 (Sized_target::relocate_special_relocatable): Likewise.
3997 * arm.cc (Target_arm::relocate_relocs): Likewise.
3998 (Target_arm::relocate_special_relocatable): Likewise.
3999 * i386.cc (Target_i386::relocate_relocs): Likewise.
4000 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4001 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4002 * target-reloc.h (relocate_relocs): Likewise.
4003 * testsuite/testfile.cc (Target_test): Likewise.
4004 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4005 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4006
4007 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4008 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4009
4010 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4011 parameter, which is unused in the [!F_SETFD] case.
4012
50ed5eb1
RM
4013 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4014 SYMNDX to off_t before comparing it to this->data_size().
4015 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4016 * incremental.cc (Output_section_incremental_inputs::do_write):
4017 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4018
2cadc0bf
RM
4019 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4020
3bfcb652
NC
40212012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4022
4023 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4024 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4025 in EABI_VER5.
4026
c1a8d56e
CC
40272012-10-29 Cary Coutant <ccoutant@google.com>
4028
4029 * dwp.cc (usage): Add file and exit status parameters;
4030 add --help and --version options.
4031 (print_version): New function.
4032 (main): Add --help and --version options.
4033
b2490a7b
L
40342012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4035
4036 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4037 final_layout_sequence.txt.
4038 * testsuite/Makefile.in: Regenerated.
4039
aa543512
L
40402012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4041
4042 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4043 COMPILE generated by automake.
4044 (LINK1): Likewise.
4045 (CXXCOMPILE1): Likewise.
4046 (CXXLINK1): Likewise.
4047 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4048 (LINK): Likewise.
4049 (CXXCOMPILE): Likewise.
4050 (CXXLINK): Likewise.
4051 * testsuite/Makefile.in: Regenerated.
4052
d361fafb
L
40532012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4054
4055 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4056 on bad fwrite return.
4057
598c7410
L
40582012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4059
4060 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4061 on val.
4062
35c813e2
CC
40632012-10-23 Cary Coutant <ccoutant@google.com>
4064
4065 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4066 * testsuite/Makefile.in: Regenerate.
4067 * testsuite/dwp_test.h: New source file.
4068 * testsuite/dwp_test_1.cc: New source file.
4069 * testsuite/dwp_test_1.s: New source file.
4070 * testsuite/dwp_test_1.sh: New source file.
4071 * testsuite/dwp_test_1b.cc: New source file.
4072 * testsuite/dwp_test_1b.s: New source file.
4073 * testsuite/dwp_test_2.cc: New source file.
4074 * testsuite/dwp_test_2.s: New source file.
4075 * testsuite/dwp_test_2.sh: New source file.
4076 * testsuite/dwp_test_main.cc: New source file.
4077 * testsuite/dwp_test_main.s: New source file.
4078
77429909
CC
40792012-10-23 Cary Coutant <ccoutant@google.com>
4080
4081 * dwp.h: New header file.
4082 * dwp.cc: New source file.
4083 * gold.h: Move shared declarations to system.h.
4084 * system.h: New header file.
4085 * Makefile.am: Add dwp.
4086 * Makefile.in: Regenerate.
4087
ed5d6712
CC
40882012-10-23 Cary Coutant <ccoutant@google.com>
4089
4090 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4091 Dwarf_info_reader::read_from_pointer.
4092 (Dwarf_pubnames_table::read_header): Likewise.
4093 (Dwarf_pubnames_table::next_name): Likewise.
4094 (Dwarf_die::read_attributes): Likewise.
4095 (Dwarf_die::skip_attributes): Likewise.
4096 (Dwarf_info_reader::read_from_pointer): New function template.
4097 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4098 (Dwarf_pubnames_table): Likewise.
4099 (Dwarf_info_reader::read_from_pointer): New function template.
4100 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4101 Dwarf_pubnames_table ctor.
4102
8787852d
CC
41032012-10-23 Cary Coutant <ccoutant@google.com>
4104
4105 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4106 abbrev_shndx.
4107 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4108 abbrev_shndx_.
4109 (Dwarf_info_reader::set_abbrev_shndx): New method.
4110 (Dwarf_info_reader::abbrev_shndx_): New data member.
4111
9fc236f3
CC
41122012-10-23 Cary Coutant <ccoutant@google.com>
4113
4114 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4115 from object, not parameters.
4116 (Dwarf_info_reader::parse): Likewise.
4117 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4118 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4119 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4120 methods.
4121
effe8365
CC
41222012-10-23 Cary Coutant <ccoutant@google.com>
4123
4124 * fileread.cc (Input_file::Input_file): New constructor.
4125 * fileread.h (class Input_file): Add new constructor.
4126
1698990d
AM
41272012-10-18 Alan Modra <amodra@gmail.com>
4128
4129 PR gold/14727
4130 * object.cc (Relobj::is_section_name_included): Also match
4131 .sdata personality section.
4132
168a4726
AM
41332012-10-18 Alan Modra <amodra@gmail.com>
4134
4135 * target-reloc.h (class Default_comdat_behavior): New, package up..
4136 (get_comdat_behaviour): ..this.
4137 (relocate_section): Add Relocate_comdat_behavior template arg,
4138 adjust code to suit.
4139 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4140 (Target_arm::scan_reloc_section): Likewise.
4141 * i386.cc (Target_i386::relocate_section): Likewise.
4142 * sparc.cc (Target_sparc::relocate_section): Likewise.
4143 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4144 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4145 * powerpc.cc (class Relocate_comdat_behavior): New.
4146 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4147 gold::relocate_section with new template arg.
4148
acc276d8
AM
41492012-10-18 Alan Modra <amodra@gmail.com>
4150
4151 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4152 dynamic relocs for GOT_TPREL got entries, without symbol if
4153 resolving locally.
4154 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4155 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4156 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4157
e10f9870
AM
41582012-10-17 Alan Modra <amodra@gmail.com>
4159
4160 PR gold/14726
4161 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4162
ae034989
ST
41632012-10-16 Sriraman Tallam <tmsriram@google.com>
4164
4165 * layout.cc (Layout::include_section): Keep sections marked
4166 SHF_EXCLUDE when doing relocatable links.
4167
f3a0ed29
AM
41682012-10-16 Alan Modra <amodra@gmail.com>
4169
4170 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4171 (Target_powerpc::do_finalize_sections): Call it.
4172 (Output_data_save_res): New class and supporting functions.
4173 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4174 normal symbols defined in object files.
4175
c6de8ed4
AM
41762012-10-12 Alan Modra <amodra@gmail.com>
4177
4178 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4179 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4180 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4181 section if scan_opd_relocs not yet called.
4182 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4183
03e25981
AM
41842012-10-12 Alan Modra <amodra@gmail.com>
4185
4186 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4187 add_local_ifunc_entry): Revert last change.
4188 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4189
c9824451
AM
41902012-10-05 Alan Modra <amodra@gmail.com>
4191
4192 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4193 do_plt_address_for_global): New functions.
4194 (Output_data_got_powerpc::do_write): Don't segfault when linking
4195 statically.
4196 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4197 add_local_ifunc_entry): Return true on adding entry..
4198 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4199 glink->add_entry call. Remove unused symtab param. Adjust calls.
4200 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4201 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4202 set up symbols here.
4203 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4204 syms here. Do so even when no .iplt. Don't segfault when linking
4205 statically.
4206 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4207 new variants without reloc param.
4208 (Glink_sym_ent::Glink_sym_ent): Likewise.
4209 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4210 reloc when refs will resolve to plt call stub.
4211 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4212 R_PPC_PLTREL24 to resolve locally.
4213 (Target_powerpc::Scan::global): Correct ifunc handling.
4214 (Target_powerpc::Relocate::relocate): Correct local sym glink
4215 lookup. Don't destroy "value" when we have a plt call stub,
4216 and when checking plt call validity.
4217 (Target_powerpc::do_dynsym_value): Simplify.
4218
19fec8c1
AM
42192012-10-05 Alan Modra <amodra@gmail.com>
4220
4221 * i386.cc (Output_data_plt_i386::address_for_global,
4222 address_for_local): Add plt offset to returned value. Adjust uses.
4223 * sparc.cc (Output_data_plt_sparc::address_for_global,
4224 address_for_local): Likewise.
4225 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4226 address_for_local): Likewise.
4227 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4228 address_for_local): Likewise.
4229 * target.h (Target::plt_address_for_global, plt_address_for_local):
4230 Update comment.
4231 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4232 (Output_data_got::Got_entry::write): Nor here.
4233 * output.h: Comment fix.
4234
e867b647
WL
42352012-10-02 Jiong Wang <jiwang@tilera.com>
4236
4237 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4238 global_offset_table_ value for larget got.
4239 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4240
e5d5f5ed
AM
42412012-09-29 Alan Modra <amodra@gmail.com>
4242
4243 * powerpc.cc (Target_powerpc::iplt_): New output section.
4244 (Target_powerpc::iplt_section, make_iplt_section,
4245 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4246 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4247 Target_powerpc::plt_entry_count): Count iplt entries too.
4248 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4249 reloc section in constructor. New params.
4250 (Target_powerpc::make_plt_section): Create reloc section here instead.
4251 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4252 functions.
4253 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4254 (Output_data_glink::add_entry, find_entry): New functions to
4255 deal with local syms.
4256 (Glink_sym_ent): Add support for local syms.
4257 (Output_data_glink::do_write): Handle ifunc plt entries.
4258 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4259 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4260 (Target_powerpc::Relocate::relocate): Likewise.
4261 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4262
ec4dbad3
AM
42632012-09-25 Alan Modra <amodra@gmail.com>
4264
4265 * object.h (Sized_relobj_file::adjust_local_symbol,
4266 do_adjust_local_symbol): New functions.
4267 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4268 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4269 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4270 and irregular opd entry spacing.
4271 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4272 (Global_symbol_visitor_opd): New functor.
4273 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4274 on deleted opd entries.
4275
5c0b3823
WL
42762012-09-15 Jiong Wang <jiwang@tilera.com>
4277
4278 * tilegx.cc: New file.
4279 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4280 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4281 * configure.tgt: Add entries for tilegx*.
4282 * configure.ac: Likewise.
4283 * Makefile.in: Rebuild.
4284 * configure: Likewise.
4285 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4286 tilegx.
4287
bfdfa4cd
AM
42882012-09-13 Alan Modra <amodra@gmail.com>
4289
4290 * target-reloc.h (scan_relocs): Call scan.local for relocs
4291 against symbols in discarded sections. Pass is_discarded
4292 param.
4293 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4294 Add is_discarded param.
4295 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4296 is_discarded to flag opd entry as discarded. Don't emit dyn
4297 relocs on such entries.
4298 (Target_powerpc::Scan::global): Similarly detect and handle
4299 such opd entries.
4300 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4301 opd_ent_. Update all uses.
4302 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4303 (Target_powerpc::relocate_section): Zero out discarded opd
4304 entry relocs.
4305
d77a0555
ILT
43062012-09-12 Ian Lance Taylor <iant@google.com>
4307
4308 PR gold/14570
4309 * output.cc: Rename Output_data_got template parameter from size
4310 to got_size for all functions. Compile all variants of
4311 Output_data_got.
4312 (Output_data_got::Got_entry::write): Correct use of size for
4313 symbol value. Use local_is_tls rather than casting to
4314 Sized_relobj_file.
4315 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4316 (class Sized_relobj_file): Add do_local_is_tls.
4317 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4318
815a1205
AM
43192012-09-11 Alan Modra <amodra@gmail.com>
4320
4321 PR gold/14566
4322 * layout.cc (Layout::set_segment_offsets): When using
4323 common-page-size alignment, ensure we are on a new max-page-size
4324 page.
4325 * output.cc (Output_segment::set_section_addresses): Use
4326 abi_pagesize, not common_pagesize for relro boundary.
4327 (Output_segment::set_offset): Likewise.
4328
bd73a62d
AM
43292012-09-11 Alan Modra <amodra@gmail.com>
4330
4331 * output.h (Output_data_got::add_global_tls, add_local_tls,
4332 add_local_tls_pair): New functions.
4333 (Output_data_got::add_local_pair_with_rel): Remove second
4334 reloc param. Expand comment.
4335 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4336 use_plt_or_tls_offset_, similarly for constructor param.
4337 (Output_data_got::Got_entry::write): Add got_index param.
4338 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4339 add_local_tls_pair): New functions.
4340 (Output_data_got::Got_entry::write): Handle tls symbols
4341 with use_plt_or_tls_offset_ set specially.
4342 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4343 (Output_data_got::do_write): Replace iterator with index, pass
4344 index to entry write function.
4345 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4346 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4347 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4348 call.
4349 * i386.cc (Target_i386::Scan::local): Likewise.
4350 * sparc.cc (Target_sparc::Scan::local): Likewise.
4351 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4352 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4353 do_tls_offset_for_global): New functions.
4354 (Target_powerpc::Scan::local): Correct TLS relocations and got
4355 entry values.
4356 (Target_powerpc::Scan::global): Don't emit unnecessary
4357 dynamic relocations on TLS GOT entries.
4358
00716ab1
AM
43592012-09-10 Matthias Klose <doko@ubuntu.com>
4360
4361 * config.in: Disable sanity check for kfreebsd.
4362
c891b3f9
SA
43632012-09-10 Sterling Augustine <saugustine@google.com>
4364
4365 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4366 (Gdb_index::pubtypes_read): New parameter.
4367 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4368 to calls.
4369 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4370 pubtypes_object_.
4371
e81fea4d
AM
43722012-09-09 Alan Modra <amodra@gmail.com>
4373
4374 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4375 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4376 * gc.h (gc_process_relocs): Call target gc_add_reference.
4377 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4378 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4379 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4380 unnecessary cast.
4381 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4382 to cater for when we don't need code offset. Update use.
4383 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4384 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4385 set_opd_valid): New functions.
4386 (Target_powerpc::do_gc_add_reference): New function.
4387 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4388 stashed refs.
4389 (Target_powerpc::do_gc_mark_symbol): New function.
4390
d2d60eef
CC
43912012-09-06 Cary Coutant <ccoutant@google.com>
4392
4393 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4394 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4395 (Dwarf_die::skip_attributes): Likewise.
4396 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4397 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4398 (main): Call it.
4399 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4400
32ed4573
L
44012012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4402
4403 * testsuite/script_test_3.t: Add .got.plt output section
4404 statement.
4405 * testsuite/script_test_4.t: Likewise.
4406
f4baf0d4
AM
44072012-09-05 Alan Modra <amodra@gmail.com>
4408
4409 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4410 update all uses and lose "enum" when using type.
4411
864a1b56
AM
44122012-09-05 Alan Modra <amodra@gmail.com>
4413
4414 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4415 * configure: Regenerate.
4416 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4417 (plugin_final_layout.stdout): Likewise.
4418 (memory_test): Set page sizes to 0x1000.
4419 * testsuite/Makefile.in: Regenerate.
4420 * testsuite/discard_locals_test.sh: Add FIXME comment.
4421 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4422 * testsuite/pr14265.t: Add .got output section statement.
4423 * testsuite/script_test_2.t: Likewise.
4424 * testsuite/script_test_3.t: Likewise.
4425 * testsuite/script_test_4.t: Likewise.
4426 * testsuite/script_test_5.t: Likewise.
4427 * testsuite/script_test_6.t: Likewise.
4428 * testsuite/script_test_7.t: Likewise.
4429 * testsuite/script_test_9.t: Likewise.
4430
3ea0a085
AM
44312012-09-05 Alan Modra <amodra@gmail.com>
4432
4433 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4434 (Powerpc_relocate_functions::Status): New typedef.
4435 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4436 (Target_powerpc::Scan::local): Handle REL64.
4437 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4438 for REL32 and REL64.
4439 (Target_powerpc::symval_for_branch): New function, extracted from..
4440 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4441 checks. Report overflow errors.
4442
7404fe1b
AM
44432012-09-05 Alan Modra <amodra@gmail.com>
4444
4445 * object.h (Sized_relobj_file::emit_relocs): Delete.
4446 (Sized_relobj_file::emit_relocs_reltype): Delete.
4447 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4448 relocate_relocs for --emit-relocs.
4449 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4450 * output.h: Update comment.
4451 (Output_segment::first_section): New function.
4452 (Output_segment::first_section_load_address): Use first_section.
4453 * output.cc (Output_segment::first_section): New function extracted..
4454 (Output_segment::first_section_load_address): ..from here. Delete.
4455 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4456 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4457 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4458 adjust call to target.h function.
4459 * i386.cc (Target_i386): Likewise.
4460 * sparc.cc (Target_sparc): Likewise.
4461 * x86_64.cc (Target_x86_64): Likewise.
4462 * powerpc.cc (Target_powerpc): Likewise.
4463 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4464 first tls section has section symbol for optimised local dynamic
4465 output relocs.
4466 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4467 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4468 optimised tls code.
4469 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4470 Rename to relocate_relocs. Update error message.
4471
957564c9
AS
44722012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4473
4474 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4475 --just-symbols.
4476
dd93cd0a
AM
44772012-08-31 Alan Modra <amodra@gmail.com>
4478
4479 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4480 (Powerpc_relobj::toc_base_offset): New stub function.
4481 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4482 got_mod_index_offset to tlsld_got_offset. Update all refs.
4483 (Target_powerpc::Relocate::enum skip_tls): New.
4484 (Target_powerpc::call_tls_get_addr_): New var.
4485 (Target_powerpc::is_branch_reloc): Move to file scope.
4486 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4487 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4488 New functions.
4489 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4490 (powerpc_info): Correct common_pagesize for ppc64.
4491 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4492 (Powerpc_relocate_functions): Add overflow check enums and functions.
4493 Add non-shift version of rela, rela_ua. Delete all rel public
4494 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4495 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4496 addr16_ha3, addr14 functions.
4497 (Output_data_got_powerpc::add_constant_pair): New function.
4498 (Output_data_got_powerpc::got_base_offset): Likewise.
4499 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4500 (instruction constants): Sort, add some more.
4501 (Output_data_glink::do_write): Add and use Address typedef. Use
4502 object->toc_base_offset() stub for 64-bit.
4503 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4504 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4505 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4506 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4507 Always treat .opd relocs as against locally defined symbol.
4508 Correct condition for RELATIVE relocs.
4509 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4510 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4511 for 32-bit syms with a plt entry. Correct ppc64 toc base
4512 calculations. Handle TLS relocs, and more. Add overflow
4513 checking and adjust for Powerpc_relocate_functions changes.
4514 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4515 Reinstate --emit-relocs code with FIXME.
4516
a1373b60
AM
45172012-08-30 Alan Modra <amodra@gmail.com>
4518
4519 * layout.cc (Layout::set_segment_offsets): Set p_align to
4520 abi_pagesize, not common_pagesize.
4521 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4522 to determine whether file header can go in segment.
4523
703d02da
AM
45242012-08-30 Alan Modra <amodra@gmail.com>
4525
4526 * output.h (Output_reloc::Output_reloc <output section>): Add
4527 is_relative param. Adjust calls.
4528 (Output_reloc::add_output_section_relative): New functions.
4529 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4530 is_relative.
4531 (Output_reloc::symbol_value): Handle SECTION_CODE.
4532
16164a6b
ST
45332012-08-24 Sriraman Tallam <tmsriram@google.com>
4534
4535 * gold.cc (queue_middle_tasks): Call layout again when unique
4536 segments for sections is desired.
4537 * layout.cc (Layout::Layout): Initialize new members.
4538 (Layout::get_output_section_flags): New function.
4539 (Layout::choose_output_section): Call get_output_section_flags.
4540 (Layout::layout): Make output section for mapping to a unique segment.
4541 (Layout::insert_section_segment_map): New function.
4542 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4543 output sections marked so.
16164a6b
ST
4544 (Layout::segment_precedes): Check for unique segments when sorting.
4545 * layout.h (Layout::Unique_segment_info): New struct.
4546 (Layout::Section_segment_map): New typedef.
4547 (Layout::insert_section_segment_map): New function.
4548 (Layout::get_output_section_flags): New function.
4549 (Layout::is_unique_segment_for_sections_specified): New function.
4550 (Layout::set_unique_segment_for_sections_specified): New function.
4551 (Layout::unique_segment_for_sections_specified_): New member.
4552 (Layout::section_segment_map_): New member.
4553 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4554 Rename is_gc_pass_one to is_pass_one.
4555 Rename is_gc_pass_two to is_pass_two.
4556 Rename is_gc_or_icf to is_two_pass.
4557 Check for which pass based on whether symbols data is present.
4558 Make it two pass when unique segments for sections is desired.
4559 * output.cc (Output_section::Output_section): Initialize new
4560 members.
4561 * output.h (Output_section::is_unique_segment): New function.
4562 (Output_section::set_is_unique_segment): New function.
4563 (Output_section::is_unique_segment_): New member.
4564 (Output_section::extra_segment_flags): New function.
4565 (Output_section::set_extra_segment_flags): New function.
4566 (Output_section::extra_segment_flags_): New member.
4567 (Output_section::segment_alignment): New function.
4568 (Output_section::set_segment_alignment): New function.
4569 (Output_section::segment_alignment_): New member.
4570 (Output_segment::Output_segment): Initialize is_unique_segment_.
4571 (Output_segment::is_unique_segment): New function.
4572 (Output_segment::set_is_unique_segment): New function.
4573 (Output_segment::is_unique_segment_): New member.
4574 * plugin.cc (allow_unique_segment_for_sections): New function.
4575 (unique_segment_for_sections): New function.
4576 (Plugin::load): Add new functions to transfer vector.
4577 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4578 * Makefile.in: Regenerate.
4579 * testsuite/plugin_final_layout.sh: Check if unique segment
4580 functionality works.
4581 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4582 are available.
4583 (allow_unique_segment_for_sections): New global.
4584 (unique_segment_for_sections): New global.
4585 (claim_file_hook): Call allow_unique_segment_for_sections.
4586 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4587
1e2bee4f
CC
45882012-08-22 Cary Coutant <ccoutant@google.com>
4589
4590 * layout.cc (Layout::include_section): Don't assert on GROUP
4591 sections with --emit-relocs.
4592
1d5dfe78
CC
45932012-08-21 Cary Coutant <ccoutant@google.com>
4594
4595 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4596 if --export-dynamic-symbol names an undef symbol.
4597
c9269dff
AM
45982012-08-18 Alan Modra <amodra@gmail.com>
4599
4600 * powerpc.cc: Formatting and white space.
4601 (Powerpc_relobj): Rename got2_section_ to special_.
4602 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4603 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4604 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4605 (Target_powerpc): Add Address typedef and invalid_address. Use
4606 throughout.
4607 (Target_powerpc::is_branch_reloc): New function.
4608 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4609 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4610 for dst_mask, value and addend.
4611 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4612 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4613 (Output_data_glink::do_write): Correct toc base. Don't try to use
4614 uint16_t for 24-bit offset. Use get_output_section_offset and
4615 check return.
4616 (Target_powerpc::Scan::local): Handle more relocs.
4617 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4618 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4619 Plug in toc restoring insn after plt calls. Translate branches
4620 to function descriptor symbols to corresponding entry point.
4621 (Target_powerpc::relocate_for_relocatable): Check return from
4622 get_output_section_offset.
4623 * symtab.h: Comment typo.
4624
b1759dce
ILT
46252012-08-14 Ian Lance Taylor <iant@google.com>
4626
4627 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4628 unsupported_relocal_local to call unsupported_reloc_global.
4629
b9b2ae8b
NC
46302012-08-14 Nick Clifton <nickc@redhat.com>
4631
4632 PR ld/14265
4633 * script-sections.cc (Sections_element::output_section_name): Add
4634 keep return parameter.
4635 (Output_section_element::match_name): Add keep return parameter.
4636 Return the value of the keep_ member.
4637 * script-sections.h (class Output_section): Update
4638 output_section_name prototype.
4639 * layout.cc (Layout::keep_input_section): New public member
4640 function.
4641 (Layout::choose_output_section): Pass keep parameter to
4642 output_section_name.
4643 * layout.h (class Layout): Add keep_input_section.
4644 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4645 sections.
4646 * testsuite/Makefile.am: Add a test.
4647 * testsuite/Makefile.in: Regenerate.
4648 * testsuite/pr14265.c: Source file for the test.
4649 * testsuite/pr14265.t: Linker script for the test.
4650 * testsuite/pr14265.sh: Shell script for the test.
4651
921b5322
AM
46522012-08-14 Alan Modra <amodra@gmail.com>
4653
4654 * target.h (Target::output_section_name): New function.
4655 (Target::do_output_section_name): New function.
4656 * layout.cc (Layout::choose_output_section): Call the above.
4657 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4658
6ce78956
AM
46592012-08-14 Alan Modra <amodra@gmail.com>
4660
4661 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4662 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4663 for replace_constant call.
4664 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4665 (Output_data_glink::do_print_to_mapfile): New function.
4666 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4667 (Target_powerpc::Relocate::relocate): Likewise.
4668
d1a8cabd
AM
46692012-08-14 Alan Modra <amodra@gmail.com>
4670
4671 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4672 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4673 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4674 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4675 all references to shndx_. Handle special case for R_PPC_PLTREL24
4676 here.
4677 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4678 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4679 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4680 here.
4681 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4682 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4683
d83ce4e3
AM
46842012-08-12 Alan Modra <amodra@gmail.com>
4685
4686 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4687 (glink insn constants): Use uint32_t.
4688 (Output_data_glink::add_entry): Use insert, not [] operator.
4689
cf43a2fe
AM
46902012-08-11 Alan Modra <amodra@gmail.com>
4691
4692 * object.h (Sized_relobj_file::find_shdr): New function.
4693 (Sized_relobj_file::find_special_sections): New function.
4694 * object.cc (Sized_relobj_file::find_shdr): New function.
4695 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4696 (Sized_relobj_file::find_special_sections): New function, split out..
4697 (Sized_relobj_file::do_read_symbols): ..from here.
4698 * output.h (Output_data_got::replace_constant): New function.
4699 (Output_data_got::num_entries): New function.
4700 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4701 (Output_data_got::got_offset): Protected rather than private.
4702 (Output_data_got::replace_got_entry): New function.
4703 * output.cc (Output_data_got::replace_got_entry): New function.
4704 * powerpc.cc (class Powerpc_relobj): New.
4705 (class Powerpc_relocate_functions): Delete all psymval variants or
4706 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4707 Implement _ha functions using corresponding _hi function.
4708 (Powerpc_relobj::find_special_sections): New function.
4709 (Target_powerpc::do_make_elf_object): New function.
4710 (class Output_data_got_powerpc): New.
4711 (class Output_data_glink): New.
4712 (class Powerpc_scan_relocatable_reloc): New.
4713 Many more changes througout file.
4714
3c892704
NC
47152012-08-09 Nick Clifton <nickc@redhat.com>
4716
4717 * po/vi.po: Updated Vietnamese translation.
4718
82435b3b
ILT
47192012-08-07 Ian Lance Taylor <iant@google.com>
4720
4721 * layout.cc (Layout::add_target_dynamic_tags): If
4722 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4723 plt_rel.
4724
a6dc81d2
NC
47252012-07-30 Nick Clifton <nickc@redhat.com>
4726
4727 * po/gold.pot: Updated template.
4728 * po/es.po: Updated Spanish translation.
4729
f1415016
CC
47302012-07-18 Cary Coutant <ccoutant@google.com>
4731
4732 PR gold/14344
4733 * configure.ac: Add check for -gpubnames support.
4734 * configure: Regenerate.
4735 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4736 support; force -gno-pubnames.
4737 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4738 support.
4739 (gdb_index_test_4): New test.
4740 * testsuite/Makefile.in: Regenerate.
4741 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4742 * testsuite/gdb_index_test_2.sh: Likewise.
4743 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4744 * testsuite/gdb_index_test_4.sh: New script.
4745 * testsuite/gdb_index_test_comm.sh: New script with common code;
4746 don't look for space after colon.
4747
b7fd7c37
ST
47482012-07-16 Sriraman Tallam <tmsriram@google.com>
4749
4750 * gold.cc (queue_middle_tasks): Update function order only after
4751 deferred objects due to plugins are processed.
4752
1f3212db
ILT
47532012-07-11 Ian Lance Taylor <iant@google.com>
4754
4755 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4756 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4757 (Target_arm::scan_reloc_for_stub): Likewise.
4758 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4759 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4760 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4761 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4762 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4763
81c82a68
ILT
47642012-07-10 Dodji Seketeli <dodji@redhat.com>
4765 Ian Lance Taylor <iant@google.com>
4766
4767 PR gold/14309
4768 * configure.ac: Test whether std::tr1::hash<off_t> works.
4769 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4770 needed.
4771 * output.h (class Output_fill): Add virtual destructor.
4772 * configure, config.in: Rebuild.
4773
eabc84f4
RM
47742012-06-22 Roland McGrath <mcgrathr@google.com>
4775
4776 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4777
370e30b6
RÁE
47782012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4779
4780 * plugin.cc (Plugin::load): Handle position independent executables.
4781
fb1b895d
CC
47822012-06-06 Cary Coutant <ccoutant@google.com>
4783
4784 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4785 add .debug_macro.
4786 (lines_only_debug_sections): Likewise.
4787 (gdb_fast_lookup_sections): New static array.
4788 (is_gdb_debug_section): Rename formal parameter.
4789 (is_lines_only_debug_section): Likewise.
4790 (is_gdb_fast_lookup_section): New function.
4791 (Layout::include_section): Check for ".zdebug_" prefix; pass
4792 section name suffix to is_gdb_debug_section, et al.; check for
4793 fast-lookup sections when building .gdb_index.
4794 * options.h (--strip-debug-gdb): Update GDB version number.
4795
7c0640fa
CC
47962012-06-06 Cary Coutant <ccoutant@google.com>
4797
4798 * configure.ac: Add check for fallocate.
4799 * configure: Regenerate.
4800 * config.in: Regenerate.
4801
4802 * options.h (class General_options): Add --mmap-output-file and
4803 --posix-fallocate options.
4804 * output.cc: (posix_fallocate): Remove; replace with...
4805 (gold_fallocate): New function.
4806 (Output_file::map_no_anonymous): Call gold_fallocate.
4807 (Output_file::map): Check --mmap-output-file option.
4808
2a49eb69
DK
48092012-06-05 Jing Yu <jingyu@google.com>
4810
4811 * gold.h (textdomain): Add do {} to empty while(0).
4812 (bindtextdomain): Likewise.
4813
fad072ac
CC
48142012-06-04 Cary Coutant <ccoutant@google.com>
4815
4816 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4817 has_dynsym_index.
4818
8cc69fb6
ST
48192012-05-25 Sriraman Tallam <tmsriram@google.com>
4820
4821 * symtab.cc (Symbol_table::define_special_symbol):
4822 Initialize *poldsym to prevent uninitialized variable errors.
4823
1be75daa
CC
48242012-05-23 Cary Coutant <ccoutant@google.com>
4825
4826 * layout.cc (Layout::section_name_mapping): Add rules to handle
4827 exact match on .data.rel.ro.local or .data.rel.ro.
4828 (Layout::output_section_name): Check for exact matches.
4829
9b689de0
CC
48302012-05-23 Cary Coutant <ccoutant@google.com>
4831
4832 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4833 more carefully.
4834
b24fdbf5
CC
48352012-05-22 Cary Coutant <ccoutant@google.com>
4836
4837 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4838 object before exporting symbol.
4839
e550e1a2
L
48402012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4841
4842 * testsuite/tls_test.cc: Include "config.h" first.
4843 * testsuite/tls_test_c.c: Likewise.
4844
df7b86aa
NC
48452012-05-17 Daniel Richard G. <skunk@iskunk.org>
4846 Nick Clifton <nickc@redhat.com>
4847
4848 PR 14072
4849 * configure.in: Add check that sysdep.h has been included before
4850 any system header files.
4851 * configure: Regenerate.
4852 * config.in: Regenerate.
4853
1007b503
CC
48542012-05-14 Cary Coutant <ccoutant@google.com>
4855
4856 * layout.cc (Layout::make_output_section): Mark .tdata section
4857 as RELRO.
4858 * testsuite/relro_test.cc: Add a TLS variable.
4859
fd885f3a
L
48602012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4861
4862 PR gold/14091
4863 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4864 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4865 R_X86_64_64.
4866
80f5885c
CC
48672012-05-08 Cary Coutant <ccoutant@google.com>
4868
4869 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4870 (lines_only_debug_sections): Likewise.
4871
2e702c99
RM
48722012-05-02 Roland McGrath <mcgrathr@google.com>
4873
4874 * nacl.cc: New file.
4875 * nacl.h: New file.
4876 * Makefile.am (CCFILES, HFILES): Add them.
4877 * Makefile.in: Regenerate.
4878 * i386.cc (Output_data_plt_i386_nacl): New class.
4879 (Output_data_plt_i386_nacl_exec): New class.
4880 (Output_data_plt_i386_nacl_dyn): New class.
4881 (Target_i386_nacl): New class.
4882 (Target_selector_i386_nacl): New class.
4883 (target_selector_i386): Use it instead of Target_selector_i386.
4884 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4885 (Target_x86_64_nacl): New class.
4886 (Target_selector_x86_64_nacl): New class.
4887 (target_selector_x86_64, target_selector_x32): Use it instead of
4888 Target_selector_x86_64.
4889 * arm.cc (Output_data_plt_arm_nacl): New class.
4890 (Target_arm_nacl): New class.
4891 (Target_selector_arm_nacl): New class.
4892 (target_selector_arm, target_selector_armbe): Use it instead of
4893 Target_selector_arm.
4894
4895 * target-select.cc (select_target): Take new Input_file* and off_t
4896 arguments, pass them on to recognize method of selector.
4897 * object.cc (make_elf_sized_object): Update caller.
4898 * parameters.cc (parameters_force_valid_target): Likewise.
4899 * incremental.cc (make_sized_incremental_binary): Likewise.
4900 * target-select.h: Update decl.
4901 (Target_selector::recognize): Take new Input_file* argument,
4902 pass it on to do_recognize.
4903 (Target_selector::do_recognize): Take new Input_file* argument.
4904 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4905 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4906 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4907 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4908
4909 * target.h (Target::Target_info): New members isolate_execinstr
4910 and rosegment_gap.
4911 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4912 * arm.cc (Target_arm::arm_info): Update initializer.
4913 * i386.cc (Target_i386::i386_info): Likewise.
4914 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4915 * sparc.cc (Target_sparc::sparc_info): Likewise.
4916 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4917 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4918 * layout.cc (Layout::attach_allocated_section_to_segment):
4919 Take new const Target* argument. If target->isolate_execinstr(), act
4920 like --rosegment.
4921 (Layout::find_first_load_seg): Take new const Target* argument;
4922 if target->isolate_execinstr(), reject PF_X segments.
4923 (Layout::relaxation_loop_body): Update caller.
4924 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4925 reset file offset to zero when we hit LOAD_SEG, and then do a second
4926 loop over the segments before LOAD_SEG to reassign offsets after
4927 addresses have been determined. Handle target->rosegment_gap().
4928 (Layout::attach_section_to_segment): Take new const Target* argument;
4929 pass it to attach_allocated_section_to_segment.
4930 (Layout::make_output_section): Update caller.
4931 (Layout::attach_sections_to_segments): Take new const Target* argument;
4932 pass it to attach_section_to_segment.
4933 * gold.cc (queue_middle_tasks): Update caller.
4934 * layout.h (Layout): Update method decls with new arguments.
4935
4936 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4937 Target_info pointer to use.
4938 (Target_arm::do_make_data_plt): New virtual method.
4939 (Target_arm::make_data_plt): New method that calls it.
4940 (Target_arm::make_plt_entry): Use it.
4941 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4942 for the section alignment.
4943 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4944 method.
4945 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4946 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4947 method.
4948 (Output_data_plt_arm::get_plt_entry_size): Call it.
4949 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4950 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4951 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4952 method.
4953 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4954 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4955 method instead of sizeof(plt_entry).
4956 (Output_data_plt_arm::add_entry): Likewise.
4957 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4958 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4959 than static method.
4960 (Target_arm::plt_entry_size): Likewise.
4961 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4962 Move to ...
4963 (Output_data_plt_arm_standard): ... here, new class.
4964 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4965 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4966 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4967
4968 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4969 Take additional argument for the PLT entry size.
4970 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4971 Use get_plt_entry_size method rather than plt_entry_size variable.
4972 (Output_data_plt_x86_64::reserve_slot): Likewise.
4973 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4974 (Output_data_plt_x86_64::add_entry): Likewise.
4975 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4976 (Output_data_plt_x86_64::address_for_global): Likewise.
4977 (Output_data_plt_x86_64::address_for_local): Likewise.
4978 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4979 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4980 Make method non-static.
4981 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4982 method.
4983 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4984 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4985 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4986 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4987 virtual method.
4988 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4989 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4990 virtual method.
4991 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4992 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4993 virtual method.
4994 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4995 (Output_data_plt_x86_64::plt_entry_size)
4996 (Output_data_plt_x86_64::first_plt_entry)
4997 (Output_data_plt_x86_64::plt_entry)
4998 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4999 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5000 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5001 (Output_data_plt_x86_64_standard): ... here, new class.
5002 (Target_x86_64::Target_x86_64): Take optional argument for the
5003 Target_info pointer to use.
5004 (Target_x86_64::do_make_data_plt): New virtual method.
5005 (Target_x86_64::make_data_plt): New method to call it.
5006 (Target_x86_64::init_got_plt_for_update): Use that.
5007 Call this->plt_->add_eh_frame method here.
5008 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5009 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5010 rather than static method.
5011 (Target_x86_64::plt_entry_size): Likewise.
5012 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5013 rather than plt_entry_size variable. Move guts of PLT filling to...
5014 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5015 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5016 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5017
5018 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5019 additional argument for the section alignment.
5020 Don't do add_eh_frame_for_plt here.
5021 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5022 non-static. Use get_plt_entry_size method rather than plt_entry_size
5023 variable.
5024 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5025 method.
5026 (Output_data_plt_i386::get_plt_entry_size): Call it.
5027 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5028 (Output_data_plt_i386::add_eh_frame): New method to call it.
5029 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5030 method.
5031 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5032 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5033 method.
5034 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5035 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5036 method instead of plt_entry_size.
5037 (Output_data_plt_i386::plt_entry_size)
5038 (Output_data_plt_i386::plt_eh_frame_fde_size)
5039 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5040 (Output_data_plt_i386_standard): ... here, new class.
5041 (Output_data_plt_i386_exec): New class.
5042 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5043 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5044 (Output_data_plt_i386::exec_plt_entry): Move to ...
5045 (Output_data_plt_i386_exec::plt_entry): ... here.
5046 (Output_data_plt_i386_dyn): New class.
5047 (Output_data_plt_i386::first_plt_entry): Move to ...
5048 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5049 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5050 (Output_data_plt_i386_dyn::plt_entry): ... here.
5051 (Target_i386::Target_i386): Take optional argument for the Target_info
5052 pointer to use.
5053 (Target_i386::do_make_data_plt): New virtual method.
5054 (Target_i386::make_data_plt): New method to call it.
5055 (Target_i386::make_plt_section): Use that.
5056 Call this->plt_->add_eh_frame method here.
5057 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5058 rather than plt_entry_size variable.
5059 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5060 (Output_data_plt_i386::address_for_local): Likewise.
5061 (Output_data_plt_i386::do_write): Likewise.
5062 Move guts of PLT filling to...
5063 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5064 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5065 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5066 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5067
b9b9f2ee
CC
50682012-05-01 Cary Coutant <ccoutant@google.com>
5069
5070 * dwarf_reader.cc (Dwarf_die::read_attributes)
5071 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5072 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5073 * reduced_debug_output.cc
5074 (Output_reduced_debug_info_section::get_die_end): Remove
5075 DW_FORM_GNU_ref_index. Add default case.
5076
57923f48
MW
50772012-04-26 Mark Wielaard <mjw@redhat.com>
5078
5079 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5080 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5081 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5082 DW_AT_high_pc as offset from DW_AT_low_pc.
5083
5084 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5085 * testsuite/Makefile.in: Regenerate.
5086 * testsuite/gdb_index_test_3.c: New test source file.
5087 * testsuite/gdb_index_test_3.sh: New test source file.
5088
2c54b4f4
ILT
50892012-04-25 Ian Lance Taylor <iant@google.com>
5090
5091 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5092 pointer.
5093 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5094 as a class, not a struct.
5095 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5096 (Target_arm::apply_cortex_a8_workaround): Likewise.
5097 * gc.h: Declare Reloc_types as a struct, not a class.
5098 * object.h: Declare Symbols_data as a struct.
5099 * reloc.h: Declare Read_relocs_data as a struct.
5100 * target.h: Declare Relocate_info as a struct.
5101
a5a5f7a3
DM
51022012-04-24 David S. Miller <davem@davemloft.net>
5103
5104 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5105 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5106 and R_SPARC_WPLT30.
5107
f038d496
CC
51082012-04-24 Cary Coutant <ccoutant@google.com>
5109
5110 * incremental-dump.cc (find_input_containing_global): Replace
5111 magic number with symbolic constant.
5112 (dump_incremental_inputs): Update version number.
5113 * incremental.cc (Output_section_incremental_inputs): Update version
5114 number; import symbolic constants from Incremental_inputs_reader.
5115 (Incremental_inputs::create_data_sections): Align relocations
5116 section correctly for 64-bit targets.
5117 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5118 constants; add padding.
5119 (Output_section_incremental_inputs::write_header): Add assert for
5120 header_size.
5121 (Output_section_incremental_inputs::write_input_files): Add assert
5122 for input_entry_size.
5123 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5124 add assert for object_info_size, input_section_entry_size,
5125 global_sym_entry_size.
5126 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5127 for data structure sizes; use them.
5128 (Incremental_input_entry_reader): Import symbolic constants from
5129 Incremental_inputs_reader; use them.
5130
a4d85145
DM
51312012-04-23 David S. Miller <davem@davemloft.net>
5132
5133 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5134 and elf_flags_set_.
5135 (Target_sparc::Target_sparc): Initialize new fields.
5136 (Target_sparc::do_make_elf_object): New function.
5137 (Target_sparc::do_adjust_elf_header): New function.
5138
1d509098
CC
51392012-04-23 Cary Coutant <ccoutant@google.com>
5140
5141 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5142 CU range table of gdb index.
5143
7ebeff7f
DM
51442012-04-20 David S. Miller <davem@davemloft.net>
5145
5146 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5147 instead of false.
5148
13cf9988
DM
51492012-04-16 David S. Miller <davem@davemloft.net>
5150
2a1079e8
DM
5151 * sparc.cc (Target_sparc::got_address): New function.
5152 (Sparc_relocate_functions::gdop_hix22): New function.
5153 (Sparc_relocate_functions::gdop_lox10): New function.
5154 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5155 relocs.
5156 (Target_sparc::Scan::local): Likewise if the global symbol is not
5157 preemptible and is not IFUNC.
5158 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5159 transformations for local and non-preemptible non-IFUNC global
5160 symbols.
5161
0bc964fc
DM
5162 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5163 writing out 64-bit part of ranges.
5164
661d7a80
DM
5165 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5166 -fpic and -fpie respectively.
5167 * Makefile.in: Regenerate.
5168
8c2bf391
DM
5169 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5170 (Target_sparc::Target_sparc): Initialize new field.
5171 (Target_sparc::do_plt_section_for_global): New function.
5172 (Target_sparc::do_plt_section_for_local): New function.
5173 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5174 (Target_sparc::make_plt_section): New function, broken out of
5175 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5176 (Target_sparc::make_plt_entry): Call make_plt_section.
5177 (Target_sparc::make_local_ifunc_plt_entry): New function.
5178 (Target_sparc::rela_ifunc_section): New function.
5179 (Target_sparc::plt_section): Remove const.
5180 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5181 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5182 and ifunc_count_ fields.
5183 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5184 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5185 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5186 (Output_data_plt_sparc::rela_ifunc): New function.
5187 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5188 (Output_data_plt_sparc::has_ifunc_section): New function.
5189 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5190 (Output_data_plt_sparc::address_for_global): New function.
5191 (Output_data_plt_sparc::address_for_local): New function.
5192 (Output_data_plt_sparc::plt_index_to_offset): New function.
5193 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5194 and entry_count.
5195 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5196 entry_count.
5197 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5198 R_SPARC_JMP_IREL to switch.
5199 (Target_sparc::Scan::check_non_pic): Likewise.
5200 (Target_sparc::Scan::local): Handle IFUNC symbols.
5201 (Target_sparc::Scan::local): Likewise.
5202 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5203 and plt_address_for_local.
5204 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5205 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5206
13cf9988
DM
5207 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5208 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5209 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5210 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5211 global relocs too.
5212 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5213 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5214 calls.
5215 * sparc.cc (Target_sparc::Scan::global): Likewise.
5216 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5217
31821be0
CC
52182012-04-16 Cary Coutant <ccoutant@google.com>
5219
5220 * archive.cc (Library_base::should_include_member): Check for
5221 --export-dynamic-symbol.
5222 * options.h (class General_options): Add --export-dynamic-symbol.
5223 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5224 --export-dynamic-symbol.
5225 (Symbol_table::gc_mark_undef_symbols): Likewise.
5226 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5227
2615994e
DM
52282012-04-12 David S. Miller <davem@davemloft.net>
5229
5230 * sparc.cc (Reloc::wdisp10): New relocation method.
5231 (Reloc::h34): Likewise.
5232 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5233 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5234 R_SPARC_WDISP10.
5235 (Target_sparc::Scan::local): Likewise.
5236 (Target_sparc::Scan::global): Likewise.
5237 (Target_sparc::Relocate::relocate): Likewise.
5238
6782735d
CC
52392012-04-09 Cary Coutant <ccoutant@google.com>
5240
5241 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5242 low_pc == 0.
5243
8c7a0b00
ILT
52442012-04-06 Ian Lance Taylor <iant@google.com>
5245
5246 * timer.cc: #include <unistd.h>.
5247
58797674
RM
52482012-04-06 Roland McGrath <mcgrathr@google.com>
5249
5250 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5251 * config.in: Regenerate.
5252 * configure: Regenerate.
5253
44350750
NC
52542012-04-05 Nick Clifton <nickc@redhat.com>
5255
5256 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5257 (AM_LC_MESSAGES): Add.
5258 * aclocal.m4: Regenerate.
5259 * config.in: Regenerate.
5260 * configure: Regenerate.
5261
c1027032
CC
52622012-03-21 Cary Coutant <ccoutant@google.com>
5263
5264 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5265 * Makefile.in: Regenerate.
5266 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5267 (Sized_elf_reloc_mapper::symbol_section): New function.
5268 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5269 (make_elf_reloc_mapper): New function.
5270 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5271 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5272 (Dwarf_abbrev_table::do_get_abbrev): New function.
5273 (Dwarf_ranges_table::read_ranges_table): New function.
5274 (Dwarf_ranges_table::read_range_list): New function.
5275 (Dwarf_pubnames_table::read_section): New function.
5276 (Dwarf_pubnames_table::read_header): New function.
5277 (Dwarf_pubnames_table::next_name): New function.
5278 (Dwarf_die::Dwarf_die): New function.
5279 (Dwarf_die::read_attributes): New function.
5280 (Dwarf_die::skip_attributes): New function.
5281 (Dwarf_die::set_name): New function.
5282 (Dwarf_die::set_linkage_name): New function.
5283 (Dwarf_die::attribute): New function.
5284 (Dwarf_die::string_attribute): New function.
5285 (Dwarf_die::int_attribute): New function.
5286 (Dwarf_die::uint_attribute): New function.
5287 (Dwarf_die::ref_attribute): New function.
5288 (Dwarf_die::child_offset): New function.
5289 (Dwarf_die::sibling_offset): New function.
5290 (Dwarf_info_reader::check_buffer): New function.
5291 (Dwarf_info_reader::parse): New function.
5292 (Dwarf_info_reader::do_parse): New function.
5293 (Dwarf_info_reader::do_read_string_table): New function.
5294 (Dwarf_info_reader::lookup_reloc): New function.
5295 (Dwarf_info_reader::get_string): New function.
5296 (Dwarf_info_reader::visit_compilation_unit): New function.
5297 (Dwarf_info_reader::visit_type_unit): New function.
5298 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5299 Sized_elf_reloc_mapper.
5300 (Sized_dwarf_line_info::symbol_section): Remove function.
5301 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5302 (Sized_dwarf_line_info::read_line_mappings): Remove object
5303 parameter, adjust callers.
5304 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5305 * dwarf_reader.h: Include <sys/types.h>.
5306 (class Track_relocs): Remove forward declaration.
5307 (class Elf_reloc_mapper): New class.
5308 (class Sized_elf_reloc_mapper): New class.
5309 (class Dwarf_abbrev_table): New class.
5310 (class Dwarf_range_list): New class.
5311 (class Dwarf_ranges_table): New class.
5312 (class Dwarf_pubnames_table): New class.
5313 (class Dwarf_die): New class.
5314 (class Dwarf_info_reader): New class.
5315 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5316 (Sized_dwarf_line_info::symbol_section): Remove member function.
5317 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5318 base class.
5319 * gdb-index.cc: New source file.
5320 * gdb-index.h: New source file.
5321 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5322 and .debug_types sections, call Layout::add_to_gdb_index.
5323 (Sized_relobj_incr::do_section_name): Implement.
5324 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5325 return type; Implement.
5326 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5327 return type.
5328 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5329 parameter list and return type.
5330 (Sized_incr_dynobj::do_section_contents): Likewise.
5331 * layout.cc: Include gdb-index.h.
5332 (Layout::Layout): Initialize gdb_index_data_.
5333 (Layout::init_fixed_output_section): Check for .gdb_index section.
5334 (Layout::add_to_gdb_index): New function. Instantiate.
5335 * layout.h: Add forward declaration for class Gdb_index.
5336 (Layout::add_to_gdb_index): New member function.
5337 (Layout::gdb_index_data_): New data member.
5338 * main.cc: Include gdb-index.h.
5339 (main): Print statistics for gdb index.
5340 * object.cc (Object::section_contents): Move code into
5341 do_section_contents.
5342 (need_decompressed_section): Check for sections needed when building
5343 gdb index.
5344 (build_compressed_section_map): Likewise.
5345 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5346 gdb index.
5347 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5348 sections; call Layout::add_to_gdb_index.
5349 (Sized_relobj_file::do_decompressed_section_contents): Call
5350 do_section_contents directly.
5351 * object.h (Object::do_section_contents): Adjust parameter list and
5352 return type.
5353 (Object::do_decompressed_section_contents): Call do_section_contents
5354 directly.
5355 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5356 return type.
5357 * options.h (class General_options): Add --gdb-index option.
5358 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5359 list and return type.
5360 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5361 * reloc.h (Track_relocs::checkpoint): New function.
5362 (Track_relocs::reset): New function.
5363
5364 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5365 New test cases.
5366 * testsuite/Makefile.in: Regenerate.
5367 * testsuite/gdb_index_test.cc: New test source file.
5368 * testsuite/gdb_index_test_1.sh: New test source file.
5369 * testsuite/gdb_index_test_2.sh: New test source file.
5370
647f1574
DK
53712012-03-19 Doug Kwan <dougkwan@google.com>
5372
5373 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5374 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5375 __exidx_start and __exidx_end. Make symbol table parameter
5376 anonymous as it is not used.
5377 * gold.cc (queue_middle_tasks): Call target hook to define any
5378 target-specific symbols.
5379 * target.h (Target::define_standard_symbols): New method.
5380 (Target::do_define_standard_symbols): Same.
5381 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5382 * testsuite/Makefile.in: Regenerate.
5383 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5384 and __exidx_end.
5385 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5386 relocations are generated for __exidx_start and __exidx_end.
5387
7c6109da
DK
53882012-03-16 Doug Kwan <dougkwan@google.com>
5389
5390 * testsuite/Makefile.am: Disable test initpri3b.
5391 * testsuite/Makefile.in: Regenerate.
5392
7b8957f8
DK
53932012-03-15 Doug Kwan <dougkwan@google.com>
5394
5395 * arm.cc (Target_arm::got_section): Make .got section read-only
5396 if -z now is given.
5397
14dc9ef7
ILT
53982012-03-15 Ian Lance Taylor <iant@google.com>
5399
5400 PR gold/13850
5401 * layout.cc (Layout::make_output_section): Correctly mark
5402 SHT_INIT_ARRAY, et. al., as relro.
5403
fa40b62a
DK
54042012-03-14 Doug Kwan <dougkwan@google.com>
5405
5406 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5407 dynamic relocations for protected symbols in shared objects.
5408
fd325007
ILT
54092012-03-13 Ian Lance Taylor <iant@google.com>
5410
5411 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5412 keep the larger alignment.
5413
e8dd54e1
CC
54142012-03-12 Cary Coutant <ccoutant@google.com>
5415
5416 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5417 handling of DW_LNE_define_file.
5418
feb5f3b0
CC
54192012-03-12 Cary Coutant <ccoutant@google.com>
5420
5421 * reduced_debug_output.cc
5422 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5423 codes to switch.
5424
a1fb4256
CC
54252012-02-29 Cary Coutant <ccoutant@google.com>
5426
5427 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5428
5dd8762a
CC
54292012-02-29 Cary Coutant <ccoutant@google.com>
5430
5431 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5432 Call Object::decompressed_section_contents.
5433 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5434 New dtor.
5435 (Sized_dwarf_line_info::buffer_start_): New data member.
5436 * merge.cc (Output_merge_data::do_add_input_section): Call
5437 Object::decompressed_section_contents.
5438 (Output_merge_string::do_add_input_section): Likewise.
5439 * object.cc (need_decompressed_section): New function.
5440 (build_compressed_section_map): Decompress sections needed later.
5441 (Sized_relobj_file::do_decompressed_section_contents): New function.
5442 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5443 * object.h (Object::decompressed_section_contents): New function.
5444 (Object::discard_decompressed_sections): New function.
5445 (Object::do_decompressed_section_contents): New function.
5446 (Object::do_discard_decompressed_sections): New function.
5447 (Compressed_section_info): New type.
5448 (Compressed_section_map): Include decompressed section contents.
5449 (Sized_relobj_file::do_decompressed_section_contents): New function.
5450 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5451
7b5de7ee
CC
54522012-02-16 Cary Coutant <ccoutant@google.com>
5453
5454 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5455 * testsuite/Makefile.in: Regenerate.
5456
f9fa4a63
CC
54572012-02-14 Cary Coutant <ccoutant@google.com>
5458
5459 * options.cc (General_options::finalize): Disallow -pie and -static.
5460
2c175ebc
DK
54612012-02-03 Doug Kwan <dougkwan@google.com>
5462
5463 * arm.cc (Arm_relocate_functions::abs8,
5464 Arm_relocate_functions::abs16): Use
5465 Bits::has_signed_unsigned_overflow32.
5466 (Arm_relocate_functions::thm_abs8): Correct range of
5467 overflow check.
5468 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5469 in assertions.
5470
90cff06f
DK
54712012-02-02 Doug Kwan <dougkwan@google.com>
5472
5473 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5474 position independent outputs, not just shared objects.
5475
63887f3d
L
54762012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5477
5478 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5479 * configure: Regenerated.
5480
bef2b434
ILT
54812012-01-27 Ian Lance Taylor <iant@google.com>
5482
5483 * reloc.h (Bits): New class with static functions, copied from
5484 namespace utils in arm.cc.
5485 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5486 instead.
5487
c335b55d
L
54882012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5489
5490 * incremental.cc (write_info_blocks): Correct relocation offset.
5491
41194d9f
L
54922012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5493
5494 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5495 (Relocate::tls_gd_to_le): Likewise.
5496
1bae613c
L
54972012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5498
5499 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5500
24482ca0
L
55012012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5502
5503 * configure.ac: Check if -mcmodel=medium works.
5504 * configure: Regenerated.
5505
c2c7840a
CC
55062012-01-24 Cary Coutant <ccoutant@google.com>
5507
5508 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5509 definition and ...
5510 (read_unsigned_LEB_128_x): ... this new function.
5511 (read_signed_LEB_128): Replaced with inline definition and ...
5512 (read_signed_LEB_128_x): ... this new function.
5513 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5514 (read_unsigned_LEB_128): Add inline definition.
5515 (read_signed_LEB_128_x): New function.
5516 (read_signed_LEB_128): Add inline definition.
5517 * testsuite/Makefile.am (leb128_unittest): New unit test.
5518 * testsuite/Makefile.in: Regenerate.
5519 * testsuite/leb128_unittest.cc: New unit test.
5520
833de760 55212012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5522
5523 PR gold/13617
5524 * i386.cc (Target_i386::do_code_fill): When using a jmp
5525 instruction, pad with nop instructions.
5526 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5527
618d6666
L
55282012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5529
5530 * x86_64.cc (gc_process_relocs): Add typename on types used in
5531 template.
5532 (scan_relocs): Likewise.
5533 (relocate_section): Likewise.
5534 (apply_relocation): Likewise.
5535
3660ff06
L
55362012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5537
5538 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5539 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5540 under x32.
5541
fc51264f
L
55422012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5543
5544 * x86_64.cc: Initial support for x32.
5545
dd74ae06
CC
55462012-01-03 Cary Coutant <ccoutant@google.com>
5547
5548 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5549 Use abstract base class for GOT.
5550 * gold/output.h (class Output_data_got_base): New abstract base class.
5551 (class Output_data_got): Derive from new base class, adjust ctors.
5552 (Output_data_got::reserve_slot): Make virtual; rename to
5553 do_reserve_slot; Adjust callers.
5554 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5555 pointer to abstract base class.
5556 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5557
83896202
ILT
55582011-12-18 Ian Lance Taylor <iant@google.com>
5559
5560 * object.h (Relobj::local_symbol_value): New function.
5561 (Relobj::local_plt_offset): New function.
5562 (Relobj::local_has_got_offset): New function.
5563 (Relobj::local_got_offset): New function.
5564 (Relobj::set_local_got_offset): New function.
5565 (Relobj::do_local_symbol_value): New pure virtual function.
5566 (Relobj::do_local_plt_offset): Likewise.
5567 (Relobj::do_local_has_got_offset): Likewise.
5568 (Relobj::do_local_got_offset): Likewise.
5569 (Relobj::do_set_local_got_offset): Likewise.
5570 (Sized_relobj::do_local_has_got_offset): Rename from
5571 local_has_got_offset.
5572 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5573 (Sized_relobj::do_set_local_got_offset): Rename from
5574 set_local_got_offset.
5575 (Sized_relobj_file::do_local_plt_offset): Rename from
5576 local_plt_offset.
5577 (Sized_relobj_file::do_local_symbol_value): New function.
5578 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5579 local_plt_offset.
5580 * output.cc (Output_data_got::Got_entry::write): Change object to
5581 Relobj. Use local_symbol_value.
5582 (Output_data_got::add_global_with_rel): Change rel_dyn to
5583 Output_data_reloc_generic*. Use add_global_generic.
5584 (Output_data_got::add_global_with_rela): Remove. Change all
5585 callers to use add_global_with_rel.
5586 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5587 Output_data_reloc_generic*. Use add_global_generic.
5588 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5589 callers to use add_global_pair_with_rel.
5590 (Output_data_got::add_local): Change object to Relobj*.
5591 (Output_data_got::add_local_plt): Likewise.
5592 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5593 change rel_dyn to Output_data_reloc_generic*. Use
5594 add_local_generic.
5595 (Output_data_got::add_local_with_rela): Remove. Change all
5596 callers to use all_local_with_rel.
5597 (Output_data_got::add_local_pair_with_rel): Change object to
5598 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5599 add_output_section_generic.
5600 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5601 callers to use add_local_pair_with_rel.
5602 (Output_data_got::reserve_local): Change object to Relobj*.
5603 * output.h: (class Output_data_reloc_generic): Add pure virtual
5604 declarations for add_global_generic, add_local_generic,
5605 add_output_section_generic.
5606 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5607 functions for Output_data_reloc_generic. Update declarations for
5608 changes listed in output.cc.
5609 (class Output_data_got): Change template parameter to got_size.
5610 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5611 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5612 function.
5613 (Sized_relobj_incr::do_local_plt_offset): New function.
5614 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5615 add_global_generic.
5616
76677ad0
CC
56172011-12-17 Cary Coutant <ccoutant@google.com>
5618
5619 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5620 * resolve.cc (Symbol_table::resolve): Likewise.
5621 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5622 arrays.
5623 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5624
8b8dd8d5
ILT
56252011-12-16 Ian Lance Taylor <iant@google.com>
5626
5627 * output.h (Output_data_reloc_generic::add): Only call
5628 add_dynamic_reloc if this is a dynamic reloc section.
5629
d55525b9
L
56302011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5631
5632 PR gold/13505
5633 * target-reloc.h (apply_relocation): Replace <64, false> with
5634 <size, big_endian>.
5635
ff81c7c1
NC
56362011-11-25 Nick Clifton <nickc@redhat.com>
5637
5638 * po/it.po: New Italian translation.
5639
628f39be
SA
56402011-11-17 Sterling Augustine <saugustine@google.com>
5641
5642 * script.cc (script_include_directive): Implement.
5643 (read_script_file): New local variables name and search_path. Update
5644 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5645 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5646 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5647
98ef3ea4
SA
56482011-11-11 Sterling Augustine <saugustine@google.com>
5649
5650 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5651 (file_or_sections_cmd): Likewise.
5652
f4a8b6d7
DK
56532011-11-11 Doug Kwan <dougkwan@google.com>
5654
5655 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5656 if --just-symbols is given.
5657
29ab395d
DK
56582011-11-10 Doug Kwan <dougkwan@google.com>
5659
5660 PR gold/13362
5661 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5662 when processing data relocs.
5663 * reloc.h (Relocate_functions::rel_unaligned): New method.
5664 (Relocate_functions::pcrel_unaligned): Ditto.
5665 (Relocate_functions::rel32_unaligned): Ditto.
5666 (Relocate_functions::pcrel32_unaligned): Ditto.
5667
2c339f71
DK
56682011-11-09 Doug Kwan <dougkwan@google.com>
5669
5670 PR gold/13362
5671 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5672 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5673 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5674 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5675 (Relocate_functions::rel_unaligned): New.
5676 (Relocate_functions::rel32_unaligned): New.
5677 * target-reloc.h (relocate_for_relocatable): Add code to handle
5678 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5679 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5680 arm_unaligned_reloc_r): New targets.
5681 * testsuite/Makefile.in: Regenerate.
5682 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5683 linking.
5684
3f3cddf1
ILT
56852011-11-02 Ian Lance Taylor <iant@google.com>
5686
5687 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5688 NATIVE_LINKER.
5689 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5690 * options.cc (General_options::finalize): Use library search path
5691 from configure script if specified. If not native and no sysroot,
5692 only search TOOLLIBDIR.
5693 * options.h (Search_directory::Search_directory): Change name to
5694 const std::string&.
5695 (General_options::add_to_library_path_with_sysroot): Change arg to
5696 const std::string&.
5697 * configure, Makefile.in, config.in: Rebuild.
5698
a8e2273b
ILT
56992011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5700
5701 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5702 we are working around the ARM1176 Erratum.
5703 * options.h (General_options::fix_arm1176): Add option.
5704 * testsuite/Makefile.am: Add testcases, and keep current ones
5705 working.
5706 * testsuite/Makefile.in: Regenerate.
5707 * testsuite/arm_fix_1176.s: New file.
5708 * testsuite/arm_fix_1176.sh: Likewise.
5709
cd6eab1c
ILT
57102011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5711
5712 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5713 may_use_blx_.
5714 (Target_arm::may_use_blx): Remove method.
5715 (Target_arm::set_may_use_blx): Likewise.
5716 (Target_arm::may_use_v4t_interworking): New method.
5717 (Target_arm::may_use_v5t_interworking): Likewise.
5718 (Target_arm::may_use_blx_): Remove member variable.
5719 (Arm_relocate_functions::arm_branch_common): Check for v5T
5720 interworking.
5721 (Arm_relocate_functions::thumb_branch_common): Likewise.
5722 (Reloc_stub::stub_type_for_reloc): Likewise.
5723 (Target_arm::do_finalize_sections): Correct interworking checks.
5724 * testsuite/Makefile.am: Add new tests.
5725 * testsuite/Makefile.in: Regenerate.
5726 * testsuite/arm_farcall_arm_arm.s: New test.
5727 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5728 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5729 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5730 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5731 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5732 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5733 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5734
286adcf4
CC
57352011-10-31 Cary Coutant <ccoutant@google.com>
5736
5737 PR gold/13023
5738 * expression.cc (Expression::eval_with_dot): Add
5739 is_section_dot_assignment parameter.
5740 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5741 absolute and assigning to dot within a section.
5742 * script-sections.cc
5743 (Output_section_element_assignment::set_section_addresses): Pass
5744 dot_section to set_if_absolute.
5745 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5746 as is_section_dot_assignment flag to eval_with_dot.
5747 (Output_section_element_dot_assignment::set_section_addresses):
5748 Likewise.
5749 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5750 parameter. Also set value if relative to dot_section; set the
5751 symbol's output_section.
5752 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5753 parameter. Adjust all callers.
5754 (Expression::eval_maybe_dot): Likewise.
5755 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5756 Adjust all callers.
5757 * testsuite/script_test_2.t: Test assignment of an absolute value
5758 to dot within an output section element.
5759
9634ed06
CC
57602011-10-31 Cary Coutant <ccoutant@google.com>
5761
5762 * options.h (class General_options): Add --[no-]gnu-unique options.
5763 * symtab.cc (Symbol_table::sized_write_globals): Convert
5764 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5765
de4101c7
CC
57662011-10-31 Cary Coutant <ccoutant@google.com>
5767
5768 PR gold/13359
5769 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5770 unnecessary assertion.
5771 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5772
7257cc92
ST
57732011-10-31 Sriraman Tallam <tmsriram@google.com>
5774
5775 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5776 gc_mark_symbol.
5777 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5778 gc_mark_symbol.
5779 Change to just keep the section associated with symbol.
5780 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5781 they are externally visible and --export-dynamic is turned on.
5782 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5783
bfc34b3f
ILT
57842011-10-19 Ian Lance Taylor <iant@google.com>
5785
5786 PR gold/13163
5787 * script-sections.cc
5788 (Output_section_element_dot_assignment::needs_output_section): New
5789 function.
5790
ea0d8c47
ILT
57912011-10-19 Ian Lance Taylor <iant@google.com>
5792
5793 PR gold/13204
5794 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5795 --section-start option was seen.
5796 * options.h (General_options::any_section_start): New function.
5797
abd242a9
DM
57982011-10-18 David S. Miller <davem@davemloft.net>
5799
5800 PR binutils/13301
5801 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5802 member to track relocation locations that have moved during TLS
5803 reloc optimizations.
5804 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5805 (Target_sparc::Relocate::relocate): Adjust view down by 4
5806 bytes if it matches reloc_adjust_addr_.
5807 (Target_sparc::Relocate::relocate_tls): Always move the
5808 __tls_get_addr call delay slot instruction forward 4 bytes when
5809 performing relaxation.
5810
bab9090f
CC
58112011-10-18 Cary Coutant <ccoutant@google.com>
5812
5813 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5814 (Output_file::map_no_anonymous): Check for non-zero
5815 return code from posix_fallocate.
5816
f7c5b166
CC
58172011-10-17 Cary Coutant <ccoutant@google.com>
5818
5819 PR gold/13245
5820 * plugin.cc (is_visible_from_outside): Check for symbols
5821 referenced from dynamic objects.
5822 * resolve.cc (Symbol_table::resolve): Don't count references
5823 from dynamic objects as references from real ELF files.
5824 * testsuite/plugin_test_2.sh: Adjust expected result.
5825
b490c0bb
CC
58262011-10-17 Cary Coutant <ccoutant@google.com>
5827
5828 * gold.cc: Include timer.h.
5829 (queue_middle_tasks): Stamp time.
5830 (queue_final_tasks): Likewise.
5831 * main.cc (main): Store timer in parameters. Print timers
5832 for each pass.
5833 * parameters.cc (Parameters::Parameters): Initialize timer_.
5834 (Parameters::set_timer): New function.
5835 (set_parameters_timer): New function.
5836 * parameters.h (Parameters::set_timer): New function.
5837 (Parameters::timer): New function.
5838 (Parameters::timer_): New data member.
5839 (set_parameters_timer): New function.
5840 * timer.cc (Timer::stamp): New function.
5841 (Timer::get_pass_time): New function.
5842 * timer.h (Timer::stamp): New function.
5843 (Timer::get_pass_time): New function.
5844 (Timer::pass_times_): New data member.
5845
f475cf7b
CC
58462011-10-17 Cary Coutant <ccoutant@google.com>
5847
5848 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5849 task for members of lib groups.
5850
cdd7e244
CC
58512011-10-17 Cary Coutant <ccoutant@google.com>
5852
5853 PR gold/13288
4f95c8b4 5854 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5855 (File_read::make_view): Move bounds check (replace with assert)...
5856 (File_read::find_or_make_view): ... to here.
5857
dfb45471
CC
58582011-10-12 Cary Coutant <ccoutant@google.com>
5859
4f95c8b4 5860 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5861 ::read returns less than requested size.
5862
53bbcc1b
CC
58632011-10-10 Cary Coutant <ccoutant@google.com>
5864
4f95c8b4 5865 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5866 Initialize defined_count_.
5867 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5868 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5869 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5870 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5871 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5872 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5873 member.
5874 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5875 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5876 Return zeroes instead of internal error.
5877
397b129b
CC
58782011-10-10 Cary Coutant <ccoutant@google.com>
5879
5880 PR gold/13249
4f95c8b4 5881 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5882 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5883 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5884 (Output_reloc::type_): Adjust size of bit field.
5885 (Output_reloc::use_plt_offset_): New bit field.
5886 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5887 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5888 flag. Adjust all callers.
4f95c8b4 5889 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5890 creating RELATIVE relocations.
5891
d5698657
NC
58922011-10-10 Nick Clifton <nickc@redhat.com>
5893
5894 * po/es.po: Updated Spanish translation.
5895 * po/fi.po: Updated Finnish translation.
5896
6a59a5c2
DN
58972011-10-03 Diego Novillo <dnovillo@google.com>
5898
5899 * options.cc (parse_uint): Fix dereference of RETVAL.
5900
f0558624
ST
59012011-09-29 Sriraman Tallam <tmsriram@google.com>
5902
5903 * layout.h (section_order_map_): New member.
5904 (get_section_order_map): New member function.
5905 * output.cc (Output_section::add_input_section): Check for patterns
5906 only when --section-ordering-file is specified.
5907 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5908 output_sections have been formed.
5909 * layout.cc (Layout_Layout): Initialize section_order_map_.
5910 * plugin.cc (update_section_order): Store order in order_map. Do not
5911 update the order.
5912 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5913 * testsuite/Makefile.in: Regenerate.
5914 * testsuite/plugin_section_order.c: New file.
5915 * testsuite/plugin_final_layout.cc: New file.
5916 * testsuite/plugin_final_layout.sh: New file.
5917
a7dac153
CC
59182011-09-29 Cary Coutant <ccoutant@google.com>
5919
4f95c8b4 5920 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5921 Check for NULL.
4f95c8b4 5922 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5923 symbols during incremental update.
5924 (Symbol_table::add_from_dynobj): Likewise.
5925
eebd87a5
ILT
59262011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5927 Ian Lance Taylor <iant@google.com>
5928
5929 * symtab.cc (Symbol_table::define_special_symbol): Always
5930 canonicalize version string.
5931
403a3331
CC
59322011-09-26 Cary Coutant <ccoutant@google.com>
5933
4f95c8b4
CC
5934 * gold.cc (queue_initial_tasks): Move option checks ...
5935 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5936 some options; make others fatal.
5937
235061c2
CC
59382011-09-26 Cary Coutant <ccoutant@google.com>
5939
5940 gcc PR lto/47247
5941 * plugin.cc (get_symbols_v2): New function.
5942 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5943 (is_referenced_from_outside): New function.
5944 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5945 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5946 (get_symbols): Pass version parameter.
5947 (get_symbols_v2): New function.
5948 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5949 parameter.
5950 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5951 (onload): Add LDPT_GET_SYMBOLS_V2.
5952 (all_symbols_read_hook): Use get_symbols_v2; check for
5953 LDPR_PREVAILING_DEF_IRONLY_EXP.
5954 * testsuite/plugin_test_3.sh: Update expected results.
5955
dc87f620
ILT
59562011-09-23 Simon Baldwin <simonb@google.com>
5957
5958 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5959 configuration options.
5960 * configure: Regenerate.
5961 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5962 * Makefile.in: Regenerate.
5963 * testsuite/Makefile.in: Regenerate.
5964
a8279f82
ST
59652011-09-19 Sriraman Tallam <tmsriram@google.com>
5966
5967 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5968
0c9350c8
CC
59692011-09-19 Cary Coutant <ccoutant@google.com>
5970
5971 * incremental.cc (can_incremental_update): Fix typo in comment.
5972 * incremental.h (can_incremental_update): Likewise.
5973
aa06ae28
CC
59742011-09-18 Cary Coutant <ccoutant@google.com>
5975
5976 * incremental.cc (can_incremental_update): New function.
5977 * incremental.h (can_incremental_update): New function.
5978 * layout.cc (Layout::init_fixed_output_section): Call it.
5979 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5980 * object.cc (Sized_relobj_file::do_layout): Call
5981 can_incremental_update.
5982
ebb300b2
CC
59832011-09-13 Cary Coutant <ccoutant@google.com>
5984
5985 * configure.ac: Check for glibc support for gnu_indirect_function
5986 support with static linking, setting automake conditional
5987 IFUNC_STATIC.
5988 * Makefile.in: Regenerate.
5989 * configure: Regenerate.
5990
5991 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5992 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5993 for IFUNC_STATIC.
5994 * testsuite/Makefile.in: Regenerate.
5995
1206d0d5
CC
59962011-09-13 Cary Coutant <ccoutant@google.com>
5997
5998 * incremental.cc (Sized_relobj_incr::do_layout): Call
5999 report_comdat_group for kept comdat sections.
6000 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6001 * testsuite/Makefile.in: Regenerate.
6002 * testsuite/incr_comdat_test_1.cc: New source file.
6003 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6004 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6005 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6006
40b29874
ILT
60072011-09-13 Ian Lance Taylor <iant@google.com>
6008
6009 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6010 variable external_symbols_offset.
6011
1b045aac
ILT
60122011-09-12 Ian Lance Taylor <iant@google.com>
6013
6014 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6015 triggered if object has no symbols.
6016
24c6c55a
DM
60172011-09-09 David S. Miller <davem@davemloft.net>
6018
6019 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6020 (Output_fill_debug_line::do_write): Likewise.
6021
66570254
CC
60222011-08-29 Cary Coutant <ccoutant@google.com>
6023
6024 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6025 casts to match formatting specs.
6026 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6027
8ea8cd50
CC
60282011-08-26 Cary Coutant <ccoutant@google.com>
6029
6030 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6031 remaining hole size when allocating.
6032 (Layout::make_output_section): Set fill methods for debug sections.
6033 * layout.h (Free_list::Free_list_node): Move from private to
6034 public.
6035 (Free_list::set_min_hole_size): New function.
6036 (Free_list::begin, Free_list::end): New functions.
6037 (Free_list::min_hole_): New data member.
6038 * output.cc: Include dwarf.h.
6039 (Output_fill_debug_info::do_minimum_hole_size): New function.
6040 (Output_fill_debug_info::do_write): New function.
6041 (Output_fill_debug_line::do_minimum_hole_size): New function.
6042 (Output_fill_debug_line::do_write): New function.
6043 (Output_section::Output_section): Initialize new data member.
6044 (Output_section::set_final_data_size): Ensure patch space is larger
6045 than minimum hole size.
6046 (Output_section::do_write): Fill holes in debug sections.
6047 * output.h (Output_fill): New class.
6048 (Output_fill_debug_info): New class.
6049 (Output_fill_debug_line): New class.
6050 (Output_section::set_free_space_fill): New function.
6051 (Output_section::free_space_fill_): New data member.
6052 * testsuite/Makefile.am (incremental_test_3): Add
6053 --incremental-patch option.
6054 (incremental_test_4): Likewise.
6055 (incremental_test_5): Likewise.
6056 (incremental_test_6): Likewise.
6057 (incremental_copy_test): Likewise.
6058 (incremental_common_test_1): Likewise.
6059 * testsuite/Makefile.in: Regenerate.
6060
7cf80422
NC
60612011-08-26 Nick Clifton <nickc@redhat.com>
6062
6063 * po/es.po: Updated Spanish translation.
6064
c3f7b0e5
CC
60652011-08-01 Cary Coutant <ccoutant@google.com>
6066
6067 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6068 * gold/testsuite/Makefile.in: Regenerate.
6069 * gold/testsuite/justsyms_exec.c: New source file.
6070 * gold/testsuite/justsyms_lib.c: New source file.
6071
9590bf25
CC
60722011-08-01 Cary Coutant <ccoutant@google.com>
6073
6074 * layout.cc (Layout::set_segment_offsets): Don't realign text
6075 segment if -Ttext was specified.
6076 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6077 file type.
6078 * object.h (Sized_relobj_file::e_type): New function.
6079 (Sized_relobj_file::e_type_): New data member.
6080 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6081 base address for ET_EXEC files.
6082 * target.cc (Target::do_make_elf_object_implementation): Allow
6083 ET_EXEC files with --just-symbols option.
6084
dcd8d12e
CC
60852011-07-28 Cary Coutant <ccoutant@google.com>
6086
6087 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6088 Add thread_number parameter.
6089 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6090 * workqueue-threads.cc
6091 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6092 current thread if its thread number is greater than desired thread
6093 count.
6094 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6095 Add thread_number parameter.
6096 (Workqueue::should_cancel_thread): Likewise.
6097 (Workqueue::find_runnable_or_wait): Pass thread_number to
6098 should_cancel_thread.
6099 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6100 parameter.
6101
804eb480
ST
61022011-07-22 Sriraman Tallam <tmsriram@google.com>
6103
6104 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6105 only after checking if it cannot be forced local.
6106 * symtab.h (is_externally_visible): Check if the symbol is not forced
6107 local.
6108
f1ddb600
ILT
61092011-07-15 Ian Lance Taylor <iant@google.com>
6110
6111 * options.h (class General_options): Add --print-output-format.
6112 Move -EL next to -EB, for better --help output.
6113 * target-select.cc: Include <cstdio>, "options.h", and
6114 "parameters.h".
6115 (Target_selector::do_target_bfd_name): New function.
6116 (print_output_format): New function.
6117 * target-select.h (class Target_selector): Update declarations.
6118 (Target_selector::target_bfd_name): New function.
6119 (print_output_format): Declare.
6120 * main.cc: Include "target-select.h".
6121 (main): Handle --print-output-format.
6122 * gold.cc: Include "target-select.h".
6123 (queue_initial_tasks): Handle --print-output-format when there are
6124 no input files.
6125 * parameters.cc (parameters_force_valid_target): Give a better
6126 error message if -EB/-EL does not match target.
6127 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6128 function.
6129
7d172687
ILT
61302011-07-15 Ian Lance Taylor <iant@google.com>
6131
6132 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6133 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6134 (Output_data_plt_i386::do_write): Write address of .dynamic
6135 section to first entry in .got.plt section.
6136 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6137 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6138 Initialize layout_.
6139 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6140 section to first entry in .got.plt section.
6141 * layout.h (Layout::dynamic_section): New function.
6142
e9552f7e
ST
61432011-07-13 Sriraman Tallam <tmsriram@google.com>
6144
6145 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6146 to claim_file call.
6147 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6148 input_section_position_, and input_section_glob_.
6149 (read_layout_from_file): Call function section_ordering_specified.
6150 * layout.h (is_section_ordering_specified): New function.
6151 (section_ordering_specified): New function.
6152 (section_ordering_specified_): New boolean member.
6153 * main.cc(main): Call load_plugins after layout object is defined.
6154 * output.cc (Output_section::add_input_section): Use
6155 function section_ordering_specified to check if section ordering is
6156 needed.
6157 * output.cc (Output_section::add_relaxed_input_section): Use
6158 function section_ordering_specified to check if section ordering is
6159 needed.
6160 (Output_section::update_section_layout): New function.
6161 (Output_section::sort_attached_input_sections): Check if input section
6162 must be reordered.
6163 * output.h (Output_section::update_section_layout): New function.
6164 * plugin.cc (get_section_count): New function.
6165 (get_section_type): New function.
6166 (get_section_name): New function.
6167 (get_section_contents): New function.
6168 (update_section_order): New function.
58797674 6169 (allow_section_ordering): New function.
e9552f7e
ST
6170 (Plugin::load): Add the new interfaces to the transfer vector.
6171 (Plugin_manager::load_plugins): New parameter.
6172 (Plugin_manager::all_symbols_read): New parameter.
6173 (Plugin_manager::claim_file): New parameter. Save the elf object for
6174 unclaimed objects.
6175 (Plugin_manager::get_elf_object): New function.
6176 (Plugin_manager::get_view): Change to directly use the bool to check
6177 if get_view is called from claim_file_hook.
6178 * plugin.h (input_objects): New function
6179 (Plugin__manager::load_plugins): New parameter.
6180 (Plugin_manager::claim_file): New parameter.
6181 (Plugin_manager::get_elf_object): New function.
6182 (Plugin_manager::in_claim_file_handler): New function.
6183 (Plugin_manager::in_claim_file_handler_): New member.
6184 (layout): New function.
6185 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6186 handler with an extra parameter. Make the elf object before calling
6187 claim_file handler.
6188 * testsuite/plugin_test.c (get_section_count): New function pointer.
6189 (get_section_type): New function pointer.
6190 (get_section_name): New function pointer.
6191 (get_section_contents): New function pointer.
6192 (update_section_order): New function pointer.
6193 (allow_section_ordering): New function pointer.
6194 (onload): Check if the new interfaces exist.
6195
9446efde
ILT
61962011-07-13 Ian Lance Taylor <iant@google.com>
6197
6198 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6199 relro section.
6200 * x86_64.cc (Target_x86_64::got_section): Likewise.
6201 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6202 (relro_now_test_SOURCES): New variable.
6203 (relro_now_test_DEPENDENCIES): New variable.
6204 (relro_now_test_LDFLAGS): New variable.
6205 (relro_now_test_LDADD): New variable.
6206 (relro_now_test.so): New target.
6207 * testsuite/Makefile.in: Rebuild.
6208
07aa62f2
ILT
62092011-07-12 Ian Lance Taylor <iant@google.com>
6210
6211 PR gold/12980
6212 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6213 GLOB_DAT relocation rather than a RELATIVE relocation for a
6214 protected symbol when creating a shared library.
6215 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6216 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6217 * testsuite/protected_main_1.cc (main): Test that protected
6218 function has same address.
6219
e2153196
ILT
62202011-07-11 Ian Lance Taylor <iant@google.com>
6221
6222 PR gold/12979
6223 * options.h (class General_options): Add -Bgroup.
6224 * options.cc (General_options::finalize): If -Bgroup is set,
6225 default to --unresolved-symbols=report-all.
6226 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6227 * target-reloc.h (issue_undefined_symbol_error): Handle
6228 --unresolved-symbols=report-all.
6229
6daf5215
ILT
62302011-07-08 Ian Lance Taylor <iant@google.com>
6231
6232 PR gold/11985
6233 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6234 if linker script discards key sections.
6235 (Layout::create_dynamic_symtab): Likewise.
6236 (Layout::assign_local_dynsym_offsets): Likewise.
6237 (Layout::sized_create_version_sections): Likewise.
6238 (Layout::create_interp): Likewise.
6239 (Layout::finish_dynamic_section): Likewise.
6240 (Layout::set_dynamic_symbol_size): Likewise.
6241
beabb2c6
ILT
62422011-07-08 Ian Lance Taylor <iant@google.com>
6243
6244 PR gold/12386
6245 * options.h (class General_options): Add --unresolved-symbols.
6246 * target-reloc.h (issue_undefined_symbol_error): Check
6247 --unresolved-symbols. Add comments.
6248
9c16daf1
ILT
62492011-07-08 Ian Lance Taylor <iant@google.com>
6250
6251 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6252 expression more complex.
6253
191f1a2d
ILT
62542011-07-08 Ian Lance Taylor <iant@google.com>
6255
6256 PR gold/11317
6257 * target-reloc.h (issue_undefined_symbol_error): New inline
6258 function, broken out of relocate_section.
6259 (relocate_section): Call issue_undefined_symbol_error.
6260 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6261 there is no TLS segment if we are about to issue an undefined
6262 symbol error.
6263 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6264
62855347
ILT
62652011-07-08 Ian Lance Taylor <iant@google.com>
6266
6267 PR gold/12279
6268 * resolve.cc (Symbol_table::should_override): Add fromtype
6269 parameter. Change all callers. Give error when linking together
6270 TLS and non-TLS symbol.
6271 (Symbol_table::should_override_with_special): Add fromtype
6272 parameter. Change all callers.
6273 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6274 there is no TLS segment if we have reported some errors.
6275 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6276
67181c72
ILT
62772011-07-08 Ian Lance Taylor <iant@google.com>
6278
6279 PR gold/12372
6280 * target.h (Target::plt_address_for_global): New function.
6281 (Target::plt_address_for_local): New function.
6282 (Target::plt_section_for_global): Remove.
6283 (Target::plt_section_for_local): Remove.
6284 (Target::do_plt_address_for_global): New virtual function.
6285 (Target::do_plt_address_for_local): New virtual function.
6286 (Target::do_plt_section_for_global): Remove.
6287 (Target::do_plt_section_for_local): Remove.
6288 (Target::register_global_plt_entry): Add Symbol_table and Layout
6289 parameters.
6290 * output.cc (Output_data_got::Got_entry::write): Use
6291 plt_address_for_global and plt_address_for_local.
6292 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6293 address of output section.
6294 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6295 got_irelative_, and irelative_count_ fields. Update
6296 declarations.
6297 (Output_data_plt_i386::has_irelative_section): New function.
6298 (Output_data_plt_i386::entry_count): Add irelative_count_.
6299 (Output_data_plt_i386::set_final_data_size): Likewise.
6300 (class Target_i386): Add got_irelative_ and rel_irelative_
6301 fields. Update declarations.
6302 (Target_i386::Target_i386): Initialize new fields.
6303 (Target_i386::do_plt_address_for_global): New function replacing
6304 do_plt_section_for_global.
6305 (Target_i386::do_plt_address_for_local): New function replacing
6306 do_plt_section_for_local.
6307 (Target_i386::got_section): Create got_irelative_.
6308 (Target_i386::rel_irelative_section): New function.
6309 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6310 fields. Don't define __rel_iplt_{start,end}.
6311 (Output_data_plt_i386::add_entry): Add symtab and layout
6312 parameters. Change all callers. Use different PLT and GOT for
6313 IFUNC symbols.
6314 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6315 layout parameters. Change all callers. Use different PLT and
6316 GOT.
6317 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6318 (Output_data_plt_i386::rel_irelative): New function.
6319 (Output_data_plt_i386::address_for_global): New function.
6320 (Output_data_plt_i386::address_for_local): New function.
6321 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6322 IRELATIVE GOT when changing IFUNC GOT entries.
6323 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6324 reloc.
6325 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6326 if we didn't create an IRELATIVE GOT.
6327 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6328 plt_address_for_local.
6329 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6330 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6331 got_irelative_, and irelative_count_ fields. Update
6332 declarations.
6333 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6334 Initialize new fields. Remove symtab parameter. Change all
6335 callers.
6336 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6337 irelative_count_.
6338 (Output_data_plt_x86_64::has_irelative_section): New function.
6339 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6340 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6341 fields. Update declarations.
6342 (Target_x86_64::Target_x86_64): Initialize new fields.
6343 (Target_x86_64::do_plt_address_for_global): New function replacing
6344 do_plt_section_for_global.
6345 (Target_x86_64::do_plt_address_for_local): New function replacing
6346 do_plt_section_for_local.
6347 (Target_x86_64::got_section): Create got_irelative_.
6348 (Target_x86_64::rela_irelative_section): New function.
6349 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6350 all callers. Don't create __rel_iplt_{start,end}.
6351 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6352 parameters. Change all callers. Use different PLT and GOT for
6353 IFUNC symbols.
6354 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6355 layout parameters. Change all callers. Use different PLT and
6356 GOT.
6357 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6358 parameters. Change all callers. Use different PLT and GOT for
6359 IFUNC symbols.
6360 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6361 (Output_data_plt_x86_64::rela_irelative): New function.
6362 (Output_data_plt_x86_64::address_for_global): New function.
6363 (Output_data_plt_x86_64::address_for_local): New function.
6364 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6365 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6366 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6367 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6368 parameters.
6369 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6370 reloc.
6371 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6372 symbols if we didn't create an IRELATIVE GOT.
6373 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6374 plt_address_for_local.
6375 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6376 * testsuite/ifuncvar1.c: New test file.
6377 * testsuite/ifuncvar2.c: New test file.
6378 * testsuite/ifuncvar3.c: New test file.
6379 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6380 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6381 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6382 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6383 * testsuite/Makefile.in: Rebuild.
6384
33c15b45
CC
63852011-07-07 Cary Coutant <ccoutant@google.com>
6386
6387 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6388 (two_file_test_1_ndebug.o): Likewise.
6389 (two_file_test_1b_ndebug.o): Likewise.
6390 (two_file_test_2_ndebug.o): Likewise.
6391 (two_file_test_main_ndebug.o): Likewise.
6392 (incremental_test_2): Link with no-debug versions.
6393
f48b5fb7
CC
63942011-07-06 Cary Coutant <ccoutant@google.com>
6395
6396 * gold/incremental.cc
6397 (Output_section_incremental_inputs::write_info_blocks): Check for
6398 hidden and internal symbols.
6399
221597a5
CC
64002011-07-06 Cary Coutant <ccoutant@google.com>
6401
6402 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6403 Check disposition for startup file.
6404 (Incremental_inputs::report_command_line): Ignore
6405 --incremental-startup-unchanged option.
6406 * options.cc (General_options::parse_incremental_startup_unchanged):
6407 New function.
6408 (General_options::General_options): Initialize new data member.
6409 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6410 (General_options): Add --incremental-startup-unchanged option.
6411 (General_options::incremental_startup_disposition): New function.
6412 (General_options::incremental_startup_disposition_): New data member.
6413
e24719f6
CC
64142011-07-06 Cary Coutant <ccoutant@google.com>
6415
6416 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6417 input file index to Script_info ctor.
6418 (Sized_incremental_binary::do_file_has_changed): Find the
6419 command-line argument for files named in scripts.
6420 * incremental.h (Script_info::Script_info): New ctor
6421 with input file index.
6422 (Script_info::input_file_index): New function.
6423 (Script_info::input_file_index_): New data member.
6424 (Incremental_binary::get_library): Add const.
6425 (Incremental_binary::get_script_info): Add const.
6426 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6427 * testsuite/Makefile.am (incremental_test_5): New test case.
6428 (incremental_test_6): New test case.
6429 * testsuite/Makefile.in: Regenerate.
6430
8f7c81e8
CC
64312011-07-06 Cary Coutant <ccoutant@google.com>
6432
6433 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6434 debug output when command lines differ.
6435
9fbd3822
CC
64362011-07-06 Cary Coutant <ccoutant@google.com>
6437
6438 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6439 --incremental-patch option.
6440 * layout.cc (Free_list::allocate): Extend allocation beyond original
6441 end if enabled.
6442 (Layout::make_output_section): Mark sections that should get
6443 patch space.
6444 * options.cc (parse_percent): New function.
6445 * options.h (parse_percent): New function.
6446 (DEFINE_percent): New macro.
6447 (General_options): Add --incremental-patch option.
6448 * output.cc (Output_section::Output_section): Initialize new data
6449 members.
6450 (Output_section::add_input_section): Print section name when out
6451 of patch space.
6452 (Output_section::add_output_section_data): Likewise.
6453 (Output_section::set_final_data_size): Add patch space when
6454 doing --incremental-full.
6455 (Output_section::do_reset_address_and_file_offset): Remove patch
6456 space.
6457 (Output_segment::set_section_list_addresses): Print debug output
6458 only if --incremental-update.
6459 * output.h (Output_section::set_is_patch_space_allowed): New function.
6460 (Output_section::is_patch_space_allowed_): New data member.
6461 (Output_section::patch_space_): New data member.
6462 * parameters.cc (Parameters::incremental_full): New function.
6463 * parameters.h (Parameters::incremental_full): New function
6464 * testsuite/Makefile.am (incremental_test_2): Add test for
6465 --incremental-patch option.
6466 * testsuite/Makefile.in: Regenerate.
6467 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6468 (t18): Remove function body.
6469
f6cccc2c
DK
64702011-07-05 Doug Kwan <dougkwan@google.com>
6471
6472 PR gold/12771
6473 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6474 Arm_Address type for relocation result.
6475 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6476 overflow check.
6477 (Arm_relocate_functions::abs32): Use unaligned access.
6478 (Arm_relocate_functions::rel32): Ditto.
6479 (Arm_relocate_functions::prel31): Ditto.
6480 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6481 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6482 static data relocations.
6483 * testsuite/Makefile.in: Regnerate.
6484 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6485
28a13fec
ILT
64862011-07-05 Ian Lance Taylor <iant@google.com>
6487
6488 PR gold/12392
6489 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6490 symbols if necessary.
6491 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6492
24d47b34
ILT
64932011-07-05 Ian Lance Taylor <iant@google.com>
6494
6495 PR gold/12952
6496 * resolve.cc (Symbol::override_base_with_special): Simply override
6497 version with special symbol version, ignoring previous version.
6498
41f9cbbe
ILT
64992011-07-05 Ian Lance Taylor <iant@google.com>
6500
6501 * object.cc (Sized_relobj_file::include_section_group): Add
6502 information to comment about signature location.
6503
886288f1
ILT
65042011-07-02 Ian Lance Taylor <iant@google.com>
6505
6506 PR gold/12957
6507 * options.h (class General_options): Add -f and -F.
6508 * options.cc (General_options::finalize): Fatal error if -f/-F
6509 are used without -shared.
6510 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6511
ae3a6d4f
ILT
65122011-07-02 Ian Lance Taylor <iant@google.com>
6513
6514 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6515
21131061
ILT
65162011-07-01 Ian Lance Taylor <iant@google.com>
6517
6518 PR gold/12525
6519 PR gold/12952
6520 * resolve.cc (Symbol::override_base_with_special): Don't override
6521 the version if the overriding symbol has a different name.
6522 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6523 all callers. If we give an error about an undefined version,
6524 define the base version if necessary.
6525 * dynobj.h (class Versions): Update declaration.
6526 * testsuite/weak_alias_test_5.cc: New file.
6527 * testsuite/weak_alias_test.script: New file.
6528 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6529 and versioned_alias have the right value, and call t2.
6530 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6531 weak_alias_test_5.so.
6532 (weak_alias_test_LDADD): Likewise.
6533 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6534 * testsuite/Makefile.in: Rebuild.
6535
611062c0
ILT
65362011-07-01 Ian Lance Taylor <iant@google.com>
6537
6538 PR gold/12525
6539 * options.h (class General_options): Support -z notext.
6540 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6541 -Wl,-z,notext.
6542 (two_file_shared_nonpic.so): Likewise.
6543 (two_file_shared_mixed.so): Likewise.
6544 (two_file_shared_mixed_1.so): Likewise.
6545 (weak_undef_lib_nonpic.so): Likewise.
6546 (alt/weak_undef_lib_nonpic.so): Likewise.
6547 (tls_test_shared_nonpic.so): Likewise.
6548 * testsuite/Makefile.in: Rebuild.
6549
328c7c2f
ILT
65502011-07-01 Ian Lance Taylor <iant@google.com>
6551
6552 PR gold/12525
6553 * configure.ac: Test whether static linking works, setting
6554 the automake conditional HAVE_STATIC.
6555 * testsuite/Makefile.am: Disable tests using -static if
6556 HAVE_STATIC is not true.
6557 * configure, testsuite/Makefile.in: Rebuild.
6558
02d7cd44
ILT
65592011-07-01 Ian Lance Taylor <iant@google.com>
6560
6561 PR gold/12525
6562 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6563 Assert if we see DW_EH_PE_indirect.
6564 * target.h (Target::ehframe_datarel_base): New function.
6565 (Target::do_ehframe_datarel_base): New target function.
6566 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6567 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6568 function.
6569
07a60597
ILT
65702011-07-01 Ian Lance Taylor <iant@google.com>
6571
6572 PR gold/12571
6573 * options.h (class General_options): Add
6574 --ld-generated-unwind-info.
6575 * ehframe.cc (Fde::write): Add address parameter. Change all
6576 callers. If associated with PLT, fill in address and size.
6577 (Cie::set_output_offset): Only add merge mapping if there is an
6578 object.
6579 (Cie::write): Add address parameter. Change all callers.
6580 (Eh_frame::add_ehframe_for_plt): New function.
6581 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6582 input_offset_ fields into union u_, with new plt field.
6583 (Fde::Fde): Adjust for new union field.
6584 (Fde::Fde) [Output_data version]: New constructor.
6585 (Fde::add_mapping): Only add merge mapping if there is an object.
6586 (class Cie): Update declarations.
6587 (class Eh_frame): Declare add_ehframe_for_plt.
6588 * layout.cc (Layout::layout_eh_frame): Break out code into
6589 make_eh_frame_section, and call it.
6590 (Layout::make_eh_frame_section): New function.
6591 (Layout::add_eh_frame_for_plt): New function.
6592 * layout.h (class Layout): Update declarations.
6593 * merge.cc (Merge_map::add_mapping): Add assertion.
6594 * i386.cc: Include "dwarf.h".
6595 (class Output_data_plt_i386): Make first_plt_entry,
6596 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6597 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6598 and plt_eh_frame_fde.
6599 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6600 boundary. Call add_eh_frame_for_plt if appropriate.
6601 * x86_64.cc: Include "dwarf.h".
6602 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6603 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6604 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6605 and plt_eh_frame_fde.
6606 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6607 appropriate.
6608
14788a3f
ILT
66092011-06-29 Ian Lance Taylor <iant@google.com>
6610
6611 PR gold/12629
6612 * object.cc (Sized_relobj_file::layout_section): Change shdr
6613 parameter to be const.
6614 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6615 out of do_layout.
6616 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6617 appropriate. Call layout_eh_frame_section.
6618 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6619 sections.
6620 * object.h (class Sized_relobj_file): Update declarations.
6621
6c21fce1
ILT
66222011-06-29 Ian Lance Taylor <iant@google.com>
6623
37e41b03 6624 PR gold/12652
6c21fce1
ILT
6625 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6626 modifier.
6627 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6628
4d5e4e62
ILT
66292011-06-29 Ian Lance Taylor <iant@google.com>
6630
6631 PR gold/12675
6632 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6633 SHT_X86_64_UNWIND.
6634 * layout.cc (Layout::layout_eh_frame): Likewise.
6635
886f533a
ILT
66362011-06-29 Ian Lance Taylor <iant@google.com>
6637
6638 PR gold/12695
6639 * layout.cc (Layout::symtab_section_shndx): New function.
6640 * layout.h (class Layout): Declare symtab_section_shndx.
6641 * output.cc (Output_section::write_header): Call it.
6642
f3ae1b28
ILT
66432011-06-29 Ian Lance Taylor <iant@google.com>
6644
6645 PR gold/12818
6646 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6647 symbols which are not used in a relocation.
6648
aecf301f
ILT
66492011-06-28 Ian Lance Taylor <iant@google.com>
6650
6651 PR gold/12898
6652 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6653 script create indistinguishable segments.
6654 (Layout::set_segment_offsets): Use stable_sort when sorting
6655 segments. Pass this to Compare_segments constructor.
6656 * layout.h (class Layout): Make segment_precedes non-static.
6657 (class Compare_segments): Change from struct to class. Add
6658 layout_ field. Add constructor.
6659 * script-sections.cc
6660 (Script_sections::attach_sections_using_phdrs_clause): Rename
6661 local orphan to is_orphan. Don't report failure to put empty
6662 section in segment. On attachment failure, report name of
6663 section, and attach to first PT_LOAD segment.
6664
03ef7571
ILT
66652011-06-28 Ian Lance Taylor <iant@google.com>
6666
6667 PR gold/12934
6668 * target-select.cc (Target_selector::Target_selector): Add
6669 emulation parameter. Change all callers.
6670 (select_target_by_bfd_name): Rename from select_target_by_name.
6671 Change all callers.
6672 (select_target_by_emulation): New function.
6673 (supported_emulation_names): New function.
6674 * target-select.h (class Target_selector): Add emulation_ field.
6675 Update declarations.
6676 (Target_selector::recognize_by_bfd_name): Rename from
6677 recognize_by_name. Change all callers.
6678 (Target_selector::supported_bfd_names): Rename from
6679 supported_names. Change all callers.
6680 (Target_selector::recognize_by_emulation): New function.
6681 (Target_selector::supported_emulations): New function.
6682 (Target_selector::emulation): New function.
6683 (Target_selector::do_recognize_by_bfd_name): Rename from
6684 do_recognize_by_name. Change all callers.
6685 (Target_selector::do_supported_bfd_names): Rename from
6686 do_supported_names. Change all callers.
6687 (Target_selector::do_recognize_by_emulation): New function.
6688 (Target_selector::do_supported_emulations): New function.
6689 (select_target_by_bfd_name): Change name in declaration.
6690 (select_target_by_emulation): Declare.
6691 (supported_emulation_names): Declare.
6692 * parameters.cc (parameters_force_valid_target): Try to find
6693 target based on emulation from -m option.
6694 * options.h (class General_options): Change doc string for -m.
6695 * options.cc (help): Print emulations.
6696 (General_options::parse_V): Likewise.
6697 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6698 Add emulation parameter. Change all callers.
6699
200b2bb9
ILT
67002011-06-28 Ian Lance Taylor <iant@google.com>
6701
6702 * target.h (class Target): Add osabi_ field.
6703 (Target::osabi): New function.
6704 (Target::set_osabi): New function.
6705 (Target::Target): Initialize osabi_.
6706 (Target::do_adjust_elf_header): Make pure virtual.
6707 (Sized_target::do_adjust_elf_header): Declare.
6708 * target.cc (Sized_target::do_adjust_elf_header): New function.
6709 (class Sized_target): Instantiate all versions.
6710 * freebsd.h (class Target_freebsd): Remove.
6711 (Target_selector_freebsd::do_recognize): Call set_osabi on
6712 Target.
6713 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6714 (Target_selector_freebsd::set_osabi): Remove.
6715 * i386.cc (class Target_i386): Inherit from Sized_target rather
6716 than Target_freebsd.
6717 * x86_64.cc (class Target_x86_64): Likewise.
6718
b3ce541e
ILT
67192011-06-28 Ian Lance Taylor <iant@google.com>
6720
6721 * target.h (Target::can_check_for_function_pointers): Rewrite.
6722 Make non-virtual.
6723 (Target::can_icf_inline_merge_sections): Likewise.
6724 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6725 (Target::Target_info): Add can_icf_inline_merge_sections field.
6726 (Target::do_can_check_for_function_pointers): New virtual
6727 function.
6728 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6729 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6730 from can_check_for_function_pointers, move in file.
6731 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6732 section_may_have_icf_unsafe_poineters, move in file.
6733 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6734 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6735 Rename from can_check_for_function_pointers, move in file.
6736 (Target_i386::can_icf_inline_merge_sections): Remove.
6737 (Target_i386::i386_info): Initialize
6738 can_icf_inline_merge_sections.
6739 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6740 Initialize can_icf_inline_merge_sections.
6741 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6742 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6743 Rename from can_check_for_function_pointers, move in file.
6744 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6745 (Target_x86_64::x86_64_info): Initialize
6746 can_icf_inline_merge_sections.
6747 * testsuite/testfile.cc (Target_test::test_target_info):
6748 Likewise.
6749 * icf.cc (get_section_contents): Correct formatting.
6750
6d1c4efb
ILT
67512011-06-27 Ian Lance Taylor <iant@google.com>
6752
6753 * symtab.cc (Symbol::versioned_name): New function.
6754 (Symbol_table::add_to_final_symtab): Use versioned_name when
6755 appropriate.
6756 (Symbol_table::sized_write_symbol): Likewise.
6757 * symtab.h (class Symbol): Declare versioned_name.
6758 * stringpool.h (class Stringpool_template): Add variant of add
6759 which takes a std::basic_string.
6760 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6761 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6762 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6763 (ver_test_12.o): New target.
6764 * testsuite/Makefile.in: Rebuild.
6765
57eb9b50
DK
67662011-06-27 Doug Kwan <dougkwan@google.com>
6767
6768 * arm.cc (Arm_relocate_functions::thm_jump8,
6769 Arm_relocate_functions::thm_jump11): Use a wider signed
6770 type to compute offset.
6771 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6772 arm_thm_jump8.
6773 * testsuite/Makefile.in: Regenerate.
6774 * testsuite/arm_branch_in_range.sh: Check test results of
6775 arm_thm_jump11 and arm_thm_jump8.
6776 * testsuite/arm_thm_jump11.s: New test source file.
6777 * testsuite/arm_thm_jump11.t: New linker script.
6778 * testsuite/arm_thm_jump8.s: New test source file.
6779 * testsuite/arm_thm_jump8.t: New linker script.
6780
487b39df
ILT
67812011-06-24 Ian Lance Taylor <iant@google.com>
6782
6783 * layout.cc: Include "object.h".
6784 (ctors_sections_in_init_array): New static variable.
6785 (Layout::is_ctors_in_init_array): New function.
6786 (Layout::layout): Add entry to ctors_sections_in_init_array if
6787 appropriate.
6788 * layout.h (class Layout): Declare is_ctors_in_init_array.
6789 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6790 is_ctors_reverse_view is set.
6791 (Sized_relobj_file::write_sections): Add layout parameter. Change
6792 all callers. Set is_ctors_reverse_view field of View_size.
6793 (Sized_relobj_file::reverse_words): New function.
6794 * object.h (Sized_relobj_file::View_size): Add
6795 is_ctors_reverse_view field.
6796 (class Sized_relobj_file): Update declarations.
6797 * testsuite/initpri3.c: New test.
6798 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6799 initpri3b.
6800 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6801 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6802 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6803 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6804 * testsuite/Makefile.in: Rebuild.
6805
472076e4
CC
68062011-06-24 Cary Coutant <ccoutant@google.com>
6807
6808 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6809 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6810 (debug_msg_cdebug.err): New targets.
6811 * testsuite/Makefile.in: Regenerate.
6812 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6813 Fix checks for link with shared library.
6814
a60af0db
DK
68152011-06-24 Doug Kwan <dougkwan@google.com>
6816
6817 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6818 skip empty text sections.
6819 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6820
5393d741
ILT
68212011-06-22 Ian Lance Taylor <iant@google.com>
6822
6823 PR gold/12910
6824 * options.h (class General_options): Add --ctors-in-init-array.
6825 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6826 friends as SHT_PROGBITS for merging sections.
6827 (Layout::layout): Remove special handling of .init_array and
6828 friends. Don't sort if doing relocatable link. Sort for .ctors
6829 and .dtors if ctors_in_init_array.
6830 (Layout::make_output_section): Force correct section types for
6831 .init_array and friends. Don't sort if doing relocatable link,
6832 Don't sort .ctors and .dtors if ctors_in_init_array.
6833 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6834 (Layout::output_section_name): Add relobj parameter. Change all
6835 callers. Handle .ctors. and .dtors. in code rather than table.
6836 Handle .ctors and .dtors if ctors_in_init_array.
6837 (Layout::match_file_name): New function, moved from output.cc.
6838 * layout.h (class Layout): Update declarations.
6839 * output.cc: Include "layout.h".
6840 (Input_section_sort_entry::get_priority): New function.
6841 (Input_section_sort_entry::match_file_name): Just call
6842 Layout::match_file_name.
6843 (Output_section::Input_section_sort_init_fini_compare::operator()):
6844 Handle .ctors and .dtors. Sort by explicit priority rather than
6845 by name.
6846 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6847 * testsuite/initpri2.c: New test.
6848 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6849 (check_PROGRAMS): Add initpri2.
6850 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6851 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6852 * configure, testsuite/Makefile.in: Rebuild.
6853
e1f74f98
ILT
68542011-06-19 Ian Lance Taylor <iant@google.com>
6855
6856 PR gold/12880
6857 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6858 .interp section to a PT_INTERP segment even if we have seen a
6859 --dynamic-linker option. Don't do it if we have seen a PHDRS
6860 clause in a linker script.
6861 (Layout::finalize): Don't create a .interp section if we've
6862 already create a PT_INTERP segment.
6863 (Layout::create_interp): Always call choose_output_section (revert
6864 patch of 2011-06-17). Don't create PT_INTERP segment.
6865 * script-sections.cc
6866 (Script_sections::create_note_and_tls_segments): Add a .interp
6867 section to a PT_INTERP segment even if we have seen a
6868 --dynamic-linker option.
6869
766f91bb
ILT
68702011-06-18 Ian Lance Taylor <iant@google.com>
6871
6872 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6873 merely because a non-PT_LOAD segment has a dynamic reloc.
6874
0d212c3a
ILT
68752011-06-18 Ian Lance Taylor <iant@google.com>
6876
6877 * layout.cc (Layout::finish_dynamic_section): Don't create
6878 DT_FLAGS entry if not needed.
6879
911a5072
ILT
68802011-06-18 Ian Lance Taylor <iant@google.com>
6881
6882 PR gold/12745
6883 * layout.cc (Layout::layout_eh_frame): Correct handling of
6884 writable .eh_frame section.
6885
534b4e5f
ILT
68862011-06-17 Ian Lance Taylor <iant@google.com>
6887
6888 PR gold/12893
6889 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6890 symbol is redefined with the exact same object and value.
6891
10b4f102
ILT
68922011-06-17 Ian Lance Taylor <iant@google.com>
6893
6894 PR gold/12880
6895 * layout.h (class Layout): Add interp_segment_ field.
6896 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6897 (Layout::attach_allocated_section_to_segment): If making shared
6898 library, put .interp section in PT_INTERP segment.
6899 (Layout::finalize): Also call create_interp if -dynamic-linker
6900 option was used.
6901 (Layout::create_interp): Assert that there is no PT_INTERP
6902 segment. If not using a SECTIONS clause, use make_output_section.
6903 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6904 * script-sections.cc
6905 (Script_sections::create_note_and_tls_segments): If making shared
6906 library, put .interp section in PT_INTERP segment.
6907
a29b0dad
ILT
69082011-06-17 Ian Lance Taylor <iant@google.com>
6909
e588ea8d
ILT
6910 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6911 when making a shared library.
6912
69132011-06-17 Ian Lance Taylor <iant@google.com>
6914
6915 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6916 parameter. Change all callers. Don't issue warning about PC32
6917 against locally defined symbol.
a29b0dad 6918
9d3b0698
ILT
69192011-06-16 Ian Lance Taylor <iant@google.com>
6920
6921 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6922 occurs in same object.
6923
85b0f90c
AM
69242011-06-14 Alan Modra <amodra@gmail.com>
6925
6926 * po/POTFILES.in: Regenerate.
6927
a94907d9
ILT
69282011-06-09 Ian Lance Taylor <iant@google.com>
6929
6930 * script-sections.cc
6931 (Orphan_output_section::set_section_addresses): For a relocatable
6932 link set address to 0.
6933
4fb3a1c3
CC
69342011-06-09 Cary Coutant <ccoutant@google.com>
6935
6936 PR gold/12804
6937 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6938 used with --compress-debug-sections.
6939 * gold/object.cc (Sized_relobj_file::do_layout): Report
6940 uncompressed size of compressed input sections.
6941
61220854
CC
69422011-06-08 Cary Coutant <ccoutant@google.com>
6943
6944 PR gold/12804
6945 * testsuite/two_file_test_2_v1.cc: Change initialization of
6946 v2 to keep it in .data.
6947
e6455dfb
CC
69482011-06-07 Cary Coutant <ccoutant@google.com>
6949
6950 * common.cc (Symbol_table::do_allocate_commons_list): Call
6951 gold_fallback.
6952 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6953 (Errors::fallback): New function.
6954 (gold_fallback): New function.
6955 * errors.h (Errors::fallback): New function.
6956 * gold.cc (gold_exit): Change status parameter to enum; adjust
6957 all callers.
6958 (queue_initial_tasks): Call gold_fallback.
6959 * gold.h: Include cstdlib.
6960 (Exit_status): New enum type.
6961 (gold_exit): Change status parameter to enum.
6962 (gold_fallback): New function.
6963 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6964 (Layout::create_symtab_sections): Likewise.
6965 (Layout::create_shdrs): Likewise.
6966 * main.cc (main): Adjust call to gold_exit.
6967 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6968 (Output_data_got::add_got_entry_pair): Likewise.
6969 (Output_section::add_input_section): Likewise.
6970 (Output_section::add_output_section_data): Likewise.
6971 (Output_segment::set_section_list_addresses): Likewise.
6972 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6973
fb0e076f
CC
69742011-06-07 Cary Coutant <ccoutant@google.com>
6975
6976 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6977 for incremental links.
6978 * output.cc (Output_segment::set_section_list_addresses): Remove
6979 FIXME and test for TLS or BSS.
6980
a5ee4d5d
CC
69812011-06-07 Cary Coutant <ccoutant@google.com>
6982
6983 * testsuite/Makefile.am: Add incremental_copy_test,
6984 incremental_common_test_1.
6985 * testsuite/Makefile.in: Regenerate.
6986 * testsuite/common_test_1_v1.c: New source file.
6987 * testsuite/common_test_1_v2.c: New source file.
6988 * testsuite/copy_test_v1.cc: New source file.
6989
5146f448
CC
69902011-06-07 Cary Coutant <ccoutant@google.com>
6991
6992 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6993 update, allocate common from bss section's free list.
6994 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6995 linker-defined symbols.
6996 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6997 Skip GOT and PLT entries that are no longer referenced.
6998 (Output_section_incremental_inputs::write_info_blocks): Mark
6999 linker-defined symbols.
7000 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7001 * output.cc (Output_section::allocate): New function.
7002 * output.h (Output_section::allocate): New function.
7003 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7004 linker-defined symbols.
7005 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7006 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7007 (Symbol::init_base_output_data): Likewise.
7008 (Symbol::init_base_output_segment): Likewise.
7009 (Symbol::init_base_constant): Likewise.
7010 (Sized_symbol::init_output_data): Likewise.
7011 (Sized_symbol::init_output_segment): Likewise.
7012 (Sized_symbol::init_constant): Likewise.
7013 (Symbol_table::do_define_in_output_data): Likewise.
7014 (Symbol_table::do_define_in_output_segment): Likewise.
7015 (Symbol_table::do_define_as_constant): Likewise.
7016 * symtab.h (Symbol::is_predefined): New function.
7017 (Symbol::init_base_output_data): Add is_predefined parameter.
7018 (Symbol::init_base_output_segment): Likewise.
7019 (Symbol::init_base_constant): Likewise.
7020 (Symbol::is_predefined_): New data member.
7021 (Sized_symbol::init_output_data): Add is_predefined parameter.
7022 (Sized_symbol::init_output_segment): Likewise.
7023 (Sized_symbol::init_constant): Likewise.
7024 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7025
26d3c67d
CC
70262011-06-07 Cary Coutant <ccoutant@google.com>
7027
7028 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7029 instead of emit_copy_reloc.
7030 (Copy_relocs::emit_copy_reloc): Refactor.
7031 (Copy_relocs::make_copy_reloc): New function.
7032 (Copy_relocs::add_copy_reloc): Remove.
7033 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7034 section.
7035 (Copy_relocs::make_copy_reloc): New function.
7036 (Copy_relocs::add_copy_reloc): Remove.
7037 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7038 unchanged input files.
7039 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7040 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7041 Reserve BSS space for COPY relocations.
7042 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7043 (Output_section_incremental_inputs::write_info_blocks): Record
7044 whether a symbol is copied from a shared object.
7045 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7046 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7047 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7048 (Incremental_input_entry_reader::get_output_symbol_index): Add
7049 is_copy parameter.
7050 (Incremental_binary::emit_copy_relocs): New function.
7051 (Incremental_binary::do_emit_copy_relocs): New function.
7052 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7053 new data member.
7054 (Sized_incremental_binary::add_copy_reloc): New function.
7055 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7056 (Sized_incremental_binary::Copy_reloc): New struct.
7057 (Sized_incremental_binary::Copy_relocs): New typedef.
7058 (Sized_incremental_binary::copy_relocs_): New data member.
7059 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7060 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7061 * target.h (Sized_target::emit_copy_reloc): New function.
7062 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7063
7cdb37d9
CC
70642011-06-02 Cary Coutant <ccoutant@google.com>
7065
7066 PR gold/12163
7067 * gold/archive.cc (Archive::Archive): Initialize new data member.
7068 (Archive::include_all_members): Return if archive has already been
7069 included.
7070 * gold/archive.h (Archive::include_all_members_): New data member.
7071
cc643b88
NC
70722011-06-02 Nick Clifton <nickc@redhat.com>
7073
7074 * dynobj.h: Fix spelling mistake in comment.
7075 * output.cc: Likewise.
7076
f62a3ca7 70772011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7078 Asier Llano
f62a3ca7
DK
7079
7080 PR gold/12826
cc643b88 7081 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7082 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7083 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7084 redundant arm_exidx_test.so.
7085 * testsuite/Makefile.in: Regenerate.
7086 (check_SCRIPTS): Add pr12826.sh
7087 (check_DATA): Add pr12826.stdout
7088 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7089 * testsuite/pr12826.sh: New file.
7090 * testsuite/pr12826_1.s: Ditto.
7091 * testsuite/pr12826_1.s: Ditto.
7092
8dbe1edc
ILT
70932011-05-30 Ian Lance Taylor <iant@google.com>
7094
7095 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7096 sections.
7097
c49875be
ILT
70982011-05-29 Ian Lance Taylor <iant@google.com>
7099
7100 PR gold/12804
7101 * testsuite/Makefile.am: Use different file name for two_file_test
7102 temporary file for each incremental test.
7103 * testsuite/Makefile.in: Rebuild.
7104
69d53f7a
ILT
71052011-05-29 Ian Lance Taylor <iant@google.com>
7106
7107 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7108 binary input file is empty.
7109
41d0ab5f
ILT
71102011-05-27 Ian Lance Taylor <iant@google.com>
7111
7112 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7113 (ver_test_9.so): Likewise.
7114 * testsuite/Makefile.in: Rebuild.
7115
89d8a36b
CC
71162011-05-26 Cary Coutant <ccoutant@google.com>
7117
7118 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7119 * incremental.cc (Incremental_inputs::report_input_section): Fix
7120 comment, indentation.
7121 (Incremental_inputs::report_comdat_group): New function.
7122 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7123 of data for incremental input file entry.
7124 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7125 group count, COMDAT group signatures.
7126 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7127 an unchanged input file.
7128 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7129 Initialize new data member.
7130 (Incremental_object_entry::add_comdat_group): New function.
7131 (Incremental_object_entry::get_comdat_group_count): New function.
7132 (Incremental_object_entry::get_comdat_signature_key): New function.
7133 (Incremental_object_entry::groups_): New data member.
7134 (Incremental_inputs::report_comdat_group): New function.
7135 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7136 data for incremental input file entry.
7137 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7138 (Incremental_input_entry_reader::get_input_section): Adjust size of
7139 data for incremental input file entry.
7140 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7141 (Incremental_input_entry_reader::get_comdat_group_signature): New
7142 function.
7143 * object.cc (Sized_relobj::include_section_group): Report kept
7144 COMDAT groups for incremental links.
7145
1706a06f
ILT
71462011-05-24 David Meyer <pdox@google.com>
7147
7148 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7149 with name parameter. Add found_name parameter.
7150 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7151 * dirsearch.h (class Dirsearch): Update declaration.
7152
a10ae760
ILT
71532011-05-24 Ian Lance Taylor <iant@google.com>
7154
7155 * archive.cc (Library_base::should_include_member): Pull in object
7156 from archive if it defines the entry symbol.
7157 * parameters.cc (Parameters::entry): New function.
7158 * parameters.h (class Parameters): Declare entry.
7159 * output.h (class Output_file_header): Remove entry_ field.
7160 * output.cc (Output_file_header::Output_file_header): Remove entry
7161 parameter. Change all callers.
7162 (Output_file_header::entry): Use parameters->entry.
7163 * gold.cc (queue_middle_tasks): Likewise.
7164 * plugin.cc (Plugin_hook::run): Likewise.
7165
aa92d6ed
CC
71662011-05-24 Cary Coutant <ccoutant@google.com>
7167
7168 * gold.cc (queue_initial_tasks): Pass incremental base filename
7169 to Output_file::open_base_file; don't print error message.
7170 * incremental-dump.cc (main): Adjust call to
7171 Output_file::open_for_modification.
7172 * incremental-dump.cc (main): Likewise.
7173 * incremental.cc (Incremental_inputs::report_command_line):
7174 Ignore --incremental-base option when comparing command lines.
7175 Ignore parameter when given as separate argument.
7176 * options.h (class General_options): Add --incremental-base.
7177 * output.cc (Output_file::Output_file):
7178 (Output_file::open_base_file): Add base_name and writable parameters;
7179 read base file into new file; print error message here.
7180 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7181 callers.
7182 * output.h (Output_file::open_for_modification): Rename to...
7183 (Output_file::open_base_file): ...this; add base_name and
7184 writable parameters; adjust all callers.
7185 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7186 callers.
7187 * testsuite/Makefile.am (incremental_test_4): Test
7188 --incremental-base.
7189 * testsuite/Makefile.in: Regenerate.
7190
2eedd706
CC
71912011-05-24 Cary Coutant <ccoutant@google.com>
7192
7193 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7194 incremental_test_4.
7195 * testsuite/Makefile.in: Regenerate.
7196 * testsuite/two_file_test_1_v1.cc: New test source file.
7197 * testsuite/two_file_test_1b_v1.cc: New test source file.
7198 * testsuite/two_file_test_2_v1.cc: New test source file.
7199
0f1c85a6
CC
72002011-05-24 Cary Coutant <ccoutant@google.com>
7201
7202 * dynobj.h (Dynobj::do_dynobj): New function.
7203 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7204 flag and soname for shared objects.
7205 * incremental.cc (Incremental_inputs::report_object): Make
7206 either Incremental_object_entry or Incremental_dynobj_entry; add
7207 soname to string table.
7208 (Incremental_inputs::report_input_section): Add assertion.
7209 (Output_section_incremental_inputs::set_final_data_size): Adjust
7210 type of input file entry for shared libraries; adjust size of
7211 shared library info entry.
7212 (Output_section_incremental_inputs::write_input_files): Write
7213 as_needed flag for shared libraries.
7214 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7215 of input file entry for shared libraries; write soname.
7216 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7217 soname from incremental info.
7218 * incremental.h (enum Incremental_input_flags): Add
7219 INCREMENTAL_INPUT_AS_NEEDED.
7220 (Incremental_input_entry::Incremental_input_entry): Initialize new
7221 data member.
7222 (Incremental_input_entry::set_as_needed): New function.
7223 (Incremental_input_entry::as_needed): New function.
7224 (Incremental_input_entry::do_dynobj_entry): New function.
7225 (Incremental_input_entry::as_needed_): New data member.
7226 (Incremental_object_entry::Incremental_object_entry): Don't check
7227 for shared library.
7228 (Incremental_object_entry::do_type): Likewise.
7229 (class Incremental_dynobj_entry): New class.
7230 (Incremental_input_entry_reader::as_needed): New function.
7231 (Incremental_input_entry_reader::get_soname): New function.
7232 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7233 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7234 size of shared library info entry.
58797674 7235 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7236 incremental link when adding DT_NEEDED entries.
7237 * object.h (Object::Object): Initialize new data member.
7238 (Object::dynobj): New function.
7239 (Object::set_as_needed): New function.
7240 (Object::as_needed): New function.
7241 (Object::do_dynobj): New function.
7242 (Object::as_needed_): New data member.
7243
6fa2a40b
CC
72442011-05-24 Cary Coutant <ccoutant@google.com>
7245
7246 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7247 info; adjust display of GOT entries.
7248 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7249 vector of input objects; remove file_status_.
7250 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7251 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7252 got_plt reader; call target hooks to reserve GOT entries.
7253 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7254 of input file info header and GOT info entry.
7255 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7256 relocation info.
7257 (Got_plt_view_info::got_descriptor): Remove.
7258 (Got_plt_view_info::sym_index): New data member.
7259 (Got_plt_view_info::input_index): New data member.
7260 (Local_got_offset_visitor::visit): Write input file index.
7261 (Global_got_offset_visitor::visit): Write 0 for input file index.
7262 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7263 with sym_index and input_index.
7264 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7265 incremental info GOT entry; replace got_descriptor with input_index.
7266 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7267 map from input file index to object.
7268 (Sized_relobj_incr::do_layout): Replace direct data member reference
7269 with accessor function.
7270 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7271 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7272 Adjust size of input file info header.
7273 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7274 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7275 (Incremental_input_entry_reader::get_input_section): Adjust size of
7276 input file info header.
7277 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7278 of incremental info GOT entry.
7279 (Incremental_got_plt_reader::get_got_desc): Remove.
7280 (Incremental_got_plt_reader::get_got_symndx): New function.
7281 (Incremental_got_plt_reader::get_got_input_index): New function.
7282 (Sized_incremental_binary::Sized_incremental_binary): Remove
7283 file_status_; add input_objects_.
7284 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7285 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7286 (Sized_incremental_binary::file_is_unchanged): Remove.
7287 (Sized_incremental_binary::set_input_object): New function.
7288 (Sized_incremental_binary::input_object): New function.
7289 (Sized_incremental_binary::file_status_): Remove.
7290 (Sized_incremental_binary::input_objects_): New data member.
7291 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7292 references.
7293 (Sized_relobj_incr::invalid_address): Move to base class.
7294 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7295 class.
7296 (Sized_relobj_incr::do_output_section_offset): Likewise.
7297 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7298 (Sized_relobj_incr::section_offsets_): Likewise.
7299 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7300 function.
7301 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7302 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7303 with accessor function.
7304 (Sized_relobj_file::do_layout): Likewise.
7305 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7306 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7307 (Sized_relobj_file::compute_final_local_value): Replace refs to
7308 section_offsets_ with accessor function.
7309 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7310 * object.h (Relobj::Relobj): Initialize new data members.
7311 (Relobj::add_dyn_reloc): New function.
7312 (Relobj::first_dyn_reloc): New function.
7313 (Relobj::dyn_reloc_count): New function.
7314 (Relobj::first_dyn_reloc_): New data member.
7315 (Relobj::dyn_reloc_count_): New data member.
7316 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7317 references.
7318 (Sized_relobj::Address): New typedef.
7319 (Sized_relobj::invalid_address): Move here from child class.
7320 (Sized_relobj::Sized_relobj): Initialize new data members.
7321 (Sized_relobj::sized_relobj): New function.
7322 (Sized_relobj::is_output_section_offset_invalid): Move here from
7323 child class.
7324 (Sized_relobj::get_output_section_offset): Likewise.
7325 (Sized_relobj::local_has_got_offset): Likewise.
7326 (Sized_relobj::local_got_offset): Likewise.
7327 (Sized_relobj::set_local_got_offset): Likewise.
7328 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7329 (Sized_relobj::clear_got_offsets): New function.
7330 (Sized_relobj::section_offsets): Move here from child class.
7331 (Sized_relobj::do_output_section_offset): Likewise.
7332 (Sized_relobj::do_set_section_offset): Likewise.
7333 (Sized_relobj::Local_got_offsets): Likewise.
7334 (Sized_relobj::local_got_offsets_): Likewise.
7335 (Sized_relobj::section_offsets_): Likewise.
7336 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7337 references.
7338 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7339 class.
7340 (Sized_relobj_file::sized_relobj): New function
7341 (Sized_relobj_file::local_has_got_offset): Move to base class.
7342 (Sized_relobj_file::local_got_offset): Likewise.
7343 (Sized_relobj_file::set_local_got_offset): Likewise.
7344 (Sized_relobj_file::get_output_section_offset): Likewise.
7345 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7346 (Sized_relobj_file::do_output_section_offset): Likewise.
7347 (Sized_relobj_file::do_set_section_offset): Likewise.
7348 (Sized_relobj_file::Local_got_offsets): Likewise.
7349 (Sized_relobj_file::local_got_offsets_): Likewise.
7350 (Sized_relobj_file::section_offsets_): Likewise.
7351 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7352 (all constructors).
7353 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7354 (Output_reloc::get_symbol_index): Likewise.
7355 (Output_reloc::local_section_offset): Likewise.
7356 (Output_reloc::get_address): Likewise.
7357 (Output_reloc::symbol_value): Likewise.
7358 (Output_data_got::reserve_slot): Move to class definition.
7359 (Output_data_got::reserve_local): New function.
7360 (Output_data_got::reserve_slot_for_global): Remove.
7361 (Output_data_got::reserve_global): New function.
7362 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7363 (all constructors, two instantiations).
7364 (Output_reloc::get_relobj): New function (two instantiations).
7365 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7366 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7367 (Output_data_reloc::add_global): Adjust type of relobj.
7368 (Output_data_reloc::add_global_relative): Likewise.
7369 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7370 (Output_data_reloc::add_local): Likewise.
7371 (Output_data_reloc::add_local_relative): Likewise.
7372 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7373 (Output_data_reloc::add_local_section): Likewise.
7374 (Output_data_reloc::add_output_section): Likewise.
7375 (Output_data_reloc::add_absolute): Likewise.
7376 (Output_data_reloc::add_target_specific): Likewise.
7377 (Output_data_got::reserve_slot): Move definition here.
7378 (Output_data_got::reserve_local): New function.
7379 (Output_data_got::reserve_global): New function.
7380 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7381 section_offsets_ with accessor function.
7382 (Sized_relobj_file::write_sections): Likewise.
7383 (Sized_relobj_file::do_relocate_sections): Likewise.
7384 * target.h (Sized_target::reserve_local_got_entry): New function.
7385 (Sized_target::reserve_global_got_entry): New function.
7386 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7387 (Target_x86_64::reserve_global_got_entry): New function.
7388 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7389
4829d394
CC
73902011-05-23 Cary Coutant <ccoutant@google.com>
7391
7392 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7393 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7394 bit when checking got_type.
7395 * incremental.cc (Sized_incremental_binary::setup_readers):
7396 Store symbol table and string table locations; initialize bit vector
7397 of file status flags.
7398 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7399 unchanged files.
7400 (Sized_incremental_binary::do_process_got_plt): New function.
7401 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7402 (Output_section_incremental_inputs::set_final_data_size): Record
7403 file index for each input file.
7404 (Output_section_incremental_inputs::write_got_plt): Store file index
7405 instead of input entry offset for each GOT entry.
7406 * incremental.h
7407 (Incremental_input_entry::Incremental_input_entry): Initialize new
7408 data member.
7409 (Incremental_input_entry::set_offset): Store file index.
7410 (Incremental_input_entry::get_file_index): New function.
7411 (Incremental_input_entry::file_index_): New data member.
7412 (Incremental_binary::process_got_plt): New function.
7413 (Incremental_binary::do_process_got_plt): New function.
7414 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7415 data members.
7416 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7417 (Sized_incremental_binary::set_file_is_unchanged): New function.
7418 (Sized_incremental_binary::file_is_unchanged): New function.
7419 (Sized_incremental_binary::do_process_got_plt): New function.
7420 (Sized_incremental_binary::file_status_): New data member.
7421 (Sized_incremental_binary::main_symtab_loc_): New data member.
7422 (Sized_incremental_binary::main_strtab_loc_): New data member.
7423 * output.cc (Output_data_got::Got_entry::write): Add case
7424 RESERVED_CODE.
7425 (Output_data_got::add_global): Call add_got_entry.
7426 (Output_data_got::add_global_plt): Likewise.
7427 (Output_data_got::add_global_with_rel): Likewise.
7428 (Output_data_got::add_global_with_rela): Likewise.
7429 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7430 (Output_data_got::add_global_pair_with_rela): Likewise.
7431 (Output_data_got::add_local): Call add_got_entry.
7432 (Output_data_got::add_local_plt): Likewise.
7433 (Output_data_got::add_local_with_rel): Likewise.
7434 (Output_data_got::add_local_with_rela): Likewise.
7435 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7436 (Output_data_got::add_local_pair_with_rela): Likewise.
7437 (Output_data_got::reserve_slot): New function.
7438 (Output_data_got::reserve_slot_for_global): New function.
7439 (Output_data_got::add_got_entry): New function.
7440 (Output_data_got::add_got_entry_pair): New function.
7441 (Output_section::add_output_section_data): Edit FIXME.
7442 * output.h
7443 (Output_section_data_build::Output_section_data_build): New
7444 constructor with size parameter.
7445 (Output_data_space::Output_data_space): Likewise.
7446 (Output_data_got::Output_data_got): Initialize new data member; new
7447 constructor with size parameter.
7448 (Output_data_got::add_constant): Call add_got_entry.
7449 (Output_data_got::reserve_slot): New function.
7450 (Output_data_got::reserve_slot_for_global): New function.
7451 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7452 (Output_data_got::add_got_entry): New function.
7453 (Output_data_got::add_got_entry_pair): New function.
7454 (Output_data_got::free_list_): New data member.
7455 * target.h (Sized_target::init_got_plt_for_update): New function.
7456 (Sized_target::register_global_plt_entry): New function.
7457 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7458 Initialize new data member; call init; add constructor with PLT count.
7459 (Output_data_plt_x86_64::init): New function.
7460 (Output_data_plt_x86_64::add_relocation): New function.
7461 (Output_data_plt_x86_64::reserve_slot): New function.
7462 (Output_data_plt_x86_64::free_list_): New data member.
7463 (Target_x86_64::init_got_plt_for_update): New function.
7464 (Target_x86_64::register_global_plt_entry): New function.
7465 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7466 incremental updates.
7467 (Output_data_plt_x86_64::add_relocation): New function.
7468 * testsuite/object_unittest.cc (Object_test): Set default options.
7469
ec69d6da
ILT
74702011-05-16 Ian Lance Taylor <iant@google.com>
7471
7472 * options.h (class General_options): Make -i a synonym for -r.
7473
732e31de
ILT
74742011-05-16 Ian Lance Taylor <iant@google.com>
7475
7476 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7477
403676b5
CC
74782011-05-10 Cary Coutant <ccoutant@google.com>
7479
7480 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7481 strip_all (-s).
7482
5b7b7d6e
ILT
74832011-05-06 Ian Lance Taylor <iant@google.com>
7484
7485 * layout.cc (Layout::layout): If the output section flags change,
7486 update the ordering.
7487
f0f9babf
CC
74882011-04-25 Cary Coutant <ccoutant@google.com>
7489
7490 * incremental-dump.cc (dump_incremental_inputs): Print local
7491 symbol info for each input file.
7492 * incremental.cc
7493 (Output_section_incremental_inputs::set_final_data_size): Add local
7494 symbol info to input file entries in incremental info.
7495 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7496 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7497 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7498 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7499 implementation.
7500 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7501 (Sized_incr_relobj::do_relocate): Write the local symbols.
7502 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7503 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7504 Adjust size of input file header.
7505 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7506 (Incremental_inputs_reader::get_local_symbol_count): New function.
7507 (Incremental_inputs_reader::get_input_section): Adjust size of input
7508 file header.
7509 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7510 (Sized_incr_relobj::This): New typedef.
7511 (Sized_incr_relobj::sym_size): New const data member.
7512 (Sized_incr_relobj::Local_symbol): New struct.
7513 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7514 (Sized_incr_relobj::do_local_symbol_offset): New function.
7515 (Sized_incr_relobj::local_symbol_count_): New data member.
7516 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7517 (Sized_incr_relobj::local_symbol_index_): New data member.
7518 (Sized_incr_relobj::local_symbol_offset_): New data member.
7519 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7520 (Sized_incr_relobj::local_symbols_): New data member.
7521 * object.h (Relobj::output_local_symbol_count): New function.
7522 (Relobj::local_symbol_offset): New function.
7523 (Relobj::do_output_local_symbol_count): New function.
7524 (Relobj::do_local_symbol_offset): New function.
7525 (Sized_relobj::do_output_local_symbol_count): New function.
7526 (Sized_relobj::do_local_symbol_offset): New function.
7527
d0a9ace3
ILT
75282011-04-22 Vladimir Simonov <sv@sw.ru>
7529
7530 * descriptors.cc (set_close_on_exec): New function.
7531 (Descriptors::open): Use set_close_on_exec.
7532 * output.cc (S_ISLNK): Define if not defined.
7533
94a3fc8b
CC
75342011-04-22 Cary Coutant <ccoutant@google.com>
7535
7536 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7537 global symbol map.
7538 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7539 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7540 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7541 relocations.
7542 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7543 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7544 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7545 * incremental.h
7546 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7547 function.
7548 (Incremental_binary::apply_incremental_relocs): New function.
7549 (Incremental_binary::do_apply_incremental_relocs): New function.
7550 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7551 data member.
7552 (Sized_incremental_binary::add_global_symbol): New function.
7553 (Sized_incremental_binary::global_symbol): New function.
7554 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7555 (Sized_incremental_binary::symbol_map_): New data member.
7556 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7557 * target.h (Sized_target::apply_relocation): New function.
7558 * target-reloc.h (apply_relocation): New function.
7559 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7560
c87e4302
DK
75612011-04-22 Doug Kwan <dougkwan@google.com>
7562
7563 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7564 flag of a SHT_ARM_EXIDX section.
2e702c99 7565 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7566 * testsuite/Makefile.in: Regenerate.
7567 * testsuite/arm_exidx_test.s: New file.
7568 * testsuite/arm_exidx_test.sh: Same.
7569
e7782cf6
CC
75702011-04-20 Cary Coutant <ccoutant@google.com>
7571
7572 PR gold/12689
7573 * archive.h (Incremental_archive_entry::Archive_member):
7574 Initialize arg_serial_ (second constructor).
7575
308ecdc7
ILT
75762011-04-17 Ian Lance Taylor <iant@google.com>
7577
7578 * object.cc (Relocate_info::location): Simplify location string.
7579 * errors.cc (Errors::error_at_location): Don't print program
7580 name.
7581 (Errors::warning_at_location): Likewise.
7582 (Errors::undefined_symbol): Likewise.
7583 * testsuite/debug_msg.sh: Update accordingly.
7584
bec5b579
CC
75852011-04-14 Cary Coutant <ccoutant@google.com>
7586
7587 * gold/layout.cc (Layout::symtab_section_offset): New function.
7588 * gold/layout.h (Layout::symtab_section_offset): New function.
7589 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7590
88597d34
ILT
75912011-04-12 Ian Lance Taylor <iant@google.com>
7592
7593 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7594 with MREMAP_MAYMOVE.
7595 * output.h (class Output_file): Add map_is_allocated_ field.
7596 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7597 not available, provide stubs. If mremap is not available, #define
7598 it to gold_mremap.
7599 (MREMAP_MAYMOVE): Define if not defined.
7600 (Output_file::Output_file): Initialize map_is_allocated_.
7601 (Output_file::resize): Check map_is_allocated_.
7602 (Output_file::map_anonymous): If mmap fails, use malloc.
7603 (Output_file::unmap): Don't do anything for an anonymous map.
7604 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7605 is not available, provide stubs.
7606 (File_read::View::~View): Use free rather than delete[].
7607 (File_read::make_view): Use malloc rather than new[]. If mmap
7608 fails, use malloc.
7609 (File_read::find_or_make_view): Use malloc rather than new[].
7610 * gold.h: Remove HAVE_REMAP code.
7611 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7612 exists. Rename mremap to gold_mremap. If mmap is not available
7613 don't do anything.
7614 * configure, config.in: Rebuild.
7615
11e361bc
ILT
76162011-04-11 Ian Lance Taylor <iant@google.com>
7617
7618 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7619 initialize local variable v.
7620
cdc29364
CC
76212011-04-11 Cary Coutant <ccoutant@google.com>
7622
7623 * archive.cc (Archive::include_member): Adjust call to
7624 report_object.
7625 (Add_archive_symbols::run): Track argument serial numbers.
7626 (Lib_group::include_member): Likewise.
7627 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7628 * archive.h (Incremental_archive_entry::Archive_member):
7629 Initialize arg_serial_.
7630 (Archive_member::arg_serial_): New data member.
7631 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7632 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7633 incremental link.
7634 (Sized_dynobj::do_for_all_local_got_entries): New function.
7635 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7636 function.
7637 * fileread.cc (get_mtime): New function.
7638 * fileread.h (get_mtime): New function.
7639 * gold.cc (queue_initial_tasks): Check for incremental update.
7640 (process_incremental_input): New function.
7641 (queue_middle_tasks): Don't force valid target for incremental
7642 update.
7643 * incremental-dump.cc (find_input_containing_global): Adjust
7644 size of symbol info entry.
7645 (dump_incremental_inputs): Dump argument serial number and
7646 in_system_directory flag; bias shndx by 1; print symbol names
7647 when dumping per-file symbol lists; use new symbol info readers.
7648 * incremental.cc
7649 (Output_section_incremental_inputs:update_data_size): New function.
7650 (Sized_incremental_binary::setup_readers): Setup input readers
7651 for each input file; build maps for files added from libraries
7652 and scripts.
7653 (Sized_incremental_binary::check_input_args): New function.
7654 (Sized_incremental_binary::do_check_inputs): Build map of argument
7655 serial numbers to input arguments.
7656 (Sized_incremental_binary::do_file_has_changed): Rename
7657 do_file_is_unchanged to this; compare file modification times.
7658 (Sized_incremental_binary::do_init_layout): New function.
7659 (Sized_incremental_binary::do_reserve_layout): New function.
7660 (Sized_incremental_binary::do_get_input_reader): Remove.
7661 (Sized_incremental_binary::get_symtab_view): New function.
7662 (Incremental_checker::can_incrementally_link_output_file): Remove.
7663 (Incremental_inputs::report_command_line): Exclude --debug options.
7664 (Incremental_inputs::report_archive_begin): Add parameter; track
7665 argument serial numbers; don't put input file entry for archive
7666 before archive members.
7667 (Incremental_inputs::report_archive_end): Put input file entry
7668 for archive after archive members.
7669 (Incremental_inputs::report_object): Add parameter; track argument
7670 serial numbers and in_system_directory flag.
7671 (Incremental_inputs::report_script): Add parameter; track argument
7672 serial numbers.
7673 (Output_section_incremental_inputs::set_final_data_size): Adjust
7674 size of symbol info entry; check for forwarding symbols.
7675 (Output_section_incremental_inputs::write_input_files): Write
7676 in_system_directory flag and argument serial number.
7677 (Output_section_incremental_inputs::write_info_blocks): Map section
7678 indices between incremental info and original input file; store
7679 input section index for each symbol.
7680 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7681 change operator() to visit().
7682 (class Global_got_offset_visitor): Likewise.
7683 (class Global_symbol_visitor_got_plt):
7684 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7685 classes.
7686 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7687 (Sized_incr_relobj::do_read_symbols): New function.
7688 (Sized_incr_relobj::do_layout): New function.
7689 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7690 (Sized_incr_relobj::do_add_symbols): New function.
7691 (Sized_incr_relobj::do_should_include_member): New function.
7692 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7693 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7694 (Sized_incr_relobj::do_section_size): New function.
7695 (Sized_incr_relobj::do_section_name): New function.
7696 (Sized_incr_relobj::do_section_contents): New function.
7697 (Sized_incr_relobj::do_section_flags): New function.
7698 (Sized_incr_relobj::do_section_entsize): New function.
7699 (Sized_incr_relobj::do_section_address): New function.
7700 (Sized_incr_relobj::do_section_type): New function.
7701 (Sized_incr_relobj::do_section_link): New function.
7702 (Sized_incr_relobj::do_section_info): New function.
7703 (Sized_incr_relobj::do_section_addralign): New function.
7704 (Sized_incr_relobj::do_initialize_xindex): New function.
7705 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7706 (Sized_incr_relobj::do_read_relocs): New function.
7707 (Sized_incr_relobj::do_gc_process_relocs): New function.
7708 (Sized_incr_relobj::do_scan_relocs): New function.
7709 (Sized_incr_relobj::do_count_local_symbols): New function.
7710 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7711 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7712 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7713 (Sized_incr_relobj::do_relocate): New function.
7714 (Sized_incr_relobj::do_set_section_offset): New function.
7715 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7716 (Sized_incr_dynobj::do_read_symbols): New function.
7717 (Sized_incr_dynobj::do_layout): New function.
7718 (Sized_incr_dynobj::do_add_symbols): New function.
7719 (Sized_incr_dynobj::do_should_include_member): New function.
7720 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7721 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7722 (Sized_incr_dynobj::do_section_size): New function.
7723 (Sized_incr_dynobj::do_section_name): New function.
7724 (Sized_incr_dynobj::do_section_contents): New function.
7725 (Sized_incr_dynobj::do_section_flags): New function.
7726 (Sized_incr_dynobj::do_section_entsize): New function.
7727 (Sized_incr_dynobj::do_section_address): New function.
7728 (Sized_incr_dynobj::do_section_type): New function.
7729 (Sized_incr_dynobj::do_section_link): New function.
7730 (Sized_incr_dynobj::do_section_info): New function.
7731 (Sized_incr_dynobj::do_section_addralign): New function.
7732 (Sized_incr_dynobj::do_initialize_xindex): New function.
7733 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7734 (make_sized_incremental_object): New function.
7735 (Incremental_library::copy_unused_symbols): New function.
7736 (Incremental_library::do_for_all_unused_symbols): New function.
7737 * incremental.h (enum Incremental_input_flags): New type.
7738 (class Incremental_checker): Remove.
7739 (Incremental_input_entry::Incremental_input_entry): Add argument
7740 serial number.
7741 (Incremental_input_entry::arg_serial): New function.
7742 (Incremental_input_entry::set_is_in_system_directory): New function.
7743 (Incremental_input_entry::is_in_system_directory): New function.
7744 (Incremental_input_entry::arg_serial_): New data member.
7745 (Incremental_input_entry::is_in_system_directory_): New data member.
7746 (class Script_info): Move here from script.h.
7747 (Script_info::Script_info): Add filename parameter.
7748 (Script_info::filename): New function.
7749 (Script_info::filename_): New data member.
7750 (Incremental_script_entry::Incremental_script_entry): Add argument
7751 serial number.
7752 (Incremental_object_entry::Incremental_object_entry): Likewise.
7753 (Incremental_object_entry::add_input_section): Build list of input
7754 sections with map to original shndx.
7755 (Incremental_object_entry::get_input_section_index): New function.
7756 (Incremental_object_entry::shndx_): New data member.
7757 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7758 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7759 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7760 serial number.
7761 (Incremental_inputs::report_archive_begin): Likewise.
7762 (Incremental_inputs::report_object): Likewise.
7763 (Incremental_inputs::report_script): Likewise.
7764 (class Incremental_global_symbol_reader): New class.
7765 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7766 and store flags and input file type.
7767 (Incremental_input_entry_reader::arg_serial): New function.
7768 (Incremental_input_entry_reader::type): Extract type from flags.
7769 (Incremental_input_entry_reader::is_in_system_directory): New function.
7770 (Incremental_input_entry_reader::get_input_section_count): Call
7771 accessor function for type.
7772 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7773 function for type; adjust size of global symbol entry.
7774 (Incremental_input_entry_reader::get_global_symbol_count): Call
7775 accessor function for type.
7776 (Incremental_input_entry_reader::get_object_count): Likewise.
7777 (Incremental_input_entry_reader::get_object_offset): Likewise.
7778 (Incremental_input_entry_reader::get_member_count): Likewise.
7779 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7780 (Incremental_input_entry_reader::get_member_offset): Likewise.
7781 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7782 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7783 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7784 (Incremental_input_entry_reader::get_global_symbol_reader): New
7785 function.
7786 (Incremental_input_entry_reader::get_output_symbol_index): New
7787 function.
7788 (Incremental_input_entry_reader::type_): Remove.
7789 (Incremental_input_entry_reader::flags_): New data member.
7790 (Incremental_inputs_reader::input_file_offset): New function.
7791 (Incremental_inputs_reader::input_file_index): New function.
7792 (Incremental_inputs_reader::input_file): Call input_file_offset.
7793 (Incremental_inputs_reader::input_file_at_offset): New function.
7794 (Incremental_relocs_reader::get_r_type): Reformat.
7795 (Incremental_relocs_reader::get_r_shndx): Reformat.
7796 (Incremental_relocs_reader::get_r_offset): Reformat.
7797 (Incremental_relocs_reader::data): New function.
7798 (Incremental_binary::Incremental_binary): Initialize new data members.
7799 (Incremental_binary::check_inputs): Add cmdline parameter.
7800 (Incremental_binary::file_is_unchanged): Remove.
7801 (Input_reader::arg_serial): New function.
7802 (Input_reader::get_unused_symbol_count): New function.
7803 (Input_reader::get_unused_symbol): New function.
7804 (Input_reader::do_arg_serial): New function.
7805 (Input_reader::do_get_unused_symbol_count): New function.
7806 (Input_reader::do_get_unused_symbol): New function.
7807 (Incremental_binary::input_file_count): New function.
7808 (Incremental_binary::get_input_reader): Change signature to use
7809 index instead of filename.
7810 (Incremental_binary::file_has_changed): New function.
7811 (Incremental_binary::get_input_argument): New function.
7812 (Incremental_binary::get_library): New function.
7813 (Incremental_binary::get_script_info): New function.
7814 (Incremental_binary::init_layout): New function.
7815 (Incremental_binary::reserve_layout): New function.
7816 (Incremental_binary::output_file): New function.
7817 (Incremental_binary::do_check_inputs): New function.
7818 (Incremental_binary::do_file_is_unchanged): Remove.
7819 (Incremental_binary::do_file_has_changed): New function.
7820 (Incremental_binary::do_init_layout): New function.
7821 (Incremental_binary::do_reserve_layout): New function.
7822 (Incremental_binary::do_input_file_count): New function.
7823 (Incremental_binary::do_get_input_reader): Change signature.
7824 (Incremental_binary::input_args_map_): New data member.
7825 (Incremental_binary::library_map_): New data member.
7826 (Incremental_binary::script_map_): New data member.
7827 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7828 new data members.
7829 (Sized_incremental_binary::output_section): New function.
7830 (Sized_incremental_binary::inputs_reader): Add const.
7831 (Sized_incremental_binary::symtab_reader): Add const.
7832 (Sized_incremental_binary::relocs_reader): Add const.
7833 (Sized_incremental_binary::got_plt_reader): Add const.
7834 (Sized_incremental_binary::get_symtab_view): New function.
7835 (Sized_incremental_binary::Inputs_reader): New typedef.
7836 (Sized_incremental_binary::Input_entry_reader): New typedef.
7837 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7838 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7839 (Sized_incremental_binary::do_file_has_changed): New function.
7840 (Sized_incremental_binary::do_init_layout): New function.
7841 (Sized_incremental_binary::do_reserve_layout): New function.
7842 (Sized_input_reader::Inputs_reader): Remove.
7843 (Sized_input_reader::Input_entry_reader): Remove.
7844 (Sized_input_reader::do_arg_serial): New function.
7845 (Sized_input_reader::do_get_unused_symbol_count): New function.
7846 (Sized_input_reader::do_get_unused_symbol): New function.
7847 (Sized_incremental_binary::do_input_file_count): New function.
7848 (Sized_incremental_binary::do_get_input_reader): Change signature;
7849 use index instead of filename.
7850 (Sized_incremental_binary::section_map_): New data member.
7851 (Sized_incremental_binary::input_entry_readers_): New data member.
7852 (class Sized_incr_relobj): New class.
7853 (class Sized_incr_dynobj): New class.
7854 (make_sized_incremental_object): New function.
7855 (class Incremental_library): New class.
7856 * layout.cc (Free_list::num_lists): New static data member.
7857 (Free_list::num_nodes): New static data member.
7858 (Free_list::num_removes): New static data member.
7859 (Free_list::num_remove_visits): New static data member.
7860 (Free_list::num_allocates): New static data member.
7861 (Free_list::num_allocate_visits): New static data member.
7862 (Free_list::init): New function.
7863 (Free_list::remove): New function.
7864 (Free_list::allocate): New function.
7865 (Free_list::dump): New function.
7866 (Free_list::print_stats): New function.
7867 (Layout_task_runner::run): Resize output file for incremental updates.
7868 (Layout::Layout): Initialize new data members.
7869 (Layout::set_incremental_base): New function.
7870 (Layout::init_fixed_output_section): New function.
7871 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7872 incremental updates.
7873 (Layout::create_gold_note): Do not create gold note section for
7874 incremental updates.
7875 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7876 for incremental updates.
7877 (Layout::set_section_offsets): For incremental updates, allocate space
7878 from free list.
7879 (Layout::create_symtab_sections): Layout with offsets relative to
7880 start of section; for incremental updates, allocate space from free
7881 list.
7882 (Layout::create_shdrs): For incremental updates, allocate space from
7883 free list.
7884 (Layout::finish_dynamic_section): For incremental updates, do not
7885 check --as-needed (fixed in subsequent patch).
7886 * layout.h (class Free_list): New class.
7887 (Layout::set_incremental_base): New function.
7888 (Layout::incremental_base): New function.
7889 (Layout::init_fixed_output_section): New function.
7890 (Layout::allocate): New function.
7891 (Layout::incremental_base_): New data member.
7892 (Layout::free_list_): New data member.
7893 * main.cc (main): Print Free_list statistics.
7894 * object.cc (Relobj::finalize_incremental_relocs): Add
7895 clear_counts parameter; clear counts only when clear_counts is set.
7896 (Sized_relobj::Sized_relobj): Initialize new base class.
7897 (Sized_relobj::do_layout): Don't report special sections.
7898 (Sized_relobj::do_for_all_local_got_entries): New function.
7899 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7900 symtab_off to all symbol table offsets.
7901 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7902 * object.h (class Got_offset_list): Move to top of file.
7903 (Object::Object): Allow case where input_file == NULL.
7904 (Object::~Object): Likewise.
7905 (Object::input_file): Assert that input_file != NULL.
7906 (Object::lock): Allow case where input_file == NULL.
7907 (Object::unlock): Likewise.
7908 (Object::is_locked): Likewise.
7909 (Object::token): Likewise.
7910 (Object::release): Likewise.
7911 (Object::is_incremental): New function.
7912 (Object::get_mtime): New function.
7913 (Object::for_all_local_got_entries): New function.
7914 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7915 (Object::set_is_in_system_directory): New function.
7916 (Object::is_in_system_directory): New function.
7917 (Object::do_is_incremental): New function.
7918 (Object::do_get_mtime): New function.
7919 (Object::do_for_all_local_got_entries): New function.
7920 (Object::is_in_system_directory_): New data member.
7921 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7922 (class Sized_relobj_base): New class.
7923 (class Sized_relobj): Derive from Sized_relobj_base.
7924 (class Sized_relobj::Symbols): Redeclare from base class.
7925 (class Sized_relobj::local_got_offset_list): Remove.
7926 (class Sized_relobj::Output_sections): Redeclare from base class.
7927 (class Sized_relobj::do_for_all_local_got_entries): New function.
7928 (class Sized_relobj::write_local_symbols): Add offset parameter.
7929 (class Sized_relobj::local_symbol_offset_): Update comment.
7930 (class Sized_relobj::local_dynsym_offset_): Update comment.
7931 * options.cc (Input_arguments::add_file): Remove const.
7932 * options.h (Input_file_argument::Input_file_argument):
7933 Initialize arg_serial_ (all constructors).
7934 (Input_file_argument::set_arg_serial): New function.
7935 (Input_file_argument::arg_serial): New function.
7936 (Input_file_argument::arg_serial_): New data member.
7937 (Input_arguments::Input_arguments): Initialize file_count_.
7938 (Input_arguments::add_file): Remove const.
7939 (Input_arguments::number_of_input_files): New function.
7940 (Input_arguments::file_count_): New data member.
7941 (Command_line::number_of_input_files): Call
7942 Input_arguments::number_of_input_files.
7943 * output.cc (Output_segment_headers::Output_segment_headers):
7944 Set current size.
7945 (Output_section::Input_section::current_data_size): New function.
7946 (Output_section::Output_section): Initialize new data members.
7947 (Output_section::add_input_section): Don't do merge sections for
7948 an incremental link; allocate space from free list for an
7949 incremental update.
7950 (Output_section::add_output_section_data): Allocate space from
7951 free list for an incremental update.
7952 (Output_section::update_data_size): New function.
7953 (Output_section::set_fixed_layout): New function.
7954 (Output_section::reserve): New function.
7955 (Output_segment::set_section_addresses): Remove const.
7956 (Output_segment::set_section_list_addresses): Remove const; allocate
7957 space from free list for an incremental update.
7958 (Output_segment::set_offset): Adjust size of RELRO segment for an
7959 incremental update.
7960 * output.h (Output_data::current_data_size): Move here from
7961 child classes.
7962 (Output_data::pre_finalize_data_size): New function.
7963 (Output_data::update_data_size): New function.
7964 (Output_section_headers::update_data_size): new function.
7965 (Output_section_data_build::current_data_size): Move to Output_data.
7966 (Output_data_strtab::update_data_size): New function.
7967 (Output_section::current_data_size): Move to Output_data.
7968 (Output_section::set_fixed_layout): New function.
7969 (Output_section::has_fixed_layout): New function.
7970 (Output_section::reserve): New function.
7971 (Output_section::update_data_size): New function.
7972 (Output_section::has_fixed_layout_): New data member.
7973 (Output_section::free_list_): New data member.
7974 (Output_segment::set_section_addresses): Remove const.
7975 (Output_segment::set_section_list_addresses): Remove const.
7976 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7977 New function.
7978 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7979 New function.
7980 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7981 parameter when calling Add_symbols constructor; store argument
7982 serial number for members of a lib group.
7983 (Add_symbols::locks): Allow case where token == NULL.
7984 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7985 (Read_member::~Read_member): New function.
7986 (Read_member::is_runnable): New function.
7987 (Read_member::locks): New function.
7988 (Read_member::run): New function.
7989 (Check_script::~Check_script): New function.
7990 (Check_script::is_runnable): New function.
7991 (Check_script::locks): New function.
7992 (Check_script::run): New function.
7993 (Check_library::~Check_library): New function.
7994 (Check_library::is_runnable): New function.
7995 (Check_library::locks): New function.
7996 (Check_library::run): New function.
7997 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7998 (Add_symbols::library_): New data member.
7999 (class Read_member): New class.
8000 (class Check_script): New class.
8001 (class Check_library): New class.
8002 * reloc.cc (Read_relocs::is_runnable): Allow case where
8003 token == NULL.
8004 (Read_relocs::locks): Likewise.
8005 (Scan_relocs::locks): Likewise.
8006 (Relocate_task::locks): Likewise.
8007 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8008 to clear counters.
8009 (Sized_relobj::incremental_relocs_scan): Fix comment.
8010 (Sized_relobj::do_relocate): Pass output file offset to
8011 write_local_symbols.
8012 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8013 from class declaration.
8014 * script.cc (read_input_script): Allocate Script_info; pass
8015 argument serial number to report_script.
8016 * script.h (class Script_info): Move to incremental.h.
8017 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8018 * symtab.h (Symbol_table::add_from_incrobj): New function.
8019 (Symbol_table::set_file_offset): New function.
8020
b961d0d7
CC
80212011-04-05 Cary Coutant <ccoutant@google.com>
8022
8023 * incremental-dump.cc (dump_incremental_inputs): Change signature
8024 to take a Sized_incremental_binary; change caller. Use readers
8025 in Sized_incremental_binary.
8026 * incremental.cc
8027 (Sized_incremental_binary::find_incremental_inputs_sections):
8028 Rename do_find_incremental_inputs_sections to this.
8029 (Sized_incremental_binary::setup_readers): New function.
8030 (Sized_incremental_binary::do_check_inputs): Check
8031 has_incremental_info_ flag; move setup code to setup_readers;
8032 use input readers.
8033 (Sized_incremental_binary::do_file_is_unchanged): New function.
8034 (Sized_incremental_binary::do_get_input_reader): New function.
8035 * incremental.h (class Incremental_binary): Move to end of file.
8036 (Incremental_binary::file_is_unchanged): New function.
8037 (Incremental_binary::do_file_is_unchanged): New function.
8038 (Incremental_binary::Input_reader): New class.
8039 (Incremental_binary::get_input_reader): New function.
8040 (class Sized_incremental_binary): Move to end of file.
8041 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8042 input section reader classes.
8043 (Sized_incremental_binary::has_incremental_info): New function.
8044 (Sized_incremental_binary::inputs_reader): New function.
8045 (Sized_incremental_binary::symtab_reader): New function.
8046 (Sized_incremental_binary::relocs_reader): New function.
8047 (Sized_incremental_binary::got_plt_reader): New function.
8048 (Sized_incremental_binary::do_file_is_unchanged): New function.
8049 (Sized_incremental_binary::Sized_input_reader): New class.
8050 (Sized_incremental_binary::get_input_reader): New function.
8051 (Sized_incremental_binary::find_incremental_inputs_sections):
8052 Rename do_find_incremental_inputs_sections to this.
8053 (Sized_incremental_binary::setup_readers): New function.
8054 (Sized_incremental_binary::has_incremental_info_): New data member.
8055 (Sized_incremental_binary::inputs_reader_): New data member.
8056 (Sized_incremental_binary::symtab_reader_): New data member.
8057 (Sized_incremental_binary::relocs_reader_): New data member.
8058 (Sized_incremental_binary::got_plt_reader_): New data member.
8059 (Sized_incremental_binary::current_input_file_): New data member.
8060
a869183f
PP
80612011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8062
8063 PR gold/12640
8064 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8065 violation.
8066
80672011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8068
8069 * archive.cc (Archive::include_member): Adjust call to report_object.
8070 (Add_archive_symbols::run): Add script_info to call to
8071 report_archive_begin.
8072 (Lib_group::include_member): Adjust call to report_object.
8073 (Add_lib_group_symbols::run): Adjust call to report_object.
8074 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8075 blocks. Add object count for script input files.
8076 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8077 script_info parameter; change all callers.
8078 (Incremental_inputs::report_object): Add script_info parameter;
8079 change all callers.
8080 (Incremental_inputs::report_script): Store backpointer to
8081 incremental info entry.
8082 (Output_section_incremental_inputs::set_final_data_size): Record
8083 additional information for scripts.
8084 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8085 * incremental.h (Incremental_script_entry::add_object): New function.
8086 (Incremental_script_entry::get_object_count): New function.
8087 (Incremental_script_entry::get_object): New function.
8088 (Incremental_script_entry::objects_): New data member; adjust
8089 constructor.
8090 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8091 (Incremental_inputs::report_object): Add script_info parameter.
8092 (Incremental_inputs_reader::get_object_count): New function.
8093 (Incremental_inputs_reader::get_object_offset): New function.
8094 * options.cc (Input_arguments::add_file): Return reference to
8095 new input argument.
8096 * options.h (Input_argument::set_script_info): New function.
8097 (Input_argument::script_info): New function.
8098 (Input_argument::script_info_): New data member; adjust all
8099 constructors.
8100 (Input_file_group::add_file): Return reference to new input argument.
8101 (Input_file_lib::add_file): Likewise.
8102 (Input_arguments::add_file): Likewise.
8103 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8104 * script.cc (Parser_closure::Parser_closure): Add script_info
8105 parameter; adjust all callers.
8106 (Parser_closure::script_info): New function.
8107 (Parser_closure::script_info_): New data member.
8108 (read_input_script): Report scripts earlier to incremental info.
8109 (script_add_file): Set script_info in Input_argument.
8110 (script_add_library): Likewise.
8111 * script.h (Script_options::Script_info): Rewrite class.
8112
a869183f 81132011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8114
8115 * archive.cc (Library_base::should_include_member): Move
8116 method here from class Archive.
8117 (Archive::Archive): Initialize base class.
8118 (Archive::should_include_member): Move to base class.
8119 (Archive::do_for_all_unused_symbols): New function.
8120 (Add_archive_symbols::run): Remove redundant access to
8121 incremental_inputs.
8122 (Lib_group::Lib_group): Initialize base class.
8123 (Lib_group::do_filename): New function.
8124 (Lib_group::include_member): Pass pointer to Lib_group to
8125 report_object.
8126 (Lib_group::do_for_all_unused_symbols): New function.
8127 (Add_lib_group_symbols::run): Report archive information for
8128 incremental links.
8129 * archive.h (class Library_base): New base class.
8130 (class Archive): Derive from Library_base.
8131 (Archive::filename): Move to base class.
8132 (Archive::set_incremental_info): Likewise.
8133 (Archive::incremental_info): Likewise.
8134 (Archive::Should_include): Likewise.
8135 (Archive::should_include_member): Likewise.
8136 (Archive::Armap_entry): Remove.
8137 (Archive::Unused_symbol_iterator): Remove.
8138 (Archive::unused_symbols_begin): Remove.
8139 (Archive::unused_symbols_end): Remove.
8140 (Archive::do_filename): New function.
8141 (Archive::do_get_mtime): New function.
8142 (Archive::do_for_all_unused_symbols): New function.
8143 (Archive::task_): Move to base class.
8144 (Archive::incremental_info_): Likewise.
8145 (class Lib_group): Derive from Library_base.
8146 (Lib_group::do_filename): New function.
8147 (Lib_group::do_get_mtime): New function.
8148 (Lib_group::do_for_all_unused_symbols): New function.
8149 (Lib_group::task_): Move to base class.
8150 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8151 function.
8152 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8153 function.
8154 * incremental.cc (Incremental_inputs::report_archive_begin):
8155 Use Library_base; call library's get_mtime; add incremental inputs
8156 entry before members.
8157 (class Unused_symbol_visitor): New class.
8158 (Incremental_inputs::report_archive_end): Use Library_base; use
8159 visitor class to record unused symbols; don't add incremental inputs
8160 entry after members.
8161 (Incremental_inputs::report_object): Use Library_base.
8162 * incremental.h
8163 (Incremental_archive_entry::Incremental_archive_entry): Remove
8164 unused Archive parameter.
8165 (Incremental_inputs::report_archive_begin): Use Library_base.
8166 (Incremental_inputs::report_archive_end): Likewise.
8167 (Incremental_inputs::report_object): Likewise.
8168 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8169 function.
8170 * object.h (Object::for_all_global_symbols): New function.
8171 (Object::do_for_all_global_symbols): New function.
8172 (Sized_relobj::do_for_all_global_symbols): New function.
8173 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8174 function.
8175 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8176 function.
8177
61ab3e40
ILT
81782011-03-27 Ian Lance Taylor <iant@google.com>
8179
8180 * archive.cc (Archive::interpret_header): Return -1 if something
8181 goes wrong. Change callers accordingly.
8182
30e1f9e6
CC
81832011-03-25 Cary Coutant <ccoutant@google.com>
8184
8185 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8186 * testsuite/Makefile.in: Regenerate.
8187
9370ce59 81882011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8189
8190 * plugin.cc (get_view): New.
8191 (Plugin::load): Pass get_view to the plugin.
8192 (Plugin_manager::get_view): New.
8193
9312bb0a
ILT
81942011-03-21 Ian Lance Taylor <iant@google.com>
8195
8196 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8197 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8198
7e12ba9e
ST
81992011-03-21 Sriraman Tallam <tmsriram@google.com>
8200
8201 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8202 Change == to -eq.
8203 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8204 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8205 Change == to -eq.
8206 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8207 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8208
fd7a005d
ILT
82092011-03-14 Ian Lance Taylor <iant@google.com>
8210
8211 * script-sections.cc (Sort_output_sections::script_compare):
8212 Rename from is_before, change return type.
8213 (Sort_output_sections::operator()): Adjust accordingly.
8214
ed16fd1b
ILT
82152011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8216
8217 PR gold/12572
8218 * testsuite/odr_violation2.cc: Add comment to make all error line
8219 numbers double digits.
8220 * testsuite/debug_msg.sh: Adjust expected errors.
8221
71ff8986
ILT
82222011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8223
8224 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8225 but mark earlier ones as non-canonical
8226 (offset_to_iterator): Update search target and example
8227 (do_addr2line): Return extra lines in a vector*
8228 (format_file_lineno): Extract from do_addr2line
8229 (one_addr2line): Add vector* out-param
8230 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8231 when a lineno entry appeared last for its instruction
8232 (Dwarf_line_info): Add vector* out-param
8233 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8234 * symtab.cc (Odr_violation_compare): Include the lineno in the
8235 comparison again.
8236 (linenos_from_loc): New. Combine the canonical line for an
8237 address with its other lines.
8238 (True_if_intersect): New. Helper functor to make
8239 std::set_intersection a query.
8240 (detect_odr_violations): Compare sets of lines instead of just
8241 one line for each function. This became less deterministic, but
8242 has fewer false positives.
8243 * symtab.h: Declarations.
8244 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8245 mix an optimized and non-optimized object in the same binary
8246 (odr_violation2.so): Same.
8247 * testsuite/Makefile.in: Regenerate from Makefile.am.
8248 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8249 * testsuite/debug_msg.sh: Update line numbers and add
8250 assertions.
8251 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8252 non-optimized context.
8253 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8254 isn't inlined, and use OdrDerived in an optimized context.
8255 * testsuite/odr_header1.h: Defines OdrDerived, where
8256 optimization will change the
8257 first-instruction-in-the-destructor's file and line number.
8258 * testsuite/odr_header2.h: Defines OdrBase.
8259
a19fefdc
ILT
82602011-03-09 Ian Lance Taylor <iant@google.com>
8261
8262 * fileread.cc (File_read::clear_views): Don't delete the whole
8263 file view.
8264
ecb351e9
ILT
82652011-03-08 Ian Lance Taylor <iant@google.com>
8266
8267 PR gold/12525
8268 * fileread.cc: #include <climits>.
8269 (GOLD_IOV_MAX): Define.
8270 (File_read::read_multiple): Limit number of entries by iov_max.
8271 * fileread.h (class File_read): Always set max_readv_entries to
8272 128.
8273
b821d13c
ILT
82742011-03-07 Ian Lance Taylor <iant@google.com>
8275
8276 PR gold/12525
8277 * options.h (class General_options): Add -dy and -dn.
8278
89243142
CC
82792011-03-02 Cary Coutant <ccoutant@google.com>
8280
8281 * testsuite/script_test_9.t: Add TLS segment.
8282
d0773f31
ILT
82832011-03-02 Simon Baldwin <simonb@google.com>
8284
8285 * configure.ac: Add check for gnu_indirect_function support in
8286 the toolchain building binutils.
8287 * configure: Rebuild.
8288
9370ce59 82892011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8290
8291 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8292 plugin only symbols.
8293 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8294 in plugin files as not needed in the symbol table.
8295
4cf7a849
ST
82962011-02-11 Sriraman Tallam <tmsriram@google.com>
8297
8298 * output.cc (Output_section::add_input_section): Delay fill
8299 generation for section ordering.
8300
b578bd7d
ILT
83012011-02-09 Ian Lance Taylor <iant@google.com>
8302
8303 PR gold/12316
8304 * object.h (class Sized_relobj): Remove clear_local_symbols.
8305 * reloc.cc (Sized_relobj::do_relocate): Don't call
8306 clear_local_symbols.
8307
9370ce59 83082011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8309
8310 * plugin.cc (is_visible_from_outside): Return true for symbols
8311 in the -u option.
8312
55382fb7
ILT
83132011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8314
8315 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8316 filename.
8317
4e271fff
ST
83182011-02-02 Sriraman Tallam <tmsriram@google.com>
8319
8320 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8321 to std::string.
4e271fff 8322 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8323 section_name to be std::string.
4e271fff
ST
8324 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8325
d433c3ac
ILT
83262011-01-25 Ian Lance Taylor <iant@google.com>
8327
8328 * script.cc (script_add_extern): Rewrite to use
8329 add_symbol_reference.
8330
880473a6
DK
83312011-01-25 Doug Kwan <dougkwan@google.com>
8332
d433c3ac 8333 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8334
f30f86fa
ILT
83352011-01-24 Ian Lance Taylor <iant@google.com>
8336
8337 * options.h (class General_options): Accept
8338 --no-detect-odr-violations.
8339
8e51a0b9
ILT
83402011-01-24 Ian Lance Taylor <iant@google.com>
8341
8342 * version.cc (version_string): Bump to 1.11.
8343
0f3b89d8
ILT
83442011-01-24 Ian Lance Taylor <iant@google.com>
8345
8346 * plugin.cc (class Plugin_rescan): Define new class.
8347 (Plugin_manager::claim_file): Set any_claimed_.
8348 (Plugin_manager::save_archive): New function.
8349 (Plugin_manager::save_input_group): New function.
8350 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8351 necessary.
8352 (Plugin_manager::new_undefined_symbol): New function.
8353 (Plugin_manager::rescan): New function.
8354 (Plugin_manager::rescannable_defines): New function.
8355 (Plugin_manager::add_input_file): Set any_added_.
8356 * plugin.h (class Plugin_manager): define new fields rescannable_,
8357 undefined_symbols_, any_claimed_, and any_added_. Declare
8358 Plugin_rescan as friend. Declare new functions.
8359 (Plugin_manager::Rescannable): Define type.
8360 (Plugin_manager::Rescannable_list): Define type.
8361 (Plugin_manager::Undefined_symbol_list): Define type.
8362 (Plugin_manager::Plugin_manager): Initialize new fields.
8363 * archive.cc (Archive::defines_symbol): New function.
8364 (Add_archive_symbols::run): Pass archive to plugins if any.
8365 * archive.h (class Archive): Declare defines_symbol.
8366 * readsyms.cc (Input_group::~Input_group): New function.
8367 (Finish_group::run): Pass input_group to plugins if any.
8368 * readsyms.h (class Input_group): Declare destructor.
8369 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8370 any.
8371
3bb951e5
ILT
83722011-01-10 Ian Lance Taylor <iant@google.com>
8373
8374 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8375 section as relro.
8376 (Layout::set_segment_offsets): Reset increase_relro before calling
8377 set_section_addresses a second time.
8378
0aa45fac
CC
83792011-01-04 Cary Coutant <ccoutant@google.com>
8380
8381 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8382 sections before NOBITS sections.
8383
0db46eb4
L
83842011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8385
8386 * version.cc (print_version): Update copyright to 2011.
8387
829c9745
CC
83882010-12-23 Cary Coutant <ccoutant@google.com>
8389
8390 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8391 of OS to this->add. Add OD parameter to second form of the function.
8392
7500420b
ILT
83932010-12-20 Ian Lance Taylor <iant@google.com>
8394
8395 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8396 second of two consecutive entries with same offset.
8397
f8e9a930
RW
83982010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8399
8400 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8401 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8402 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8403 to avoid unneeded links against $(LDADD).
8404 * testsuite/Makefile.in: Regenerate.
8405
2fbb4320
ILT
84062010-12-15 Ian Lance Taylor <iant@google.com>
8407
8408 PR gold/12324
8409 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8410 for R_X86_64_32 and R_X86_64_PC32.
8411 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8412 ver_matching_def_pic.o.
8413 (ver_matching_def_pic.o): New target.
8414
fedb228d
RW
84152010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8416
8417 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8418 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8419 Move definition before File_read::View member definitions.
8420 (File_read::View::~View): Initialize and hold lock before
8421 updating current_mapped_bytes.
8422
9b547ce6
RW
84232010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8424
8425 * dwarf_reader.cc: Remove outdated comment.
8426 * gold-threads.cc: Fix typo in error message.
8427 * archive.cc: Fix typos in comments.
8428 * archive.h: Likewise.
8429 * arm-reloc-property.cc: Likewise.
8430 * arm-reloc-property.h: Likewise.
8431 * arm-reloc.def: Likewise.
8432 * arm.cc: Likewise.
8433 * attributes.h: Likewise.
8434 * cref.cc: Likewise.
8435 * ehframe.cc: Likewise.
8436 * fileread.h: Likewise.
8437 * gold.h: Likewise.
8438 * i386.cc: Likewise.
8439 * icf.cc: Likewise.
8440 * incremental.h: Likewise.
8441 * int_encoding.cc: Likewise.
8442 * layout.h: Likewise.
8443 * main.cc: Likewise.
8444 * merge.h: Likewise.
8445 * object.cc: Likewise.
8446 * object.h: Likewise.
8447 * options.cc: Likewise.
8448 * readsyms.cc: Likewise.
8449 * reduced_debug_output.cc: Likewise.
8450 * reloc.cc: Likewise.
8451 * script-sections.cc: Likewise.
8452 * sparc.cc: Likewise.
8453 * symtab.h: Likewise.
8454 * target-reloc.h: Likewise.
8455 * target.cc: Likewise.
8456 * target.h: Likewise.
8457 * timer.cc: Likewise.
8458 * timer.h: Likewise.
8459 * x86_64.cc: Likewise.
8460
83e17bd5
CC
84612010-12-09 Cary Coutant <ccoutant@google.com>
8462
8463 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8464 stack.
8465 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8466 parameter; change all callers.
8467 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8468 * options.h (warn_execstack): New option.
8469
017257f8
DK
84702010-12-07 Doug Kwan <dougkwan@google.com>
8471
8472 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8473 like function call relocations.
8474
c20cbc06
ILT
84752010-12-07 Ian Lance Taylor <iant@google.com>
8476
8477 * archive.cc (Archive::get_elf_object_for_member): Permit
8478 punconfigured to be NULL.
8479 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8480 (Archive::include_member): Pass NULL to get_elf_object_for_member
8481 if we searched for the archive and this is the first included
8482 object.
8483
4dbfafcc
ILT
84842010-12-01 Ian Lance Taylor <iant@google.com>
8485
8486 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8487 track_relocs_type_ field.
8488 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8489 Set track_relocs_type_.
8490 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8491 contents when using RELA relocs.
8492 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8493 reloc_map_.
8494 * reloc.cc (Track_relocs::next_addend): New function.
8495 * reloc.h (class Track_relocs): Declare next_addend.
8496
e5e19edd
ILT
84972010-12-01 Ian Lance Taylor <iant@google.com>
8498
8499 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8500 virtual destructor.
8501
9a5ce24c
ILT
85022010-12-01 Ian Lance Taylor <iant@google.com>
8503
8504 * README: Update compilers known to work and fail.
8505
c7791212
NC
85062010-11-23 Matthias Klose <doko@ubuntu.com>
8507
8508 * configure.in: For --enable-gold, handle value `default' instead of
8509 `both*'. Always install ld as ld.bfd, install as ld if gold is
8510 not the default.
8511 * configure: Regenerate.
8512
0ad220c9
DK
85132010-11-18 Doug Kwan <dougkwan@google.com>
8514
8515 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8516 and right_alignment to be zero. Store result alignment only if it is
8517 greater than existing alignment.
8518
ab8056e0
CC
85192010-11-16 Cary Coutant <ccoutant@google.com>
8520
8521 PR gold/12220
8522 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8523 Check for ".zdebug_line".
8524
fd064a5b
CC
85252010-11-16 Doug Kwan <dougkwan@google.com>
8526 Cary Coutant <ccoutant@google.com>
8527
8528 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8529 by reference; adjust all callers.
8530 * output.cc (Output_segment::set_section_addresses): Adjust references
8531 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8532 list is empty.
8533 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8534 end at page boundary.
8535
6fc6ea19
CC
85362010-11-16 Cary Coutant <ccoutant@google.com>
8537
8538 PR gold/12220
8539 * layout.cc (Layout::choose_output_section): Transform names of
8540 compressed sections even when using a script with a SECTIONS clause.
8541 (Layout::output_section_name): Remove code to transform
8542 compressed debug section names.
8543 * output.cc (Output_section::add_input_section): Use uncompressed
8544 section size when tracking input sections.
8545
95a2c8d6
RS
85462010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8547
8548 * symtab.h (Symbol::NON_PIC_REF): Remove.
8549 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8550 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8551 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8552 (Symbol::use_plt_offset): Take a flags argument and pass it
8553 directly to needs_dynamic_reloc. Restrict check for undefined
8554 weak symbols to function calls.
8555 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8556 (Target_arm::Scan::global): Use it.
8557 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8558 (Target_arm::Relocate::relocate): Likewise.
8559 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8560 parameter with an r_type parameter. Use get_reference_flags
8561 to get the flags.
8562 (Target_arm::Relocate::relocate): Update accordingly.
8563 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8564 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8565 (Target_i386::Scan::global): Likewise.
8566 (Target_i386::Relocate::relocate): Likewise.
8567 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8568 parameter with an r_type parameter. Use get_reference_flags
8569 to get the flags.
8570 (Target_i386::Relocate::relocate): Update accordingly.
8571 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8572 (Target_powerpc::Scan::global): Use it.
8573 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8574 (Target_powerpc::Relocate::relocate): Likewise.
8575 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8576 (Target_sparc::Scan::global): Use it.
8577 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8578 (Target_sparc::Relocate::relocate): Likewise.
8579 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8580 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8581 (Target_x86_64::Scan::global): Likewise.
8582 (Target_x86_64::Relocate::relocate): Likewise.
8583
f625ae50
DK
85842010-11-08 Doug Kwan <dougkwan@google.com>
8585 Cary Coutant <ccoutant@google.com>
8586
8587 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8588 (Arm_exidx_merge_section::section_contents_): New data member.
8589 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8590 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8591 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8592 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8593 in parameters instead of calling Object::section_contents without
8594 locking.
8595 (Arm_output_section::group_section): New parameter TASK. Pass it
8596 to callees that need locking objects.
8597 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8598 to lock EXIDX input sections. Fix a formatting issue. Call
8599 Arm_exidx_merged_section::build_contents to create merged section
8600 contents.
8601 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8602 to lock object of stub table owner.
8603 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8604 TEXT_SIZE to initialize data member TEXT_SIZE_.
8605 (Arm_exidx_input_section::addralign): Fix typo in comment.
8606 (Arm_exidx_input_section::text_size): New method.
8607 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8608 that require locking objects. Lock objects before scanning for stubs
8609 and updating local symbols.
8610 (Arm_input_section<big_endian>::init): Copy contents of original
8611 input section.
2e702c99 8612 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8613 original input section instead of calling Object::section_contents
8614 without locking.
8615 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8616 size without calling Object::section_size().
8617 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8618 for size. Allocate a buffer for merged EXIDX entries.
8619 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8620 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8621 building code to Arm_exidx_merged_section::build_contetns. Write
8622 out contetns in buffer instead of building it on the fly.
8623 (Arm_relobj::make_exidx_input_section): Also pass text section size
8624 to Arm_exidx_input_section constructor.
8625 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8626 (Arm_dynobj::do_read_symbols): Fix memory leak.
8627 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8628 * target.h: (class Task): Add forward declaration.
8629 (Target::relax): Add new parameter TASK and pass it to
8630 Target::do_relax().
8631 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8632
5f9bcf58
CC
86332010-11-05 Cary Coutant <ccoutant@google.com>
8634
8635 PR gold/10708
8636 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8637 object when reading from the file.
8638 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8639 second layout pass.
8640 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8641 when reading section contents.
8642 (get_section_contents): Likewise.
8643 (icf::find_identical_sections): Likewise.
8644 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8645 object when reading from the file.
8646 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8647 the object when doing deferred section layout.
8648
e597fa08
NC
86492010-11-03 Nick Clifton <nickc@redhat.com>
8650
8651 PR gold/12001
8652 * script.h (class Symbol_assignment: name): New member. Returns
8653 the name of the symbol.
8654 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8655 Returns true if the given symbol name is on the list of
8656 assignments wating to be processed.
8657 * archive.cc (should_incldue_member): If the symbol is undefined,
8658 check to see if it is on the list of symbols pending assignment.
8659
3f9a3278
ILT
86602010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8661
8662 * script-sections.cc (Script_sections::find_memory_region): Check
8663 for a NULL output section pointer.
8664
d06fb4d1
DK
86652010-10-29 Doug Kwan <dougkwan@google.com>
8666
8667 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8668 Output_section::add_relaxed_input_section.
8669 * output.cc (Output_section::add_relaxed_input_section): Add new
8670 arguments LAYOUT and NAME. Set section order index.
8671 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8672 Copy section order index.
8673 * output.h (Output_section::add_relaxed_input_section): Add new
8674 arguments LAYOUT and NAME.
8675
90e24de5
ILT
86762010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8677
8678 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8679 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8680 * testsuite/Makefile.in: Regenerate.
8681
c9484ea5
DK
86822010-10-20 Doug Kwan <dougkwan@google.com>
8683
8684 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8685 without SHF_LINK_ORDER flags.
8686 * layout.cc (Layout::choose_output_section): Do not filter
8687 SHF_LINK_ORDER flag in a relocatable link.
8688
5bc2f5be
CC
86892010-10-17 Cary Coutant <ccoutant@google.com>
8690
8691 * output.h (Output_segment::set_section_addresses): Change function
8692 signature. Update all callers.
8693 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8694 sections.
8695 (Output_segment::set_section_addresses): Align after last TLS
8696 section. Add padding before last relro section instead of after.
8697
0c91cf04
DK
86982010-10-17 Doug Kwan <dougkwan@google.com>
8699
8700 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8701 GOT output section to be writable.
8702
8c21d9d3
CC
87032010-10-14 Cary Coutant <ccoutant@google.com>
8704
8705 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8706 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8707 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8708 mode.
8709 * incremental.cc (report_command_line): Ignore all forms of
8710 --incremental.
8711 * layout.cc (Layout::Layout): Check parameters for incremental link
8712 mode.
8713 * options.cc (General_options::parse_incremental): New function.
8714 (General_options::parse_no_incremental): New function.
8715 (General_options::parse_incremental_full): New function.
8716 (General_options::parse_incremental_update): New function.
8717 (General_options::incremental_mode_): New data member.
8718 (General_options::finalize): Check incremental_mode_.
8719 * options.h (General_options): Update help text for --incremental.
8720 Add --no-incremental, --incremental-full, --incremental-update.
8721 (General_options::Incremental_mode): New enum type.
8722 (General_options::incremental_mode): New function.
8723 (General_options::incremental_mode_): New data member.
8724 * parameters.cc (Parameters::incremental_mode_): New data member.
8725 (Parameters::set_options): Set incremental_mode_.
8726 (Parameters::set_incremental_full): New function.
8727 (Parameters::incremental): New function.
8728 (Parameters::incremental_update): New function.
8729 (set_parameters_incremental_full): New function.
8730 * parameters.h (Parameters::set_incremental_full): New function.
8731 (Parameters::incremental): New function.
8732 (Parameters::incremental_update): New function.
8733 (Parameters::incremental_mode_): New data member.
8734 (set_parameters_incremental_full): New function.
8735 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8736 incremental link mode.
8737 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8738 (Sized_relobj::do_relocate_sections): Likewise.
8739 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8740 option.
8741 * testsuite/Makefile.in: Regenerate.
8742 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8743
bb32aa18 87442010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8745
8746 * script-sections.h (class Script_sections): Make
8747 Sections_elements typedef public.
8748 * script-sections.cc (class Sort_output_sections): Add elements_
8749 field. Add constructor which sets it; change all callers.
8750 (Sort_output_sections::is_before): New function.
8751 (Sort_output_sections::operator()): Call is_before.
8752 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8753 conditional.
8754 * testsuite/script_test_10.sh: New test. Test script section
8755 order.
8756 * testsuite/script_test_10.t: Likewise.
8757 * testsuite/script_test_10.s: Likewise.
8758 * testsuite/Makefile.am: Wrap the cross linker tests and the
8759 common tests into NATIVE_OR_CROSS_LINKER.
8760 (check_SCRIPTS): Add script_test_10.sh.
8761 (check_DATA): Add script_test_10.stdout.
8762 (script_test_10.o, script_test_10): New targets.
8763 (script_test_10.stdout): New target.
8764 * configure, testsuite/Makefile.in: Regenerate.
8765
3cef7179
ILT
87662010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8767
8768 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8769 error for the deprecated relocations.
8770 (Target_arm::Scan::global): Likewise.
8771 (Target_arm::Relocate::relocate): Likewise.
8772
7411e9a8
RS
87732010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8774
8775 * fileread.cc (Input_file::find_file): Initialize *found_name
8776 and *namep when using the fallback search for case 4.
8777
6a9da32a
CC
87782010-10-11 Cary Coutant <ccoutant@google.com>
8779
8780 * options.h (class General_options): Redefine -z lazy as an alias for
8781 the negation of -z now.
8782
ac897c20
ILT
87832010-10-11 Ian Lance Taylor <iant@google.com>
8784
8785 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8786 binding.
8787
ea5cae92
NC
87882010-10-06 Nick Clifton <nickc@redhat.com>
8789
8790 * script-sections.cc(class Memory_region): Remove
8791 current_lma_offset_ field. Rename current_vma_offset_ to
8792 current_offset_. Add last_section_ field.
8793 (Memory_region::get_current_vma_address): Rename to
8794 get_current_address.
8795 (Memory_region::get_current_lma_address): Delete.
8796 (Memory_region::increment_vma_offset): Rename to
8797 increment_offset.
8798 (Memory_region::increment_lma_offset): Delete.
8799 (Memory_region::attributes_compatible): New method. Returns
8800 true if the provided section is compatible with the region.
8801 (Memory_region::get_last_section): New method. Returns the last
8802 section to use the region.
8803 (Memory_region::set_last_section): New method. Stores the last
8804 section to use the region.
8805 (Script_sections::block_in_region): New method. Returns true if
8806 a block of memory is contained within a region.
8807 (Script_sections::find_memory_region): New method. Locates a
8808 memory region to be used to set a VMA or LMA address.
8809 (Output_section_definition::set_section_addresses): Add code to
8810 check for addresses set by memory regions.
8811 (Output_segment::set_section_addresses): Remove memory region
8812 walking code.
8813 (Script_sections::create_segment): Add a warning if a header
8814 segment is created outside of any region.
8815 * script-sections.h (class Script_sections): Add prototypes for
8816 find_memory_region and block_in_region methods.
8817 * testsuite/memory_test.s: Use .long instead of .word.
8818 * testsuite/memory_test.t: Add some more output sections.
8819 * testsuite/memory_test.sh: Update expected output.
8820
a9bfd952
DK
88212010-10-02 Doug Kwan <dougkwan@google.com>
8822
8823 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8824 defintion to symtab.h
8825 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8826 declaration to defintion.
8827
bacff3ab
NC
88282010-10-01 Nick Clifton <nickc@redhat.com>
8829
8830 * expression.cc (eval): Replace dummy argument with NULL.
8831 (eval_maybe_dot): Check for a NULL result section pointer.
8832 (Symbol_expression::value): Likewise.
8833 (Dot_expression::value): Likewise.
8834 (BINARY_EXPRESSION): Likewise.
8835 (Max_expression::value): Likewise.
8836 (Min_expression::value): Likewise.
8837 (Absolute_expression::value): Likewise.
8838 (Addr_expression::value_from_output_section): Likewise.
8839 (Loaddddr_expression::value_from_output_section): Likewise.
8840 (Segment_start_expression::value): Likewise.
8841 * script-sections.cc
8842 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8843 argument with NULL.
8844 (Sections_elememt_dot_assignment::set_section_addresses):
8845 Likewise.
8846 (Output_data_expression::do_write_to_buffer): Likewise.
8847 (Output_section_definition::finalize_symbols): Likewise.
8848 (Output_section_definition::set_section_addresses): Likewise.
8849
f81bc8b5
DK
88502010-09-30 Doug Kwan <dougkwan@google.com>
8851
8852 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8853
c95e9f27
ST
88542010-09-28 Sriraman Tallam <tmsriram@google.com>
8855
8856 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8857 function.
c95e9f27
ST
8858 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8859 virtual function.
8860 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8861 virtual function.
8862 * icf.cc (get_section_contents): Inline merge sections only when
8863 target allows it.
8864
3cac54d2
RW
88652010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8866
8867 * configure: Regenerate.
8868
2904037a
ILT
88692010-09-17 Ian Lance Taylor <iant@google.com>
8870
8871 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8872 * testsuite/Makefile.am (memory_test.o): New target.
8873 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8874 memory_test.t.
8875 * testsuite/Makefile.in: Rebuild.
2904037a 8876
bca7fb63
DK
88772010-09-17 Doug Kwan <dougkwan@google.com>
8878
8879 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8880 defintion if relocation uses GOT entries of the symbol.
8881 * testsuite/icf_safe_test.sh: Fix test.
8882 * testsuite/icf_safe_so_test.sh: Fix test.
8883
4ef28648
CC
88842010-09-16 Cary Coutant <ccoutant@google.com>
8885
8886 * script_sections.cc (class Memory_region): Remove "NULL" from
8887 vector initializations.
8888
793990de
CC
88892010-09-15 Cary Coutant <ccoutant@google.com>
8890
8891 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8892 Resolve forwarding symbols.
8893
81e015e2
DK
88942010-09-15 Doug Kwan <dougkwan@google.com>
8895
8896 * gold/testsuite/script_test_3.t: Add ARM special sections.
8897 * gold/testsuite/script_test_4.t: Same.
8898 * gold/testsuite/script_test_5.t: Same.
8899 * gold/testsuite/script_test_6.t: Same.
8900 * gold/testsuite/script_test_7.t: Same.
8901 * gold/testsuite/script_test_7.t: Same.
8902 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8903
36171d64
CC
89042010-09-14 Cary Coutant <ccoutant@google.com>
8905
8906 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8907 (Target_x86_64::Relocate::relocate_tls): Replace check for
8908 saw_tls_block_reloc_ with test for executable section.
8909
d89051bd
CC
89102010-09-12 Cary Coutant <ccoutant@google.com>
8911
8912 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8913 position-independent executables to shared libraries need dynamic
8914 relocations.
8915 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8916 position-independent executables.
8917 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8918 * testsuite/Makefile.in: Regenerate.
8919
fca41f0f
NC
89202010-09-10 Nick Clifton <nickc@redhat.com>
8921
8922 PR gold/11997
8923 * testsuite/memory_test.t: Discard any sections that are not
8924 needed.
8925
6695e4b3
L
89262010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8927
8928 PR gold/11996
8929 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8930 "This::" to work around a bug in gcc 4.2.
8931
8932 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8933
0f72bf6f
RÁE
89342010-09-09 Rafael Espindola <espindola@google.com>
8935
8936 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8937 sections with different PF_X flags in the same segment.
8938 (Layout::find_first_load_seg): Search all segments to find the first
8939 one.
8940 * options.h (rosegment): New.
8941
89422010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8943
05a79166 8944 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8945
aa98ff75
DK
89462010-09-08 Doug Kwan <dougkwan@google.com>
8947
8948 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8949 (Arm_relobj::do_relocate_sections): Add new parameter for output
8950 file to match the parent.
8951 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8952 of local symbols instead of input values. Update code to track
8953 changes in gold::relocate_section.
8954 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8955 (Sized_relobj::compute_final_local_value_internal): New methods.
8956 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8957 body into private version of Sized_relobj::compute_final_local_value.
8958 Call the inline method.
8959 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8960 merged symbol value if there is one.
8961 (Symbol_value::has_output_value): New method defintiion.
8962 (Sized_relobj::Compute_final_local_value_status): New enum type.
8963 (Sized_relobj::compute_final_local_value): New methods.
8964 (Sized_relobj::compute_final_local_value_internal): New methods.
8965 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8966 and arm_cortex_a8.sh.
8967 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8968 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8969 New tests.
8970 * Makefile.in: Regenerate.
8971 * testsuite/arm_bl_out_of_range.s: Update test.
8972 * testsuite/thumb_bl_out_of_range.s: Ditto.
8973 * testsuite/thumb_blx_out_of_range.s: Ditto.
8974 * testsuite/arm_branch_out_of_range.sh: New file.
8975 * testsuite/arm_cortex_a8.sh: Ditto.
8976 * testsuite/arm_cortex_a8_b.s: Ditto.
8977 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8978 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8979 * testsuite/arm_cortex_a8_bl.s: Ditto.
8980 * testsuite/arm_cortex_a8_blx.s: Ditto.
8981 * testsuite/arm_cortex_a8_local.s: Ditto.
8982 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8983 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8984
05a79166
L
89852010-09-08 Rafael Espindola <espindola@google.com>
8986
8987 * Makefile.am (memory_test.stdout): Run readelf with -W.
8988 * Makefile.in: Regenerate.
8989 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8990 64 bit output.
8991
33dbc701
RÁE
89922010-09-08 Rafael Espindola <espindola@google.com>
8993
8994 * script-sections.cc (Script_sections::add_memory_region): Convert
8995 field precision to int.
8996 * script.cc (script_set_section_region, script_set_section_region):
8997 Convert field precision to int.
8998
731ca54a
RÁE
89992010-09-08 Rafael Espindola <espindola@google.com>
9000
9001 * arm.cc (do_finalize_sections): Create the __exidx_start and
9002 __exdix_end symbols even when the section is missing.
9003
7f8cd844
NC
90042010-09-08 Nick Clifton <nickc@redhat.com>
9005
9006 * README: Remove claim that MEMORY is not supported.
9007 * expression.cc (script_exp_function_origin)
9008 (script_exp_function_length): Move from here to ...
9009 * script.cc: ... here.
9010 (script_set_section_region, script_add_memory)
9011 (script_parse_memory_attr, script_include_directive): New
9012 functions.
9013 * script-sections.cc
9014 (class Memory_region): New class.
9015 (class Output_section_definition): Add set_memory_region,
9016 set_section_vma, set_section_lma and get_section_name methods.
9017 (class Script_Sections): Add add_memory_region,
9018 find_memory_region, find_memory_region_origin,
9019 find_memory_region_length and set_memory_region methods.
9020 Have set_section_addresses method walk the list of set memory
9021 regions.
9022 Extend the print methos to display memory regions.
9023 * script-sections.h: Add prototypes for new methods.
9024 Add enum for MEMORY region attributes.
9025 * yyscript.y: Add support for parsing MEMORY regions.
9026 * script-c.h: Add prototypes for new functions.
9027 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9028 * testsuite/Makefile.in: Regenerate.
9029 * testsuite/memory_test.sh: New script.
9030 * testsuite/memory_test.s: New assembler source file.
9031 * testsuite/memory_test.t: New linker script.
9032
a4649286
DK
90332010-08-27 Doug Kwan <dougkwan@google.com>
9034
9035 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9036 reference override an existing dynamic weak reference.
9037 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9038 * testsuite/Makefile.in: Regenerate.
9039 * testsuite/dyn_weak_ref.sh: New file.
9040 * testsuite/dyn_weak_ref_1.c: Ditto.
9041 * testsuite/dyn_weak_ref_2.c: Ditto.
9042
b56648ad
ILT
90432010-08-27 Ian Lance Taylor <iant@google.com>
9044
9045 * incremental.h (class Incremental_input_entry): Add virtual
9046 destructor.
9047
809313cb
ILT
90482010-08-27 Ian Lance Taylor <iant@google.com>
9049
9050 * testsuite/start_lib_test_3.c: Mark t3 as used.
9051
11e32464
NC
90522010-08-27 Nick Clifton <nickc@redhat.com>
9053
9054 * options.cc (version_script): Fix small typo in previous
9055 whitespace tidyup.
9056
ca09d69a
NC
90572010-08-25 Nick Clifton <nickc@redhat.com>
9058
9059 * archive.cc: Formatting fixes: Remove whitespace between
9060 typename and following asterisk. Remove whitespace between
9061 function name and opening parenthesis.
9062 * archive.h: Likewise.
9063 * arm.cc: Likewise.
9064 * attributes.cc: Likewise.
9065 * attributes.h: Likewise.
9066 * common.cc: Likewise.
9067 * copy-relocs.cc: Likewise.
9068 * dirsearch.h: Likewise.
9069 * dynobj.cc: Likewise.
9070 * ehframe.cc: Likewise.
9071 * ehframe.h: Likewise.
9072 * expression.cc: Likewise.
9073 * fileread.cc: Likewise.
9074 * fileread.h: Likewise.
9075 * gc.h: Likewise.
9076 * gold-threads.cc: Likewise.
9077 * gold.cc: Likewise.
9078 * i386.cc: Likewise.
9079 * icf.h: Likewise.
9080 * incremental-dump.cc: Likewise.
9081 * incremental.cc: Likewise.
9082 * layout.cc: Likewise.
9083 * layout.h: Likewise.
9084 * main.cc: Likewise.
9085 * merge.cc: Likewise.
9086 * merge.h: Likewise.
9087 * object.cc: Likewise.
9088 * object.h: Likewise.
9089 * options.cc: Likewise.
9090 * options.h: Likewise.
9091 * output.cc: Likewise.
9092 * output.h: Likewise.
9093 * plugin.cc: Likewise.
9094 * plugin.h: Likewise.
9095 * powerpc.cc: Likewise.
9096 * reloc.cc: Likewise.
9097 * script-c.h: Likewise.
9098 * script-sections.cc: Likewise.
9099 * script.cc: Likewise.
9100 * stringpool.cc: Likewise.
9101 * symtab.cc: Likewise.
9102 * symtab.h: Likewise.
9103 * target.cc: Likewise.
9104 * timer.cc: Likewise.
9105 * timer.h: Likewise.
9106 * version.cc: Likewise.
9107 * x86_64.cc: Likewise.
9108
b8fa8750
NC
91092010-08-24 Nick Clifton <nickc@redhat.com>
9110
9111 PR 11899
9112 * layout.cc (segment_precedes): Sort segments by their physical
9113 addresses, if they have been set.
9114
9919d93b
CC
91152010-08-23 Cary Coutant <ccoutant@google.com>
9116
9117 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9118 symbols data.
9119 (Lib_group::include_member): Unlock object after deleting its
9120 symbols data.
9121 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9122 the bug fixed here.
9123
97b4be1c
CC
91242010-08-19 Neil Vachharajani <nvachhar@google.com>
9125 Cary Coutant <ccoutant@google.com>
9126
9127 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9128 constructor, and set_blocker.
9129 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9130 readsyms_blocker_.
9131 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9132 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9133 * testsuite/Makefile.am (start_lib_test): New test case.
9134 * testsuite/Makefile.in: Regenerate.
9135 * testsuite/start_lib_test_main.c: New file.
9136 * testsuite/start_lib_test_1.c: New file.
9137 * testsuite/start_lib_test_2.c: New file.
9138 * testsuite/start_lib_test_3.c: New file.
9139
dd0b1884
ILT
91402010-08-19 Ian Lance Taylor <iant@google.com>
9141
9142 * Makefile.in: Rebuild with automake 1.11.1.
9143 * aclocal.m4: Likewise.
9144 * testsuite/Makefile.in: Likewise.
9145
7223e9ca
ILT
91462010-08-19 Ian Lance Taylor <iant@google.com>
9147
9148 PR 10893
9149 * i386.cc (class Output_data_plt_i386): Update declarations.
9150 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9151 local_ifuncs_ fields.
9152 (Target_i386::do_plt_section_for_global): New function.
9153 (Target_i386::do_plt_section_for_local): New function.
9154 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9155 parameter; change all callers. Initialize global_ifuncs_ and
9156 local_ifuncs_. If doing a static link define __rel_iplt_start and
9157 __rel_iplt_end.
9158 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9159 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9160 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9161 symbols.
9162 (Target_i386::make_plt_section): New function, broken out of
9163 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9164 (Target_i386::make_plt_entry): Call make_plt_section.
9165 (Target_i386::make_local_ifunc_plt_entry): New function.
9166 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9167 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9168 R_386_IRELATIVE to switch.
9169 (Target_i386::Scan::global): Likewise.
9170 (Target_i386::Relocate::relocate): Likewise.
9171 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9172 switch.
9173 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9174 (Target_x86_64::do_plt_section_for_global): New function.
9175 (Target_x86_64::do_plt_section_for_local): New function.
9176 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9177 parameter; change all callers. If doing a static link define
9178 __rela_iplt_start and __rela_iplt_end.
9179 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9180 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9181 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9182 to point to .plt.
9183 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9184 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9185 switch.
9186 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9187 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9188 R_X86_64_IRELATIVE to switch.
9189 (Target_x86_64::Scan::global): Likewise.
9190 (Target_x86_64::Relocate::relocate): Likewise.
9191 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9192 switch.
9193 * target.h (class Target): Add plt_section_for_global and
9194 plt_section_for_local functions. Add do_plt_section_for_global
9195 and do_plt_section_for_local virtual functions.
9196 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9197 clarifying comments.
9198 (Symbol::use_plt_offset): Handle IFUNC symbol.
9199 * object.cc (Sized_relobj::Sized_relobj): Initialize
9200 local_plt_offsets_.
9201 (Sized_relobj::local_has_plt_offset): New function.
9202 (Sized_relobj::local_plt_offset): New function.
9203 (Sized_relobj::set_local_plt_offset): New function.
9204 (Sized_relobj::do_count): Handle IFUNC symbol.
9205 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9206 a bit away from input_shndx_ field. Add set_is_func_symbol and
9207 is_ifunc_symbol functions.
9208 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9209 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9210 local_plt_offsets_ field.
9211 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9212 * output.h (class Output_section_data): Add non-const
9213 output_section function.
9214 (class Output_data_got): Update declarations.
9215 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9216 Add use_plt_offset parameter to global and local constructors.
9217 Change all callers. Change local_sym_index_ field to 31 bits.
9218 Change GSYM_CODE and CONSTANT_CODE accordingly.
9219 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9220 doing a static link don't set sh_link field.
9221 (Output_data_got::Got_entry::write): Use PLT offset if
9222 appropriate.
9223 (Output_data_got::add_global_plt): New function.
9224 (Output_data_got::add_local_plt): New function.
9225 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9226 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9227 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9228 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9229 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9230 IFUNC conditional.
9231 * testsuite/ifunc-sel.h: New file.
9232 * testsuite/ifuncmain1.c: New file.
9233 * testsuite/ifuncmain1vis.c: New file.
9234 * testsuite/ifuncmod1.c: New file.
9235 * testsuite/ifuncdep2.c: New file.
9236 * testsuite/ifuncmain2.c: New file.
9237 * testsuite/ifuncmain3.c: New file.
9238 * testsuite/ifuncmod3.c: New file.
9239 * testsuite/ifuncmain4.c: New file.
9240 * testsuite/ifuncmain5.c: New file.
9241 * testsuite/ifuncmod5.c: New file.
9242 * testsuite/ifuncmain6pie.c: New file.
9243 * testsuite/ifuncmod6.c: New file.
9244 * testsuite/ifuncmain7.c: New file.
9245 * configure, testsuite/Makefile.in: Rebuild.
9246
56f75c03
ILT
92472010-08-18 Ian Lance Taylor <iant@google.com>
9248
9249 * incremental.cc
9250 (Output_section_incremental_inputs::write_input_files): Add cast
9251 to avoid signed/unsigned comparison warning.
9252 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9253
55455f89
CC
92542010-08-12 Cary Coutant <ccoutant@google.com>
9255
9256 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9257
e2054bcb
ILT
92582010-08-13 Ian Lance Taylor <iant@google.com>
9259
9260 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9261
74f67560
DK
92622010-08-12 Cary Coutant <ccoutant@google.com>
9263 Doug Kwan <dougkwan@google.com>
9264
9265 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9266 defintion overrides non-weak undef, remember that the original undef
9267 is not weak.
9268 * symtab.cc (Symbol_table::sized_write_global): For undef without
9269 an original weak binding, set binding to global in output.
9270 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9271 * testsuite/Makefile.in: Regenerate.
9272 * testsuite/strong_ref_weak_def.sh: New file.
9273 * testsuite/strong_ref_weak_def_1.c: Ditto.
9274 * testsuite/strong_ref_weak_def_2.c: Ditto.
9275
d1238d12
CC
92762010-08-12 Cary Coutant <ccoutant@google.com>
9277
9278 * testsuite/incremental_test.sh: Rewrite.
9279 * testsuite/incremental_test_1.c: Rewrite.
9280 * testsuite/incremental_test_2.c: Rewrite.
9281
0e70b911
CC
92822010-08-12 Cary Coutant <ccoutant@google.com>
9283
9284 * arm.cc (Target_arm::got_size): Add const.
9285 (Target_arm::got_entry_count): New function.
9286 (Target_arm::plt_entry_count): New function.
9287 (Target_arm::first_plt_entry_offset): New function.
9288 (Target_arm::plt_entry_size): New function.
9289 (Output_data_plt_arm::entry_count): New function.
9290 (Output_data_plt_arm::first_plt_entry_offset): New function.
9291 (Output_data_plt_arm::get_plt_entry_size): New function.
9292 * i386.cc (Target_i386::got_size): Add const.
9293 (Target_i386::got_entry_count): New function.
9294 (Target_i386::plt_entry_count): New function.
9295 (Target_i386::first_plt_entry_offset): New function.
9296 (Target_i386::plt_entry_size): New function.
9297 (Output_data_plt_i386::entry_count): New function.
9298 (Output_data_plt_i386::first_plt_entry_offset): New function.
9299 (Output_data_plt_i386::get_plt_entry_size): New function.
9300 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9301 find_incremental_inputs_sections. Dump incremental_got_plt section.
9302 * incremental.cc: Include target.h.
9303 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9304 parameter. Adjust all callers. Find incremental_got_plt section.
9305 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9306 section.
9307 (Output_section_incremental_inputs::set_final_data_size): Calculate
9308 size of incremental_got_plt section.
9309 (Output_section_incremental_inputs::do_write): Write the
9310 incremental_got_plt section.
9311 (Got_plt_view_info): New struct.
9312 (Local_got_offset_visitor): New class.
9313 (Global_got_offset_visitor): New class.
9314 (Global_symbol_visitor_got_plt): New class.
9315 (Output_section_incremental_inputs::write_got_plt): New function.
9316 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9317 Add parameter. Adjust all callers.
9318 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9319 (Incremental_inputs::got_plt_section): New function.
9320 (Incremental_inputs::got_plt_section_): New data member.
9321 (Incremental_got_plt_reader): New class.
9322 * layout.cc (Layout::create_incremental_info_sections): Add the
9323 incremental_got_plt section.
9324 * object.h (Got_offset_list::get_list): New function.
9325 (Got offset_list::for_all_got_offsets): New function.
9326 (Sized_relobj::local_got_offset_list): New function.
9327 * powerpc.cc (Target_powerpc::got_size): Add const.
9328 (Target_powerpc::got_entry_count): New function.
9329 (Target_powerpc::plt_entry_count): New function.
9330 (Target_powerpc::first_plt_entry_offset): New function.
9331 (Target_powerpc::plt_entry_size): New function.
9332 (Output_data_plt_powerpc::entry_count): New function.
9333 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9334 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9335 * sparc.cc (Target_sparc::got_size): Add const.
9336 (Target_sparc::got_entry_count): New function.
9337 (Target_sparc::plt_entry_count): New function.
9338 (Target_sparc::first_plt_entry_offset): New function.
9339 (Target_sparc::plt_entry_size): New function.
9340 (Output_data_plt_sparc::entry_count): New function.
9341 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9342 (Output_data_plt_sparc::get_plt_entry_size): New function.
9343 * symtab.h (Symbol::got_offset_list): New function.
9344 (Symbol_table::for_all_symbols): New function.
9345 * target.h (Sized_target::got_entry_count): New function.
9346 (Sized_target::plt_entry_count): New function.
9347 (Sized_target::plt_entry_size): New function.
9348 * x86_64.cc (Target_x86_64::got_size): Add const.
9349 (Target_x86_64::got_entry_count): New function.
9350 (Target_x86_64::plt_entry_count): New function.
9351 (Target_x86_64::first_plt_entry_offset): New function.
9352 (Target_x86_64::plt_entry_size): New function.
9353 (Output_data_plt_x86_64::entry_count): New function.
9354 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9355 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9356
09ec0418
CC
93572010-08-12 Cary Coutant <ccoutant@google.com>
9358
9359 * archive.cc: Include incremental.h.
9360 (Archive::Archive): Initialize incremental_info_.
9361 (Archive::include_member): Record archive members in incremental info.
9362 (Add_archive_symbols::run): Record begin and end of an archive in
9363 incremental info.
9364 (Lib_group::include_member): Record objects in incremental info.
9365 * archive.h (Incremental_archive_entry): Forward declaration.
9366 (Archive::set_incremental_info): New member function.
9367 (Archive::incremental_info): New member function.
9368 (Archive::Unused_symbol_iterator): New class.
9369 (Archive::unused_symbols_begin): New member function.
9370 (Archive::unused_symbols_end): New member function.
9371 (Archive::incremental_info_): New data member.
9372 * incremental-dump.cc (find_input_containing_global): New function.
9373 (dump_incremental_inputs): Dump new incremental info sections.
9374 * incremental.cc: Include symtab.h.
9375 (Output_section_incremental_inputs): New class.
9376 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9377 new incremental info sections.
9378 (Sized_incremental_binary::do_check_inputs): Likewise.
9379 (Incremental_inputs::report_archive): Remove.
9380 (Incremental_inputs::report_archive_begin): New function.
9381 (Incremental_inputs::report_archive_end): New function.
9382 (Incremental_inputs::report_object): New function.
9383 (Incremental_inputs::finalize_inputs): Remove.
9384 (Incremental_inputs::report_input_section): New function.
9385 (Incremental_inputs::report_script): Rewrite.
9386 (Incremental_inputs::finalize): Do nothing but finalize string table.
9387 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9388 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9389 (Incremental_inputs::create_data_sections): New function.
9390 (Incremental_inputs::relocs_entsize): New function.
9391 (Output_section_incremental_inputs::set_final_data_size): New function.
9392 (Output_section_incremental_inputs::do_write): New function.
9393 (Output_section_incremental_inputs::write_header): New function.
9394 (Output_section_incremental_inputs::write_input_files): New function.
9395 (Output_section_incremental_inputs::write_info_blocks): New function.
9396 (Output_section_incremental_inputs::write_symtab): New function.
9397 * incremental.h (Incremental_script_entry): Forward declaration.
9398 (Incremental_object_entry): Forward declaration.
9399 (Incremental_archive_entry): Forward declaration.
9400 (Incremental_inputs): Forward declaration.
9401 (Incremental_inputs_header_data): Remove.
9402 (Incremental_inputs_header): Remove.
9403 (Incremental_inputs_header_write): Remove.
9404 (Incremental_inputs_entry_data): Remove.
9405 (Incremental_inputs_entry): Remove.
9406 (Incremental_inputs_entry_write): Remove.
9407 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9408 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9409 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9410 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9411 Likewise.
9412 (Incremental_input_entry): New class.
9413 (Incremental_script_entry): New class.
9414 (Incremental_object_entry): New class.
9415 (Incremental_archive_entry): New class.
9416 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9417 (Incremental_inputs::report_inputs): Remove.
9418 (Incremental_inputs::report_archive): Remove.
9419 (Incremental_inputs::report_archive_begin): New function.
9420 (Incremental_inputs::report_archive_end): New function.
9421 (Incremental_inputs::report_object): Change prototype.
9422 (Incremental_inputs::report_input_section): New function.
9423 (Incremental_inputs::report_script): Change prototype.
9424 (Incremental_inputs::get_reloc_count): New function.
9425 (Incremental_inputs::set_reloc_count): New function.
9426 (Incremental_inputs::create_data_sections): New function.
9427 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9428 (Incremental_inputs::inputs_section): New function.
9429 (Incremental_inputs::symtab_section): New function.
9430 (Incremental_inputs::relocs_section): New function.
9431 (Incremental_inputs::get_stringpool): Add const.
9432 (Incremental_inputs::command_line): Add const.
9433 (Incremental_inputs::inputs): Remove.
9434 (Incremental_inputs::command_line_key): New function.
9435 (Incremental_inputs::input_file_count): New function.
9436 (Incremental_inputs::input_files): New function.
9437 (Incremental_inputs::relocs_entsize): New function.
9438 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9439 (Incremental_inputs::finalize_inputs): Remove.
9440 (Incremental_inputs::Input_info): Remove.
9441 (Incremental_inputs::lock_): Remove.
9442 (Incremental_inputs::inputs_): Change type.
9443 (Incremental_inputs::inputs_map_): Remove.
9444 (Incremental_inputs::current_object_entry_): New data member.
9445 (Incremental_inputs::inputs_section_): New data member.
9446 (Incremental_inputs::symtab_section_): New data member.
9447 (Incremental_inputs::relocs_section_): New data member.
9448 (Incremental_inputs::reloc_count_): New data member.
9449 (Incremental_inputs_reader): New class.
9450 (Incremental_symtab_reader): New class.
9451 (Incremental_relocs_reader): New class.
9452 * layout.cc (Layout::finalize): Move finalization of incremental info
9453 and creation of incremental info sections to follow finalization of
9454 symbol table. Set offsets for postprocessing sections.
9455 (Layout::create_incremental_info_sections): Call
9456 Incremental_inputs::create_data_sections. Add incremental symtab
9457 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9458 sections to layout after input sections.
9459 * layout.h (struct Timespec): Forward declaration.
9460 (Layout::incremental_inputs): Add const.
9461 (Layout::create_incremental_info_sections): Add parameter.
9462 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9463 * object.cc: Include incremental.h.
9464 (Relobj::finalize_incremental_relocs): New function.
9465 (Sized_relobj::do_layout): Record input sections in incremental info.
9466 * object.h (Object::output_section): New function.
9467 (Object::output_section_offset): Moved from Relobj.
9468 (Object::get_incremental_reloc_base): New function.
9469 (Object::get_incremental_reloc_count): New function.
9470 (Object::do_output_section): New function.
9471 (Object::do_output_section_offset): Moved from Relobj.
9472 (Object::do_get_incremental_reloc_base): New function.
9473 (Object::do_get_incremental_reloc_count): New function.
9474 (Object::Object): Initialize new data members.
9475 (Relobj::output_section): Renamed do_output_section and moved to
9476 protected.
9477 (Relobj::output_section_offset): Moved to Object.
9478 (Relobj::do_get_incremental_reloc_base): New function.
9479 (Relobj::do_get_incremental_reloc_count): New function.
9480 (Relobj::allocate_incremental_reloc_counts): New function.
9481 (Relobj::count_incremental_reloc): New function.
9482 (Relobj::finalize_incremental_relocs): New function.
9483 (Relobj::next_incremental_reloc_index): New function.
9484 (Relobj::reloc_counts_): New data member.
9485 (Relobj::reloc_bases_): New data member.
9486 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9487 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9488 (Sized_relobj::incremental_relocs_scan): New function.
9489 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9490 (Sized_relobj::incremental_relocs_write): New function.
9491 (Sized_relobj::incremental_relocs_write_reltype): New function.
9492 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9493 incremental link.
9494 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9495 archives and object files elsewhere.
9496 (Add_symbols::run): Report object files here.
9497 (Finish_group::run): Report end of archive at end of group.
9498 * reloc.cc: Include layout.h, incremental.h.
9499 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9500 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9501 (Sized_relobj::incremental_relocs_scan): New function.
9502 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9503 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9504 (Sized_relobj::incremental_relocs_write): New function.
9505 (Sized_relobj::incremental_relocs_write_reltype): New function.
9506 * script.cc (read_input_script): Rewrite test for incremental link.
9507 Change call to Incremental_inputs::report_script.
9508 * symtab.h (Symbol_table::first_global_index): New function.
9509 (Symbol_table::output_count): New function.
9510
ce0d1972
DK
95112010-08-12 Doug Kwan <dougkwan@google.com>
9512
9513 * arm.cc (Target_arm::merge_object_attributes): Check command line
9514 options --no-wchar-size-warning and --no-enum-size-warning.
9515 * options.h (General_options): Add ld-compatible options
9516 --no-enum-size-warning and --no-wchar-size-warning.
9517
6e5710ce
ILT
95182010-08-04 Ian Lance Taylor <iant@google.com>
9519
9520 * x86_64.cc (Target_x86_64::Scan::local): Use
9521 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9522 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9523 (Target_x86_64::Scan::global): Likewise.
9524 (Target_x86_64::Relocate::relocate): Likewise.
9525 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9526 Likewise.
9527
fef830db
CC
95282010-08-03 Cary Coutant <ccoutant@google.com>
9529
9530 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9531 to reserve space in merged_strings vector. Keep total input size
9532 for stats.
9533 (Output_merge_string::do_print_merge_stats): Print total input size.
9534 * merge.h (Output_merge_string): Add input_size_ field.
9535 * stringpool.cc (Stringpool_template::string_length): Move
9536 implementations out of Stringpool_template class and place in
9537 stringpool.h.
9538 * stringpool.h (string_length): Move out of Stringpool_template.
9539
1e3811b0
ILT
95402010-08-03 Ian Lance Taylor <iant@google.com>
9541
9542 PR 11712
9543 * layout.cc (relaxation_loop_body): If address of load segment is
9544 set, adjust address to include headers if possible.
9545
7af0c620
ILT
95462010-08-03 Ian Lance Taylor <iant@google.com>
9547
9548 * version.cc (version_string): Bump to 1.10.
9549
22f0da72
ILT
95502010-08-03 Ian Lance Taylor <iant@google.com>
9551
9552 PR 11805
9553 * layout.h (enum Output_section_order): Define.
9554 (class Layout): Update declarations.
9555 * layout.cc (Layout::get_output_section): Add order parameter.
9556 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9557 is_first_non_relro parameters. Change all callers.
9558 (Layout::choose_output_section): Likewise.
9559 (Layout::add_output_section_data): Likewise.
9560 (Layout::make_output_section): Likewise. Set order.
9561 (Layout::default_section_order): New function.
9562 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9563 * output.cc (Output_section::Output_section): Initialize order_.
9564 Don't initialize deleted fields.
9565 (Output_segment::Output_segment): Don't initialize deleted
9566 fields.
9567 (Output_segment::add_output_section_to_load): New function
9568 replacing add_output_section. Change all callers to call this or
9569 add_output_section_to_nonload.
9570 (Output_segment::add_output_section_to_nonload): New function.
9571 (Output_segment::remove_output_section): Rewrite.
9572 (Output_segment::add_initial_output_data): Likewise.
9573 (Output_segment::has_any_data_sections): Likewise.
9574 (Output_segment::is_first_section_relro): Likewise.
9575 (Output_segment::maximum_alignment): Likewise.
9576 (Output_segment::has_dynamic_reloc): New function replacing
9577 dynamic_reloc_count. Change all callers.
9578 (Output_segment::has_dynamic_reloc_list): New function replacing
9579 dynamic_reloc_count_list. Change all callers.
9580 (Output_segment::set_section_addresses): Rewrite.
9581 (Output_segment::set_offset): Rewrite.
9582 (Output_segment::find_first_and_last_list): Remove.
9583 (Output_segment::set_tls_offsets): Rewrite.
9584 (Output_segment::first_section_load_address): Likewise.
9585 (Output_segment::output_section_count): Likewise.
9586 (Output_segment::section_with_lowest_load_address): Likewise.
9587 (Output_segment::write_section_headers): Likewise.
9588 (Output_segment::print_sections_to_map): Likewise.
9589 * output.h (class Output_data): Remove dynamic_reloc_count_
9590 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9591 (Output_data::add_dynamic_reloc): Rewrite.
9592 (Output_data::has_dynamic_reloc): New function.
9593 (Output_data::dynamic_reloc_count): Remove.
9594 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9595 is_last_relro_, is_first_non_relro_, is_interp_,
9596 is_dynamic_linker_section_ fields. Add order and set_order
9597 functions. Remove is_relro_local, set_is_relro_local,
9598 is_last_relro, set_is_last_relro, is_first_non_relro,
9599 set_is_first_non_relro functions, is_interp, set_is_interp,
9600 is_dynamic_linker_section, and set_is_dynamic_linker_section
9601 functions.
9602 (class Output_segment): Change Output_data_list from std::list to
9603 std:;vector. Add output_lists_ field. Remove output_data_ and
9604 output_bss_ fields. Update declarations.
9605
3ff2ccb0
ILT
96062010-08-02 Ian Lance Taylor <iant@google.com>
9607
9608 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9609 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9610 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9611
88a4108b
ILT
96122010-08-02 Ian Lance Taylor <iant@google.com>
9613
9614 PR 11855
9615 * script.cc (Script_options::Script_options): Initialize
9616 symbol_definitions_ and symbol_references_.
9617 (Script_options::add_symbol_assignment): Update
9618 symbol_definitions_ and symbol_references_.
9619 (Script_options::add_symbol_reference): New function.
9620 (script_symbol): New function.
9621 * script.h (class Script_options): Add symbol_definitions_ and
9622 symbol_references_ fields.
9623 (Script_options::referenced_const_iterator): New type.
9624 (Script_options::referenced_begin): New function.
9625 (Script_options::referenced_end): New function.
9626 (Script_options::is_referenced): New function.
9627 (Script_options::any_unreferenced): New function.
9628 * script-c.h (script_symbol): Declare.
9629 * yyscript.y (exp): Call script_symbol.
9630 * symtab.cc: Include "script.h".
9631 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9632 Change all callers. Check symbols referenced by scripts.
9633 (Symbol_table::add_undefined_symbols_from_command_line): Add
9634 layout parameter. Change all callers.
9635 (Symbol_table::do_add_undefined_symbols_from_command_line):
9636 Likewise. Break out loop body. Check symbols referenced by
9637 scripts.
9638 (Symbol_table::add_undefined_symbol_from_command_line): New
9639 function broken out of
9640 do_add_undefined_symbols_from_command_line.
9641 * symtab.h (class Symbol_table): Update declarations.
9642 * archive.cc: Include "layout.h".
9643 (Archive::should_include_member): Add layout parameter. Change
9644 all callers. Check for symbol mentioned in expression.
9645 * archive.h (class Archive): Update declaration.
9646 * object.cc (Sized_relobj::do_should_include_member): Add layout
9647 parameter.
9648 * object.h (Object::should_include_member): Add layout parameter.
9649 Change all callers.
9650 (Object::do_should_include_member): Add layout parameter.
9651 (class Sized_relobj): Update declaration.
9652 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9653 parameter.
9654 * dynobj.h (class Sized_dynobj): Update declaration.
9655 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9656 layout parameter.
9657 * plugin.h (class Sized_pluginobj): Update declaration.
9658
5f1ab67a
ILT
96592010-08-02 Ian Lance Taylor <iant@google.com>
9660
9661 PR 11866
9662 * output.cc (Output_segment::set_offset): Search for the first and
9663 last sections rather than assuming that the list is in order.
9664 (Output_segment::find_first_and_last_list): New function.
9665 * output.h (class Output_segment): Update declarations.
9666 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9667 (relro_strip_test_SOURCES): New variable.
9668 (relro_strip_test_DEPENDENCIES): New variable.
9669 (relro_strip_test_LDFLAGS): New variable.
9670 (relro_strip_test_LDADD): New variable.
9671 (relro_strip_test.so): New target.
9672
a8df5856
ILT
96732010-08-02 Ian Lance Taylor <iant@google.com>
9674
9675 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9676 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9677 (Target_i386::got_tlsdesc_section): New function.
9678 (Target_i386::got_section): Create space for GOT entries for
9679 TLSDESC relocations.
9680 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9681 R_386_TLS_GOTDESC.
9682 (Target_i386::Scan::global): Likewise.
9683 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9684 using TLSDESC GOT.
9685 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9686 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9687 (Target_x86_64::got_tlsdesc_section): New function.
9688 (Target_x86_64::got_section): Create space for GOT entries for
9689 TLSDESC relocations.
9690 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9691 R_386_TLS_GOTDESC.
9692 (Target_x86_64::Scan::global): Likewise.
9693 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9694 using TLSDESC GOT.
9695
0c10a0a6
ILT
96962010-08-02 Ian Lance Taylor <iant@google.com>
9697
9698 * testsuite/final_layout.sh: Use dc to convert from hex to
9699 decimal.
9700
41cbeecc
ST
97012010-07-29 Sriraman Tallam <tmsriram@google.com>
9702
9703 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9704 paramter to the call to gold::gc_process_relocs.
9705 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9706 paramter to the call to gold::gc_process_relocs.
9707 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9708 parameter to the call to gold::gc_process_relocs.
9709 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9710 template parameter to the call to gold::gc_process_relocs.
9711 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9712 paramter to the call to gold::gc_process_relocs.
9713 * gc.h (get_embedded_addend_size): New function.
9714 (gc_process_relocs): Save the size of the reloc for use by ICF.
9715 * icf.cc (get_section_contents): Get the addend from the text section
9716 for SHT_REL relocation sections.
9717 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9718 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9719 * int_encoding.h (read_from_pointer): New overloaded function.
9720 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9721 * testsuite/icf_sht_rel_addend_test.sh: New file.
9722 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9723 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9724
6ea55b82
RW
97252010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9726
9727 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9728 * Makefile.in: Regenerate.
9729 * testsuite/Makefile.in: Regenerate.
9730
9691462b
ILT
97312010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9732
9733 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9734 * gold/testsuite/debug_msg.cc: Likewise.
9735 * gold/testsuite/odr_violation1.cc
9736 * gold/testsuite/odr_violation2.cc
9737
76897331
CC
97382010-07-21 Cary Coutant <ccoutant@google.com>
9739
9740 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9741 string, and length fields.
9742 (Output_merge_string::Merged_strings_list): New type.
9743 (Output_merge_string::Merged_strings_lists): New typedef.
9744 (Output_merge_string): Replace merged_strings_ with
9745 merged_strings_lists_.
9746 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9747 Merged_strings_list per input object and section. Don't store pointer
9748 to the string. Don't store length with each merged string entry.
9749 (Output_merge_string::finalize_merged_data): Loop over list of merged
9750 strings lists. Recompute length of each merged string.
9751
78384e8f
CC
97522010-07-15 Cary Coutant <ccoutant@google.com>
9753
9754 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9755 here.
9756
783659f9
ILT
97572010-07-14 Ian Lance Taylor <iant@google.com>
9758
9759 * descriptors.cc (Descriptors::open): Report correct name in error
9760 message.
9761
131687b4
DK
97622010-07-13 Doug Kwan <dougkwan@google.com>
9763
9764 * arm.cc (Arm_input_section::Arm_input_section): For a
9765 SHT_ARM_EXIDX section, always keeps the input sections.
9766 (Arm_input_section::set_exidx_section_link): New method.
9767 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9768 has_errors_ to false.
9769 (Arm_exidx_input_section::has_errors,
9770 Arm_exidx_input_section::set_has_errors): New methods.
9771 (Arm_exidx_input_section::has_errors_): New data member.
9772 (Arm_relobj::get_exidx_shndx_list): New method.
9773 (Arm_output_section::append_text_sections_to_list): Do not skip
9774 section without SHF_EXECINSTR.
9775 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9776 errors.
2e702c99 9777 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9778 section header. Make error messages more verbose. Check for
9779 a non-executable section linked to an EXIDX section.
9780 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9781 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9782 check that there is no deferred EXIDX section if we exit early.
9783 Instead of not making an EXIDX section in case of an error, make one
9784 and set the has_errors flag of it.
9785 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9786 in a relocatable link.
9787 (Target_arm::do_relax): Look for the EXIDX output section instead of
9788 assuming that it is called .ARM.exidx.
2e702c99 9789 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9790 section list. Do not check for SHF_EXECINSTR section flags but
9791 skip any input section with errors.
9792 * output.cc (Output_section::Output_section): Initialize
9793 always_keeps_input_sections_ to false.
9794 (Output_section::add_input_section): Check for
9795 always_keeps_input_sections_.
9796 * output.h (Output_section::always_keeps_input_sections,
9797 Output_section::set_always_keeps_input_sections): New methods.
9798 (Output_section::always_keeps_input_sections): New data member.
9799
69517287
RÁE
98002010-07-13 Rafael Espindola <espindola@google.com>
9801
9802 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9803 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9804
82742395
ILT
98052010-07-13 Philip Herron <herron.philip@googlemail.com>
9806 Ian Lance Taylor <iant@google.com>
9807
9808 * output.h (Output_section_lookup_maps::add_merge_section):
9809 Correct check of whether value was inserted.
9810 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9811 (Output_section_lookup_maps::add_relaxed_input_section):
9812 Likewise.
9813 * arm.cc (Target_arm::got_section): Remove used local os.
9814 * i386.cc (Target_i386::got_section): Likewise.
9815 * x86_64.cc (Target_x86_64::got_section): Likewise.
9816 * sparc.cc (Target_sparc::got_section): Likewise.
9817 (Target_sparc::relocate): Remove unused local have_got_offset.
9818 * powerpc.cc (Target_powerpc::relocate): Likewise.
9819
f2d707b5
ILT
98202010-07-13 Ian Lance Taylor <iant@google.com>
9821
241531d6
ILT
9822 * compressed_output.cc (zlib_decompress): Fix signature in
9823 !HAVE_ZLIB_H case.
9824
f2d707b5
ILT
9825 * archive.cc (Archive::include_member): Unlock an external member
9826 of a thin archive. Don't bother to delete an object we know is
9827 NULL.
9828
a2e47362
CC
98292010-07-12 Cary Coutant <ccoutant@google.com>
9830
9831 * compressed_output.cc (zlib_decompress): New function.
9832 (get_uncompressed_size): New function.
9833 (decompress_input_section): New function.
9834 * compressed_output.h (get_uncompressed_size): New function.
9835 (decompress_input_section): New function.
9836 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9837 Handle compressed debug sections.
9838 * layout.cc (is_compressed_debug_section): New function.
9839 (Layout::output_section_name): Map compressed section names to
9840 canonical names.
9841 * layout.h (is_compressed_debug_section): New function.
9842 (is_debug_info_section): Recognize compressed debug sections.
9843 * merge.cc: Include compressed_output.h.
9844 (Output_merge_data::do_add_input_section): Handle compressed
9845 debug sections.
9846 (Output_merge_string::do_add_input_section): Handle compressed
9847 debug sections.
9848 * object.cc: Include compressed_output.h.
9849 (Sized_relobj::Sized_relobj): Initialize new data members.
9850 (build_compressed_section_map): New function.
9851 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9852 * object.h (Object::section_is_compressed): New method.
9853 (Object::do_section_is_compressed): New method.
9854 (Sized_relobj::Compressed_section_map): New type.
9855 (Sized_relobj::do_section_is_compressed): New method.
9856 (Sized_relobj::compressed_sections_): New data member.
9857 * output.cc (Output_section::add_input_section): Handle compressed
9858 debug sections.
9859 * reloc.cc: Include compressed_output.h.
9860 (Sized_relobj::write_sections): Handle compressed debug sections.
9861
ce279a62
CC
98622010-07-08 Cary Coutant <ccoutant@google.com>
9863
9864 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9865 weak when resolving to a dynamic def.
9866 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9867 for weak undef/dynamic def cases. Adjust callers.
9868 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9869 undef_binding_weak_.
9870 (Symbol_table::sized_write_globals): Adjust symbol binding.
9871 (Symbol_table::sized_write_symbol): Add binding parameter.
9872 * symtab.h (Symbol::set_undef_binding): New method.
9873 (Symbol::is_undef_binding_weak): New method.
9874 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9875 (Symbol_table::should_override): Add new parameter.
9876 (Symbol_table::sized_write_symbol): Add new parameter.
9877
9878 * testsuite/weak_undef_file1.cc: Add new test case.
9879 * testsuite/weak_undef_file2.cc: Fix header comment.
9880 * testsuite/weak_undef_test.cc: Add new test case.
9881
b2286c10
DK
98822010-06-29 Doug Kwan <dougkwan@google.com>
9883
9884 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9885 Initialize USE_SYMBOL_.
9886 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9887 definition.
9888 (Arm_reloc_property::uses_symbol_): New data member declaration.
9889 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9890 uses symbol value and symbol is undefined but not weakly undefined.
9891
4802450a
RÁE
98922010-06-28 Rafael Espindola <espindola@google.com>
9893
9894 * plugin.cc (Plugin::load): Use dlerror.
9895
e5ca47ba
ILT
98962010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9897
9898 * symtab.cc (detect_odr_violations): When reporting an ODR
9899 violation, report an object where the symbol is defined.
9900
8a75a161
DK
99012010-06-25 Doug Kwan <dougkwan@google.com>
9902
9903 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9904 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9905 definition.
9906 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9907 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9908 target hook to detect function points.
9909 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9910 * icf.h (Icf::check_section_for_function_pointers): Change type of
9911 parameter SECTION_NAME to const reference to std::string. Use
9912 target hook to determine if section may have unsafe pointers.
9913 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9914 method definition.
9915
42218b9f
RÁE
99162010-06-21 Rafael Espindola <espindola@google.com>
9917
9918 * fileread.cc (Input_file::find_fie): New
9919 (Input_file::open): Use Input_file::find_fie.
9920 * fileread.h (Input_file::find_fie): New
9921 * plugin.cc (set_extra_library_path): New.
9922 (Plugin::load): Add set_extra_library_path to the transfer vector.
9923 (Plugin_manager::set_extra_library_path): New.
9924 (Plugin_manager::add_input_file): Use the extra search path if set.
9925 (set_extra_library_path(): New.
9926 * plugin.h (Plugin_manager): Add set_extra_library_path and
9927 extra_search_path_.
9928
a0506cca
CC
99292010-06-19 Cary Coutant <ccoutant@google.com>
9930
9931 * layout.cc (gdb_sections): Add .debug_types.
9932 (lines_only_debug_sections): Likewise.
9933
6508b958
RÁE
99342010-06-18 Rafael Espindola <espindola@google.com>
9935
9936 * plugin.cc (add_input_file,add_input_library)
9937 (Plugin_manager::add_input_file): Make filename arguments const.
9938 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9939 const.
9940
3e235302
DK
99412010-06-16 Doug Kwan <dougkwan@google.com>
9942
9943 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9944 .ARM.attributes section if we have not merged any input
9945 attributes sections.
9946
106e8a6c
DK
99472010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9948
9949 * arm.cc: Allow combining objects with no EABI version
9950 information.
9951
91ff43fe
RÁE
99522010-06-15 Rafael Espindola <espindola@google.com>
9953
9954 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9955
68ed838c
ILT
99562010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9957
9958 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9959 (struct iovec): Correct !HAVE_READV definition.
9960
f3a2388f
CC
99612010-06-10 Cary Coutant <ccoutant@google.com>
9962
9963 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9964 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9965 reloc sections.
9966 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9967
9968 PR 11683
9969 * symtab.h (Symbol::is_placeholder): New member function.
9970 * target-reloc.h (relocate_section): Check for placeholder symbols.
9971
9972 * testsuite/Makefile.am (plugin_test_8): New test.
9973 (plugin_test_9): New test.
9974 * testsuite/Makefile.in: Regenerate.
9975
e1df38aa
NC
99762010-06-09 Nick Clifton <nickc@redhat.com>
9977
9978 * yyscript.y (input_list_element): Allow strings prefixed with
9979 the '-' character. Treat these as libraries.
9980 * script.cc (script_add_library): New function. Adds a library
9981 specified by "-l<name>" found in an input script.
9982 * script-c.h: Add prototype for script_add_library.
9983
25bbe950
DK
99842010-06-07 Doug Kwan <dougkwan@google.com>
9985
9986 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9987 Restrict stub-group size to be within long conditional branch
9988 range when working around cortex-A8 erratum.
9989
0f32ea4c
ILT
99902010-06-07 Damien Diederen <dd@crosstwine.com>
9991
9992 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9993 #ifdef typo.
9994
8fe2a369
ST
99952010-06-03 Sriraman Tallam <tmsriram@google.com>
9996
9997 PR gold/11658
9998 * output.cc
9999 (Output_section::Input_section_sort_entry::compare_section_ordering):
10000 Change to return non-zero correctly.
10001 (Output_section::Input_section_sort_section_order_index_compare
10002 ::operator()): Change to fix ambiguity in comparisons.
10003
6e9ba2ca
ST
100042010-06-01 Sriraman Tallam <tmsriram@google.com>
10005
10006 * gold.h (is_wildcard_string): New function.
10007 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10008 (Layout::layout_eh_frame): Ditto.
10009 (Layout::find_section_order_index): New method.
10010 (Layout::read_layout_from_file): New method.
10011 * layout.h (Layout::find_section_order_index): New method.
10012 (Layout::read_layout_from_file): New method.
10013 (Layout::input_section_position_): New private member.
10014 (Layout::input_section_glob_): New private member.
10015 * main.cc (main): Call read_layout_from_file here.
10016 * options.h (--section-ordering-file): New option.
10017 * output.cc (Output_section::input_section_order_specified_): New
10018 member.
10019 (Output_section::Output_section): Initialize new member.
10020 (Output_section::add_input_section): Add new parameter.
10021 Keep input sections when --section-ordering-file is used.
10022 (Output_section::set_final_data_size): Sort input sections when
10023 section ordering file is specified.
10024 (Output_section::Input_section_sort_entry): Add new parameter.
10025 Check sorting type.
10026 (Output_section::Input_section_sort_entry::compare_section_ordering):
10027 New method.
10028 (Output_section::Input_section_sort_compare::operator()): Change to
10029 consider section_order_index.
10030 (Output_section::Input_section_sort_init_fini_compare::operator()):
10031 Change to consider section_order_index.
10032 (Output_section::Input_section_sort_section_order_index_compare
10033 ::operator()): New method.
10034 (Output_section::sort_attached_input_sections): Change to sort
10035 according to section order when specified.
e1df38aa
NC
10036 (Output_section::add_input_section<32, true>): Add new parameter.
10037 (Output_section::add_input_section<64, true>): Add new parameter.
10038 (Output_section::add_input_section<32, false>): Add new parameter.
10039 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
10040 * output.h (Output_section::add_input_section): Add new parameter.
10041 (Output_section::input_section_order_specified): New
10042 method.
10043 (Output_section::set_input_section_order_specified): New method.
10044 (Input_section::Input_section): Initialize section_order_index_.
10045 (Input_section::section_order_index): New method.
10046 (Input_section::set_section_order_index): New method.
10047 (Input_section::section_order_index_): New member.
10048 (Input_section::Input_section_sort_section_order_index_compare): New
10049 struct.
10050 (Output_section::input_section_order_specified_): New member.
10051 * script-sections.cc (is_wildcard_string): Delete and move modified
10052 method to gold.h.
10053 (Output_section_element_input::Output_section_element_input): Modify
10054 call to is_wildcard_string.
10055 (Output_section_element_input::Input_section_pattern
10056 ::Input_section_pattern): Ditto.
10057 (Output_section_element_input::Output_section_element_input): Ditto.
10058 * testsuite/Makefile.am (final_layout): New test case.
10059 * testsuite/Makefile.in: Regenerate.
10060 * testsuite/final_layout.cc: New file.
10061 * testsuite/final_layout.sh: New file.
10062
3537c84b
RÁE
100632010-06-01 Rafael Espindola <espindola@google.com>
10064
10065 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10066
105b6afd
RÁE
100672010-06-01 Rafael Espindola <espindola@google.com>
10068
10069 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10070 visibility of symbols.
10071
29e11421
DK
100722010-05-27 Doug Kwan <dougkwan@google.com>
10073
10074 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10075 from start of output section instead of address for a local symbol
10076 in a merged or relaxed section when doing a relocatable link.
10077
5e0f337e
RÁE
100782010-05-26 Rafael Espindola <espindola@google.com>
10079
703d02da 10080 PR 11604
5e0f337e
RÁE
10081 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10082 adding sections the garbage collector removed.
10083 * gold/testsuite/Makefile.am: Add test.
10084 * gold/testsuite/Makefile.in: Regenerate.
10085 * gold/testsuite/plugin_test_7.sh: New.
10086 * gold/testsuite/plugin_test_7_1.c: New.
10087 * gold/testsuite/plugin_test_7_2.c: New.
10088
f4187277
RÁE
100892010-05-26 Rafael Espindola <espindola@google.com>
10090
10091 * script-sections.cc (Output_section_definition::set_section_addresses):
10092 Check for --section-start.
10093
5c388529
DK
100942010-05-26 Doug Kwan <dougkwan@google.com>
10095
10096 * arm.cc (Arm_scan_relocatable_relocs): New class.
10097 (Target_arm::relocate_special_relocatable): New method.
10098 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10099 (Arm_relocate_functions::thumb_branch_common): Same.
10100 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10101 instead of Default_scan_relocatable_relocs.
10102 * target-reloc.h (relocate_for_relocatable): Let target handle
10103 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10104 * target.h (Sized_target::relocate_special_relocatable): New method.
10105
bca1c3ae
ILT
101062010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10107
10108 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10109
0439c796
DK
101102010-05-23 Doug Kwan <dougkwan@google.com>
10111
10112 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10113 instead of a cast.
10114 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10115 with a direct branch, not a conditional branch, to a stub.
10116 * merge.cc (Output_merge_base::record_input_section): New method
10117 defintion.
10118 (Output_merge_data::do_add_input_section): Record input section if
10119 keeps-input-sections flag is set.
10120 (Output_merge_string::do_add_input_section): Ditto.
10121 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10122 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10123 INPUT_SECTIONS_.
10124 (Output_merge_base::keeps_input_sections,
10125 Output_merge_base::set_keeps_input_sections,
10126 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10127 method definitions.
10128 (Output_merge_base::Input_sections): New type declaration.
10129 (Output_merge_base::input_sections_begin,
10130 Output_merge_base::input_sections_end,
10131 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10132 (Output_merge_base::bool keeps_input_sections_,
10133 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10134 Output_merge_base::input_sections_): New data members.
10135 (Output_merge_data::do_set_keeps_input_sections): New method
10136 defintion.
10137 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10138 * output.cc (Output_section::Input_section::relobj): Move method
10139 defintion from class declaration to here and handle merge sections.
10140 (Output_section::Input_section::shndx): Ditto.
10141 (Output_section::Output_section): Remove initializations of removed
10142 data members and initialize new data member LOOKUP_MAPS_.
10143 (Output_section::add_input_section): Set keeps-input-sections flag
10144 for a newly created merge output section as appropriate. Adjust code
10145 to use Output_section_lookup_maps class.
10146 (Output_section::add_relaxed_input_section): Adjst code for lookup
10147 maps code refactoring.
2e702c99 10148 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10149 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10150 class. If adding input section to a newly created merge output
10151 section fails, remove the new merge section.
10152 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10153 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10154 (Output_section::find_merge_section): Ditto.
0439c796 10155 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10156 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10157 Output_section_lookup_maps class.
10158 (Output_section::get_input_sections): Export merge sections. Adjust
10159 code to use Output_section_lookup_maps class.
10160 (Output_section:::add_script_input_section): Adjust code to use
10161 Output_section_lookup_maps class. Update lookup maps for merge
10162 sections also.
10163 (Output_section::discard_states): Use Output_section_lookup_maps.
10164 (Output_section::restore_states): Same.
10165 * output.h (Merge_section_properties): Move class defintion out of
10166 Output_section.
10167 (Output_section_lookup_maps): New class.
10168 (Output_section::Input_section::is_merge_section): New method
10169 defintion.
10170 (Output_section::Input_section::relobj): Move defintion out of class
10171 defintion. Declare method only.
10172 (Output_section::Input_section::shndx): Ditto.
10173 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10174 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10175 (Output_section::Merge_section_by_properties_map,
10176 Output_section::Output_section_data_by_input_section_map,
10177 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10178 Remove types.
2e702c99 10179 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10180 KEEPS_INPUT_SECTIONS.
10181 (Output_section::build_lookup_maps): New method declaration.
10182 (Output_section::merge_section_map_,
10183 Output_section::merge_section_by_properties_map_,
10184 Output_section::relaxed_input_section_map_,
10185 Output_section::is_relaxed_input_section_map_valid_): Remove data
10186 members.
10187 (Output_section::lookup_maps_): New data member.
10188
76295588
L
101892010-05-21 Doug Kwan <dougkwan@google.com>
10190
10191 PR gold/11619
10192 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10193 avoid a compilation error.
10194
d103a984
RÁE
101952010-05-19 Rafael Espindola <espindola@google.com>
10196
10197 * script-sections.cc (Output_section_definition::allocate_to_segment):
10198 Update the phdrs_list even when the output section is NULL.
10199 * testsuite/Makefile.am: Add test.
10200 * testsuite/Makefile.in: Regenerate.
10201 * testsuite/script_test_9.cc: New.
10202 * testsuite/script_test_9.sh: New.
10203 * testsuite/script_test_9.t: New.
10204
6625d24e
DK
102052010-05-19 Doug Kwan <dougkwan@google.com>
10206
10207 * arm.cc (Arm_input_section::original_size): New method.
10208 (Arm_input_section::do_addralign): Add a cast.
10209 (Arm_input_section::do_output_offset): Remove static cast.
10210 (Arm_input_section::original_addralign,
10211 Arm_input_section::original_size_): Change type to uint32_t.
10212 (Arm_input_section::init): Add safe casts for section alignment
10213 and size.
10214 (Arm_input_section::set_final_data_size): Do not set address and
10215 offset of stub table.
10216 (Arm_output_section::fix_exidx_coverage): Change use of of
10217 Output_section::Simple_input_section to that of
10218 Output_section::Input_section.
10219 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10220 except for the first pass.
10221 * output.cc (Output_section::get_input_sections): Change type of
10222 input_sections to std::list<Input_section>.
10223 (Output_section::add_script_input_section): Rename from
10224 Output_section::add_simple_input_section. Change type of SIS
10225 parameter from Simple_input_section to Input_section.
10226 * output.h (Output_section::Simple_input_section): Remove class.
10227 (Output_section::Input_section): Change class visibility to public.
10228 (Output_section::Input_section::addralign): Use stored alignments
10229 for special input sections if set.
10230 (Output_section::Input_section::set_addralign): New method.
10231 (Output_section::get_input_sections): Change parameter type from
10232 list of Simple_input_section to list of Input_section.
10233 (Output_section::add_script_input_section): Rename from
10234 Output_section::add_simple_input_section. Change first parameter's
10235 type from Simple_input_section to Input_section and remove the
10236 second and third parameters.
10237 * script-sections.cc (Input_section::Input_section_list): Change
10238 type to list of Output_section::Input_section/
10239 (Input_section_info::Input_section_info): Change parameter type of
10240 INPUT_SECTION to Output_section::Input_section.
10241 (Input_section_info::input_section): Change return type.
10242 (Input_section_info::input_section_): Change type to
10243 Output_section::Input_section.
10244 (Output_section_element_input::set_section_addresses): Adjust code
10245 to use Output_section::Input_section instead of
10246 Output_section::Simple_input_section. Adjust code for renaming
10247 of Output_section::add_simple_input_section.
10248 (Orphan_output_section::set_section_addresses): Ditto.
10249
e1e82ea4
RW
102502010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10251
10252 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10253 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10254
91e75c8a
RÁE
102552010-05-18 Rafael Espindola <espindola@google.com>
10256
10257 * options.cc (General_options::finalize): Handle -nostdlib.
10258 * options.h (nostdlib): New option.
10259 * script.cc (script_add_search_dir): Handle -nostdlib.
10260
da59ad79
DK
102612010-05-12 Doug Kwan <dougkwan@google.com>
10262
10263 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10264 attributes section only if there no attributes section after merging.
10265 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10266 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10267 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10268 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10269 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10270 and arm_attr_merge_7.stdout.
10271 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10272 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10273 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10274 arm_attr_merge_7b.o): New rules.
10275 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10276 arm_attr_merge_7
10277 * testsuite/Makefile.in: Regenerate.
10278 * testsuite/arm_attr_merge.sh: New file.
10279 * testsuite/arm_attr_merge_[67][ab].s: Same.
10280
3e01a7fd
NC
102812010-05-05 Nick Clifton <nickc@redhat.com>
10282
10283 * po/es.po: Updated Spanish translation.
10284
7ad2014a
L
102852010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10286
10287 * Makefile.am (install-exec-local): Properly install gold as
10288 default cross linker.
10289 * Makefile.in: Regenerated.
10290
4fda8867
NC
102912010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10292 Nick Clifton <nickc@redhat.com>
10293
10294 * configure.ac (install_as_default): Define and set to false
10295 unless --enable-gold or --enable-gold=both/gold has been
10296 specified.
10297 * configure: Regenerate.
10298
10299 * Makefile.am (install-exec-local): Install the executable as
10300 'ld.gold'. If install_as_default is true then also install it as
10301 'ld'.
10302 * Makefile.in: Regenerated.
10303
bd288ea2
ILT
103042010-04-24 Ian Lance Taylor <iant@google.com>
10305
10306 * layout.cc (Layout::layout_reloc): In relocatable link don't
10307 combine reloc sections for grouped sections.
10308
ef38fd8a
ST
103092010-04-23 Sriraman Tallam <tmsriram@google.com>
10310
10311 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10312 sections that are not ordinary to icf.
10313 * icf.cc (get_section_contents): Handle relocation pointing to section
10314 with no object or shndx information.
10315 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10316 * testsuite/Makefile.in: Regenerate.
10317 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10318 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10319
f6973bdc
ILT
103202010-04-22 Ian Lance Taylor <iant@google.com>
10321
10322 * expression.cc (Expression::Expression_eval_info): Add
10323 result_alignment_pointer field.
10324 (Expression::eval_with_dot): Add result_alignment_pointer
10325 parameter. Change all callers.
10326 (Expression::eval_maybe_dot): Likewise.
10327 (class Binary_expression): Add alignment_pointer parameter to
10328 left_value and right_value. Change all callers.
10329 (BINARY_EXPRESSION): Set result alignment.
10330 (class Trinary_expression): Add alignment_pointer parameter to
10331 arg2_value and arg3_value. Change all callers.
10332 (Trinary_cond::value): Set result alignment.
10333 (Max_expression::value, Min_expression::value): Likewise.
10334 (Align_expression::value): Likewise.
10335 * script-sections.cc (class Sections_element): Add dot_alignment
10336 parameter to set_section_addresses virtual function. Update
10337 instantiations.
10338 (class Output_section_element): Likewise.
10339 (Script_sections::create_segments): Add dot_alignment parameter.
10340 Change all callers.
10341 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10342 (Script_sections::set_phdrs_clause_addresses): Likewise.
10343 * script-sections.h: Update declarations.
10344 * script.h: Update declarations.
10345 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10346 min_p_align.
10347 * testsuite/script_test_3.t: Set large alignment.
10348 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10349 segment has expected alignment.
10350
9c9c98a5
NC
103512010-04-22 Nick Clifton <nickc@redhat.com>
10352
10353 * po/gold.pot: Updated by the Translation project.
10354 * po/vi.po: Updated Vietnamese translation.
10355
2253bfba
L
103562010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10357
10358 * testsuite/Makefile.am (check_PROGRAMS): Add
10359 icf_virtual_function_folding_test.
10360 * testsuite/Makefile.in: Regenerated.
10361
85fdf906
AH
103622010-04-15 Andrew Haley <aph@redhat.com>
10363
10364 * options.h (merge_exidx_entries): New option.
10365 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10366 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10367 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10368 (Target_arm::merge_exidx_entries): New function.
10369 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10370 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10371 to Arm_exidx_fixup constructor.
10372 Add new arg, merge_exidx_entries.
10373 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10374 Arm_output_section::fix_exidx_coverage.
10375
ce97fa81
ST
103762010-04-18 Sriraman Tallam <tmsriram@google.com>
10377
10378 * icf.cc (get_section_contents): Check for preemptible functions.
10379 Ignore addend when appropriate.
10380 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10381 section folded.
10382 (add_from_relobj): Check for section folded.
10383 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10384 * symtab.h (should_add_dynsym_entry): Add new parameter.
10385 * target-reloc.h (scan_relocs): Check for section folded.
10386 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10387 Check reloc types for function pointers in shared objects.
10388 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10389 case.
10390 (icf_preemptible_functions_test): New test case.
10391 (icf_string_merge_test): New test case.
10392 * testsuite.Makefile.in: Regenerate.
10393 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10394 bar_glob. Refactor code.
10395 * testsuite/icf_preemptible_functions_test.cc: New file.
10396 * testsuite/icf_preemptible_functions_test.sh: New file.
10397 * testsuite/icf_string_merge_test.cc: New file.
10398 * testsuite/icf_string_merge_test.sh: New file.
10399 * testsuite/icf_virtual_function_folding_test.cc: New file.
10400 * testsuite/icf_virtual_function_folding_test.sh: New file.
10401
04ceb17c
DK
104022010-04-14 Doug Kwan <dougkwan@google.com>
10403
10404 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10405 for local symbol recounting if we remove a section due to ICF.
10406 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10407 there are no regular objects in input.
10408
153e7da4
DK
104092010-04-13 Doug Kwan <dougkwan@google.com>
10410
10411 * arm.cc (Arm_input_section::set_final_data_size): Compute
10412 accurate final data size instead of using current data size.
10413
4dbd9faf
DK
104142010-04-09 Doug Kwan <dougkwan@google.com>
10415
10416 * layout.cc (Layout::choose_output_section): Handle script section
10417 types.
10418 (Layout::make_output_section_for_script): Add section type parameter.
10419 Handle script section types.
10420 * layout.h (Layout::make_output_section_for_script): Add section
10421 type parameter.
10422 * output.cc (Output_section::Output_section): Initialize data member
10423 is_noload_.
10424 (Output_section::do_reset_address_and_file_offset): Do not set address
10425 to 0 if section is a NOLOAD section.
10426 * output.h (Output_section::is_noload): New method.
10427 (Output_section::set_is_noload): Ditto.
10428 (Output_section::is_noload_): New data member.
10429 * script-c.h (Script_section_type): New enum type.
10430 (struct Parser_output_section_header): Add new file section_type.
10431 * script-sections.cc (Sections_element::output_section_name): Add
10432 parameter for returning script section type.
10433 (Output_section_definition::output_section_name): Ditto.
10434 (Output_section_definition::section_type)P; New method.
10435 (Output_section_definiton::script_section_type_name): Ditto.
10436 (Output_section_definition::script_section_type_): New data member.
10437 (Output_section_definition::Output_section_definition): Initialize
10438 data member Output_section_definition::script_section_type_.
10439 (Output_section_definition::create_sections): Pass script section type
10440 to Layout::make_output_section_for_script.
10441 (Output_section_definition::output_section_name): Return script
10442 section type to caller.
10443 (Output_section_definition::set_section_address): Do not advance
10444 dot value and load address if section type is NOLOAD. Set address
10445 of NOLOAD sections regardless of section flags.
10446 (Output_section_definition::print): Print section type if it is
10447 not SCRIPT_SECTION_TYPE_NONE.
10448 (Output_section_definition::section_type): New method.
10449 (Output_section_definition::script_section_type_name): Ditto.
10450 (Script_sections::output_section_name): Add new parameter
10451 PSECTION_TYPE for returning script section type. Pass it to
10452 section elements. Handle discard sections.
10453 (Sort_output_sections::operator()): Handle NOLOAD sections.
10454 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10455 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10456 returning script section type.
10457 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10458 INFO and NOLOAD.
10459 * yyscript.y (union): Add new field SECTION_TYPE.
10460 (COPY, DSECT, INFO, NOLOAD): New tokens.
10461 (opt_address_and_section_type): Change type to output_section_header.
10462 (section_type): New non-terminal
10463 (section_header): Handle section type.
2253bfba 10464 (opt_address_and_section_type): Return section type value.
4dbd9faf 10465
721ea635
L
104662010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10467
10468 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10469 * testsuite/plugin_common_test_2.c (foo): Likewise.
10470
6bf924b0
DK
104712010-04-08 Doug Kwan <dougkwan@google.com>
10472
10473 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10474 Output_merge_data.
10475 * output.cc (Output_section::add_merge_input_section): Simplify
10476 code and return status of Output_merge_base::add_input_section.
e1df38aa 10477 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10478 returns true.
10479
24af6f92
DK
104802010-04-07 Doug Kwan <dougkwan@google.com>
10481
10482 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10483 if section is marked as containing instructions but has no mapping
10484 symbols.
10485 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10486 correct section index.
10487 (Arm_relobj::find_linked_text_section): Ditto.
10488
00698fc5
CC
104892010-04-07 Cary Coutant <ccoutant@google.com>
10490
10491 * archive.cc (include_member): Destroy Read_symbols_data object before
10492 releasing file.
10493 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10494 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10495 (Read_symbols_data::~Read_symbols_data) New destructor.
10496 (Section_relocs::Section_relocs) New constructor.
10497 (Section_relocs::~Section_relocs) New destructor.
10498 (Read_relocs_data::Read_relocs_data) New constructor.
10499 (Read_relocs_data::~Read_relocs_data) New destructor.
10500 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10501 pointers to NULL after deleting.
10502
7296d933
DK
105032010-04-07 Doug Kwan <dougkwan@google.com>
10504
10505 * arm.cc: Replace "endianity" with "endianness" in comments.
10506 (Arm_exidx_cantunwind): Ditto.
10507 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10508 (Arm_relobj::merge_flags_and_attributes): New method.
10509 (Arm_relobj::merge_flags_and_attributes_): New data member.
10510 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10511 (Arm_relobj::scan_sections_for_stubs): Ditto.
10512 (Arm_relobj::do_read_symbols): Check to see if we really want to
10513 merge processor-specific flags and attributes. Exit early if
10514 an object is empty except for section names and the undefined symbol.
10515 (Target_arm::do_finalize_sections): Move check for ELF format to
10516 Arm_relobj::do_read_symbols. Merge processor specific flags and
10517 attributes from a regular object only when we have determined that
10518 it is aapropriate. Do not create an .ARM.attributes section in
10519 output if there is no regular input object.
10520 (Target_arm::merge_processor_specific_flags): Check
10521 --warn-mismatch before printing any error.
10522 (Target_arm::merge_object_attributes): Ditto.
10523 * gold.cc (queue_middle_tasks): Handle the case in which there is
10524 no regular object in input.
10525 * options.cc (General_options::parse_EB): New method.
10526 (General_options::parse_EL): Same.
10527 (General_options::General_options): Initialize endianness_.
10528 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10529 New options.
10530 (General_options::Endianness): New enum.
10531 (General_options::endianness): New method.
10532 (General_options::endianness_): New data member.
10533 * parameters.cc (Parameters::set_options): Check target endianness.
10534 (Parameters::set_target_once): Ditto.
10535 (Parameters::check_target_endianness): New method.
10536 (parameters_force_valid_target): If either -EL or -EB is specified,
10537 use it to define endianness of default target.
10538 * parameters.h (Parameters::check_target_endianness): New method
10539 declaration.
10540 * target.h (class Target): Change "endianity" to "endianness"
10541 in comments.
10542
efc8d4f2
RW
105432010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10544
10545 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10546 * configure: Regenerate.
10547 * Makefile.in: Regenerate.
10548 * testsuite/Makefile.in: Regenerate.
10549
be234d88
CC
105502010-04-06 Cary Coutant <ccoutant@google.com>
10551
10552 gcc PR lto/42757
10553 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10554 prevailing definitions of common symbols.
10555 * testsuite/plugin_test_6.sh: New test case.
10556 * testsuite/plugin_common_test_1.c: New test case.
10557 * testsuite/plugin_common_test_2.c: New test case.
10558 * testsuite/Makefile.am (plugin_test_6): New test case.
10559 * testsuite/Makefile.in: Regenerate.
10560
bd32c6bd
NC
105612010-04-06 Nick Clifton <nickc@redhat.com>
10562
10563 * po/vi.po: New Vietnamese translation.
10564
323c532f
DK
105652010-03-30 Doug Kwan <dougkwan@google.com>
10566
10567 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10568
4fcd97eb
DK
105692010-03-25 Doug Kwan <dougkwan@google.com>
10570
10571 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10572 to avoid a conversion warning on a 32-bit host.
10573
4ebf39db
ILT
105742010-03-24 Ian Lance Taylor <iant@google.com>
10575
10576 * testsuite/script_test_3.t: Add a TLS segment.
10577 * testsuite/Makefile.am (check_PROGRAMS): Add
10578 tls_phdrs_script_test.
10579 (tls_phdrs_script_test_SOURCES): Define.
10580 (tls_phdrs_script_test_DEPENDENCIES): Define.
10581 (tls_phdrs_script_test_LDFLAGS): Define.
10582 (tls_phdrs_script_test_LDADD): Define.
10583 * testsuite/Makefile.in: Rebuild.
10584
4a599bdd
CC
105852010-03-23 Cary Coutant <ccoutant@google.com>
10586
10587 * fileread.cc (find_or_make_view): Fix comment.
10588
6c93b22c
ILT
105892010-03-23 Ian Lance Taylor <iant@google.com>
10590
10591 * script-sections.cc (class Orphan_section_placement): Define
10592 PLACE_TLS and PLACE_TLS_BSS.
10593 (Orphan_section_placement::Orphan_section_placement): Initialize
10594 new places.
10595 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10596 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10597 (tls_script_test_SOURCES): Define.
10598 (tls_script_test_DEPENDENCIES): Define.
10599 (tls_script_test_LDFLAGS): Define.
10600 (tls_script_test_LDADD): Define.
10601 * testsuite/Makefile.in: Rebuild.
10602
a2c7281b
DK
106032010-03-22 Doug Kwan <dougkwan@google.com>
10604
10605 * arm.cc (Arm_relocate_functions::abs8,
10606 Arm_relocate_functions::abs16): Use correct check for overflow
10607 specified in the ARM ELF specs.
10608 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10609 target of a BLX instruction specially.
10610 (Reloc_stub::stub_type_for_reloc): Ditto.
10611 (Relocate::relocate): Use symbolic names instead of numeric relocation
10612 codes to report error.
10613 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10614 workaround.
10615 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10616 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10617 thumb2_blx_out_of_range.stdout
10618 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10619 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10620 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10621 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10622 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10623 thumb2_blx_in_range, thumb2_blx_in_range.o,
10624 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10625 thumb2_blx_out_of_range.o): New rules.
2e702c99 10626 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10627 thumb2_blx_in_range and thumb2_blx_out_of_range.
10628 * testsuite/Makefile.in: Regenerate.
10629 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10630 * testsuite/thumb_blx_in_range.s: New file.
10631 * testsuite/thumb_blx_out_of_range.s: New file.
10632
b0193076
RÁE
106332010-03-22 Rafael Espindola <espindola@google.com>
10634
10635 * archive.cc (Should_include): Move to archive.h.
10636 (should_include_member): Make it a member of Archive.
10637 (Lib_group): New.
10638 (Add_lib_group_symbols): New.
10639 * archive.h: Include options.h.
10640 (Archive_member): Moved from Archive.
10641 (Should_include): Moved from archive.cc.
10642 (Lib_group): New.
10643 (Add_lib_group_symbols): New.
10644 * dynobj.cc (do_should_include_member): New.
10645 * dynobj.h (do_should_include_member): New.
10646 * gold.cc (queue_initial_tasks): Update call to queue.
10647 * main.cc (main): Print lib group stats.
10648 * object.cc (do_should_include_member): New.
10649 * object.h: Include archive.h.
10650 (Object::should_include_member): New.
10651 (Object::do_should_include_member): New.
10652 (Sized_relobj::do_should_include_member): New.
10653 * options.cc (General_options::parse_start_lib): New.
10654 (General_options::parse_end_lib): New.
10655 (Input_arguments::add_file): Handle lib groups.
10656 (Input_arguments::start_group): Check we are not in a lib.
10657 (Input_arguments::start_lib): New.
10658 (Input_arguments::end_lib): New.
10659 * options.h (General_options): Add start_lib and end_lib.
10660 (Input_argument::lib_): New.
10661 (Input_argument::lib): New.
10662 (Input_argument::is_lib): New.
10663 (Input_file_lib): New.
10664 (Input_arguments::in_lib_): New.
10665 (Input_arguments::in_lib): New.
10666 (Input_arguments::start_lib): New.
10667 (Input_arguments::end_lib_): New.
10668 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10669 in unused members as preempted.
10670 (Sized_pluginobj::do_should_include_member): New.
10671 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10672 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10673 return the blocker.
10674 (Read_symbols::do_whole_lib_group): New.
10675 (Read_symbols::do_lib_group): New.
10676 (Read_symbols::do_read_symbols): Handle lib groups.
10677 (Read_symbols::get_name): Handle lib groups.
10678 * readsyms.h (Read_symbols): Add an archive member pointer.
10679 (Read_symbols::do_whole_lib_group): New.
10680 (Read_symbols::do_lib_group): New.
10681 (Read_symbols::member_): New.
10682 * script.cc (read_input_script): Update call to queue_soon.
10683
d099120c
DK
106842010-03-19 Doug Kwan <dougkwan@google.com>
10685
10686 * arm.cc (Stub_table::Stub_table): Initialize new data members
10687 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10688 (Stub_table::add_reloc_stub): Assign stub offset and update
10689 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10690 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10691 New data members.
2e702c99 10692 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10693 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10694 instead of going over all reloc stubs.
2e702c99 10695 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10696 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10697 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10698 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10699 Stringpool_template::offset_.
10700 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10701 Stringpool_template::offset_ to zero.
10702
1aa37384
DK
107032010-03-15 Doug Kwan <dougkwan@google.com>
10704
10705 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10706 offset_.
10707 (Stringpool_template::new_key_offset): New method.
10708 (Stringpool_template::add_string): Assign offsets when adding new
10709 strings.
10710 (Stringpool_template::set_string_offsets): Do not set string offsets
10711 when not optimizing.
10712 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10713 member size_.
2e702c99
RM
10714 (Chunked_vector::clear): Clear size_.
10715 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10716 (Chunked_vector::size): Return size_.
10717 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10718 (Chunked_vector::size_): New data member.
1aa37384
DK
10719 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10720 (Stringpool_template::new_key_offset): New method declaration.
10721 (Stringpool_template::offset_): New data member.
10722
b672b057
RÁE
107232010-03-15 Rafael Espindola <espindola@google.com>
10724
10725 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10726 Add_symbols' constructor.
10727 * readsyms.h (Add_symbols): Remove the input_group member.
10728
b6848d3c
ILT
107292010-03-10 Ian Lance Taylor <iant@google.com>
10730
10731 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10732 target to ask whether a reference to a symbol requires a stack
10733 split.
10734 * target.h (Target::is_call_to_non_split): New function.
10735 (Target::do_is_call_to_non_split): Declare virtual function.
10736 * target.cc: Include "symtab.h".
10737 (Target::do_is_call_to_non_split): New function.
10738 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10739
a2a5469e
CC
107402010-03-10 Cary Coutant <ccoutant@google.com>
10741
10742 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10743 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10744 (File_read::open[2]): Add whole_file_view_ to list of views.
10745 (File_read::make_view): Remove test of whole_file_view_.
10746 (File_read::find_or_make_view): Create whole_file_view_ if
10747 necessary.
10748 (File_read::clear_views): Replace bool parameter with enum;
10749 adjust all callers. Don't delete views with permanent data;
10750 do delete cached views and views from archives if
10751 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10752 if clearing the corresponding view.
10753 * fileread.h (File_read::Clear_views_mode): New enum.
10754 (File_read::View::is_permanent_view): New method.
10755 (File_read::clear_views): Replace bool parameter
10756 with enum; adjust all callers.
10757 * options.h (General_options): Change keep_files_mapped option;
10758 add map_whole_files.
10759 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10760 releasing the file.
10761 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10762 the file.
10763
8861f32b
DM
107642010-03-10 David S. Miller <davem@davemloft.net>
10765
10766 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10767
d62d0f5f
ST
107682010-03-09 Sriraman Tallam <tmsriram@google.com>
10769
10770 * icf.cc (get_section_contents): Add '@' marker after processing the
10771 merge reloc.
10772
9177756d
DK
107732010-03-08 Doug Kwan <dougkwan@google.com>
10774
10775 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10776 due to a conversion warning.
10777 (Arm_relobj::update_output_local_symbol_count): Check for local
10778 symbol with unset output index.
10779
9e9e071b
ILT
107802010-03-05 Ian Lance Taylor <iant@google.com>
10781
10782 * options.h (class General_options): Add --spare-dynamic-tags.
10783 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10784 --spare-dynamic-tags.
10785
a81ee015
ILT
107862010-03-05 Ian Lance Taylor <iant@google.com>
10787
10788 * incremental.cc: Include "libiberty.h".
10789
44ec90b9
RO
107902010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10791
10792 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10793 function, is_info_ member.
10794 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10795 (Versions::Versions): Update caller.
10796 (Versions::define_base_version): Likewise.
10797 (Versions::add_def): Likewise.
10798
0897ed3b
ST
107992010-03-03 Sriraman Tallam <tmsriram@google.com>
10800
10801 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10802 (Scan::possible_function_pointer_reloc): New function.
10803 (Scan::local_reloc_may_be_function_pointer): Change to call
10804 possible_function_pointer_reloc.
10805 (Scan::global_reloc_may_be_function_pointer): Ditto.
10806 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10807 relocations in ".data.rel.ro._ZTV" section.
10808 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10809 * testsuite/icf_safe_so_test.cc: Ditto.
10810 * testsuite/icf_safe_test.cc: Ditto.
10811 * testsuite/icf_safe_test.sh: Ditto.
10812
d3bbad62
ILT
108132010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10814 Ian Lance Taylor <iant@google.com>
10815
10816 * target-reloc.h (relocate_section): Check the symbol table index
10817 for -1U before setting the local symbol index.
10818 (scan_relocatable_relocs): If copying the relocation, record that
10819 the local symbol is required.
10820 * object.h (Symbol_value::is_output_symtab_index_set): New
10821 function.
10822 (Symbol_value::may_be_discarded_from_output_symtab): New
10823 function.
10824 (Symbol_value::has_output_symtab_entry): New function.
10825 (Symbol_value::needs_output_symtab_entry): Remove.
10826 (Symbol_value::output_symtab_index): Make sure the symbol index is
10827 set.
10828 (Symbol_value::set_output_symtab_index): Make sure the symbol
10829 index is not set. Make sure the new index is valid.
10830 (Symbol_value::set_must_have_output_symtab_entry): New function.
10831 (Symbol_value::has_output_dynsym_entry): New function.
10832 (Symbol_value::set_output_dynsym_index): Make sure the new index
10833 is valid.
10834 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10835 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10836 local symbol if permitted.
10837 (Sized_relobj::do_finalize_local_symbols): Call
10838 is_output_symtab_index_set rather than needs_output_symtab_entry.
10839 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10840 rather than needs_output_symtab_entry. Call
10841 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10842 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10843 is_output_symtab_index_set rather than needs_output_symtab_entry.
10844 * testsuite/discard_locals_relocatable_test.c: New file.
10845 * testsuite/discard_locals_test.sh: Test -r.
10846 * testsuite/Makefile.am (check_DATA): Add
10847 discard_locals_relocatable_test1.syms,
10848 discard_local_relocatable_test2.syms.
10849 (MOSTLYCLEANFILES): Likewise. Also add
10850 discard_locals_relocatable_test1.lout and
10851 discard_locals_relocatable_test2.out.
10852 (discard_locals_relocatable_test1.syms): New target.
10853 (discard_locals_relocatable_test.o): New target.
10854 (discard_locals_relocatable_test1.out): New target.
10855 (discard_locals_relocatable_test2.syms): New target.
10856 (discard_locals_relocatable_test2.out): New target.
10857 (various): Add missing ../ld-new dependencies.
10858 * testsuite/Makefile.in: Rebuild.
10859
7e8ccf26
NC
108602010-03-03 Nick Clifton <nickc@redhat.com>
10861
10862 * po/fi.po: New Finnish translation.
10863
2a0ff005
DK
108642010-03-01 Doug Kwan <dougkwan@google.com>
10865
10866 * layout.cc (Layout::Layout): Force section types of .init_array*,
10867 .preinit_array* and .fini_array* sections.
10868 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10869 Fix check of return value of std::string::find.().
10870 (Output_section::Input_section_sort_compare::operator()): Remove
10871 comment about .init_array.
10872 (Output_section::Input_section_sort_init_fini_compare::operator()):
10873 New method.
10874 (Output_section::sort_attached_input_sections): Handle .init_array
10875 and .fini_array specially.
10876 * output.h (Output_section::Inut_section_sort_compare): Update
10877 comment.
10878 (Output_section::Input_section_sort_init_fini_compare): New struct.
10879
c3e4ae29
DK
108802010-02-26 Doug Kwan <dougkwan@google.com>
10881
10882 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10883 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10884 * testsuite/debug_msg.sh: Avoid matching source line number for
10885 use of global variable undef_int.
10886
2fd9ae7a
DK
108872010-02-26 Doug Kwan <dougkwan@google.com>
10888
10889 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10890 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10891 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10892 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10893 * options.cc (General_options::General_options): Initialize member
10894 fix_v4bx_.
10895 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10896 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10897 and rm_no_fix_v4bx.stdout
10898 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10899 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10900 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10901 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10902 and arm_no_fix_v4bx.
10903 * Makefile.in: Regenerate.
10904 * testsuite/arm_fix_v4bx.s: New file.
10905 * testsuite/arm_fix_v4bx.sh: Ditto.
10906
67ec7d0b
DK
109072010-02-24 Doug Kwan <dougkwan@google.com>
10908
10909 * arm.cc (Target_arm::got_section): Make the .got section the first
10910 non RELRO section in the data segment.
10911 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10912 suffixes of section names.
10913
10165461
DK
109142010-02-24 Doug Kwan <dougkwan@google.com>
10915
10916 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10917 flags and attributes merging if an input file is a binary file.
10918 * fileread.cc (Input_file::open): Record format of original file.
10919 * fileread.h (Input_file::Format): New enum type.
2e702c99 10920 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10921 (Input_file::format): New method definition.
10922 (Input_file::format_):: New data member.
10923
4a54abbb
DK
109242010-02-24 Doug Kwan <dougkwan@google.com>
10925
10926 * arm.cc (Arm_output_data_got): New class.
10927 (ARM_TCB_SIZE): New constant
10928 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10929 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10930 If user uses a script with a SECTIONS clause, issue only a warning
10931 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10932 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10933 garbage collection.
10934 (Target_arm::got_mode_index_entry): Handle static linking.
10935 (Target_arm::Scan::local): Ditto.
10936 (Target_arm::Scan::global): Ditto.
10937 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10938 all incorrectly implemented relocations.
e1df38aa 10939 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10940 Arm_output_section::fix_exidx_coverage.
10941 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10942 from ".ARM.exidx." and ".ARM.extab.".
10943
ca419a6f
ILT
109442010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10945
10946 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10947 section if it does not already exist.
10948 * attributes.cc (Attributes_section_data::Attributes_section_data):
10949 Don't crash if size is zero.
10950
135b9c78
ILT
109512010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10952 Ian Lance Taylor <iant@google.com>
10953
10954 * gold.cc (queue_middle_tasks): If no input files were opened,
10955 exit.
10956 * workqueue.h (Task_function::Task_function): Assert that there is
10957 a blocker.
10958
bb0bfe4f
DK
109592010-02-22 Doug Kwan <dougkwan@google.com>
10960
10961 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10962 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10963 types to avoid warnings due to different uint64_t implementations
10964 on different hosts.
10965
2a2b6d42
DK
109662010-02-21 Doug Kwan <dougkwan@google.com>
10967
10968 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10969 handling of the maximum backward branch offset.
2e702c99 10970 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10971 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10972 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10973 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10974 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10975 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10976 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10977 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10978 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10979 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10980 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10981 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10982 thumb2_bl_out_of_range.o): New rules.
10983 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10984 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10985 thumb2_bl_out_of_range
10986 * testsuite/Makefile.in: Regenerate.
10987 * testsuite/arm_bl_in_range.s: New file.
10988 * testsuite/arm_bl_out_of_range.s: Ditto.
10989 * testsuite/arm_branch_in_range.sh: Ditto.
10990 * testsuite/arm_branch_range.t: Ditto.
10991 * testsuite/thumb2_branch_range.t: Ditto.
10992 * testsuite/thumb_bl_in_range.s: Ditto.
10993 * testsuite/thumb_bl_out_of_range.s: Ditto.
10994 * testsuite/thumb_branch_range.t: Ditto.
10995
b487ad64
ST
109962010-02-20 Sriraman Tallam <tmsriram@google.com>
10997
10998 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10999 Add reloc offset information.
11000 * icf.cc (get_section_contents): Change iterators to point to the new
11001 vectors. Add reloc offset information to the contents.
11002 * icf.h (Icf::Sections_reachable_info): New typedef.
11003 (Icf::Sections_reachable_list): New typedef.
11004 (Icf::Offset_info): New typedef.
11005 (Icf::Reloc_info): New struct typedef.
11006 (Icf::Reloc_info_list): New typedef.
11007 (Icf::symbol_reloc_list): Delete method.
11008 (Icf::addend_reloc_list): Delete method.
11009 (Icf::section_reloc_list): Delete method.
11010 (Icf::reloc_info_list): New method.
11011 (Icf::reloc_info_list_): New member.
11012
f96accdf
DK
110132010-02-19 Doug Kwan <dougkwan@google.com>
11014
11015 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11016 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11017 * arm.cc (Arm_relocation_functions): New forward declaration.
11018 (Target_arm::Target_arm): Initialize new data members
11019 got_mod_index_offset_ and tls_base_symbol_defined_.
11020 (Target_arm::Relocate::relocate_tls): New method.
11021 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11022 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11023 New methods.
2e702c99 11024 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
11025 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11026 (Target_arm::got_mod_index_offset_,
11027 Target_arm::tls_base_symbol_defined_): New data members.
11028 (Target_arm::Scan::local, Target::Scan::global,
11029 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11030 relocations.
11031
c8761b9a
DK
110322010-02-18 Doug Kwan <dougkwan@google.com>
11033
11034 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11035 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11036 text section as a parameter becuase some broken tools may not set
11037 the link in section header.
11038 (Target_arm::has_got_section): New method.
11039 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11040 without any mapping symbol as data only. Remove warning.
11041 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11042 link in its section header, try to discover the link by inspecting the
11043 REL31 relocation at the beginning of the section.
11044 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11045 in error message.
11046 (Target_arm::Scan::global): Treat any reference to the symbol
11047 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11048
21bb3914
ST
110492010-02-12 Sriraman Tallam <tmsriram@google.com>
11050
11051 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11052 (Scan::global_reloc_may_be_function_pointer): New function.
11053 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11054 (Scan::global_reloc_may_be_function_pointer): New function.
11055 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11056 (Scan::global_reloc_may_be_function_pointer): New function.
11057 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11058 (Scan::global_reloc_may_be_function_pointer): New function.
11059 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11060 (Scan::global_reloc_may_be_function_pointer): New function.
11061 (Scan::possible_function_pointer_reloc): New function.
11062 (Target_x86_64::can_check_for_function_pointers): New function.
11063 * gc.h (gc_process_relocs): Scan relocation types to determine if
11064 function pointers were taken for targets that support it.
11065 * icf.cc (Icf::find_identical_sections): Include functions for
11066 folding in safe ICF whose pointer is not taken.
11067 * icf.h (Secn_fptr_taken_set): New typedef.
11068 (fptr_section_id_): New member.
11069 (section_has_function_pointers): New function.
11070 (set_section_has_function_pointers): New function.
11071 (check_section_for_function_pointers): New function.
11072 * options.h: Fix comment for safe ICF option.
11073 * target.h (can_check_for_function_pointers): New function.
11074 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11075 Modify icf_safe_test for X86-64.
11076 * testsuite/Makefile.in: Regenerate.
11077 * testsuite/icf_safe_so_test.cc: New file.
11078 * testsuite/icf_safe_so_test.sh: New file.
11079 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11080 (main): Change to take pointer to function kept_func_3.
11081 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11082 folding is done correctly for X86-64.
11083
0da6fa6c
DM
110842010-02-12 David S. Miller <davem@davemloft.net>
11085
11086 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11087 is_symbolless parameter.
11088 (Output_reloc<SHT_REL>::is_symbolless): New.
11089 (Output_reloc<SHT_REL>::is_symbolless_): New.
11090 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11091 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11092 (Output_reloc<SHT_RELA>::is_symbolless): New.
11093 (Output_data_reloc::add_global): Handle is_symbolless.
11094 (Output_data_reloc::add_global_relative): Likewise.
11095 (Output_data_reloc::add_local): Likewise.
11096 (Output_data_reloc::add_local_relative): Likewise.
11097 (Output_data_reloc::add_symbolless_global_addend): New.
11098 (Output_data_reloc::add_symbolless_local_addend): New.
11099 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11100 is_symbolless.
11101 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11102 instead of ->is_relative_
11103 (Output_reloc::write): Likewise.
11104 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11105 (Output_reloc::write_rel): Simplify.
11106
11107 * sparc.cc (Target_sparc::Scan::local): Use
11108 ->add_symbolless_local_addend as needed.
11109 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11110 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11111 based upon relocation offset.
11112
e4782e83
DK
111132010-02-11 Doug Kwan <dougkwan@google.com>
11114
11115 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11116 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11117 beginning of function.
11118 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11119 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11120 parameter is_32bit in calls to should_apply_static_reloc.
11121 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11122 (check_DATA): Add arm_abs_global.stdout.
11123 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11124 arm_abs_global.stdout): New rules.
11125 (MOSTLLYCLEANFILES): Add arm_abs_global
11126 * Makefile.in: Regenerate.
11127 * testsuite/arm_abs_global.s: New file.
11128 * testsuite/arm_abs_global.sh: Ditto.
11129 * testsuite/arm_abs_lib.s: Ditto.
11130
93ceb764
ILT
111312010-02-11 Ian Lance Taylor <iant@google.com>
11132
11133 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11134 Read_relocs task.
11135 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11136 Allocate_commons_task first.
11137 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11138 task, rather than symtab_lock_.
11139 (Gc_process_relocs::~Gc_process_relocs): New function.
11140 (Gc_process_relocs::is_runnable): Check this_blocker_.
11141 (Gc_process_relocs::locks): Use next_blocker_ rather than
11142 blocker_.
11143 (Scan_relocs::~Scan_relocs): New function.
11144 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11145 symtab_lock_.
11146 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11147 next_blocker_.
11148 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11149 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11150 constructor accordingly.
11151 (class Gc_process_relocs): Likewise.
11152 (class Scan_relocs): Likewise.
11153 * common.h (class Allocate_commons_task): Remove symtab_lock_
11154 field, and corresponding constructor parameter.
11155 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11156 symtab_lock_.
11157 (Allocate_commons_task::locks): Likewise.
11158
114dfbe1
ILT
111592010-02-11 Ian Lance Taylor <iant@google.com>
11160
11161 * gold-threads.h (class Once): Define.
11162 (class Initialize_lock): Rewrite as child of Once.
11163 * gold-threads.cc (class Once_initialize): Define.
11164 (once_pointer_control): New static variable.
11165 (once_pointer, once_arg): New static variables.
11166 (c_run_once): New static function.
11167 (Once::Once, Once::run_once, Once::internal_run): New functions.
11168 (class Initialize_lock_once): Remove.
11169 (initialize_lock_control): Remove.
11170 (initialize_lock_pointer): Remove.
11171 (initialize_lock_once): Remove.
11172 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11173 (Initialize_lock::initialize): Rewrite.
11174 (Initialize_lock::do_run_once): New function.
11175 * archive.cc (Archive::interpret_header): Only clear name if it is
11176 not already empty.
11177 * fileread.cc: Include "gold-threads.h"
11178 (file_counts_lock): New static variable.
11179 (file_counts_initialize_lock): Likewise.
11180 (File_read::release): Only increment counts when using --stats.
11181 Use a lock around the increment.
11182 * parameters.cc (class Set_parameters_target_once): Define.
11183 (set_parameters_target_once): New static variable.
11184 (Parameters::Parameters): Move here from parameters.h.
11185 (Parameters::set_target): Rewrite.
11186 (Parameters::set_target_once): New function.
11187 (Parameters::clear_target): Move here and rewrite.
11188 * parameters.h (class Parameters): Update declarations. Add
11189 set_parameters_target_once_ field.
11190 (Parameters::Parameters): Move to parameters.cc.
11191 (Parameters::clear_target): Likewise.
11192 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11193 task.
11194 (Start_group::~Start_group): New function.
11195 (Start_group::is_runnable): New function.
11196 (Start_group::locks, Start_group::run): New functions.
11197 (Finish_group::run): Change saw_undefined to size_t.
11198 * readsyms.h (class Start_group): Define.
11199 (class Finish_group): Change saw_undefined_ field to size_t.
11200 (Finish_group::Finish_group): Remove saw_undefined and
11201 this_blocker parameters. Change all callers.
11202 (Finish_group::set_saw_undefined): New function.
11203 (Finish_group::set_blocker): New function.
11204 * symtab.h (class Symbol_table): Change saw_undefined to return
11205 size_t. Change saw_undefined_ field to size_t.
11206 * target-select.cc (Set_target_once::do_run_once): New function.
11207 (Target_selector::Target_selector): Initialize set_target_once_
11208 field. Don't initialize lock_ and initialize_lock_ fields.
11209 (Target_selector::instantiate_target): Rewrite.
11210 (Target_selector::set_target): New function.
11211 * target-select.h (class Set_target_once): Define.
11212 (class Target_selector): Update declarations. Make
11213 Set_target_once a friend. Remove lock_ and initialize_lock_
11214 fields. Add set_target_once_ field.
11215
fa17a3f4
ILT
112162010-02-10 Ian Lance Taylor <iant@google.com>
11217
11218 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11219 queueing any tasks.
11220 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11221 (queue_middle_tasks): Add all blockers before queueing any tasks.
11222 (queue_final_tasks): Likewise.
11223 * token.h (Task_token::add_blockers): New function.
11224 * object.h (Input_objects::number_of_relobjs): New function.
11225
c7177d31
ILT
112262010-02-10 Ian Lance Taylor <iant@google.com>
11227
5de0e392
ILT
11228 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11229 shared, not if not position independent.
11230 * x86_64.cc (Relocate::relocate_tls): Likewise.
11231 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11232 (tls_pie_pic_test): New target.
11233 * testsuite/Makefile.in: Rebuild.
11234
c7177d31
ILT
11235 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11236 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11237 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11238 * testsuite/Makefile.in: Rebuild.
11239
684b268a
DM
112402010-02-09 David S. Miller <davem@davemloft.net>
11241
11242 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11243 R_SPARC_RELATIVE using ->add_local_relative().
11244 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11245
612a8d3d
DM
11246 * output.h (Output_data_dynamic::add_section_size): New method
11247 that takes two Output_data objects.
11248 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11249 entry param. Handle it in initializers.
11250 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11251 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11252 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11253 arg.
11254 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11255 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11256 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11257 for dynrel_includes_plt.
11258 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11259 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11260 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11261 before .rela.plt
11262 (Target_sparc::do_finalize_sections): Update to pass true for
11263 dynrel_includes_plt.
11264 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11265 output before .rela.plt
11266 (Target_powerpc::do_finalize_sections): Update to pass true for
11267 dynrel_includes_plt when 32-bit.
11268
cb1be87e
DK
112692010-02-08 Doug Kwan <dougkwan@google.com>
11270
11271 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11272 method.
11273 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11274 Arm_relobj::scan_section_for_cortex_a8_stubs,
11275 Arm_relobj::do_relocation_section): Instead of calling
11276 Output_section::output_address, use faster
11277 Arm_relobj::simple_input_section_output_address.
11278
705b5121
DM
112792010-02-08 David S. Miller <davem@davemloft.net>
11280
11281 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11282 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11283 relocation helper function.
11284
024c4466
DM
11285 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11286 just like R_SPARC_GOT{10,13,22}.
11287 (Target_sparc::Scan::local): Likewise.
11288 (Target_sparc::Relocate:relocate): Likewise.
11289
9109c078
ILT
112902010-02-06 Ian Lance Taylor <iant@google.com>
11291
11292 * configure.ac: Rewrite targetobjs duplicate removal code to use
11293 only shell constructs.
11294 * configure: Rebuild.
11295
cf846138
DK
112962010-02-05 Doug Kwan <dougkwan@google.com>
11297
11298 PR 11247
11299 * arm.cc (Arm_relobj::section_is_scannable): New method.
11300 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11301 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11302
6cfaf60b
DK
113032010-02-04 Doug Kwan <dougkwan@google.com>
11304
11305 PR 11247
11306 * arm-reloc-property.cc (cstdio): Include.
11307 * configure.ac (targetobjs): Remove duplicates.
11308 * configure: Regenerate.
11309 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11310 big and little endian version for a given address size.
11311
5c57f1be
DK
113122010-02-03 Doug Kwan <dougkwan@google.com>
11313
11314 * arm-reloc-property.cc
11315 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11316 definition.
11317 * arm-reloc-property.h
11318 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11319 New method definition.
11320 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11321 declaration.
11322 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11323 overflow to N.
11324 (GOT_PREL): Change implemented to Y.
11325 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11326 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11327 (Arm_relocate_functions::movw_abs_nc): Remove method.
11328 (Arm_relocate_functions::movt_abs): Ditto.
11329 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11330 (Arm_relocate_functions::thm_movt_abs): Ditto.
11331 (Arm_relocate_functions::movw_rel_nc): Ditto.
11332 (Arm_relocate_functions::movw_rel): Ditto.
11333 (Arm_relocate_functions::movt_rel): Ditto.
11334 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11335 (Arm_relocate_functions:thm_movw_rel): Ditto.
11336 (Arm_relocate_functions:thm_movt_rel): Ditto.
11337 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11338 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11339 New method definitions.
11340 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11341 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11342 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11343 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11344 (Target_arm::Relocate::relocate): Check for non-static or
11345 unimplemented relocation code and exit early. Change calls to
11346 Target_arm::reloc_uses_thumb_bit and
11347 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11348 instead. Refactor code to handle similar relocations to increase
11349 code sharing. Remove check for unsupported relocation code in switch
11350 statement.
11351 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11352 relocation property table to find out size. Change error message to
11353 print out the name of a relocation code instead of the numeric value.
11354 (Target_arm::scan_reloc_for_stub): Use relocation property table
11355 instead of calling Target_arm::reloc_uses_thumb_bit().
11356
218c5831
DK
113572010-02-02 Doug Kwan <dougkwan@google.com>
11358
11359 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11360 types of relaxed input section.
11361
0d31c79d
DK
113622010-02-02 Doug Kwan <dougkwan@google.com>
11363
11364 * Makefile.am (HFILES): Add arm-reloc-property.h.
11365 (DEFFILES): New.
2e702c99
RM
11366 (TARGETSOURCES): Add arm-reloc-property.cc
11367 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11368 (libgold_a_SOURCES): $(DEFFILES)
11369 * Makefile.in: Regenerate.
11370 * arm-reloc-property.cc: New file.
11371 * arm-reloc-property.h: New file.
11372 * arm-reloc.def: New file.
11373 * arm.cc: Update comments.
11374 (arm-reloc-property.h): New included header.
11375 (arm_reloc_property_table): New global variable.
11376 (Target_arm::do_select_as_default_target): New method definition.
11377 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11378 arm-reloc-property to targ_extra_obj.
11379 * parameters.cc (set_parameters_target): Call
11380 Target::select_as_default_target().
11381 * target.h (Target::select_as_default_target): New method definition.
11382 (Target::do_select_as_default_target): Same.
11383
546c7457
DK
113842010-02-01 Doug Kwan <dougkwan@google.com>
11385
11386 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11387 first_output_text_section_.
11388 (Arm_exidx_fixup::first_output_text_section): New method definition.
11389 (Arm_exidx_fixup::first_output_text_section_): New data member.
11390 (Arm_exidx_fixup::process_exidx_section): Record the first text
11391 output section seen.
11392 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11393 and entsize in output section header.
11394
11b861d5
DK
113952010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11396
11397 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11398 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11399 (Arm_relocate_functions::thm_alu11): New Method.
11400 (Arm_relocate_functions::thm_pc8): New Method.
11401 (Arm_relocate_functions::thm_pc12): New Method.
11402 (Target_arm::Scan::local): Handle the relocations.
11403 (Target_arm::Scan::global): Likewise.
11404 (Target_arm::Relocate::relocate): Likewise.
11405 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11406
c9a2c125
DK
114072010-01-29 Doug Kwan <dougkwan@google.com>
11408
11409 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11410 of relocation types as ld.
11411
1521477a
DK
114122010-01-29 Doug Kwan <dougkwan@google.com>
11413
11414 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11415 to public.
11416 (Arm_relocate_functions::thumb_branch_common): Ditto.
11417 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11418 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11419 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11420 Arm_relocate_functions::jump24): Remove.
11421 (Target_arm::Relocate::relocate): Adjust code to call
11422 Arm_relocation_functions::arm_branch_common and
11423 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11424 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11425
e7eca48c
DK
114262010-01-29 Doug Kwan <dougkwan@google.com>
11427
11428 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11429 output_local_symbol_count_needs_update_.
11430 (Arm_relobj::output_local_symbol_count_needs_update,
11431 Arm_relobj::set_output_local_symbol_count_needs_update,
11432 Arm_relobj::update_output_local_symbol_count): New methods.
11433 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11434 member.
11435 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11436 of pointed function as in a R_ARM_PREL31 relocation.
11437 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11438 for output local symbol count updating.
11439 (Target_arm::do_relax): Update output local symbol counts in objects
11440 if necessary.
11441 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11442
02961d7e
ILT
114432010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11444
11445 * arm.cc: Added support for the ARM relocations:
11446 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11447 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11448 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11449 movw_prel_nc).
11450 (Arm_relocate_functions::movw_rel): New method.
11451 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11452 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11453 thm_movw_prel_nc).
11454 (Arm_relocate_functions::thm_movw_rel): New method.
11455 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11456 thm_movt_prel).
11457 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11458 relocations.
11459 (Target_arm::Scan::global): Likewise.
11460 (Target_arm::Relocate::relocate): Likewise.
11461 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11462 Likewise.
11463
b10d2873
ILT
114642010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11465
11466 * arm.cc: Added support for ARM group relocations.
11467 (Target_arm::reloc_needs_sym_origin): New method.
11468 (Arm_relocate_functions::calc_grp_kn): New method.
11469 (Arm_relocate_functions::calc_grp_residual): New method.
11470 (Arm_relocate_functions::calc_grp_gn): New method.
11471 (Arm_relocate_functions::arm_grp_alu): New Method.
11472 (Arm_relocate_functions::arm_grp_ldr): New Method.
11473 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11474 (Arm_relocate_functions::arm_grp_ldc): New Method.
11475 (Target_arm::Scan::local): Handle the ARM group relocations.
11476 (Target_arm::Scan::global): Likewise.
11477 (Target_arm::Relocate::relocate): Likewise.
11478 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11479 Likewise.
11480
2b328d4e
DK
114812010-01-26 Doug Kwan <dougkwan@google.com>
11482
11483 * arm.cc (set): Include.
11484 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11485 pointer type.
2e702c99 11486 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11487 (Arm_output_section::append_text_sections_to_list): New method.
11488 (Arm_output_section::fix_exidx_coverage): Ditto.
11489 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11490 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11491 Relobj::set_section_offset() instead of
11492 Sized_relobj::invalidate_section_offset().
2e702c99 11493 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11494 parameter for section headers. Ignore relocation sections for
11495 unallocated sections and EXIDX sections.
11496 (Target_arm::fix_exidx_coverage): New method.
11497 (Target_arm::output_section_address_less_than): New type.
11498 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11499 linked text section instead of the EXIDX section.
11500 (Arm_output_section::create_stub_group): Add an assertion to check
11501 that this is not an EXIDX output section.
11502 (Arm_output_section::append_text_sections_to_list): New method.
11503 (Arm_output_section::fix_exidx_coverage): Ditto.
11504 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11505 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11506 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11507 first pass.
11508 (Target_arm::fix_exidx_coverage): New method.
11509 * object.h (Relobj::set_output_section): New method.
11510 (Sized_relobj::invalidate_section_offset): Remove method.
11511 (Sized_relobj::do_invalidate_section_offset): Remove method.
11512 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11513
c7f3c371
DK
115142010-01-25 Doug Kwan <dougkwan@google.com>
11515
11516 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11517 Fix warning due to signed and unsigned comparison on a 32-bit host.
11518
8923b24c
DK
115192010-01-22 Doug Kwan <dougkwan@google.com>
11520
11521 * arm.cc (Target_arm::do_relax): Record an output section for section
11522 offset adjustment it contains any stub table that has changed.
11523 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11524 offsets in an output section if necessary.
11525 * output.cc (Output_section::Output_section): Initialize
11526 section_offsets_need_adjustments_.
11527 (Output_section::add_input_section_for_script): Renamed to
11528 Output_section::add_simple_input_section.
11529 (Output_section::save_states): Add a comment.
11530 (Output_section::discard_states): New method defintion.
11531 (Output_section::adjust_section_offsets): Same.
11532 * output.h (Output_section::add_input_section_for_script): Renamed to
11533 Output_section::add_simple_input_section.
11534 (Output_section::discard_states): New method declaration.
11535 (Output_section::adjust_section_offsets): Same.
11536 (Output_section::section_offsets_need_adjustment,
11537 Output_section::set_section_offsets_need_adjustment): New method
11538 definitions.
11539 (Output_section::section_offsets_need_adjustment_): New data member.
11540 * script-sections.cc
11541 (Output_section_element_input::set_section_address): Adjust code for
11542 renaming of Output_section::add_input_section_for_script.
11543 (Orphan_output_section::set_section_address): Same.
11544
9b2fd367
DK
115452010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11546
11547 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11548 Fix_v4bx enum values .
11549 * gold/options.h (General_options): New option definitions.
11550 (General_options::fix_v4bx): New method.
11551 (General_options::Fix_v4bx): New enum.
11552 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11553 (General_options::parse_fix_v4bx_interworking): New method.
11554
80d0d023
DK
115552010-01-22 Doug Kwan <dougkwan@google.com>
11556
11557 * arm.cc (Arm_exidx_fixup): New class.
11558
af2cdeae
DK
115592010-01-21 Doug Kwan <dougkwan@google.com>
11560
11561 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11562 classes.
11563 (Arm_exidx_section_offset_map): New type.
11564
993d07c1
DK
115652010-01-21 Doug Kwan <dougkwan@google.com>
11566
11567 * arm.cc (Arm_exidx_input_section): New class.
11568 (Arm_relobj::exidx_input_section_by_link,
11569 Arm_relobj::exidx_input_section_by_shndx,
11570 Arm_relobj::make_exidx_input_section): New methods.
11571 (read_arm_attributes_section): Remove.
11572 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11573 information about them.
11574 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11575 to here.
11576
5ac169d4
DK
115772010-01-20 Doug Kwan <dougkwan@google.com>
11578
11579 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11580 Input_section_specifier to Section_id.
11581 (Target_arm::new_arm_input_section: Adjust code for change of key
11582 type.
11583 (Target_arm::find_arm_input_section): Ditto.
11584 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11585 (Section_id): Remove.
11586 (Garbage_collection::Section_id_hash): Remove.
11587 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11588 (Section_id): Remove.
11589 (Icf::Section_id_hash): Remove.
11590 * object.h (Section_id, Const_section_id, Section_id_hash,
11591 Const_section_id_hash): New type definitions.
11592 * output.cc (Output_section::add_relaxed_input_section): Change to
11593 use Const_section_id instead of Input_section_specifier as key type.
11594 (Output_section::add_merge_input_section): Ditto.
11595 (Output_section::build_relaxation_map): Change to use Section_id
11596 instead of Input_section_specifier as key type.
2e702c99 11597 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11598 Ditto.
11599 (Output_section::convert_input_sections_to_relaxed_sections): Change
11600 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11601 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11602 (Output_section::find_relaxed_input_section): Ditto.
11603 * output.h (Input_section_specifier): Remove class.
11604 (Output_section::Output_section_data_by_input_section_map): Change
11605 key type to Const_section_id.
11606 (Output_section::Output_relaxed_input_section_by_input_section_map):
11607 Ditto.
11608 (Output_section::Relaxation_map): Change key type to Section_id.
11609
a2162063
ILT
116102010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11611
11612 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11613 (class Arm_v4bx_stub): New class.
11614 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11615 (Stub_factory::make_arm_v4bx_stub): New method.
11616 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11617 (Stub_table::empty): Handle v4bx stubs.
11618 (Stub_table::add_arm_v4bx_stub): New method.
11619 (Stub_table::find_arm_v4bx_stub): New method.
11620 (Arm_relocate_functions::v4bx): New method.
11621 (Target_arm::fix_v4bx): New method.
11622 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11623 (Stub_table::relocate_stubs): Likewise.
11624 (Stub_table::do_write): Likewise.
11625 (Stub_table::update_data_size_and_addralign): Likewise.
11626 (Stub_table::finalize_stubs): Likewise.
11627 (Target_arm::Scan::local): Likewise.
11628 (Target_arm::Scan::global): Likewise.
11629 (Target_arm::do_finalize_sections): Likewise.
11630 (Target_arm::Relocate::relocate): Likewise.
11631 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11632 Likewise.
11633 (Target_arm::scan_reloc_for_stub): Likewise.
11634 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11635
5696ab0b
ILT
116362010-01-19 Ian Lance Taylor <iant@google.com>
11637
11638 * output.cc (Output_section_headers::do_sized_write): Write large
11639 segment count to sh_info field.
11640 (Output_file_header::do_sized_write): For large segment count,
11641 write PN_XNUM to e_phnum field.
11642
800d0f56
ILT
116432010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11644
11645 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11646 (Arm_relocate_functions::thm_jump8): New function.
11647 (Arm_relocate_functions::thm_jump11): New function.
11648 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11649 R_ARM_THM_JUMP11.
11650 (Target_arm::Scan::global): Likewise.
11651 (Target_arm::Relocate::relocate): Likewise.
11652 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11653 Likewise.
11654
41263c05
DK
116552010-01-14 Doug Kwan <dougkwan@google.com>
11656
11657 * arm.cc (map, utility): Include headers.
11658 (Target_arm::apply_cortex_a8_workaround): New method.
11659 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11660 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11661 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11662 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11663 the --[no-]fix-cortex-a8 command line options.
11664 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11665 (Target_arm::relocate_stub): Use addend in instruction template.
11666 * options.h (DEFINE_bool): Set the user-set flag.
11667 (General_options): Add --[no-]-fix-cortex options.
11668 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11669 : Update fast look-up map after conversion.
41263c05 11670
459e9b03
ST
116712010-01-14 Sriraman Tallam <tmsriram@google.com>
11672
11673 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11674 in the first pass of do_layout.
11675
b521dfe4
DK
116762010-01-13 Doug Kwan <dougkwan@google.com>
11677
11678 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11679 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11680 apparent compiler problem of not folding static constant integral
11681 data members of elfcpp::Elf_sizes<32>.
11682
44272192
DK
116832010-01-13 Doug Kwan <dougkwan@google.com>
11684
11685 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11686 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11687 Arm_relobj::scan_section_for_cortex_a8_erratum,
11688 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11689 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11690 sections to scan for relocation stubs into a new method
11691 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11692 relocation and Cortex-A8 stub scanning.
11693 (Target_arm::do_relax): Force stubs to be after stubbed sections
11694 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11695 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11696 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11697
44b71ece
ILT
116982010-01-12 Ian Lance Taylor <iant@google.com>
11699
11700 * target-reloc.h (visibility_error): New inline function.
11701 (relocate_section): Call visibility_error.
11702 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11703 (MOSTLYCLEANFILES): Likewise.
11704 (protected_4_pic.o, protected_3.err): New targets.
11705 * testsuite/protected_4.cc: New file.
11706
a120bc7f
DK
117072010-01-12 Doug Kwan <dougkwan@google.com>
11708
11709 * arm.cc (Cortex_a8_reloc): New class.
11710 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11711 and cortex_a8_relocs_info_.
11712 (Target_arm::fix_cortex_a8): New method definition.
11713 (Target_arm::Cortex_a8_relocs_info): New type.
11714 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11715 New data member declarations.
11716 (Target_arm::scan_reloc_for_stub): Record information about
11717 relocations for THUMB branches that might be exempted from the
11718 Cortex-A8 workaround.
11719 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11720 at the beginning of a relaxation pass.
11721
20138696
DK
117222010-01-12 Doug Kwan <dougkwan@google.com>
11723
11724 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11725 (Arm_relobj::Mapping_symbol_position,
11726 Arm_reloj::Mapping_symbol_position_less,
11727 Arm_relobj::Mapping_symbols_info): New types.
11728 (Target_arm::is_mapping_symbol_name): New method definition.
11729 (Arm_relobj::do_count_local_symbols): Save information about mapping
11730 symbols.
11731
089d69dc
DK
117322010-01-11 Doug Kwan <dougkwan@google.com>
11733
11734 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11735 Arm_relocate_functions::thumb32_branch_upper,
11736 Arm_relocate_functions::thumb32_branch_lower,
11737 Arm_relocate_functions::thumb32_cond_branch_offset,
11738 Arm_relocate_functions::thumb32_cond_branch_upper,
11739 Arm_relocate_functions::thumb32_cond_branch_lower,
11740 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11741 branch offset encoding.
11742 (Arm_relocate_functions::thumb_branch_common): Use new branch
11743 offset encoding methods to avoid code duplication.
11744 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11745 (Stub_addend_reader::operator()): Use new branch encoding method
11746 to avoid code duplication.
11747
99e5bff2
DK
117482010-01-11 Doug Kwan <dougkwan@google.com>
11749
11750 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11751 (Target_arm::do_finalize_sections): Define special EXIDX section
11752 symbols only if referenced.
11753 * gc.h (Garbage_collection::add_reference): New method.
11754 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11755 code duplication.
11756
98e090bd
ILT
117572010-01-11 Ian Lance Taylor <iant@google.com>
11758
d0a91bd8
ILT
11759 * script.cc (Version_script_info::build_expression_list_lookup):
11760 Change complaing about duplicate wildcard match from error to
11761 warning.
11762
98e090bd
ILT
11763 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11764 of 2009-12-30.
11765 (Version_script_info::Version_script_info): Initialize globs_,
11766 default_version_, default_is_global_, and exact_. Don't
11767 initialize globals_ or locals_.
11768 (Version_script_info::build_lookup_tables): Build local symbols
11769 first.
11770 (Version_script_info::unquote): New function.
11771 (Version_script_info::add_exact_match): New function.
11772 (Version_script_info::build_expression_list_lookup): Remove lookup
11773 parameter. Add is_global parameter. Change all callers. Handle
11774 wildcard pattern specially. Unquote pattern. Call
11775 add_exact_match.
11776 (Version_script_info::get_name_to_match): New function.
11777 (Version_script_info::get_symbol_version): New function.
11778 (Version_script_info::get_symbol_version_helper): Remove.
11779 (Version_script_info::check_unmatched_names): Call unquote.
11780 * script.h (class Version_script_info): Change get_symbol_version
11781 to be non-inline and add is_global parameter; change all callers.
11782 Rewrite symbol_is_local. Update declarations. Define struct
11783 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11784 Remove globals_ and locals_ members. Add exact_, globs_,
11785 default_version_, is_global_.
11786 (Version_script_info::Glob): Remove pattern, add expression and
11787 is_global. Update constructor. Change all callers.
11788 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11789 default version.
11790 (Versions::symbol_section_contents): If a symbol is undefined, or
11791 defined in a dynamic object, set the version index to
11792 VER_NDX_LOCAL.
11793 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11794 symbol_is_local.
11795 (Symbol_table::add_from_pluginobj): Likewise.
11796 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11797
d56962d3
DK
117982010-01-11 Doug Kwan <dougkwan@google.com>
11799
11800 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11801 (incremental_dump_LDADD): Add linking option for libintl.
11802 * Makefile.in: Regenerate.
11803
94e6ee91
L
118042010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11805
11806 PR gold/11144
11807 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11808 instead of -Ds.
11809 * testsuite/Makefile.in: Regenerated.
11810
e96c574b
DK
118112010-01-10 Doug Kwan <dougkwan@google.com>
11812
11813 * options.h (DEFINE_var): Use parentheses around argument varname__
11814 in macro body to avoid any unintended subsequent substitutions.
11815
7198066b
ILT
118162010-01-10 Ian Lance Taylor <iant@google.com>
11817
ba4d53bf
ILT
11818 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11819 candidates before doing symbol resolution.
11820
7198066b
ILT
11821 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11822 ODR candidates if only one is weak.
11823
a2beed37
ILT
118242010-01-08 Ian Lance Taylor <iant@google.com>
11825
11826 * script.cc (Version_script_info::build_expression_list_lookup):
11827 Don't warn about ambiguous version, just record the ambiguity.
11828 (Version_script_info::get_symbol_version_helper): Give error if
11829 version is ambiguous.
11830
2fb7225c
DK
118312010-01-08 Doug Kwan <dougkwan@google.com>
11832
11833 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11834 prev_data_size_ and prev_addralign_. Remove initializer for
11835 deleted data member has_been_changed_.
11836 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11837 to determine if the table is empty.
11838 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11839 Remove.
11840 (Stub_table::add_reloc_stub): Define method in class definition
11841 instead of just declaring it there.
11842 (Stub_table::add_cortex_a8_stub): New method definition.
11843 (Stub_table::update_data_size_and_addralign): Ditto.
11844 (Stub_table::finalize_stubs): Ditto.
11845 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11846 (Stub_table::do_addralign_): Return address alignment in the
11847 (Stub_table::do_reset_address_and_file_offset): Define method in
11848 class definition instead of declaring it there. Set current data
11849 size to be the data size of the previous pass.
11850 (Stub_table::set_final_data_size): Use current data size as the
11851 final data size.
11852 (Stub_table::relocate_stub): Change parameter type of stub from
11853 Reloc_stub pointer to Stub pointer.
11854 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11855 (Stub_table::Cortex_a8_stub_list): New typedef.
11856 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11857 Stub_table::prev_addralign_): New data member.
11858 (Arm_relobj::Arm_relobj): Initialize data member
11859 section_has_cortex_a8_workaround_.
11860 (Arm_relobj::section_has_cortex_a8_workaround,
11861 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11862 definitions.
11863 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11864 declarations.
11865 (Target_arm::relocate_stub): Change parameter type of stub from
11866 Reloc_stub pointer to Stub pointer.
11867 (Insn_template::size, Insn_template::alignment): Handle
11868 THUMB16_SPECIAL_TYPE.
11869 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11870 Stub_table::update_data_size_and_addralign,
11871 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11872 definitions.
11873 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11874 (Stub_table::do_write): Ditto.
11875 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11876
880cd20d
ILT
118772010-01-08 Ian Lance Taylor <iant@google.com>
11878
11879 PR 11108
11880 * symtab.h (class Symbol): Remove fields is_target_special_ and
11881 has_plt_offset_. Add field is_defined_in_discarded_section_.
11882 (Symbol::is_defined_in_discarded_section): New function.
11883 (Symbol::set_is_defined_in_discarded_section): New function.
11884 (Symbol::has_plt_offset): Rewrite.
11885 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11886 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11887 Don't initialize is_target_special_ or has_plt_offset_.
11888 Initialize is_defined_in_discarded_section_.
11889 (Symbol_table::add_from_relobj): If appropriate, set
11890 is_defined_in_discarded_section.
11891 * resolve.cc (Symbol::override_base_with_special): Don't test
11892 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11893 * target-reloc.h (relocate_section): Do special handling for
11894 symbols defined in discarded sections for global symbols as well
11895 as local symbols.
11896
2703e3eb
ILT
118972010-01-08 Ian Lance Taylor <iant@google.com>
11898
11899 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11900 the SHT_SYMTAB case.
11901
339d40a3
ILT
119022010-01-08 Ian Lance Taylor <iant@google.com>
11903
11904 * object.cc (Sized_relobj::do_layout): Don't get confused if
11905 layout_eh_frame returns NULL.
11906
abecea76
ILT
119072010-01-08 Ian Lance Taylor <iant@google.com>
11908
11909 PR 11084
11910 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11911 dynamic symbol table, use the normal symbol table.
11912 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11913 symbol table.
11914
6b7dd3f3
ILT
119152010-01-08 Ian Lance Taylor <iant@google.com>
11916
11917 PR 11072
11918 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11919 sections.
11920
36c50e63
L
119212010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11922
11923 * version.cc (print_version): Change to "Copyright 2010".
11924
e291e7b9
ILT
119252010-01-08 Ian Lance Taylor <iant@google.com>
11926
11927 PR 10287
11928 PR 11063
11929 * i386.cc (class Target_i386): Change return type of plt_section
11930 to be non-const.
11931 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11932 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11933 tls_desc_rel_ field.
11934 (Output_data_plt_i386::rel_tls_desc): New function.
11935 (Target_i386::rel_tls_desc_section): New function.
11936 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11937 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11938 R_386_TLS_DESC reloc in rel_tls_desc_section.
11939 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11940 Define struct Tlsdesc_info.
11941 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11942 (Target_x86_64::do_reloc_symbol_index): New function.
11943 (Target_x86_64::add_tlsdesc_info): New function.
11944 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11945 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11946 tlsdesc_rel_ field.
11947 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11948 all callers.
11949 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11950 (Target_x86_64::rela_tlsdesc_section): New function.
11951 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11952 handling.
11953 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11954 (Target_x86_64::do_reloc_addend): New function.
11955 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11956 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11957 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11958 (Output_reloc::type): New function.
11959 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11960 (Output_reloc::is_target_specific): New function.
11961 (Output_reloc::target_arg): New function.
11962 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11963 absolute relocs and target specific relocs.
11964 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11965 add_target_specific.
11966 (class Output_data_reloc) [SHT_RELA]: Likewise.
11967 * output.cc (Output_reloc::Output_reloc): Add four new versions
11968 for absolute relocs and target specific relocs.
11969 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11970 (Output_reloc::get_symbol_index): Likewise.
11971 (Output_reloc::local_section_offset): Check that local_sym_index_
11972 is not TARGET_CODE or 0.
11973 (Output_reloc::symbol_value): Likewise.
11974 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11975 reloc.
11976 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11977 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11978 functions.
11979 * layout.cc (add_target_dynamic_tags): Use output section for
11980 DT_PLTRELSZ and DT_JMPREL.
11981
3a44184e
ILT
119822010-01-07 Ian Lance Taylor <iant@google.com>
11983
11984 PR 11061
11985 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11986 function.
11987 (class Output_data_reloc_generic): Define.
11988 (class Output_data_reloc_base): Change base class to
11989 Output_data_reloc_generic. Change add() method to call
11990 bump_relative_reloc_count for a relative reloc. Remove
11991 sort_relocs_ field.
11992 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11993 to sort_relocs().
11994 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11995 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11996 appropriate.
11997 * layout.h (class Layout): Update declaration.
11998
ea715a34
ILT
119992010-01-07 Ian Lance Taylor <iant@google.com>
12000
12001 * output.h (class Output_data): Add const version of
12002 output_section and do_output_section.
12003 (class Output_section_data): Add const version of
12004 do_output_section.
12005 (class Output_section): Likewise.
12006 * layout.cc (Layout::add_target_dynamic_tags): New function.
12007 * layout.h (class Layout): Update declarations.
12008 * arm.cc (Target_arm::do_finalize_sections): Use
12009 add_target_dynamic_tags.
12010 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12011 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12012 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12013 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12014
659948a4
ILT
120152010-01-07 Ian Lance Taylor <iant@google.com>
12016
12017 PR 11042
12018 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12019 object as needed.
12020
9d3b86f6
ILT
120212010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12022 Ian Lance Taylor <iant@google.com>
12023
12024 PR 11019
12025 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12026 Xindex::read_symtab_xindex.
12027
bb0d3eb0
DK
120282010-01-07 Doug Kwan <dougkwan@google.com>
12029
12030 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12031 (Insn_template::thumb16_bcond_insn): New method declaration.
12032 (Insn_template): Fix spelling.
12033 (Stub::thumb16_special): New method declaration.
12034 (Stub::do_write): Define virtual method which was previously pure
12035 virtual.
12036 (Stub::do_thumb16_special): New method declaration.
12037 (Stub::do_fixed_endian_write): New template member.
12038 (Reloc_stub::do_write): Remove.
12039 (Reloc_stub::do_fixed_endian_write): Remove.
12040 (Cortex_a8_stub): New class definition.
12041 (Stub_factory::make_cortex_a8_stub): New method definition.
12042 (Stub_factory::Stub_factory): Add missing static storage class
12043 qualifier for elf32_arm_stub_a8_veneer_blx.
12044
ffeef7df
ILT
120452010-01-07 Ian Lance Taylor <iant@google.com>
12046
dc3f80fe
ILT
12047 PR 10980
12048 * options.h (class General_options): Add --warn-unresolved-symbols
12049 and --error-unresolved-symbols.
12050 * errors.cc (Errors::undefined_symbol): Implement
12051 --warn-unresolved-symbols.
12052
ffeef7df
ILT
12053 * options.h (class General_options): Add -z text and -z textoff.
12054 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12055
f1ec9ded
ST
120562010-01-06 Sriraman Tallam <tmsriram@google.com>
12057
12058 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12059 (Garbage_collection::cident_sections): New function.
12060 (Garbage_collection::add_cident_section): New function.
12061 (Garbage_collection::cident_sections_): New member.
12062 (gc_process_relocs): Add references to sections whose names are C
12063 identifiers.
12064 * gold.h (cident_section_start_prefix): New constant.
12065 (cident_section_stop_prefix): New constant.
12066 (is_cident): New function.
12067 * layout.cc (Layout::define_section_symbols): Replace string constants
12068 with the newly defined constants.
12069 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12070 C identifiers.
12071 * testsuite/Makefile.am: Add gc_orphan_section_test.
12072 * testsuite/Makefile.in: Regenerate.
12073 * testsuite/gc_orphan_section_test.cc: New file.
12074 * testsuite/gc_orphan_section_test.sh: New file.
12075
6eda8c29
ILT
120762010-01-06 Ian Lance Taylor <iant@google.com>
12077
b9674e17
ILT
12078 PR 10980
12079 * options.h (class General_options): Add --warn-shared-textrel.
12080 * layout.cc (Layout::finish_dynamic_section): Implement
12081 --warn-shared-textrel.
12082
6eda8c29
ILT
12083 PR 10980
12084 * options.h (class General_options): Add --warn-multiple-gp.
12085
32dcd44e
ILT
120862010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12087
12088 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12089 $(THREADSLIB) and $(LIBDL).
12090 * Makefile.in: Rebuild.
12091
a192ba05
ILT
120922010-01-06 Ian Lance Taylor <iant@google.com>
12093
12094 PR 10980
12095 * options.cc (General_options::parse_section_start): New function.
12096 (General_options::section_start): New function.
12097 (General_options::General_options): Initialize all members.
12098 * options.h: Include <map>
12099 (class General_options): Add --section-start. Add section_starts_
12100 member.
12101 * layout.cc (Layout::attach_allocated_section_to_segment): If
12102 --section-start was used, set the address of the segment. Remove
12103 local sort_sections.
12104 (Layout::relaxation_loop_body): If the address of the load segment
12105 has been set by --section-start, don't use it.
12106 * output.h (Output_segment::update_flags_for_output_section): New
12107 function.
12108 * output.cc (Output_segment::add_output_section): Call
12109 update_flags_for_output_section.
12110
dde3f402
ILT
121112010-01-05 Ian Lance Taylor <iant@google.com>
12112
62dfdd4d
ILT
12113 PR 10980
12114 * options.h (class General_options): Add --undefined-version.
12115 * script.cc (struct Version_expression): Add was_matched_by_symbol
12116 field.
12117 (Version_script_info::matched_symbol): New function.
12118 (Version_script_info::get_symbol_version_helper): Call
12119 matched_symbol.
12120 (Version_script_info::check_unmatched_names): New function.
12121 * script.h (class Version_script_info): Update declarations.
12122 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12123
9c4ae156
ILT
12124 * options.h (class General_options): Use DEFINE_bool_alias for
12125 allow_multiple_definition.
12126 * resolve.cc (Symbol_table::should_override): Don't test
12127 allow_multiple_definition.
12128
dde3f402
ILT
12129 PR 10980
12130 * options.h (class General_options): Add --cref.
12131 * main.cc (main): Print cref table if --cref. Don't close mapfile
12132 until after printing cref table.
12133 * cref.cc: Include "symtab.h".
12134 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12135 (Cref_table_compare::operator()): New function.
12136 (Cref_inputs::gather_cref): New function.
12137 (filecol): New static const.
12138 (Cref_inputs::print_cref): New function.
12139 (Cref::print_cref): New function.
12140 * cref.h: Include <cstdio>.
12141 (class Cref): Update declarations.
12142 * mapfile.h (Mapfile::file): New function.
12143 * object.h (class Object): Define Symbols. Declare virtual
12144 do_get_global_symbols.
12145 (Object::get_global_symbols): New function.
12146 * object.cc (Input_objects::add_object): Pass object to cref_ if
12147 --cref.
12148 (Input_objects::archive_start): Likewise.
12149 (Input_objects::archive_stop): Likewise.
12150 (Input_objects::print_cref): New function.
12151 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12152 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12153 --cref.
12154 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12155 function.
12156 * plugin.h (class Sized_pluginobj): Update declarations.
12157
8781f709
ILT
121582010-01-05 Ian Lance Taylor <iant@google.com>
12159
12160 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12161 to is_default_version. Rename insdef to insdefault.
12162 (Symbol_table::add_from_relobj): Rename def to is_default_version
12163 and local to is_forced_local.
12164 (Symbol_table::add_from_pluginobj): Likewise.
12165 (Symbol_table::add_from_dynobj): Likewise.
12166 (Symbol_table::define_special_symbol): Rename insdef to
12167 insdefault.
12168
fe35d28d
ILT
121692010-01-04 Ian Lance Taylor <iant@google.com>
12170
30bc8c46
ILT
12171 PR 10980
12172 * options.h (class General_options): Add
12173 --allow-multiple-definition and -z muldefs.
12174 * resolve.cc (Symbol_table::should_override): Don't warn about a
12175 multiple symbol definition if --allow-multiple-definition or -z
12176 muldefs.
12177
7eaea549
ILT
12178 PR 10980
12179 * options.h (class General_options): Add --add-needed and
12180 --copy-dt-needed-entries. Tweak --as-needed help entry.
12181 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12182 error if --copy-dt-needed-entries aka --add-needed is used and
12183 would cause a change in behaviour.
12184
fe35d28d
ILT
12185 PR 10980
12186 * options.h (class General_options): Add -G as a short version of
12187 --shared. Add no-op options -assert, -g, and -i.
12188
55a2bb35
ST
121892010-01-04 Sriraman Tallam <tmsriram@google.com>
12190
12191 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12192 check for .text or .gnu.linkonce.t sections.
12193 * icf.cc (Icf::find_identical_sections): Ditto.
12194 Change the detection for mangled function name within the section
12195 name.
12196 * icf.h (is_section_foldable_candidate): New function.
12197
719328e1
ILT
121982009-12-30 Ian Lance Taylor <iant@google.com>
12199
12200 PR 10980
12201 * options.h (class General_options): Permit two dashes with
12202 --retain-symbols-file.
12203
d7bb5745
ILT
122042009-12-30 Ian Lance Taylor <iant@google.com>
12205
403a15dd
ILT
12206 PR 10979
12207 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12208 don't put the file header and segment headers in the text
12209 segment.
12210
eda294df
ILT
12211 PR 10979
12212 * common.cc (Sort_commons::operator()): Stabilize sort when both
12213 entries are NULL.
12214 (Symbol_table::do_allocate_commons_list): When allocating common
12215 symbols, skip a symbol which is no longer common.
12216 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12217 an object before checking its type.
12218 * testsuite/common_test_2.c: New file.
12219 * testsuite/common_test_3.c: New file.
12220 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12221 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12222 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12223 (common_test_2_pic.o, common_test_2.so): New targets.
12224 (common_test_3_pic.o, common_test_3.so): New targets.
12225 * testsuite/Makefile.in: Rebuild.
12226
d7bb5745
ILT
12227 PR 10979
12228 * script.cc (read_input_script): If we see a new SECTIONS clause,
12229 and we have added an input section, give an error.
12230 * layout.h (class Layout): Add have_added_input_section function.
12231 Add have_added_input_section_ field.
12232 * layout.cc (Layout::Layout): Initialize
12233 have_added_input_section_.
12234 (Layout::layout): Set have_added_input_section_.
12235 (Layout::layout_eh_frame): Likewise.
12236
fc59c572
ILT
122372009-12-30 Ian Lance Taylor <iant@google.com>
12238
12239 PR 10931
12240 * options.h (class General_options): Add --sort-common option.
12241 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12242 * common.cc (Sort_common): Add sort_order parameter to
12243 constructor. Add sort_order_ field.
12244 (Sort_commons::operator): Check sort_order_.
12245 (Symbol_table::allocate_commons): Determine the sort order.
12246 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12247 Change all callers.
12248 (Symbol_table::do_allocate_commons_list): Likewise.
12249
1c74fab0
ILT
122502009-12-30 Ian Lance Taylor <iant@google.com>
12251
12252 PR 10916
12253 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12254 symbols from this object, don't change the visibility of an
12255 undefined symbol.
12256 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12257
6affe781
ILT
122582009-12-30 Ian Lance Taylor <iant@google.com>
12259
12260 PR 10861
12261 * script.h (class Version_script_info): Define Language enum.
12262 Update declarations. Define Glob, Exact, and Lookup types. Add
12263 new fields globals_, locals_, and is_finalized_.
12264 * script.cc: Various formatting fixes.
12265 (class Parser_closure): Change language_stack_ from a vector of
12266 std::string to one of Version_script_info::Language. Adjust all
12267 uses accordingly.
12268 (class Lazy_demangler): Remove.
12269 (struct Version_expression): Change language from std::string to
12270 Version_script_info::Language.
12271 (Version_script_info::Version_script_info): New function.
12272 (Version_script_info::~Version_script_info): Don't call clear.
12273 (Version_script_info::finalize): New function.
12274 (Version_script_info::build_lookup_tables): New function.
12275 (Version_script_info::build_expression_list_lookup): New
12276 function.
12277 (Version_script_info::get_symbol_version_helper): Rewrite to use
12278 lookup tables.
12279 (Version_script_info::print_expression_list): Adjust to use
12280 Version_script_info::Language.
12281 (script_push_lex_into_version_mode): Check that the version script
12282 has not been finalized.
12283 (version_script_push_lang): Change language string to
12284 Version_script_info::Language.
12285 * options.cc (Command_line::version_script): New function.
12286 * options.h (class General_options): Add finalize_dynamic_list
12287 function. Change version_script from declaration to definition.
12288 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12289 * testsuite/version_script.map: Remove duplicate def of foo.
12290 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12291 version_script.map.
12292 * testsuite/Makefile.in: Rebuild.
12293
818bf354
ILT
122942009-12-30 Ian Lance Taylor <iant@google.com>
12295
12296 PR 10843
12297 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12298 if the input symbol index is 0, make the output symbol index 0.
12299
ebcc8304
ILT
123002009-12-30 Ian Lance Taylor <iant@google.com>
12301
12302 PR 10670
12303 * options.h (class General_options): Add -x/--discard-all.
12304 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12305 --discard-all. If the local symbol needs a dynamic entry, check
12306 that before handling --discard-locals.
12307
176fe33f
ILT
123082009-12-30 Ian Lance Taylor <iant@google.com>
12309
bb321bb1
ILT
12310 PR 10450
12311 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12312 flags to PF_R.
12313 (Output_segment::add_output_section): Don't change the flags if
12314 the type is PT_TLS.
12315
176fe33f
ILT
12316 PR 10450
12317 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12318 GNU hash table if they need a dynamic value. Otherwise, don't add
12319 them if they are defined in a dynamic object or are forced local.
12320
e8cd95c7
ILT
123212009-12-29 Ian Lance Taylor <iant@google.com>
12322
1b81fb71
ILT
12323 PR 10450
12324 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12325 .gnu.hash table for a 32-bit target.
12326
8d6d383d
ILT
12327 PR 10450
12328 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12329 regular and a dynamic object only needs a dynamic symbol table
12330 entry if it is externally visible.
12331
e785ec03
ILT
12332 PR 10450
12333 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12334 constructor. Add global_offset_table_ field.
12335 (Target_i386::got_section): Set global_offset_table_.
12336 (Target_i386::do_finalize_sections): Set global_offset_table_
12337 size.
12338 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12339 in constructor. Add global_offset_table_ field.
12340 (Target_x86_64::got_section): Set global_offset_table_.
12341 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12342 size.
12343
1a2dff53
ILT
12344 * layout.cc (Layout::Layout): Initialize increase_relro_.
12345 (Layout::get_output_section): Add is_relro, is_last_relro, and
12346 is_first_non_relro parameters. Change all callers.
12347 (Layout::choose_output_section): Likewise.
12348 (Layout::add_output_section_data): Likewise.
12349 (Layout::make_output_section): Likewise.
12350 (Layout::set_segment_offsets): Clear increase_relro when using a
12351 linker script.
12352 * layout.h (class Layout): Add increase_relro method. Add
12353 increase_relro_ field. Update declarations.
12354 * output.cc (Output_section::Output_section): Initialize
12355 is_last_relro_ and is_first_non_relro_.
12356 (Output_segment::add_output_section): Group relro sections is
12357 do_sort is true. Handle is_last_relro and is_first_non_relro.
12358 (Output_segment::maximum_alignment): Remove relro handling.
12359 (Output_segment::set_section_addresses): Add increase_relro
12360 parameter. Change all callers. Add initial alignment to align
12361 relro sections on separate page. Remove old relro handling.
12362 (Output_segment::set_section_list_addresses): Remove in_relro
12363 parameter. Change all callers.
12364 (Output_segment::set_offset): Add increase parameter. Change all
12365 callers. Remove old relro handling.
12366 * output.h (class Output_section): Add new methods: is_last_relro,
12367 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12368 Add is_last_relro_ and is_first_non_relro_ fields.
12369 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12370 Create separate .got.plt section. Call increase_relro.
12371 * x86_64.cc (Target_x86_64::got_section): Likewise.
12372 * testsuite/relro_script_test.t: Add .got.plt.
12373
f0ba79e2
ILT
12374 PR 10450
12375 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12376 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12377 (Layout::finalize): Call set_dynamic_symbol_size.
12378 (Layout::set_dynamic_symbol_size): New function.
12379 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12380 set_dynamic_symbol_size.
12381
e8cd95c7
ILT
12382 PR 10450
12383 * output.h (class Output_section): Add is_entsize_zero_ field.
12384 * output.cc (Output_section::Output_section): Initialize
12385 is_entsize_zero_.
12386 (Output_section::set_entsize): If two different entsizes are
12387 requested, force it to zero.
12388 (Output_section::add_input_section): Set flags for .debug_str
12389 before updating section flags. Set entsize.
12390 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12391 and SHF_STRING if all input sections have those flags.
12392
3e1b9a8a
RÁE
123932009-12-29 Rafael Espindola <espindola@google.com>
12394
12395 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12396 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12397 reporting.
3e1b9a8a 12398
3dcad376
ST
123992009-12-29 Sriraman Tallam <tmsriram@google.com>
12400
12401 * options.cc (General_options::parse_version): Allow -v to exit
12402 without an error if there is nothing to link.
12403
084e2665
ILT
124042009-12-29 Ian Lance Taylor <iant@google.com>
12405
12406 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12407 using a version of gcc before 4.1.
12408 * configure: Rebuild.
12409
250acde3
CD
124102009-12-28 Chris Demetriou <cgd@google.com>
12411
12412 * attributes.cc (Output_attributes_section_data::do_write): Use
12413 std::vector::front rather than std::vector::data.
12414
99fff23b
ILT
124152009-12-28 Ian Lance Taylor <iant@google.com>
12416
12417 * symtab.h (class Symbol_table): Add enum Defined.
12418 * resolve.cc (Symbol_table::should_override): Add defined
12419 parameter. Change all callers. Test whether object is NULL
12420 before calling a method on it.
12421 (Symbol_table::report_resolve_problem): Add defined parameter.
12422 Change all callers.
12423 (Symbol_table::should_override_with_special): Likewise.
12424 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12425 parameter. Change all callers.
12426 (Symbol_table::do_define_in_output_data): Likewise.
12427 (Symbol_table::define_in_output_segment): Likewise.
12428 (Symbol_table::do_define_in_output_segment): Likewise.
12429 (Symbol_table::define_as_constant): Likewise.
12430 (Symbol_table::do_define_as_constant): Likewise.
12431 * script.h (class Symbol_assignment): Add is_defsym parameter to
12432 constructor; change all callers.
12433 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12434 parameter. Change all callers. Add is_defsym_ field.
12435 (class Parser_closure): Add parsing_defsym parameter to
12436 constructor; change all callers. Add parsing_defsym accessor
12437 function. Add parsing_defsym_ field.
12438
556bd683
ILT
124392009-12-28 Ian Lance Taylor <iant@google.com>
12440
12441 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12442 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12443
1782c879
ILT
124442009-12-23 Ian Lance Taylor <iant@google.com>
12445
12446 * i386.cc (Target_i386::do_calls_non_split): Recognize
12447 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12448 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12449 -fsplit-stack prologue when using %r11.
1782c879 12450
329ca2b1
ST
124512009-12-21 Sriraman Tallam <tmsriram@google.com>
12452
12453 * options.cc (General_options::parse_version): Make -v continue and do
12454 the link like GNU ld does.
12455
d675ff46
RÁE
124562009-12-17 Rafael Avila de Espindola <espindola@google.com>
12457
12458 * Makefile.am (CCFILES): Add timer.cc.
12459 (HFILES): Add timer.h.
12460 * configure.ac: Check for sysconf and times.
12461 * main.cc: include timer.h.
12462 (main): Use Timer instead of get_run_time.
12463 * timer.cc: New.
12464 * timer.h: New.
12465 * workqueue.cc: include timer.h.
12466 (Workqueue::find_and_run_task):
12467 Report user, sys and wall time.
12468 * Makefile.in: Regenerate.
12469 * config.in: Regenerate.
12470 * configure: Regenerate.
12471
d6344fb5
DK
124722009-12-16 Doug Kwan <dougkwan@google.com>
12473
12474 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12475 sections.
12476 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12477 relaxed input sections.
12478 * output.cc (Output_section::find_relaxed_input_section): Change
12479 return type to Output_relaxed_input_section pointer. Adjust code
12480 for new type of relaxed_input_section_map_.
12481 * output.h (Output_section::find_relaxed_input_section): Change
12482 return type to Output_relaxed_input_section pointer.
12483 (Output_section::Output_relaxed_input_section_by_input_section_map):
12484 New type.
12485 (Output_section::relaxed_input_section_map_): Change type to
12486 Output_section::Output_relaxed_input_section_by_input_section_map.
12487 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12488 input section.
12489
0e0d5469
ILT
124902009-12-15 Ian Lance Taylor <iant@google.com>
12491
12492 * layout.cc (Layout::create_shstrtab): Only write out after input
12493 sections if we are compressing debug sections.
12494
0649a889
ILT
124952009-12-15 Ian Lance Taylor <iant@google.com>
12496
12497 * archive.cc (Archive::add_symbols): Only look up a symbol without
12498 a version if there is, in fact, a version.
12499
2ea97941
ILT
125002009-12-14 Ian Lance Taylor <iant@google.com>
12501
12502 Revert -Wshadow changes, all changes from:
12503 2009-12-11 Doug Kwan <dougkwan@google.com>
12504 2009-12-11 Nick Clifton <nickc@redhat.com>
12505 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12506
b0eec2cc
DK
125072009-12-11 Doug Kwan <dougkwan@google.com>
12508
12509 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12510 due to -Wshadow.
12511 * attributes.cc (Object_attribute::size): Ditto.
12512 (Attributes_section_data::size): Ditto.
12513 (Attributes_section_data::Attributes_section_data): Ditto.
12514 (Output_attributes_section_data::do_write): Ditto.
12515 * attributes.h (Object_attribute::set_type): Ditto.
12516 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12517
91d6fa6a
NC
125182009-12-11 Nick Clifton <nickc@redhat.com>
12519
12520 * archive.cc: Fix shadowed variable warnings.
12521 * arm.cc: Likewise.
12522 * compressed_output.cc: Likewise.
12523 * compressed_output.h: Likewise.
12524 * configure: Likewise.
12525 * dwarf_reader.cc: Likewise.
12526 * dynobj.cc: Likewise.
12527 * dynobj.h: Likewise.
12528 * ehframe.cc: Likewise.
12529 * ehframe.h: Likewise.
12530 * errors.cc: Likewise.
12531 * expression.cc: Likewise.
12532 * fileread.cc: Likewise.
12533 * fileread.h: Likewise.
12534 * freebsd.h: Likewise.
12535 * i386.cc: Likewise.
12536 * icf.cc: Likewise.
12537 * incremental.h: Likewise.
12538 * layout.cc: Likewise.
12539 * layout.h: Likewise.
12540 * mapfile.cc: Likewise.
12541 * merge.cc: Likewise.
12542 * merge.h: Likewise.
12543 * object.cc: Likewise.
12544 * object.h: Likewise.
12545 * options.h: Likewise.
12546 * output.cc: Likewise.
12547 * output.h: Likewise.
12548 * parameters.cc: Likewise.
12549 * plugin.cc: Likewise.
12550 * powerpc.cc: Likewise.
12551 * reduced_debug_output.cc: Likewise.
12552 * reduced_debug_output.h: Likewise.
12553 * reloc.cc: Likewise.
12554 * reloc.h: Likewise.
12555 * resolve.cc: Likewise.
12556 * script-sections.cc: Likewise.
12557 * script.cc: Likewise.
12558 * script.h: Likewise.
12559 * sparc.cc: Likewise.
12560 * symtab.cc: Likewise.
12561 * symtab.h: Likewise.
12562 * target-select.cc: Likewise.
12563 * target-select.h: Likewise.
12564 * token.h: Likewise.
12565 * workqueue.cc: Likewise.
12566 * workqueue.h: Likewise.
12567 * x86_64.cc: Likewise.
12568
a0351a69
DK
125692009-12-10 Doug Kwan <dougkwan@google.com>
12570
12571 * arm.cc (attributes.h): New include.
12572 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12573 (Arm_relobj::~Arm_relobj): Delete object pointed by
12574 attributes_section_data_.
12575 (Arm_relobj::attributes_section_data): New method definition.
12576 (Arm_relobj::attributes_section_data_): New data member declaration.
12577 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12578 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12579 attributes_section_data_.
12580 (Arm_dynobj::attributes_section_data): New method definition.
12581 (Arm_dynobj::attributes_section_data_): New data member declaration.
12582 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12583 initialization value of may_use_blx_ to false.
2e702c99 12584 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12585 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12586 object attributes to compute results instead of hard-coding.
12587 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12588 Target_arm::get_secondary_compatible_arch,
12589 Target_arm::set_secondary_compatible_arch
12590 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12591 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12592 New method declarations.
12593 (Target_arm::get_aeabi_object_attribute): New method definition.
12594 (Target_arm::attributes_section_data_): New data member declaration.
12595 (read_arm_attributes_section): New template definition.
12596 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12597 (Arm_dynobj::do_read_symbols): Ditto.
12598 (Target_arm::do_finalize_sections): Merge attributes sections from
12599 input. Check for BLX use after attributes section merging.
12600 Fix __exidx_start and __exidx_end visibility. Create an
12601 .ARM.attributes section if necessary.
12602 (Target_arm::get_secondary_compatible_arch,
12603 Target_arm::set_secondary_compatible_arch,
12604 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12605 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12606 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12607 New method definitions.
12608
b59befec
ILT
126092009-12-09 Ian Lance Taylor <iant@google.com>
12610
12611 * plugin.cc (Plugin::load): Don't cast from void* to a function
12612 pointer.
12613
1276bc89
ILT
126142009-12-09 Ian Lance Taylor <iant@google.com>
12615
12616 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12617 information fields.
12618
2f2de248
L
126192009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12620
12621 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12622 Replace two_file_shared_1.so with two_file_shared_2.so.
12623 * testsuite/Makefile.in: Regenerated.
12624
4f787271
DK
126252009-12-08 Doug Kwan <dougkwan@google.com>
12626
12627 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12628 (HFILES): Add attributes.h and int_encoding.h.
12629 * Makefile.in: Regenerate.
12630 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12631 function definitions to int_encoding.cc
12632 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12633 prototypes to int_encoding.h
12634 * reduced_debug_output.cc (int_encoding.h): New include.
12635 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12636 function definitions to int_encoding.cc
12637 (insert_into_vector, read_from_pointer): Move template definitions to
12638 int_encoding.h
12639 * attributes.cc: New file.
12640 * attributes.h: New file.
12641 * int_encoding.cc: New file.
12642 * int_encoding.h: New file.
12643
20b52f1a
RÁE
126442009-12-07 Rafael Avila de Espindola <espindola@google.com>
12645
12646 PR gold/11055
12647 * incremental-dump.cc (dump_incremental_inputs): New.
12648 (main): Use dump_incremental_inputs.
12649
53d7974c
L
126502009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12651
12652 PR gold/10893
12653 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12654 checking elfcpp::STT_FUNC.
12655 (Target_i386::Relocate::relocate): Likewise.
12656 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12657
12658 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12659 symbols from shared libraries into normal FUNC symbols.
12660
12661 * symtab.h (Symbol): Add is_func and use it.
12662
05a352e6
DK
126632009-12-05 Doug Kwan <dougkwan@google.com>
12664
12665 * arm.cc (Target_arm::arm_info): Initialize new fields
12666 attributes_section and attributes_vendor.
12667 * i386.cc (Target_i386::i386_info): Same.
12668 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12669 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12670 fields attributes_section and attributes_vendor.
53d7974c 12671 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12672 * target.h (Target::attributes_section, Target::attributes_vendor,
12673 Target::is_attributes_section, Target::attribute_arg_type,
12674 Target::attributes_order): New method definitions.
12675 (Target::Target_info::attributes_section,
12676 Target::Target_info::attributes_vendor): New fields.
12677 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12678 virtual method definitions.
12679 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12680 attributes_section and attributes_vendor.
12681 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12682
f4e5969c
DK
126832009-12-05 Doug Kwan <dougkwan@google.com>
12684
12685 * arm.cc: Update comments about interworking and stub generation.
12686 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12687 considered as non-PIC.
12688 (Arm_relocate_functions::base_abs): Fix formatting.
12689 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12690 of function to use GOT entry address instead of offset.
12691 (Target_arm::Scan::global): Issue an error if a symbol would need a
12692 PLT does not get one because it is untyped. Remove code to create
12693 dynamic symbols for relative branches.
12694 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12695 takes unsigned integer instead of boolean.
12696
1abce4a6
L
126972009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12698
12699 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12700 (two_file_test_LDADD): Likewise.
12701 (common_test_1_LDADD): Likewise.
12702 (exception_test_LDADD) Likewise.
12703 (weak_test_LDADD): Likewise.
12704 (many_sections_test_LDADD): Likewise.
12705 (initpri1_LDADD): Likewise.
12706 (script_test_1_LDADD): Likewise.
12707 (script_test_2_LDADD): Likewise.
12708 (justsyms_LDADD): Likewise.
12709 (binary_test_LDADD): Likewise.
12710 (large_LDADD): Likewise.
12711 * testsuite/Makefile.in: Regenerated.
12712
adcf2816 127132009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12714
adcf2816
L
12715 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12716 (Symbol_table::override_with_special): Likewise.
12717 (Symbol_table::add_from_object): Likewise.
12718
28e67f5d
RÁE
127192009-12-04 Rafael Avila de Espindola <espindola@google.com>
12720
12721 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12722 Don't set the data_offset twice.
12723
ae10a101
RÁE
127242009-12-04 Rafael Avila de Espindola <espindola@google.com>
12725
12726 * testsuite/Makefile.in: Regenerate.
12727
f59f41f3
DK
127282009-12-03 Doug Kwan <dougkwan@google.com>
12729
12730 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12731 (Target_arm::do_finalize_sections): Add parameter for symbol table
12732 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12733 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12734 parameter for symbol table pointer.
12735 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12736 an additional parameter for a pointer to symbol table.
12737 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12738 parameter for a symbol table pointer.
12739 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12740 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12741 Ditto.
12742 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12743 parameter for a symbol table pointer.
12744
ca55d848
RÁE
127452009-12-03 Rafael Avila de Espindola <espindola@google.com>
12746
12747 * incremental.cc (Incremental_inputs_header)
12748 (Incremental_inputs_header_write, Incremental_inputs_entry)
12749 (Incremental_inputs_entry_write): Move ...
12750 * incremental.h (Incremental_inputs_header)
12751 (Incremental_inputs_header_write, Incremental_inputs_entry)
12752 (Incremental_inputs_entry_write): here.
12753
3aec4f9c
RÁE
127542009-12-02 Rafael Avila de Espindola <espindola@google.com>
12755
12756 * incremental.cc (make_sized_incremental_binary): Set the target.
12757 Error if it is incompatible.
12758 * output.h (Output_file): Add filename method.
12759
9c0ae74d
RÁE
127602009-12-02 Rafael Avila de Espindola <espindola@google.com>
12761
12762 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12763 from the get_* methods.
12764
a45500ae
RÁE
127652009-12-02 Rafael Avila de Espindola <espindola@google.com>
12766
12767 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12768 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12769 Write 0 for the data_offset of scripts.
12770
325e6408
RÁE
127712009-12-02 Rafael Avila de Espindola <espindola@google.com>
12772
12773 * testsuite/Makefile.am: Add the incremental_test.sh test.
12774 * testsuite/incremental_test.sh: New.
12775 * testsuite/incremental_test_1.c: New.
12776 * testsuite/incremental_test_2.c: New.
12777
954c3e2e
RÁE
127782009-12-01 Rafael Avila de Espindola <espindola@google.com>
12779
703d02da 12780 * incremental-dump.cc (main): Fix typos.
954c3e2e 12781
f8086623
RÁE
127822009-11-27 Rafael Avila de Espindola <espindola@google.com>
12783
12784 PR gold/11025
12785 * incremental-dump.cc (main): Use llu to print 64 bit values.
12786
3b0dd6ac
L
127872009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12788 H.J. Lu <hongjiu.lu@intel.com>
12789
12790 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12791 $(LIBDL).
12792 (incremental_dump_LDADD): Likewise.
12793 * Makefile.in: Regenerated.
12794
a6d1ef57 127952009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12796
a6d1ef57
DK
12797 Revert:
12798
12799 2009-11-25 Doug Kwan <dougkwan@google.com>
12800
12801 * arm.cc (Target_arm::Target_arm): Move method definition
12802 outside of class definition. Add code to handle
12803 --target1-rel, --target1-abs and --target2= options.
12804 (Target_arm::get_reloc_reloc_type): Change method to be
12805 non-static and const.
12806 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12807 New data member declaration.
12808 (Target_arm::Scan::local, Target_arm::Scan::global,
12809 Target_arm::Relocate::relocate,
12810 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12811 Adjust call to Target_arm::get_real_reloc_type.
12812 (Target_arm::get_real_reloc_type): Use command line options
12813 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12814 * options.h (--target1-rel, --target1-abs, --target2): New
12815 ARM-only options.
12816
50aeb7d4
DK
128172009-11-25 Doug Kwan <dougkwan@google.com>
12818
12819 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12820 class definition. Add code to handle --target1-rel, --target1-abs
12821 and --target2= options.
12822 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12823 and const.
12824 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12825 member declaration.
12826 (Target_arm::Scan::local, Target_arm::Scan::global,
12827 Target_arm::Relocate::relocate,
12828 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12829 call to Target_arm::get_real_reloc_type.
12830 (Target_arm::get_real_reloc_type): Use command line options to
12831 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12832 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12833 options.
12834
51938283
DK
128352009-11-25 Doug Kwan <dougkwan@google.com>
12836
12837 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12838 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12839 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12840 formatting.
12841 (Arm_relocate_functions::thm_call): Replace body with a call to
12842 Arm_relocate_functions::thumb_branch_common.
12843 (Arm_relocate_functions::thm_jump24,
12844 Arm_relocate_functions::thm_xpc22): New method definitions.
12845 (Arm_relocate_functions::thumb_branch_common): New method definition.
12846 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12847 operator.
12848 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12849 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12850
e2b8f3c4
RÁE
128512009-11-24 Rafael Avila de Espindola <espindola@google.com>
12852
12853 * Makefile.am: Build incremental-dump
12854 * Makefile.in: Regenerate.
12855 * incremental-dump.cc: New.
12856 * incremental.cc (Incremental_inputs_header_data,
12857 Incremental_inputs_entry_data): Move to incremental.h
12858 * incremental.h: (Incremental_inputs_header_data,
12859 Incremental_inputs_entry_data): Move from incremental.cc
12860
bcba9aec
RÁE
128612009-11-24 Rafael Avila de Espindola <espindola@google.com>
12862
12863 * incremental.cc (Incremental_inputs_header,
12864 Incremental_inputs_header_write, Incremental_inputs_entry,
12865 Incremental_inputs_entry_write): Add a typedef with the data type.
12866
7c3afe08
RÁE
128672009-11-24 Rafael Avila de Espindola <espindola@google.com>
12868
12869 * incremental.cc (Incremental_inputs_header,
12870 Incremental_inputs_header_write, Incremental_inputs_entry,
12871 Incremental_inputs_entry_write): Update comment about which
12872 type has the filed descriptions.
12873
d204b6e9
DK
128742009-11-15 Doug Kwan <dougkwan@google.com>
12875
12876 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12877 (Arm_relocate_functions::arm_branch_common): Change method defintion
12878 in class definition to a method declaration and update list of formal
12879 parameters.
12880 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12881 Arm_relocation_functions::jump24): Adjust call to
12882 Arm_relocate_functions::arm_branch_common. Update list of formal
12883 parameters.
12884 (Arm_relocate_functions::xpc25): New method definition.
12885 (Arm_relocate_functions::arm_branch_common): Move method defintion
12886 out from class definition. Use stubs for mode-switching and extending
12887 branch ranges.
12888 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12889 specially. Change code to enable use of stubs in ARM branches.
12890
43d12afe
DK
128912009-11-10 Doug Kwan <dougkwan@google.com>
12892
12893 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12894 in method declaration.
12895 (Target_arm::relocate_stub): New method declaration.
12896 (Target_arm::default_target): Change to return a pointer instead of
12897 a const reference.
12898 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12899 Target_arm::default_target.
12900 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12901 method definition.
12902 (Target_arm::relocate_section): Adjust view.
12903 (Target_arm::relocate_stub): New method definition.
12904
ac33a407
DK
129052009-11-10 Doug Kwan <dougkwan@google.com>
12906
12907 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12908 a format warning.
12909 * incremental.cc (open_incremental_binary): Initialized local
12910 variables to avoid warnings.
12911 * object.cc (make_elf_object): Ditto.
12912 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12913 a format warning.
e1df38aa 12914
88ee28e9
L
12915009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12916
12917 PR gold/10930
12918 * testsuite/plugin_test.c: Include "config.h".
12919
2daedcd6
DK
129202009-11-09 Doug Kwan <dougkwan@google.com>
12921
12922 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12923 (arm_symbol_value): Remove.
12924 (Arm_relocate_functions::arm_branch_common,
12925 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12926 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12927 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12928 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12929 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12930 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12931 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12932 Arm_relocate_functions::thm_mobw_abs_nc,
12933 Arm_relocate_functions::thm_mov_abs,
12934 Arm_relocate_functions::movw_prel_nc,
12935 Arm_relocate_functions::thm_movt_abs,
12936 Arm_relocate_functions::movt_prel,
12937 Arm_relocate_functions::thm_movw_prel_nc,
12938 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12939 (Target_arm::Relocate::relocate): Only decompose address into two
12940 parts if relocation type uses the thumb-bit and pass the actual
12941 bit instead of a flag indicating that the thumb-bit is used. Adjust
12942 calls to methods in Arm_relocate_functions for this change.
12943
1276bc89 129442009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12945
12946 PR 10925
12947 * reloc.cc: Instantiate
12948 Sized_relobj::initialize_input_to_output_maps and
12949 Sized_relobj:free_input_to_output_maps.
12950
e53ad1b5
ILT
129512009-11-06 Ian Lance Taylor <iant@google.com>
12952
12953 PR 10876
12954 * defstd.cc (in_segment): Set only_if_ref true for "end".
12955
eb44217c
DK
129562009-11-06 Doug Kwan <dougkwan@google.com>
12957
12958 * arm.cc (class Reloc_stub): Correct a comment.
12959 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12960 (Target_arm::scan_section_for_stubs): New method declaration.
12961 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12962 Change methods from private to protected.
12963 (Target_arm::do_may_relax): New method definition.
12964 (Target_arm::do_relax, Target_arm::group_sections,
12965 Target_arm::scan_reloc_for_stub,
12966 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12967 (Target_arm::arm_input_section_map_): New data member declaration.
12968 (Target_arm::scan_reloc_for_stub,
12969 Target_arm::scan_reloc_section_for_stubs,
12970 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12971 Target_arm::do_relax): New method definitions.
12972
5d329b7d
ILT
129732009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12974
12975 * configure.ac: Check for (struct stat)::st_mtim
12976 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12977 * config.in: Regenerate.
12978 * configure: Regenerate.
12979
96a0d71b
ILT
129802009-11-05 Ian Lance Taylor <iant@google.com>
12981
12982 PR 10910
12983 * output.cc (Output_segment::add_output_section): Add missing
12984 return statement.
12985
594c8e5e
ILT
129862009-11-04 Ian Lance Taylor <iant@google.com>
12987
12988 PR 10880
12989 * object.h (class Object): Add is_needed and set_is_needed
12990 methods. Add is_needed_ field. Make bool fields into bitfields.
12991 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12992 defined in a dynamic object and referenced by a regular object,
12993 set is_needed for the dynamic object.
12994 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12995 if the file is marked with as_needed and it is not needed.
12996
22b127cc
ILT
129972009-11-04 Ian Lance Taylor <iant@google.com>
12998
12999 PR 10887
13000 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13001 tags if data is discarded by linker script.
13002 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13003 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13004 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13005 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13006
f5c870d2
ILT
130072009-11-04 Ian Lance Taylor <iant@google.com>
13008
13009 * layout.cc (Layout::get_output_section): Add is_interp and
13010 is_dynamic_linker_section parameters. Change all callers.
13011 (Layout::choose_output_section): Likewise.
13012 (Layout::make_output_section): Likewise.
13013 (Layout::add_output_section_data): Add is_dynamic_linker_section
13014 parameter. Change all callers.
13015 * layout.h (class Layout): Update declarations.
13016 * output.h (class Output_section): Add is_interp, set_is_interp,
13017 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13018 Add is_interp_, is_dynamic_linker_section_ fields. Change
13019 generate_code_fills_at_write_ to a bitfield.
13020 * output.cc (Output_section::Output_sections): Initialize new
13021 fields.
13022 (Output_segment::add_output_section): Add do_sort parameter.
13023 Change all callers.
13024
1ae4d23b
ILT
130252009-11-03 Ian Lance Taylor <iant@google.com>
13026
13027 PR 10860
13028 * options.h (class General_options): Add --warn-common.
13029 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13030 merging two common symbols.
13031 (Symbol_table::should_override): Handle --warn-common when merging
13032 a common symbol with a defined symbol. Use report_resolve_problem
13033 for multiple definitions.
13034 (Symbol_table::report_resolve_problem): New function.
13035 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13036
55da9579
DK
130372009-11-03 Doug Kwan <dougkwan@google.com>
13038
13039 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13040 stub_factory_.
13041 (Target_arm::stub_factory): New method definition.
13042 (Target_arm::new_arm_input_section,
13043 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13044 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 13045 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
13046 New type definitions.
13047 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13048 member declarations.
13049 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13050 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13051 New method definitions.
13052
37a9ac43
ILT
130532009-11-03 Ian Lance Taylor <iant@google.com>
13054
13055 * options.h (class General_options): Add --warn_constructors.
13056
b3d6a3d4
ILT
130572009-11-03 Ian Lance Taylor <iant@google.com>
13058
13059 PR 10893
13060 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13061 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13062
934b01dd
ILT
130632009-11-03 Ian Lance Taylor <iant@google.com>
13064
13065 PR 10895
13066 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13067 --msgid-bugs-address.
13068 (install-pdf): New target.
13069 (install-data_yes): Look up one directory to find mkinstalldirs.
13070
03c1939b
L
130712009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13072
13073 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13074 tree.
13075
ebd95253
DK
130762009-10-30 Doug Kwan <dougkwan@google.com>
13077
13078 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13079
e9bbb538
DK
130802009-10-30 Doug Kwan <dougkwan@google.com>
13081
13082 * arm.cc (Stub_addend_reader): New struct template definition
13083 and partial specializations.
13084 (Stub_addend_reader::operator()): New method definition for a
13085 partially specialized template.
13086
d5b40221
DK
130872009-10-30 Doug Kwan <dougkwan@google.com>
13088
13089 * arm.cc (Arm_relobj::processor_specific_flags): New method
13090 definition.
13091 (Arm_relobj::do_read_symbols): New method declaration.
13092 (Arm_relobj::processor_specific_flags_): New data member declaration.
13093 (Arm_dynobj): New class definition.
13094 (Target_arm::do_finalize_sections): Add input_objects parameter.
13095 (Target_arm::do_adjust_elf_header): New method declaration.
13096 (Target_arm::are_eabi_versions_compatible,
13097 (Target_arm::merge_processor_specific_flags): New method declaration.
13098 (Target_arm::do_make_elf_object): New overloaded method definitions
13099 and declaration.
13100 (Arm_relobj::do_read_symbols): New method definition.
13101 (Arm_dynobj::do_read_symbols): Ditto.
13102 (Target_arm::do_finalize_sections): Add input_objects parameters.
13103 Merge processor-specific flags from all input objects.
13104 (Target_arm::are_eabi_versions_compatible,
13105 Target_arm::merge_processor_specific_flags,
13106 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13107 New method definitions.
13108 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13109 Input_objects pointer type parameter.
13110 * layout.cc (Layout::finalize): Pass input objects to target's.
13111 finalize_sections function.
13112 * output.cc (Output_file_header::do_sized_write): Set ELF file
13113 header's processor-specific flags.
13114 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13115 Input_objects pointer type parameter.
13116 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13117 * target.h (Input_objects): New forward class declaration.
13118 (Target::processor_specific_flags,
13119 Target::are_processor_specific_flags_sect): New method definitions.
13120 (Target::finalize_sections): Add input_objects parameter.
13121 (Target::Target): Initialize processor_specific_flags_ and
13122 are_processor_specific_flags_set_.
13123 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13124 parameter.
13125 (Target::set_processor_specific_flags): New method definition.
13126 (Target::processor_specific_flags_,
13127 Target::are_processor_specific_flags_set_): New data member
13128 declarations.
13129 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13130 Input_objects pointer type parameter.
13131
ebabffbd
DK
131322009-10-30 Doug Kwan <dougkwan@google.com>
13133
13134 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13135
ad0f2072
ILT
131362009-10-28 Ian Lance Taylor <iant@google.com>
13137
13138 * object.h (class Relobj): Drop options parameter from
13139 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13140 do_scan_relocs, do_relocate. Change all callers.
13141 (class Sized_relobj): Drop options parameters from
13142 do_gc_process_relocs, do_scan_relocs, do_relocate,
13143 do_relocate_sections, relocate_sections, emit_relocs_scan,
13144 emit_relocs_scan_reltype. Change all callers.
13145 (struct Relocate_info): Remove options field and all references to
13146 it.
13147 * reloc.h (class Read_relocs): Remove options constructor
13148 parameter and options_ field. Change all callers.
13149 (class Gc_process_relocs, class Scan_relocs): Likewise.
13150 (class Relocate_task): Likewise.
13151 * target-reloc.h (scan_relocs): Remove options parameter. Change
13152 all callers.
13153 (scan_relocatable_relocs): Likewise.
13154 * target.h (class Sized_target): Remove options parameter from
13155 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13156 all callers.
13157 * gc.h (gc_process_relocs): Remove options parameter. Change all
13158 callers.
13159 * arm.cc: Update functions to remove options parameters.
13160 * i386.cc: Likewise.
13161 * powerpc.cc: Likewise.
13162 * sparc.cc: Likewise.
13163 * x86_64.cc: Likewise.
13164 * testsuite/testfile.cc: Likewise.
13165
8ffa3667
DK
131662009-10-28 Doug Kwan <dougkwan@google.com>
13167
13168 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13169 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13170 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13171 New method definitions.
13172
40f36857
CC
131732009-10-28 Cary Coutant <ccoutant@google.com>
13174
13175 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13176 (Plugin::cleanup_done_): New member.
13177 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13178 (Plugin_manager::cleanup_done_): Remove.
13179 (Plugin_manager::add_input_file): Edit error message.
13180 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13181 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13182
2c849493
ILT
131832009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13184
13185 * fileread.cc: (File_read::View::~View): Use the new
13186 data_ownership_ filed.
13187 (File_read::~File_read): Dispose the new whole_file_view_.
13188 (File_read::open): Mmap the whole file if needed.
13189 (File_read::open): Use whole_file_view_ instead of contents_.
13190 (File_read::find_view): Use whole_file_view_ if applicable.
13191 (File_read::do_read): Use whole_file_view_ instead of contents_.
13192 (File_read::make_view): Use whole_file_view_ instead of contents_,
13193 update File_read::View::View call.
13194 (File_read::find_or_make_view): Update File_read::View::View
13195 call.
13196 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13197 remove contents_
13198 (File_read::View::Data_ownership): New enum.
13199 (File_read::View::View): Replace bool mapped_ with Data_ownership
13200 argument.
13201 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13202 (File_read::View::data_ownership_): New field.
13203 (File_read::contents_): Remove (replaced by whole_file_view_).
13204 (File_read::whole_file_view_): New field.
13205 * options.h (class General_options): Add --keep-files-mapped.
13206
24998053
CC
132072009-10-27 Cary Coutant <ccoutant@google.com>
13208
13209 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13210 * testsuite/Makefile.am (plugin_test_5): New test case.
13211 * testsuite/Makefile.in: Regenerate.
13212
72adc4fa
DK
132132009-10-25 Doug Kwan <dougkwan@google.com>
13214
13215 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13216 from private to protected to allow access by child class.
13217 (Sized_relobj::do_relocate_sections): New method declaration.
13218 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13219 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13220 Sized_relobj::relocate_sections. Instantiate template explicitly
13221 for different target sizes and endianity.
13222
07f508a2
DK
132232009-10-24 Doug Kwan <dougkwan@google.com>
13224
13225 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13226 (Arm_input_section::as_arm_input_section): New method.
13227 (Arm_output_section): New class definition.
13228 (Arm_output_section::create_stub_group,
13229 Arm_output_section::group_sections): New method definitions.
13230
10ad9fe5
DK
132312009-10-22 Doug Kwan <dougkwan@google.com>
13232
13233 * arm.cc (Arm_input_section): New class definition.
13234 (Arm_input_section::init, Arm_input_section:do_write,
13235 Arm_input_section::set_final_data_size,
13236 Arm_input_section::do_reset_address_and_file_offset): New method
13237 definitions.
13238
56ee5e00
DK
132392009-10-21 Doug Kwan <dougkwan@google.com>
13240
13241 * arm.cc (Stub_table, Arm_input_section): New forward class
13242 declarations.
13243 (Stub_table): New class defintion.
13244 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13245 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13246 New method definition.
13247
b569affa
DK
132482009-10-21 Doug Kwan <dougkwan@google.com>
13249
13250 * arm.cc: Update copyright comments.
13251 (Target_arm): New forward class template declaration.
13252 (Arm_address): New type.
13253 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13254 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13255 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13256 constants.
13257 (Insn_template): Same.
13258 (DEF_STUBS): New macro.
13259 (Stub_type): New enum type.
13260 (Stub_template): New class definition.
13261 (Stub): Same.
13262 (Reloc_stub): Same.
13263 (Stub_factory): Same.
13264 (Target_arm::Target_arm): Initialize may_use_blx_ and
13265 should_force_pic_veneer_.
13266 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13267 Target_arm::should_force_pic_veneer,
13268 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13269 Target_arm::using_thumb_only, Target_arm:;default_target): New
13270 method defintions.
13271 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13272 New data member declarations.
13273 (Insn_template::size, Insn_template::alignment): New method defintions.
13274 (Stub_template::Stub_template): New method definition.
13275 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13276 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13277 (Stub_factory::Stub_factory): New method definition.
13278 * gold.h (string_hash): New template.
13279 * output.h (Input_section_specifier::hash_value): Use
13280 gold::string_hash.
13281 (Input_section_specifier::string_hash): Remove.
13282 * stringpool.cc (Stringpool_template::string_hash): Use
13283 gold::string_hash.
13284
6c172549
DK
132852009-10-20 Doug Kwan <dougkwan@google.com>
13286
13287 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13288 symbols of relaxed input sections.
13289 * output.h (Output_section::find_relaxed_input_section): Make
13290 method public.
13291
c5617f2f
DK
132922009-10-16 Doug Kwan <dougkwan@google.com>
13293
13294 * dynobj.cc (Versions::Versions): Initialize version_script_.
13295 Only insert base version symbol definition for a shared object
13296 if version script defines any version versions.
13297 (Versions::define_base_version): New method definition.
13298 (Versions::add_def): Check that base version is not needed.
13299 (Versions::add_need): Define base version lazily.
13300 * dynobj.h (Versions::define_base_version): New method declaration.
13301 (Versions::needs_base_version_): New data member declaration.
13302 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13303 (check_DATA): Add no_version_test.stdout.
13304 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13305 New make rules.
13306 * testsuite/Makefile.in: Regenerate.
13307 * testsuite/no_version_test.c: New file.
13308 * testsuite/no_version_test.sh: Ditto.
13309
3c12dcdb
DK
133102009-10-16 Doug Kwan <dougkwan@google.com>
13311
13312 * expression.cc (class Segment_start_expression): New class definition.
13313 (Segment_start_expression::value): New method definition.
13314 (script_exp_function_segment_start): Return a new
13315 Segment_start_expression.
13316 * gold/script-c.h (script_saw_segment_start_expression): New function
13317 prototype.
13318 * script-sections.cc (Script_sections::Script_sections): Initialize
13319 SAW_SEGMENT_START_EXPRESSION_ to false.
13320 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13321 and -Tbbs options to specify section addresses if given in
13322 command line and no SEGMENT_START expression is seen in a script.
13323 * script-sections.h (Script_sections::saw_segment_start_expression,
13324 Script_sections::set_saw_segment_start_expression): New method
13325 definition.
13326 (Script_sections::saw_segment_start_expression_): New data member
13327 declaration.
13328 * script.cc (script_saw_segment_start_expression): New function.
13329 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13330 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13331 script_test_7.sh and script_test_8.sh.
13332 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13333 script_test_8.stdout.
13334 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13335 (script_test_6, script_test_6.stdout, script_test_7,
13336 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13337 * Makefile.in: Regenerate.
13338 * testsuite/script_test_6.sh: New file.
13339 * testsuite/script_test_6.t: Same.
13340 * testsuite/script_test_7.sh: Same.
13341 * testsuite/script_test_7.t: Same.
13342 * testsuite/script_test_8.sh: Same.
13343
64b1ae37
DK
133442009-10-16 Doug Kwan <dougkwan@google.com>
13345
13346 * output.cc (Output_segment::set_section_list_address): Cast
13347 expressions to unsigned long long type to avoid format warnings.
13348
661be1e2
ILT
133492009-10-15 Ian Lance Taylor <iant@google.com>
13350
12edd763 13351 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13352 dot assignment to script_sections_.
12edd763
ILT
13353 * script-sections.cc (Script_sections::add_dot_assignment):
13354 Initialize if necessary.
13355
68b6574b
ILT
13356 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13357 program headers with no load segment if there is a linker script.
13358
661be1e2
ILT
13359 * layout.cc (Layout::set_segment_offsets): Align the file offset
13360 to the segment aligment for -N or -n with no load segment.
13361 * output.cc (Output_segment::add_output_section): Don't crash if
13362 the first section is a TLS section.
13363 (Output_segment::set_section_list_addresses): Print an error
13364 message if the address moves backward in a linker script.
13365 * script-sections.cc
13366 (Output_section_element_input::set_section_addresses): Don't
13367 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13368 (Orphan_output_section::set_section_addresses): Likewise.
13369
f15f61a7
DK
133702009-10-15 Doug Kwan <dougkwan@google.com>
13371
13372 * layout.cc (Layout::finish_dynamic_section): Generate tags
13373 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13374 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13375 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13376
82bb573a
ILT
133772009-10-14 Ian Lance Taylor <iant@google.com>
13378
13379 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13380 fields.
13381 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13382 data_shdr fields of relinfo.
13383 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13384 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13385 R_386_TLS_LDO_32, adjust based on section flags.
13386 (Target_i386::Relocate::fix_up_ldo): Remove.
13387
374ad285
ILT
133882009-10-13 Ian Lance Taylor <iant@google.com>
13389
13390 Add support for -pie.
13391 * options.h (class General_options): Add -pie and
13392 --pic-executable.
13393 (General_options::output_is_position_independent): Test -pie.
13394 (General_options::output_is_executable): Return true if not shared
13395 and not relocatable.
13396 (General_options::output_is_pie): Remove.
13397 * options.cc (General_options::finalize): Reject incompatible uses
13398 of -pie.
13399 * gold.cc (queue_middle_tasks): A -pie link is not static.
13400 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13401 * symtab.cc (Symbol::final_value_is_known): Return false if
13402 output_is_position_independent.
13403 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13404 output_is_position_independent.
13405 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13406 output_is_position_independent.
13407 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13408 output_is_position_independent.
13409 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13410 two_file_pie_test.
13411 (basic_pie_test.o, basic_pie_test): New targets.
13412 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13413 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13414 (two_file_pie_test): New target.
13415 * testsuite/Makefile.in: Rebuild.
13416 * README: Remove note saying that -pie is not supported.
13417
c6585162
ILT
134182009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13419
13420 * options.h (class General_options): Add -init and -fini.
13421 * layout.cc (Layout::finish_dynamic_section): Emit
13422 given init and fini functions.
13423
032ce4e9
ST
134242009-10-13 Sriraman Tallam <tmsriram@google.com>
13425
13426 * gc.h (gc_process_relocs): Check if icf is enabled using new
13427 function.
13428 * gold.cc (queue_initial_tasks): Likewise.
13429 (queue_middle_tasks): Likewise.
13430 * object.cc (do_layout): Likewise.
13431 * symtab.cc (is_section_folded): Likewise.
13432 * main.cc (main): Likewise.
13433 * reloc.cc (Read_relocs::run): Likewise.
13434 (Sized_relobj::do_scan_relocs): Likewise.
13435 * icf.cc (is_function_ctor_or_dtor): New function.
13436 (Icf::find_identical_sections): Check if function is ctor or dtor when
13437 safe icf is chosen.
13438 * options.h (General_options::icf): Change option to be an enum.
13439 (Icf_status): New enum.
13440 (icf_enabled): New method.
13441 (icf_safe_folding): New method.
13442 (set_icf_status): New method.
13443 (icf_status_): New variable.
13444 * (options.cc) (General_options::finalize): Set icf_status_.
13445 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13446 icf_test and icf_keep_unique_test to use the --icf enum flag.
13447 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13448 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13449
f345227a
ST
134502009-10-12 Sriraman Tallam <tmsriram@google.com>
13451
13452 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13453 includes to gc.h and icf.h.
13454 * arm.cc: Include gc.h.
13455 * gold.cc: Likewise.
13456 * i386.cc: Likewise.
13457 * powerpc.cc: Likewise.
13458 * sparc.cc: Likewise.
13459 * x86_64.cc: Likewise.
13460 * gc.h: Include icf.h.
13461
1c7814ed
ILT
134622009-10-11 Ian Lance Taylor <iant@google.com>
13463
13464 * plugin.cc: Include "gold.h" before other header files.
13465
ae3b5189
CD
134662009-10-10 Chris Demetriou <cgd@google.com>
13467
13468 * options.h (Input_file_argument::Input_file_type): New enum.
13469 (Input_file_argument::is_lib_): Replace with...
13470 (Input_file_argument::type_): New member.
13471 (Input_file_argument::Input_file_argument): Take Input_file_type
13472 'type' rather than boolean 'is_lib' as second argument.
13473 (Input_file_argument::is_lib): Use type_.
13474 (Input_file_argument::is_searched_file): New function.
13475 (Input_file_argument::may_need_search): Handle is_searched_file.
13476 * options.cc (General_options::parse_library): Support -l:filename.
13477 (General_options::parse_just_symbols): Update for Input_file_argument
13478 changes.
13479 (Command_line::process): Likewise.
13480 * archive.cc (Archive::get_file_and_offset): Likewise.
13481 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13482 * script.cc (read_script_file, script_add_file): Likewise.
13483 * fileread.cc (Input_file::Input_file): Likewise.
13484 (Input_file::will_search_for): Handle is_searched_file.
13485 (Input_file::open): Likewise.
13486 * readsyms.cc (Read_symbols::get_name): Likewise.
13487 * testsuite/Makefile.am (searched_file_test): New test.
13488 * testsuite/Makefile.in: Regenerate.
13489 * testsuite/searched_file_test.cc: New file.
13490 * testsuite/searched_file_test_lib.cc: New file.
13491
f3048a1d
ILT
134922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13493 Ian Lance Taylor <iant@google.com>
13494
13495 * descriptor.cc: Include <cstdio> and "binary-io.h".
13496 (Descriptors::open): Open the files in binary mode always.
13497 * script.cc (Lex::get_token): Treat \r as whitespace.
13498
d4780e57
ILT
134992009-10-09 Ian Lance Taylor <iant@google.com>
13500
13501 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13502
d9a893b8
ILT
135032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13504 Ian Lance Taylor <iant@google.com>
13505
13506 * configure.ac: Check for readv function also.
13507 * fileread.cc (readv): Define if not HAVE_READV.
13508 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13509 does not exist.
13510 * config.in: Regenerate.
13511 * configure: Regenerate.
13512
c0a62865
DK
135132009-10-09 Doug Kwan <dougkwan@google.com>
13514
13515 * layout.cc (Layout::make_output_section): Call target hook to make
13516 ordinary output section.
13517 (Layout::finalize): Adjust parameter list of call the
13518 Target::may_relax().
13519 * layout.h (class Layout::section_list): New method.
13520 * merge.h (Output_merge_base::entsize): Change visibility to public.
13521 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13522 New methods.
13523 (Output_merge_string::do_is_string): New method.
13524 * object.cc (Sized_relobj::do_setup): renamed from
13525 Sized_relobj::set_up.
13526 * object.h (Sized_relobj::adjust_shndx,
13527 Sized_relobj::initializ_input_to_output_maps,
13528 Sized_relobj::free_input_to_output_maps): Change visibilities to
13529 protected.
13530 (Sized_relobj::setup): Virtualize.
13531 (Sized_relobj::do_setup): New method declaration.
13532 (Sized_relobj::invalidate_section_offset,
13533 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13534 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13535 * options.cc (parse_int): New function.
13536 * options.h (parse_int): New declaration.
13537 (DEFINE_int): New macro.
13538 (stub_group_size): New option.
13539 * output.cc (Output_section::Output_section): Initialize memebers
13540 merge_section_map_, merge_section_by_properties_map_,
13541 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13542 (Output_section::add_input_section): Handled deferred code-fill
13543 generation and remove an old comment.
13544 (Output_section::add_relaxed_input_section): New method definition.
13545 (Output_section::add_merge_input_section): Use merge section by
13546 properties map to speed to search. Update merge section maps
13547 as appropriate.
13548 (Output_section::build_relaxation_map): New method definition.
13549 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13550 Same.
13551 (Output_section::relax_input_section): Renamed to
13552 Output_section::convert_input_sections_to_relaxed_sections and change
13553 interface to take a vector of pointers to relaxed sections.
13554 (Output_section::find_merge_section,
13555 Output_section::find_relaxed_input_section): New method definitions.
13556 (Output_section::is_input_address_mapped,
13557 Output_section::output_offset, Output_section::output_address):
13558 Use output section data maps to speed up searching.
13559 (Output_section::find_starting_output_address): Add comments.
13560 (Output_section::do_write,
13561 Output_section::write_to_postprocessing_buffer): Do code-fill
13562 generation as appropriate.
13563 (Output_section::get_input_sections): Invalidate relaxed input section
13564 map.
13565 (Output_section::restore_states): Adjust type of checkpoint .
13566 Invalidate relaxed input section map.
13567 * output.h (Output_merge_base): New class declaration.
13568 (Input_section_specifier): New class defintion.
13569 (class Output_relaxed_input_section) Change base class to
13570 Output_section_data_build.
13571 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13572 base class initializer.
13573 (Output_section::add_relaxed_input_section): New method declaration.
13574 (Output_section::Input_section): Change visibility to protected.
2e702c99 13575 (Output_section::Input_section::relobj,
c0a62865
DK
13576 Output_section::Input_section::shndx): Handle relaxed input sections.
13577 Output_section::input_sections) Change visibility to protected. Also
13578 define overload to return a non-const pointer.
13579 (Output_section::Merge_section_properties): New class defintion.
13580 (Output_section::Merge_section_by_properties_map,
13581 Output_section::Output_section_data_by_input_section_map,
13582 Output_section::Relaxation_map): New types.
13583 (Output_section::relax_input_section): Rename method to
13584 Output_section::convert_input_sections_to_relaxed_sections and change
13585 interface to take a vector of relaxed section pointers.
13586 (Output_section::find_merge_section,
13587 Output_section::find_relaxed_input_section,
13588 Output_section::build_relaxation_map,
13589 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13590 New method declarations.
13591 (Output_section::merge_section_map_
13592 Output_section::merge_section_by_properties_map_,
13593 Output_section::relaxed_input_section_map_,
13594 Output_section::is_relaxed_input_section_map_valid_,
13595 Output_section::generate_code_fills_at_write_): New data members.
13596 * script-sections.cc
13597 (Output_section_element_input::set_section_addresses): Call
13598 current_data_size and addralign methods of relaxed input sections.
13599 (Orphan_output_section::set_section_addresses): Call current_data_size
13600 and addralign methods of relaxed input sections.
13601 * symtab.cc (Symbol_table::compute_final_value): Extract template
13602 from the body of Symbol_table::sized_finalize_symbol.
13603 (Symbol_table::sized_finalized_symbol): Call
13604 Symbol_table::compute_final_value.
13605 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13606 (Symbol_table::compute_final_value): New templated method declaration.
13607 * target.cc (Target::do_make_output_section): New method defintion.
13608 * target.h (Target::make_output_section): New method declaration.
13609 (Target::relax): Add more parameters for input objects, symbol table
13610 and layout. Adjust call to do_relax.
13611 (Target::do_make_output_section): New method declaration.
13612 (Target::do_relax): Add parameters for input objects, symbol table
13613 and layout.
13614
d446d6c4
ILT
136152009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13616
13617 * pread.c: Include stdio.h.
13618
bc06c745
ILT
136192009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13620
13621 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13622 defined.
13623
75aea3d0
ILT
136242009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13625
13626 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13627 Change read_shndx type to unsigned int.
13628 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13629 int.
13630 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13631 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13632 Change read_shndx type to unsigned int.
13633 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13634 int.
13635 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13636 * layout.cc (Layout::create_symtab_sections): Cast the result of
13637 local_symcount * symsize to off_t in the gold_assert.
13638
be8fcb75
ILT
136392009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13640
13641 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13642 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13643 R_ARM_BASE_ABS.
13644 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13645 (Arm_relocate_functions::thm_abs5): New function.
13646 (Arm_relocate_functions::abs12): New function.
13647 (Arm_relocate_functions::abs16): New function.
13648 (Arm_relocate_functions::base_abs): New function.
13649 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13650 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13651 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13652 R_ARM_BASE_ABS.
13653 (Scan::global): Likewise.
13654 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13655 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13656 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13657 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13658 R_ARM_BASE_ABS.
13659
c2a122b6
ILT
136602009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13661
13662 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13663 (Arm_relocate_functions::movt_prel): New function.
13664 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13665 (Arm_relocate_functions::thm_movt_prel): New function.
13666 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13667 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13668 (Scan::global, Relocate::relocate): Likewise.
13669 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13670
c4aa1e2d
ILT
136712009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13672
13673 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13674 Incremental_checker.
13675 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13676 unsigned int.
13677 (class Incremental_inputs_header): New class.
13678 (Incremental_inputs_header_writer): Edit comment.
13679 (Incremental_inputs_entry): New class.
13680 (Incremental_inputs_entry_writer): Edit comment.
13681 (Sized_incremental_binary::do_find_incremental_inputs_section):
13682 Add *strtab_shndx parameter, fill it.
13683 (Sized_incremental_binary::do_check_inputs): New method.
13684 (Incremental_checker::can_incrementally_link_output_file): Use
13685 Sized_incremental_binary::check_inputs.
13686 (Incremental_inputs::report_command_line): Save command line in
13687 command_line_.
13688 * incremental.h:
13689 (Incremental_binary::find_incremental_inputs_section): New
13690 method.
13691 (Incremental_binary::do_find_incremental_inputs_section): Add
13692 strtab_shndx parameter.
13693 (Incremental_binary::do_check_inputs): New pure virtual method.
13694 (Sized_incremental_binary::do_check_inputs): Declare.
13695 (Incremental_checker::Incremental_checker): Add incremental_inputs
13696 parameter, use it to initialize incremental_inputs_.
13697 (Incremental_checker::incremental_inputs_): New field.
13698 (Incremental_checker::command_line): New method.
13699 (Incremental_checker::inputs): New method.
13700 (Incremental_checker::command_line_): New field.
13701
c549a694
ILT
137022009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13703
13704 * incremental.cc: Include <cstdarg> and "target-select.h".
13705 (vexplain_no_incremental): New function.
13706 (explain_no_incremental): New function.
13707 (Incremental_binary::error): New method.
13708 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13709 method.
13710 (make_sized_incremental_binary): New function.
13711 (open_incremental_binary): New function.
13712 (can_incrementally_link_file): Add checks if output is ELF and has
13713 inputs section.
13714 * incremental.h: Include "elfcpp_file.h" and "output.h".
13715 (Incremental_binary): New class.
13716 (Sized_incremental_binary): New class.
13717 (open_incremental_binary): Declare.
13718 * object.cc (is_elf_object): Use
13719 elfcpp::Elf_recognizer::is_elf_file.
13720 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13721 * output.h (Output_file::filesize): New method.
13722
fd3c5f0b
ILT
137232009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13724
13725 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13726 New function.
13727 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13728 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13729 function.
13730 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13731 function.
13732 (Arm_relocate_functions::movw_abs_nc): New function.
13733 (Arm_relocate_functions::movt_abs): New function.
13734 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13735 (Arm_relocate_functions::thm_movt_abs): New function.
13736 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13737 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13738 (Scan::global): Likewise.
13739 (Relocate::relocate): Likewise.
13740 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13741
7f5309a5
ILT
137422009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13743
13744 * arm.cc (Arm_relocate_functions::got_prel) New function.
13745 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13746 (Relocate::relocate): Likewise.
13747 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13748
364c7fa5
ILT
137492009-10-06 Ian Lance Taylor <iant@google.com>
13750
13751 * options.h (class General_options): Define
13752 split_stack_adjust_size parameter.
13753 * object.h (class Object): Add uses_split_stack_ and
13754 has_no_split_stack_ fields. Add uses_split_stack and
13755 has_no_split_stack accessor functions. Declare
13756 handle_split_stack_section.
13757 (class Reloc_symbol_changes): Define.
13758 (class Sized_relobj): Define Function_offsets. Declare
13759 split_stack_adjust, split_stack_adjust_reltype, and
13760 find_functions.
13761 * object.cc (Object::handle_split_stack_section): New function.
13762 (Sized_relobj::do_layout): Call handle_split_stack_section.
13763 * dynobj.cc (Sized_dynobj::do_layout): Call
13764 handle_split_stack_section.
13765 * reloc.cc (Sized_relobj::relocate_sections): Call
13766 split_stack_adjust for executable sections in split_stack
13767 objects. Pass reloc_map to relocate_section.
13768 (Sized_relobj::split_stack_adjust): New function.
13769 (Sized_relobj::split_stack_adjust_reltype): New function.
13770 (Sized_relobj::find_functions): New function.
13771 * target-reloc.h: Include "object.h".
13772 (relocate_section): Add reloc_symbol_changes parameter. Change
13773 all callers.
13774 * target.h (class Target): Add calls_non_split method. Declare
13775 do_calls_non_split virtual method. Declare match_view and
13776 set_view_to_nop.
13777 * target.cc: Include "elfcpp.h".
13778 (Target::do_calls_non_split): New function.
13779 (Target::match_view): New function.
13780 (Target::set_view_to_nop): New function.
13781 * gold.cc (queue_middle_tasks): Give an error if mixing
13782 split-stack and non-split-stack objects with -r.
13783 * i386.cc (Target_i386::relocate_section): Add
13784 reloc_symbol_changes parameter.
13785 (Target_i386::do_calls_non_split): New function.
13786 * x86_64.cc (Target_x86_64::relocate_section): Add
13787 reloc_symbol_changes parameter.
13788 (Target_x86_64::do_calls_non_split): New function.
13789 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13790 parameter.
13791 * powerpc.cc (Target_powerpc::relocate_section): Add
13792 reloc_symbol_changes parameter.
13793 * sparc.cc (Target_sparc::relocate_section): Add
13794 reloc_symbol_changes parameter.
13795 * configure.ac: Call AM_CONDITIONAL for the default target.
13796 * configure: Rebuild.
13797 * testsuite/Makefile.am (TEST_AS): New variable.
13798 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13799 (check_DATA): Add split_i386 and split_x86_64 files.
13800 (SPLIT_DEFSYMS): Define.
13801 (split_i386_[1234n].o): New targets.
13802 (split_i386_[124]): New targets.
13803 (split_i386_[1234r].stdout): New targets.
13804 (split_x86_64_[1234n].o): New targets.
13805 (split_x86_64_[124]): New targets.
13806 (split_x86_64_[1234r].stdout): New targets.
13807 (MOSTLYCLEANFILES): Add new executables.
13808 * testsuite/split_i386.sh: New file.
13809 * testsuite/split_x86_64.sh: New file.
13810 * testsuite/split_i386_1.s: New file.
13811 * testsuite/split_i386_2.s: New file.
13812 * testsuite/split_i386_3.s: New file.
13813 * testsuite/split_i386_4.s: New file.
13814 * testsuite/split_i386_n.s: New file.
13815 * testsuite/split_x86_64_1.s: New file.
13816 * testsuite/split_x86_64_2.s: New file.
13817 * testsuite/split_x86_64_3.s: New file.
13818 * testsuite/split_x86_64_4.s: New file.
13819 * testsuite/split_x86_64_n.s: New file.
13820 * testsuite/testfile.cc (Target_test): Update relocation_section
13821 function.
13822 * testsuite/Makefile.in: Rebuild.
13823
e8a9fcda
ILT
138242009-10-06 Ian Lance Taylor <iant@google.com>
13825
13826 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13827 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13828 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13829 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13830 the address on ldo_addrs_.
13831 (Target_i386::Relocate::fix_up_ldo): New function.
13832
e99daf92
ILT
138332009-10-06 Rafael Espindola <espindola@google.com>
13834
13835 * plugin.cc (add_input_library): New.
13836 (Plugin::load): Add add_input_library to tv.
13837 (Plugin_manager::add_input_file): Add the is_lib argument.
13838 (add_input_file): Update call to Plugin_manager::add_input_file.
13839 (add_input_library): New.
13840 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13841
966d4097
DK
138422009-09-30 Doug Kwan <dougkwan@google.com>
13843
13844 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13845 symbol and call Symbol::may_need_copy_reloc to determine if
13846 a copy reloc is needed.
13847 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13848 nocopyreloc is given in command line.
13849 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13850 given in command line.
13851 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13852 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13853 of the removed Target_i386::may_need_copy_reloc.
13854 * options.h (copyreloc): New option with default value false.
13855 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13856 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13857 instead of the removed Target_powerpc::may_need_copy_reloc.
13858 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13859 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13860 instead of the removed Target_sparc::may_need_copy_reloc.
13861 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13862 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13863 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13864 instead of the removed Target_x86_64::may_need_copy_reloc.
13865
029ba973
ILT
138662009-09-30 Ian Lance Taylor <iant@google.com>
13867
13868 * object.h (class Object): Remove target_ field, and target,
13869 sized_target, and set_target methods.
13870 (Object::sized_target): Remove.
13871 (class Sized_relobj): Update declarations. Remove sized_target.
13872 * object.cc (Sized_relobj::setup): Remove target parameter.
13873 Change all callers.
13874 (Input_objects::add_object): Don't do anything with the target.
13875 (make_elf_sized_object): Add punconfigured parameter. Change all
13876 callers. Set or test parameter target.
13877 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13878 Change all callers.
13879 * parameters.cc (Parameters::set_target): Change parameter type to
13880 be non-const.
13881 (Parameters::default_target): Remove.
13882 (set_parameters_target): Change parameter type to be non-const.
13883 (parameters_force_valid_target): New function.
13884 (parameters_clear_target): New function.
13885 * parameters.h (class Parameters): Update declarations. Remove
13886 default_target method. Add sized_target and clear_target
13887 methods. Change target_ to be non-const.
13888 (set_parameters_target): Update declaration.
13889 (parameters_force_valid_target): Declare.
13890 (parameters_clear_target): Declare.
13891 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13892 as NULL if we aren't searching.
13893 (Add_symbols::run): Don't check for compatible target.
13894 * fileread.cc (Input_file::open_binary): Call
13895 parameters_force_valid_target.
13896 * gold.cc (queue_middle_tasks): Likewise.
13897 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13898 set_target on object.
13899 * dynobj.h (class Sized_dynobj): Update declarations.
13900 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13901 make_elf_object returns NULL.
13902 (Archive::include_member): Don't check whether object target is
13903 compatible.
13904 * output.cc (Output_section::add_input_section): Get target from
13905 parameters.
13906 (Output_section::relax_input_section): Likewise.
13907 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13908 parameters.
13909 (Sized_relobj::do_scan_relocs): Likewise.
13910 (Sized_relobj::relocate_sections): Likewise.
13911 * resolve.cc (Symbol_table::resolve): Likewise.
13912 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13913 parameter. Change all callers.
13914 (Symbol_table::add_from_object): Get target from parameters.
13915 (Symbol_table::add_from_relobj): Don't check object target.
13916 (Symbol_table::add_from_dynobj): Likewise.
13917 (Symbol_table::define_special_symbol): Get target from
13918 parameters.
13919 * symtab.h (class Symbol_table): Update declaration.
13920 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13921 parameter. Change all callers. Clear parameter target.
13922 (Binary_test): Test target here.
13923 * testsuite/object_unittest.cc (gold_testsuite): Remove
13924 target_test_pointer parameter. Change all callers.
13925 (Object_test): Test target here.
13926
a6a22b83
ILT
139272009-09-26 Ian Lance Taylor <iant@google.com>
13928
13929 * testsuite/initpri1.c: Don't try to use constructor priorities if
13930 compiling with gcc before 4.3.
13931
6a8f49fe
ILT
139322009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13933
13934 * testsuite/retain_symbols_file_test.sh (check_present): Change
13935 output file name to retain_symbols_file_test.stdout.
13936 (check_absent): Likewise.
13937
8c604651
CS
139382009-09-18 Craig Silverstein <csilvers@google.com>
13939
13940 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13941 * options.cc: Include <cerrno> and <fstream>.
13942 (General_options::finalize): Parse -retain-symbols-file tag.
13943 * options.h: New flag.
13944 (General_options): New method should_retain_symbol, new
13945 variable symbols_to_retain.
13946 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13947 should_retain_symbol map.
13948 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13949 * testsuite/Makefile.in: Regenerate.
13950 * testsuite/retain_symbols_file_test.sh: New file.
13951
ca58b19f
NC
139522009-09-18 Nick Clifton <nickc@redhat.com>
13953
13954 * po/es.po: Updated Spanish translation.
13955
20e6d0d6
DK
139562009-09-17 Doug Kwan <dougkwan@google.com>
13957
13958 * debug.h (DEBUG_RELAXATION): New constant.
13959 (DEBUG_ALL): Add DEBUG_RELAXATION.
13960 (debug_string_to_enum): Add relaxation debug option.
13961 * layout.cc
13962 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13963 Layout::Relaxation_debug_check::read_sections,
13964 Layout::Relaxation_debug_check::read_sections): New method definitions.
13965 (Layout::Layout): Initialize data members
13966 record_output_section_data_from_scrips_,
13967 script_output_section_data_list_ and relaxation_debug_check_.
13968 (Layout::save_segments, Layout::restore_segments,
13969 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13970 Layout::relaxation_loop_body): New method definitions.
13971 (Layout::finalize): Support relaxation. Move section layout code to
13972 Layout::relaxation_loop_body.
13973 (Layout::set_asection_address_from_script): Move code for orphan
13974 section placement out.
13975 (Layout::place_orphan_sections_in_script): New method definition.
13976 * layout.h (Output_segment_headers, Output_file_header):
13977 New forward class declarations.
13978 (Layout::~Layout): Define.
13979 (Layout::new_output_section_data_from_script): New method definition.
13980 (Layout::place_orphan_sections_in_script): New method declaration.
13981 (Layout::Segment_states): New type declaration.
13982 (Layout::save_segments, Layout::restore_segments,
13983 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13984 Layout::relaxation_loop_body): New method declarations.
13985 (Layout::Output_section_data_list): New type declaration.
13986 (Layout::Relaxation_debug_check): New class definition.
13987 (Layout::record_output_section_data_from_script_,
13988 Layout::script_output_section_data_list_, Layout::segment_states_,
13989 Layout::relaxation_debug_check_): New data members.
13990 * output.cc: (Output_section_headers::do_size): New method definition.
13991 (Output_section_headers::Output_section_headers): Move size
13992 computation to Output_section_headers::do_size.
13993 (Output_segment_headers::do_size): New method definition.
e1df38aa 13994 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13995 Output_file_header::do_size and call it.
13996 (Output_file_header::do_size): New method definition.
13997 (Output_data_group::Output_data_group): Adjust call to
13998 Output_section_data.
13999 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14000 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 14001 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
14002 RELAXED_INPUT_SECTION_CODE.
14003 (Output_section::Output_section): Initialize data member checkpoint_.
14004 (Output_section::~Output_section): Delete checkpoint object pointed
14005 by checkpoint_.
14006 (Output_section::add_input_section): Always add an Input_section if
14007 relaxing.
14008 (Output_section::add_merge_input_section): Add assert.
14009 (Output_section::relax_input_section): New method definition.
14010 (Output_section::set_final_data_size): Set load address to zero for
14011 an unallocated section.
14012 (Output_section::do_address_and_file_offset_have_reset_values):
14013 New method definition.
14014 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14015 Handle relaxed input section.
14016 (Output_section::sort_attached_input_sections): Checkpoint input
14017 section list lazily.
14018 (Output_section::get_input_sections): Change type of input_sections to
14019 list of Simple_input_section pointers. Checkpoint input section list
14020 lazily. Also handle relaxed input sections.
14021 (Output_section::add_input_section_for_script): Take a reference to
14022 a Simple_input_section object instead of Relobj pointer and section
14023 index as parameter. Handle relaxed input sections.
14024 (Output_section::save_states, Output_section::restore_states): New
14025 method definitions.
14026 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14027 (Output_data::is_data_size_fixed): New method definition.
14028 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14029 if it is fixed.
14030 (Output_data::address_and_file_offset_have_reset_values): New method
14031 definition.
14032 (Output_data::do_address_and_file_offset_have_reset_values): New method
14033 definition.
14034 (Output_data::set_data_size): Check that data size is not fixed.
14035 (Output_data::fix_data_size): New method definition.
14036 (Output_data::is_data_size_fixed_): New data member.
14037 (Output_section_headers::set_final_data_size): New method definition.
14038 (Output_section_headers::do_size): New method declaration.
14039 (Output_segment_headers::set_final_data_size): New method definition.
14040 (Output_segment_headers::do_size): New method declaration.
14041 (Output_file_header::set_final_data_size)::New method definition.
14042 (Output_file_header::do_size)::New method declaration.
14043 (Output_section_data::Output_section_data): Add new parameter
14044 is_data_size_fixed and use it to fix data size.
14045 (Output_data_const::Output_data_const): Adjust call to base class
14046 constructor and fix data size.
14047 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14048 base class constructor and fix data size.
14049 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14050 base class constructor and fix data size.
14051 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14052 class constructor and fix data size.
14053 (Output_data_group::set_final_data_size): New method definition.
14054 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14055 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14056 class constructor and fix data size.
14057 (Output_relaxed_input_section): New class definition.
14058 (Output_section::Simple_input_section): New class definition.
14059 (Output_section::get_input_sections): Adjust parameter list.
14060 (Output_section::add_input_section_for_script): Same.
14061 (Output_section::save_states, Output_section::restore_states,
14062 Output_section::do_address_and_file_offset_have_reset_values,
14063 (Output_section::Input_section::Input_section): Handle
14064 RELAXED_INPUT_SECTION_CODE. Add new overload for
14065 Output_relaxed_input_section.
14066 (Output_section::Input_section::is_input_section,
14067 Output_section::Input_section::set_output_section): Handle relaxed
14068 input section.
14069 (Output_section::Input_section::is_relaxed_input_section,
14070 Output_section::Input_section::output_section_data,
14071 Output_section::Input_section::relaxed_input_section): New method
14072 definitions.
14073 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14074 value.
14075 (Output_section::Input_section::u1_): Update comments.
14076 (Output_section::Input_section::u2_): Add new union member poris.
14077 (Output_section::Checkpoint_output_section): New classs definition.
14078 (Output_section::relax_input_section): New method declaration.
14079 (Output_section::checkpoint_): New data member.
14080 (Output_segment): Update comments.
14081 (Output_segment::Output_segment): Un-privatize copy constructor.
14082 (Output_segment::operator=): Un-privatize.
14083 * script-sections.cc (Output_section_element::Input_section_list):
14084 Change element type to Output_section::Simple_input_section.
14085 (Output_section_element_dot_assignment::set_section_addresses):
14086 Register output section data for relaxation clean up.
14087 (Output_data_exression::Output_data_expression): Adjust call to base
14088 constructor to fix data size.
14089 (Output_section_element_data::set_section_addresses): Register
14090 Output_data_expression object for relaxation clean up.
14091 (struct Input_section_info): Replace Relobj pointer and section index
14092 pair with Output_section::Simple_input_section and Convert struct to a
14093 class.
14094 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14095 Input_section_info data member to use accessors.
20e6d0d6
DK
14096 (Output_section_element_input::set_section_addresses): Use layout
14097 parameter. Adjust code to use Output_section::Simple_input_section
14098 and Input_secction_info classes. Register filler for relaxation
14099 clean up.
14100 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14101 and section index pair with Output_section::Simple_input_section
14102 class. Adjust code accordingly.
14103 (Phdrs_element::release_segment): New method definition.
14104 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14105 segment list.
14106 (Script_sections::release_segments): New method definition.
14107 * gold/script-sections.h (Script_sections::release_segments): New
14108 method declaration.
14109 * gold/target.h (Target::may_relax, Target::relax,
14110 Target::do_may_relax, Target::do_relax): New method definitions.
14111
5e445df6
ILT
141122009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14113
14114 * arm.cc (has_signed_unsigned_overflow): New function.
14115 (Arm_relocate_functions::abs8): New function.
14116 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14117 (Target_arm::Scan::global): Likewise.
14118 (Target_arm::relocate::relocate): Likewise.
14119 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14120 Likewise.
14121
8c604651 141222009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14123
14124 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14125 * testsuite/Makefile.in: Regenerate.
14126
1e9cc1c2
NC
141272009-09-11 Nick Clifton <nickc@redhat.com>
14128
14129 * po/gold.pot: Updated by the Translation project.
14130
6a89f575
CC
141312009-09-08 Cary Coutant <ccoutant@google.com>
14132
14133 * output.cc (Output_file::open): Add execute permission to empty file.
14134 * testsuite/Makefile.am (permission_test): New test.
14135 * testsuite/Makefile.in: Regenerate.
14136
fdcac5af
ILT
141372009-09-02 Ian Lance Taylor <iant@google.com>
14138
14139 * output.cc (Output_file::resize): Call map_no_anonymous rather
14140 than map.
14141
44453f85
ILT
141422009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14143
14144 * gold.cc: Include "incremental.h".
14145 (queue_initial_tasks): Call Incremental_checker methods.
14146 * incremental.cc: Include "output.h".
14147 (Incremental_checker::can_incrementally_link_output_file): New
14148 method.
14149 * incremental.h (Incremental_checker): New class.
14150
14151 * output.cc (Output_file::open_for_modification): New method.
14152 (Output_file::map_anonymous): Changed return type to bool. Record
14153 map in base_ field.
14154 (Output_file::map_no_anonymous): New method, broken out of map.
14155 (Output_file::map): Use map_no_anonymous and map_anonymous.
14156 * output.h (class Output_file): Update declarations.
14157
293c1386
CC
141582009-08-24 Cary Coutant <ccoutant@google.com>
14159
14160 * options.h (Command_line::Pre_options): New class.
14161 (Command_line::pre_options): New member.
14162 * options.cc (gold::options::ready_to_register): New variable.
14163 (One_option::register_option): Do nothing if not registering options.
14164 Assert if same short option registered twice.
14165 (General_options::General_options): Turn off option registration when
14166 done constructing.
14167 (Command_line::Pre_options::Pre_options): New constructor.
14168
f773f3d2
CC
141692009-08-24 Cary Coutant <ccoutant@google.com>
14170
06a73cfe
CC
14171 * options.h (General_options::no_keep_memory): Remove incorrect
14172 short option.
f773f3d2 14173
a15af8e2
RW
141742009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14175
14176 * Makefile.am (am__skiplex, am__skipyacc): New.
14177 * Makefile.in: Regenerate.
14178
c462b41b
RW
141792009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14180
14ec8efd
RW
14181 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14182 (INCLUDES): ... this.
14183 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14184 (AM_CPPFLAGS): Renamed from ...
14185 (INCLUDE): ... this.
14186 * Makefile.in, testsuite/Makefile.in: Regenerate.
14187
81ecdfbb
RW
14188 * Makefile.in: Regenerate.
14189 * aclocal.m4: Likewise.
14190 * config.in: Likewise.
14191 * configure: Likewise.
14192 * testsuite/Makefile.in: Likewise.
14193
c462b41b
RW
14194 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14195 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14196 * Makefile.in: Regenerate.
14197 * testsuite/Makefile.in: Regenerate.
14198
2da73f13
CC
141992009-08-19 Cary Coutant <ccoutant@google.com>
14200
14201 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14202 symbols in shared libraries overridden by hidden or internal symbols
14203 in the main program.
14204
2db70501
CD
142052009-08-19 Chris Demetriou <cgd@google.com>
14206
14207 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14208 checking source file names in error messages.
14209
f733487b
DK
142102009-08-18 Doug Kwan <dougkwan@google.com>
14211
14212 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14213 an elcpp::Ehdr as parameter. Adjust call to set_target.
14214 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14215 an elfcpp::Ehdr as parameter.
14216 * object.cc (Object::set_target): Remove the version that looks up
14217 a target and sets it.
14218 (Sized_relobj::setup): Take a Target object instead of
14219 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14220 (make_elf_sized_object): Find target and ask target to
14221 make an ELF object.
14222 * object.h: (Object::set_target): Remove the version that looks up
14223 a target and sets it.
14224 (Sized_relobj::setup): Take a Target object instead of
14225 an elfcpp:Ehdr as parameter.
14226 * target.cc: Include dynobj.h.
14227 (Target::do_make_elf_object_implementation): New.
2e702c99 14228 (Target::do_make_elf_object): New.
f733487b
DK
14229 * target.h (Target::make_elf_object): New template declaration.
14230 (Target::do_make_elf_object): New method declarations.
14231 (Target::do_make_elf_object_implementation): New template declaration.
14232
cc70f101
ILT
142332009-08-14 Ian Lance Taylor <iant@google.com>
14234
14235 * gold.h (FUNCTION_NAME): Define.
14236 (gold_unreachable): Use FUNCTION_NAME.
14237
ef5e0cb1
ST
142382009-08-12 Sriraman Tallam <tmsriram@google.com>
14239
14240 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14241 symbol in the --keep-unique list is not found.
14242
48c187ce
ST
142432009-08-12 Sriraman Tallam <tmsriram@google.com>
14244
14245 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14246 been maked as --keep-unique.
14247 (Icf::unfold_section): New function.
14248 * icf.h (Icf::unfold_section): New function.
14249 * options.h (General_options::keep_unique): New option.
14250 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14251 * testsuite/Makefile.in: Regenerate.
14252 * testsuite/icf_keep_unique_test.sh: New file.
14253 * testsuite/icf_keep_unique_test.cc: New file.
14254
645afe0c
CC
142552009-08-12 Cary Coutant <ccoutant@google.com>
14256
14257 PR 10471
14258 * resolve.cc (Symbol_table::resolve): Check for references from
14259 dynamic objects to hidden and internal symbols.
14260 * testsuite/Makefile.am (hidden_test.sh): New test.
14261 * testsuite/Makefile.in: Regenerate.
14262 * testsuite/hidden_test.sh: New script.
14263 * testsuite/hidden_test_1.c: New test source.
14264 * testsuite/hidden_test_main.c: New test source.
14265
11af873f
DK
142662009-08-11 Doug Kwan <dougkwan@google.com>
14267
14268 * arm.cc: Update comments.
14269 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14270 segment to locate the .ARM.exidx section if present.
14271
b9f7d72d
DK
142722009-08-09 Doug Kwan <dougkwan@google.com>
14273
14274 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14275 patch.
14276
ddd3c53c
ST
142772009-08-07 Sriraman Tallam <tmsriram@google.com>
14278 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14279 compiler warnings.
14280
27721062
ST
142812009-08-06 Sriraman Tallam <tmsriram@google.com>
14282
14283 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14284 valid tls_segment only for non-debug-section relocations.
14285 * testsuite/Makefile.am: Add gc_tls_test.
14286 * testsuite/Makefile.in: Regenerate.
14287 * testsuite/gc_tls_test.cc: New file.
14288 * testsuite/gc_tls_test.sh: New file.
14289
ef15dade 142902009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14291
ef15dade
ST
14292 * icf.cc: New file.
14293 * icf.h: New file.
14294 * Makefile.am (CCFILES): Add icf.cc.
14295 (HFILES): Add icf.h
14296 * Makefile.in: Regenerate.
14297 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14298 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14299 section, symbol and addend information for the relocs.
14300 * gold.cc (queue_middle_tasks): Call identical code folding.
14301 * gold.h: Add defines for multimap.
14302 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14303 to the call of finalize_local_symbols.
14304 * main.cc (main): Create object of class Icf.
14305 * object.cc (Sized_relobj::do_layout): Allow this function to be
14306 called twice during icf.
14307 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14308 to sections marked as identical by icf.
14309 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14310 when available.
14311 (Sized_relobj::do_section_entsize): New function.
14312 * object.h (Object::section_entsize): New function.
14313 (Object::do_section_entsize): New pure virtual function.
14314 (Relobj::finalize_local_symbols): Add new parameter.
14315 (Relobj::do_section_entsize): New function.
14316 * options.h (General_options::icf): New option.
14317 (General_options::icf_iterations): New option.
14318 (General_options::print_icf_sections): New option.
14319 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14320 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14321 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14322 icf.
14323 * symtab.cc (Symbol_table::is_section_folded): New function.
14324 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14325 to sections marked as identical by icf.
14326 * symtab.h (Symbol_table::set_icf): New function.
14327 (Symbol_table::icf): New function.
14328 (Symbol_table::is_section_folded): New function.
14329 (Symbol_table::icf_): New data member.
14330 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14331 * testsuite/Makefile.am: Add commands to build icf_test.
14332 * testsuite/Makefile.in: Regenerate.
14333 * testsuite/icf_test.sh: New file.
14334 * testsuite/icf_test.cc: New file.
14335
c3b65ac4
CD
143362009-07-24 Chris Demetriou <cgd@google.com>
14337
14338 * layout.cc (is_compressible_debug_section): Fix incorrect
14339 comment about compressed section names.
14340
1caf2c51
ILT
143412009-07-20 Ian Lance Taylor <ian@airs.com>
14342
14343 PR 10419
14344 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14345
1ef4d87f
ILT
143462009-07-16 Ian Lance Taylor <iant@google.com>
14347
14348 PR 10400
14349 * layout.h: #include <map>.
14350 (class Kept_section): Change from struct to class. Add accessors
14351 and setters. Add section size to Comdat_group mapping. Change
14352 Comdat_group to std::map. Add is_comdat_ field. Add
14353 linkonce_size field in union.
14354 (class Layout): Update declaration of find_or_add_kept_section.
14355 Don't declare find_kept_object.
14356 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14357 parameter. Add object, shndx, is_comdat, and is_group_name
14358 parameters. Change all callers. Adjust for new Kept_section.
14359 (Layout::find_kept_object): Remove.
14360 * object.cc (Sized_relobj::include_section_group): Update use of
14361 Kept_section. Rename secnum to shndx. Only record
14362 Kept_comdat_section if sections are the same size.
14363 (Sized_relobj::include_linkonce_section): Update use of
14364 Kept_section. Only record Kept_comdat_section if sections are the
14365 same size. Set size of linkonce section.
14366 (Sized_relobj::map_to_kept_section): Update call to
14367 get_kept_comdat_section.
14368 * object.h (class Sized_relobj): Rename fields in
14369 Kept_comdat_section to drop trailing underscores; change object
14370 field to Relobj*. Change Kept_comdat_section_table to store
14371 struct rather than pointer.
14372 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14373 Add kept_object and kept_shndx parameters. Change all callers.
14374 (Sized_relobj::get_kept_comdat_section): Change return type to
14375 bool. Add kept_object and kept_shndx parameters. Change all
14376 callers.
14377 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14378 Layout::find_or_add_kept_section.
14379
37c3b7b0
ILT
143802009-07-09 Ian Lance Taylor <iant@google.com>
14381
14382 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14383 Reserve space in the hash table.
14384
98fa85cb
ILT
143852009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14386
14387 * fileread.cc (File_read::get_mtime): New method.
14388 * fileread.h (Timespec): New structure.
14389 (File_read::get_mtime): New method.
14390 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14391 Renamed from timestamp_nsec.
14392 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14393 Elf_Xword.
e1df38aa 14394 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14395 timestamp_nsec.
e1df38aa 14396 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14397 (Incremental_inputs::report_obejct): Save mtime; style fix.
14398 (Incremental_inputs::report_script): Save mtime; style fix.
14399 (Incremental_inputs::finalize_inputs): Style fix.
14400 (Incremental_inputs::finalize): Style fix.
14401 (Incremental_inputs::create_input_section_data): Store inputs
14402 mtime.
14403 * incremental.h (Incremental_inputs::report_script): Add mtime
14404 argument.
14405 (Incremental_inputs::Input_info::Input_info): Intialize only one
14406 union member.
14407 (Incremental_inputs::Input_info::archive): Move to nameless
14408 union.
14409 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14410 (Incremental_inputs::Input_info::script): Move to nameless union.
14411 (Incremental_inputs::mtime): New field.
14412 * script.cc (read_input_script): Pass file mtime to
14413 Incremental_input.
14414 * script.h (Script_info::inputs): Style fix.
14415
c9d70757
ILT
144162009-07-01 Ian Lance Taylor <ian@airs.com>
14417
14418 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14419 instead of 32.
14420
9c547ec3
ILT
144212009-06-24 Ian Lance Taylor <iant@google.com>
14422
14423 PR 10156
14424 * layout.cc (Layout::choose_output_section): If we find an
14425 existing section, update the flags.
14426 (Layout::create_notes): New function, broken out of
14427 Layout::finalize.
14428 (Layout::finalize): Don't create note sections.
14429 (Layout::create_note): Don't crash if linker script discards
14430 section.
14431 (Layout::create_gold_note): Likewise.
14432 (Layout::create_build_id): Likewise. Don't set
14433 after_input_sections on the section.
14434 (Layout::create_executable_stack_info): Remove target parameter.
14435 Change caller.
14436 * layout.h (class Layout): Declare create_notes. Update
14437 declaration of create_executable_stack_info.
14438 * gold.cc (queue_middle_tasks): Call create_notes.
14439 * output.cc (Output_section::update_flags_for_input_section): Move
14440 here from output.h. If SHF_ALLOC flag is newly set, mark address
14441 invalid.
14442 * output.h (Output_data::mark_address_invalid): New function.
14443 (class Output_section): Only declare, not define,
14444 update_flags_for_input_section. Remove set_flags.
14445
55458500
ILT
144462009-06-24 Ian Lance Taylor <iant@google.com>
14447
14448 * script-sections.cc (Output_section_definition::
14449 set_section_addresses): Rename shadowing local load_address to
14450 laddr.
14451
1307d6cd
ILT
144522009-06-24 Ian Lance Taylor <iant@google.com>
14453
14454 PR 10244
14455 * reloc.cc (relocate_sections): Skip empty relocation sections.
14456
ec3f783e
ILT
144572009-06-23 Ian Lance Taylor <iant@google.com>
14458
14459 PR 10156
14460 * layout.cc (Layout::create_note): Use choose_output_section
14461 rather than make_output_section.
14462
459c9f1c
ILT
144632009-06-23 Ian Lance Taylor <iant@google.com>
14464
14465 PR 10237
14466 * options.cc (General_options::parse_V): Set printed_version_.
14467 (General_options::General_options): Initialize printed_version_.
14468 * options.h (class General_options): Add printed_version_ field.
14469 * gold.cc (queue_initial_tasks): If there are no input files,
14470 don't give a fatal error if we printed the version information.
14471 (queue_middle_tasks): If using -r with a shared object, give a
14472 fatal error rather than an ordinary error.
14473
1518dc8f
ILT
144742009-06-23 Ian Lance Taylor <iant@google.com>
14475
14476 PR 10219
14477 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14478 (Layout::make_output_section): Set have_stabstr_section_ if we see
14479 a .stab*str section.
14480 (Layout::finalize): Call link_stabs_sections.
14481 (Layout::link_stabs_sections): New file.
14482 * layout.h (class Layout): Add have_stabstr_section_ field.
14483 Declare link_stabs_sections.
14484
3d857b98
DK
144852009-06-23 Doug Kwan <dougkwan@google.com>
14486
14487 * Makefile.am (libgold_a_LIBADD): New.
14488 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14489 * Makefile.in: Regenerate.
3d857b98
DK
14490 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14491 * configure: Regenerate.
14492 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14493 * fileread.cc: Include sys/state.h
14494 * gold.h: Declare memmem and strndup if found missing.
14495 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14496
0639a6f6
ILT
144972009-06-23 Ian Lance Taylor <iant@google.com>
14498
14499 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14500 * configure: Rebuild.
14501
8d63875c
ILT
145022009-06-23 Ian Lance Taylor <iant@google.com>
14503
14504 PR 10147
14505 * object.cc (Object::section_contents): Don't try to get a view if
14506 the section has length zero.
14507 (Object::handle_gnu_warning_section): If the section is empty, use
14508 the name of the section as the warning.
14509
f7c8a183
ILT
145102009-06-23 Ian Lance Taylor <iant@google.com>
14511
14512 PR 10133
14513 * stringpool.h (class Stringpool_template): Add optimize_ field.
14514 (Stringpool_template::set_optimize): New function.
14515 * stringpool.cc (Stringpool_template::Stringpool_template):
14516 Initialize optimize_ field.
14517 (Stringpool_template::set_string_offsets): Test local optimize
14518 fild rather than parameter.
14519 * layout.cc (Layout::Layout): Call set_optimize on the section
14520 name stringpool.
14521
e6a307ba
ILT
145222009-06-22 Ian Lance Taylor <iant@google.com>
14523
14524 PR 10030
14525 * yyscript.y: Parse TARGET.
14526 * script.cc (script_set_target): New function.
14527 * script-c.h (script_set_target): Declare.
14528 * options.cc (General_options::string_to_object_format): Rename
14529 from string_to_object_format in anonymous namespace. Change
14530 callers.
14531 * options.h (class General_options): Declare
14532 string_to_object_format.
14533
3ee173de
ILT
145342009-06-22 Ian Lance Taylor <iant@google.com>
14535
14536 * script-sections.cc (Script_sections::create_segments): Don't put
14537 program headers in a PT_LOAD segment if -n or -N.
14538
145392009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14540
14541 PR 10141
14542 * options.h (class General_options): Add -z lazy and -z now. Sort
14543 -z options into alphabetical order.
14544 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14545
cd6739a1 145462009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14547
14548 * layout.cc (Layout::make_output_section): Call
14549 Target::new_output_section.
14550 (Layout::attach_allocated_section_to_segment): Put large section
14551 sections in a separate load segment with the large segment flag
14552 set.
14553 (Layout::segment_precedes): Sort large data segments after other
14554 load segments.
14555 (align_file_offset): New static function.
14556 (Layout::set_segment_offsets): Use align_file_offset.
14557 * output.h (class Output_section): Add is_small_section_ and
14558 is_large_section_ fields.
14559 (Output_section::is_small_section): New function.
14560 (Output_section::set_is_small_section): New function.
14561 (Output_section::is_large_section): New function.
14562 (Output_section::set_is_large_section): New function.
14563 (Output_section::is_large_data_section): New function.
14564 (class Output_segment): Add is_large_data_segment_ field.
14565 (Output_segment::is_large_data_segment): New function.
14566 (Output_segment::set_is_large_data_segment): New function.
14567 * output.cc (Output_section::Output_section): Initialize new
14568 fields.
14569 (Output_segment::Output_segment): Likewise.
14570 (Output_segment::add_output_section): Add assertion that large
14571 data sections always go in large data segments. Force small data
14572 sections to the end of the list of data sections. Force small BSS
14573 sections to the start of the list of BSS sections. For large BSS
14574 sections to the end of the list of BSS sections.
14575 * symtab.h (class Symbol): Declare is_common_shndx.
14576 (Symbol::is_defined): Check Symbol::is_common_shndx.
14577 (Symbol::is_common): Likewise.
14578 (class Symbol_table): Define enum Commons_section_type. Update
14579 declarations. Add small_commons_ and large_commons_ fields.
14580 * symtab.cc (Symbol::is_common_shndx): New function.
14581 (Symbol_table::Symbol_table): Initialize new fields.
14582 (Symbol_table::add_from_object): Put small and large common
14583 symbols in the right list.
14584 (Symbol_table::sized_finalized_symbol): Check
14585 Symbol::is_common_shndx.
14586 (Symbol_table::sized_write_globals): Likewise.
14587 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14588 common symbol lists. Don't call do_allocate_commons_list if the
14589 list is empty.
14590 (Symbol_table::do_allocate_commons_list): Remove is_tls
14591 parameter. Add comons_section_type parameter. Change all
14592 callers. Handle small and large common symbols.
14593 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14594 Symbol::is_common_shndx.
14595 * resolve.cc (symbol_to_bits): Likewise.
14596 * target.h (Target::small_common_shndx): New function.
14597 (Target::small_common_section_flags): New function.
14598 (Target::large_common_shndx): New function.
14599 (Target::large_common_section_flags): New function.
14600 (Target::new_output_section): New function.
14601 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14602 small_common_section_flags, and large_common_section_flags
14603 fields.
14604 (Target::do_new_output_section): New virtual function.
14605 * arm.cc (Target_arm::arm_info): Initialize new fields.
14606 * i386.cc (Target_i386::i386_info): Likewise.
14607 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14608 Likewise.
14609 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14610 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14611 (Target_x86_64::do_new_output_section): New function.
14612 * configure.ac: Define conditional MCMODEL_MEDIUM.
14613 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14614 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14615 (large_LDFLAGS): Define.
14616 * testsuite/large.c: New file.
14617 * testsuite/testfile.cc (Target_test::test_target_info):
14618 Initialize new fields.
14619 * configure, testsuite/Makefile.in: Rebuild.
14620
bb04269c
DK
146212009-06-05 Doug Kwan <dougkwan@google.com>
14622
14623 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14624 * Makefile.in: Regenerate.
bb04269c
DK
14625 * i386.cc (class Target_i386): Define new virtual method to
14626 override do_is_local_label_name in parent.
14627 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14628 local symbols if --discard-locals or -X is given.
14629 * options.h (class General_options): Declare new options
14630 '--discard-locals' and '-X' for discarding locals.
14631 * target.h (class Target): Define new methods is_local_label_name.
14632 Declare new virtual method do_is_local_label_name.
14633 * target.cc: New file.
14634 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14635 (check_SCRIPTS): Add discard_locals_test.sh.
14636 (check_DATA): Add discard_local_tests.syms.
14637 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14638 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14639 * testsuite/Makefile.in: Regenerate.
14640 * testsuite/discard_locals_test.c: New file.
14641 * testsuite/discard_locals_test.sh: Same.
14642
805bb01c
DK
146432009-06-05 Doug Kwan <dougkwan@google.com>
14644
14645 * object.cc (Sized_relobj::Sized_relobj): Initialize
14646 discarded_eh_frame_shndx_ to -1U.
14647 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14648 section.
14649 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14650 a discarded .eh_frame section.
14651 (Sized_relobj::do_finalize_local_symbols): Ditto.
14652 * object.h (class Sized_relobj): Declare new member
14653 discarded_eh_frame_shndx_.
14654 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14655 (local_labels_test.o, local_labels_test): New rules.
14656 * testsuite/Makefile.in: Regenerate.
14657
1dcd334d
DK
146582009-06-04 Doug Kwan <dougkwan@google.com>
14659
14660 * layout.cc (Layout::section_name_mapping): Add mapping for
14661 special ARM sections.
14662
96d49306
DK
146632009-06-03 Doug Kwan <dougkwan@google.com>
14664
14665 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14666 (utils::has_overflow): Same.
14667
dff16297
ILT
146682009-06-03 Ian Lance Taylor <iant@google.com>
14669
14670 * layout.cc (Layout::section_name_mapping): New array, replacing
14671 Layout::linkonce_mapping.
14672 (Layout::section_name_mapping_count): New variable, replacing
14673 Layout::linkonce_mapping_count.
14674 (Layout::linkonce_output_name): Remove.
14675 (Layout::output_section_name): Rewrite.
14676 * layout.h (class Layout): Rename Linkonce_mapping to
14677 Section_name_mapping, linkonce_mapping to section_name_mapping,
14678 linkonce_mapping_count to section_name_mapping_count. Don't
14679 declare linkonce_output_name.
14680
c121c671
DK
146812009-06-03 Doug Kwan <dougkwan@google.com>
14682
14683 * gold/arm.cc (namespace utils): New.
14684 (Target_arm::reloc_is_non_pic): Define new method.
14685 (class Arm_relocate_functions): New.
14686 (Target_arm::Relocate::relocate): Handle relocation types used by
14687 Android.
14688
07800fab
ILT
146892009-06-03 Ian Lance Taylor <iant@google.com>
14690
14691 * arm.cc (Target_arm::scan::global): Use || instead of |.
14692
c121c671
DK
146932009-06-02 Doug Kwan <dougkwan@google.com>
14694
14695 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14696 issued_non_pic_error_.
14697 (class Target_arm::Scan): Declare new method check_non_pic.
14698 Define new method symbol_needs_plt_entry.
14699 Declare new data member issued_non_pic_error_.
14700 (class Target_arm::Relocate): Declare new method
14701 should_apply_static_reloc.
14702 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14703 (Target_arm::Scan::check_non_pic): Define new method.
14704 (Target_arm::Scan::local): Handle a small subset of reloc types used
14705 by Android.
14706 (Target_arm::Scan::local): Same.
14707 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14708
b19b0c6d
ILT
147092009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14710
14711 * incremental.cc (Incremental_inputs::report_command_line): Filter
14712 out --incremental-* options.
14713
94cdfcff
DK
147142009-05-29 Doug Kwan <dougkwan@google.com>
14715
14716 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14717 template class.
14718 (class Target_arm): Update comment.
14719 (Target_arm::Target_arm): Initialize new data members GOT_,
14720 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14721 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14722 and Target_arm::rel_dyn_section.
14723 Declare new_enum Target_arm::Got_type.
14724 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14725 and DYNBSS_.
14726 Update commments for member do_dynsym_value.
14727 (Target_arm::got_size, Target_arm::plt_section,
14728 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14729 new methods inside class defintion.
14730 (Target_arm::got_section): Define new method.
14731 (Target_arm::rel_dyn_section): Same.
14732 (Output_data_plt_arm): New template class.
14733 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14734 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14735 (Output_data_plt_arm::add_entry): Same.
14736 (Output_data_plt_arm::first_plt_entry): Define new
14737 static data member for PLT instruction template.
14738 (Output_data_plt_arm::plt_entry): Same.
14739 (Output_data_plt_arm::do_write): Define new method.
14740 (Target_arm::make_plt_entry): Same.
14741 (Target_arm::do_finalize_sections): Same.
14742 (Target_arm::do_dynsym_value): Same.
14743
4a657b0d
DK
147442009-05-28 Doug Kwan <dougkwan@google.com>
14745
14746 * Makefile.am (TARGETSOURCES): Add arm.cc.
14747 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14748 * Makefile.in: Regenerate.
14749 * arm.cc: New file.
14750 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14751
e7ae8c36
DK
147522009-05-26 Doug Kwan <dougkwan@google.com>
14753
14754 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14755 (General_options::check_excluded_libs): Strip off directories in
14756 archive name before matching like GNU ld does.
14757 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14758 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14759 (exclude_libs_test_LDFLAGS): Add linker option
14760 -Wl,--exclude-libs,libexclude_libs_test_3
14761 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14762 an explicit archive without using -l.
14763 (alt/libexclude_libs_test_3.a): New make rule.
14764 * testsuite/Makefile.in: Regenerate.
14765 * testsuite/exclude_libs_test.c : Declare lib3_default().
14766 (main): Call it.
14767 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14768 * exclude_libs_test_3.c: New file.
14769
f12e7348
NC
147702009-05-26 Nick Clifton <nickc@redhat.com>
14771
14772 * po/id.po: New Indonesian translation.
14773 * po/gold.pot: Updated template file.
14774
4daadc0d
ST
147752009-05-22 Sriraman Tallam <tmsriram@google.com>
14776
e1df38aa 14777 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14778 gc_comdat_test files. Add -Wl,--gc-sections to build
14779 gc_comdat_test.
14780 * testsuite/Makefile.in: Regenerate.
14781 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14782
531813ad
ST
147832009-05-21 Sriraman Tallam <tmsriram@google.com>
14784
14785 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14786 kept comdat section was garbage collected.
14787 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14788 * testsuite/Makefile.in: Regenerate.
14789 * testsuite/gc_comdat_test.sh: New file.
14790 * testsuite/gc_comdat_test_1.cc: New file.
14791 * testsuite/gc_comdat_test_2.cc: New file.
14792
65514900
CC
147932009-05-19 Doug Kwan <dougkwan@google.com>
14794
14795 * archive.cc (Archive::Archive): Move constructor from archive.h
14796 to here. Initialize no_export_.
14797 (Archive::get_elf_object_for_member): Set no_export flag of object.
14798 * archive.h (Archive::Archive): Move constructor body to
14799 archive.cc.
14800 (Archive::no_export): New method.
14801 (Archive::no_export_): New field.
14802 * object.h (Object::Object): Initialize no_export_ to false.
14803 (Object::no_export, Object::set_no_export): New methods.
14804 (Object::no_export_): New field.
14805 * options.cc (General_options::parse_exclude_libs): New method.
14806 (General_options::check_excluded_libs) Same.
14807 * options.h (exclude_libs): New option.
14808 (General_options::check_excluded_libs): New method declaration.
14809 (General_options::excluded_libs_): New field.
14810 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14811 default or protected visibility if an object has no-export flag set.
14812 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14813 (check_SCRIPTS): Add exclude_libs_test.sh.
14814 (check_DATA): Add exclude_libs_test.syms.
14815 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14816 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14817 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14818 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14819 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14820 libexclude_libs_test_2.a): New rules.
14821 * testsuite/Makefile.in: Regenerate.
14822 * testsuite/exclude_libs_test.c: New file.
14823 * testsuite/exclude_libs_test.sh: Ditto.
14824 * testsuite/exclude_libs_test_1.c: Ditto.
14825 * testsuite/exclude_libs_test_2.c: Ditto.
14826
1b77ea50
ILT
148272009-05-15 Ian Lance Taylor <iant@google.com>
14828
14829 * configure.ac: Check for declarations for cases where libiberty.h
14830 checks HAVE_DECL_xxx.
14831 * configure, config.in: Rebuild.
14832
072fe7ce
ILT
148332009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14834
14835 * gold.h (Incremental_argument_list): Remove (invalid) forward
14836 declaration.
14837 * incremental.cc (Incremental_inputs::report_achive): New method.
14838 (Incremental_inputs::report_object): New method.
14839 (Incremental_inputs::report_script): New method.
14840 (Incremental_inputs::finalize_inputs): New method.
14841 (Incremental_inputs::finalize): Call finalize_inputs().
14842 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14843 Create inputs entries.
14844 * incremental.h (Incremental_input_type): New enum.
14845 (Incremental_inputs::Incremental_input): Initialize new fields.
14846 (Incremental_inputs::report_inputs): New method.
14847 (Incremental_inputs::report_achive): New method.
14848 (Incremental_inputs::report_object): New method.
14849 (Incremental_inputs::report_script): New method.
14850 (Incremental_inputs::finalize_inputs): New method.
14851 (Incremental_inputs::Input_info): New struct.
14852 (Incremental_inputs::Input_info_map): New typedef.
14853 (Incremental_inputs::lock_): New field.
14854 (Incremental_inputs::Inputs_): New field.
14855 (Incremental_inputs::Inputs_map): New field.
14856 * main.cc (main): Call Incremental_input::report_inputs.
14857 * options.h (Input_argument_list): Typedef moved from
14858 Input_arguments.
14859 (Input_file_group::Files): Remove, use ::Input_argument_list.
14860 (Input_file_group::Input_argument_list): Remove, use
14861 ::Input_argument_list.
14862 * plugin.cc (Plugin_manager::add_input_file): Add error in
14863 incremental build.
14864 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14865 functions.
14866 * script.cc (read_input_script): Call
14867 Incremental_input::report_script.
14868 * script.h (Script_info): New class.
14869
b0481b0b
ILT
148702009-04-27 Ian Lance Taylor <iant@google.com>
14871
14872 * x86_64.cc (do_adjust_output_section): Set entsize to
14873 plt_entry_size.
14874
b22a5a41 148752009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14876
14877 * output.cc (Output_file::close): After short writes, continue
14878 writing from the correct offset in the buffer being written.
14879
40fde488
CD
148802009-04-23 Chris Demetriou <cgd@google.com>
14881
14882 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14883 * configure: Regenerate.
14884 * config.in: Regenerate.
14885 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14886 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14887
3ce2c28e
ILT
148882009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14889
14890 * incremental.cc (Incremental_inputs_header_data): Renamed from
14891 Incremental_input_header_data.
14892 (Incremental_inputs_header_data::data_size): New field.
14893 (Incremental_inputs_header_data::put_input_file_count): Renamed
14894 from input_file_count.
14895 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14896 from command_line_offset.
14897 (Incremental_inputs_header_data::put_reserved): Renamed from
14898 put_reserved.
14899 (Incremental_inputs_entry_data): Renamed from
14900 Incremental_input_entry_data.
14901 (Incremental_inputs_entry_data::data_size): New field.
14902 (Incremental_inputs::report_command_line): New method.
14903 (Incremental_inputs::finalize): New method.
14904 (Incremental_inputs::create_incremental_inputs_data): New method.
14905 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14906 * incremental.h: New file.
14907 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14908 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14909 incremental builds.
703d02da 14910 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14911 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14912 (Layout::create_incremental_info_sections): New method.
14913 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14914 * main.cc (main): Notify Incremental_input of the command line.
14915
e55bde5e
ILT
149162009-04-01 Ian Lance Taylor <iant@google.com>
14917 Mikolaj Zalewski <mikolajz@google.com>
14918
14919 * gold.h (reserve_unordered_map): Define, three versions, one for
14920 each version of Unordered_map.
14921 * layout.cc (Layout::Layout): Remove options parameter. Add
14922 number_of_input_files parameter. Don't initialize options_.
14923 Initialize number_of_input_files_ and resized_signatures_. Move
14924 sections_are_attached_.
14925 (Layout::layout_group): Reserve space for group_signatures_.
14926 (Layout::find_or_add_kept_section): Change name parameter to be a
14927 reference. Resize signatures_ map when it gets large enough.
14928 (Layout::layout_eh_frame): Use parameters->options() instead of
14929 this->options_.
14930 (Layout::make_output_section): Likewise.
14931 (Layout::attach_allocated_section_to_segment): Likewise.
14932 (Layout::finalize, Layout::create_executable_stack): Likewise.
14933 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14934 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14935 * layout.h (class Layout): Update declarations. Remove options_
14936 field. Add number_of_input_files_ and resized_signatures_
14937 fields. Move sections_are_attached_ field.
14938 * main.cc (main): Pass number of input files to Layout
14939 constructor. Don't pass options.
14940
154b857c
ILT
149412009-03-30 Ian Lance Taylor <iant@google.com>
14942
14943 * ffsll.c (ffsll): Correct implementation.
14944
2f35ab9b
ILT
149452009-03-27 Ian Lance Taylor <iant@google.com>
14946
fd03461a
ILT
14947 * ffsll.c: New file.
14948 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14949 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14950 * ftruncate.c (ftruncate): Declare before definition.
14951 * mremap.c (mremap): Likewise.
14952 * pread.c (pread): Likewise.
14953 * configure, Makefile.in, config.in: Rebuild.
14954
2f35ab9b
ILT
14955 * mremap.c: New file.
14956 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14957 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14958 (mremap): Declare if HAVE_MREMAP is not defined.
14959 * configure, Makefile.in, config.in: Rebuild.
14960
33aea2fd
CC
149612009-03-27 Cary Coutant <ccoutant@google.com>
14962
14963 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14964 position independent.
14965 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14966 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14967
6d479619
CC
149682009-03-24 Cary Coutant <ccoutant@google.com>
14969
14970 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14971 an executable.
14972 (needs_dynamic_reloc): Likewise.
14973
afc06bb8
ILT
149742009-03-24 Ian Lance Taylor <iant@google.com>
14975
14976 * yyscript.y (file_cmd): Recognize EXTERN.
14977 (extern_name_list, extern_name_list_body): New nonterminals.
14978 * script.cc (script_add_extern): Define.
14979 * script-c.h (script_add_extern): Declare.
14980
f6060a4d
ILT
149812009-03-24 Rafael Avila de Espindola <espindola@google.com>
14982
14983 * object.cc (is_elf_object): Define.
14984 * object.h (is_elf_object): Declare.
14985 * archive.cc (Archive::get_elf_object_for_member): Call
14986 is_elf_object.
33aea2fd 14987 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14988
26736d8e
ILT
149892009-03-24 Elliott Hughes <enh@google.com>
14990
14991 * output.cc (Output_file::map_anonymous): Define.
14992 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14993 try an anonymous one. Report the size if the mmap fails.
14994 * output.h (class Output_file): Declare map_anonymous.
14995
22fd9730
ILT
149962009-03-24 Ian Lance Taylor <iant@google.com>
14997
14998 * target-select.cc (instantiate_target): Don't acquire the lock if
14999 the instantiated_target_ field has already been set.
15000
cb010894
ILT
150012009-03-23 Ian Lance Taylor <iant@google.com>
15002
7f055c20
ILT
15003 * gold-threads.h (class Initialize_lock): Define.
15004 * gold-threads.cc (class Initialize_lock_once): Define.
15005 (initialize_lock_control): New static variable.
15006 (initialize_lock_pointer): New static variable.
15007 (initialize_lock_once): New static function.
15008 (Initialize_lock::Initialize_lock): Define.
15009 (Initialize_lock::initialize): Define.
15010 * target-select.h: Include "gold-threads.h".
15011 (class Target_selector): Add lock_ and initialize_lock_ fields.
15012 Don't define instantiate_target, just declare it.
15013 * target-select.cc (Target_selector::Target_selector): Initialize
15014 new fields.
15015 (Target_selector::instantiate_target): Define.
15016 * descriptors.h: Include "gold-threads.h".
15017 (class Descriptors): Add initialize_lock_ field.
15018 * descriptors.cc (Descriptors::Descriptors): Initialize new
15019 field.
15020 (Descriptors::open): Use initialize_lock_ field
15021 * errors.h (class Errors): Add initialize_lock_ field.
15022 * errors.cc (Errors::Errors): Initialize new field.
15023 (Errors::initialize_lock): Use initialize_lock_ field.
15024 * powerpc.cc (class Target_selector_powerpc): Remove
15025 instantiated_target_ field. In do_recognize call
15026 instantiate_target rather than do_instantiate_target. In
15027 do_instantiate_target just allocate a new target.
15028 * sparc.cc (class Target_selector_sparc): Likewise.
15029
36959681
ILT
15030 * freebsd.h: New file.
15031 * i386.cc: Include "freebsd.h".
15032 (Target_i386): Derive from Target_freebsd rather than
15033 Sized_target.
15034 (Target_selector_i386): Derive from Target_selector_freebsd rather
15035 than Target_selector.
15036 * x86_64.cc: Include "freebsd.h".
15037 (Target_x86_64): Derive from Target_freebsd rather than
15038 Sized_target.
15039 (Target_selector_x86_64): Derive from Target_selector_freebsd
15040 rather than Target_selector.
15041 * target.h (class Target): Add adjust_elf_header and
15042 do_adjust_elf_header.
15043 * output.cc (Output_file_header:: do_sized_write): Call target
15044 adjust_elf_header routine.
15045 * configure.tgt: Set targ_osabi.
15046 * configure.ac: Define GOLD_DEFAULT_OSABI.
15047 * parameters.cc (Parameters::default_target): Pass
15048 GOLD_DEFAULT_OSABI to select_target.
15049 * target-select.h (class Target_selector): Make instantiate_target
15050 protected rather than private.
15051 * Makefile.am (HFILES): Add freebsd.h.
15052 * configure, Makefile.in, config.in: Rebuild.
15053
cb010894
ILT
15054 * merge.cc (do_add_input_section): Correct pend value. Change
15055 message about last entry not being null terminated from error to
15056 warning.
15057
0e879927
ILT
150582009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15059
15060 * incremental.cc: New file.
15061 * Makefile.am (CCFILES): Add incremental.cc.
15062 * Makefile.in: Rebuild.
15063
41105937
PP
150642009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15065
15066 * layout.cc (Layout::output_section_name): Preserve names
15067 of '.note.' sections.
e1df38aa 15068
60439920
ILT
150692009-03-19 Ian Lance Taylor <iant@google.com>
15070
15071 * descriptors.cc (Descriptors::open): Check that the options are
15072 valid before using them.
15073
0d371ad3
ILT
150742009-03-18 Ian Lance Taylor <iant@google.com>
15075
15076 * script-sections.h: Include <list>.
15077 (class Script_sections): Change Sections_elements from std::vector
15078 to std::list. Typedef public Elements_iterator. Add
15079 orphan_section_placement_, data_segment_align_start_, and
15080 saw_data_segment_align_ fields. Remove data_segment_align_index_
15081 field.
15082 * script-sections.cc (class Orphan_section_placement): New class.
15083 (class Sections_element): Add virtual functions is_relro and
15084 orphan_section_init. Remove virtual function place_orphan_here.
15085 (class Output_section_definition): Add is_relro and
15086 orphan_section_init. Remove place_orphan_here.
15087 (class Orphan_output_section): Likewise.
15088 (Script_sections::Script_sections): Update for field changes.
15089 (Script_sections::data_segment_align): Set saw_data_segment_align_
15090 and data_segment_align_start_, not data_segment_align_index.
15091 (Script_sections::data_segment_relro_end): Check
15092 saw_data_segment_align_. Use data_segment_align_start_ rather
15093 than data_segment_align_index_.
15094 (Script_sections::place_orphan): Rewrite to use
15095 Orphan_section_placement.
15096
9201d894
ILT
150972009-03-17 Ian Lance Taylor <iant@google.com>
15098
9c5b8369
ILT
15099 * archive.cc (Archive::add_symbols): Check for a version attached
15100 to the symbol name in the archive map.
15101 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15102 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15103 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15104 (ver_test_11.a): New target.
15105 * testsuite/Makefile.in: Rebuild.
15106
9201d894
ILT
15107 * configure.ac: Check for chsize and posix_fallocate. Replace
15108 ftruncate.
15109 * ftruncate.c: New file, from gnulib.
15110 * output.cc (posix_fallocate): Define dummy version if not
15111 HAVE_POSIX_FALLOCATE.
15112 (Output_file::map): Call posix_fallocate rather than lseek and
15113 write.
15114 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15115 * configure, Makefile.in, config.in: Rebuild.
15116
ef4ab7a8 151172009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15118
ef4ab7a8
PP
15119 * layout.h (Layout::create_note): Add section_name parameter.
15120 * layout.cc (Layout::create_note): Likewise.
15121 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15122
8c500701
ILT
151232009-03-17 Ian Lance Taylor <iant@google.com>
15124
e85b18e1
ILT
15125 * descriptors.cc: Include "options.h".
15126 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15127 (Descriptors::open): Always use O_CLOEXEC when opening a new
15128 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15129 then set FD_CLOEXEC.
15130
9efe6174
ILT
15131 * sparc.cc (class Target_sparc): Add has_got_section.
15132 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15133 make sure we have a GOT section.
15134
15135 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15136 (Target_sparc::Scan::local): Likewise.
15137 (Target_sparc::Scan::global): Likewise.
15138 (Target_sparc::Relocate::relocate): Likewise.
15139 (Target_sparc::Relocate::relocate_tls): Likewise.
15140
8c500701
ILT
15141 * symtab.cc (Symbol_table::define_default_version): New function,
15142 broken out of add_from_object.
15143 (Symbol_table::add_from_object): Call define_default_version.
15144 (Symbol_table::define_special_symbol): Add resolve_oldsym
15145 parameter. Change all callers. If the version for a symbol comes
15146 from a version script, resolve it with the symbol with the same
15147 name with no version. Also add the symbol without a version if
15148 appropriate.
15149 (do_define_in_output_data): If resolving with oldsym, don't delete
15150 sym.
15151 (do_define_in_output_segment): Likewise.
15152 (do_define_as_constant): Likewise.
15153 * symtab.h (class Symbol_table): Update declarations.
15154
f1ed28fb
ILT
151552009-03-13 Ian Lance Taylor <iant@google.com>
15156
15f8229b
ILT
15157 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15158 (Read_symbols::requeue): New function.
15159 (Read_symbols::do_read_symbols): If make_elf_object fails because
15160 the target type is not configured, and the file was searched for,
15161 issue a warning and retry with the next directory.
15162 (Add_symbols::run): If the file has an incompatible format, and
15163 it was searched for, requeue the Read_symbols task. On error,
15164 release the object.
15165 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15166 dirindex parameter to constructor. Change all callers. Declare
15167 incompatible_warning and requeue.
15168 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15169 input_argument_ and input_group_ fields. Add them to
15170 constructor. Change all callers.
15171 (class Read_script): Add dirindex_ field. Add it to constructor.
15172 Change all callers.
15173 * archive.cc (Archive::setup): Remove input_objects parameter.
15174 Change all callers.
15175 (Archive::get_file_and_offset): Likewise.
15176 (Archive::read_all_symbols): Likewise.
15177 (Archive::read_symbols): Likewise.
15178 (Archive::get_elf_object_for_member): Remove input_objects
15179 parameter. Add punconfigured parameter. Change all callers.
15180 (Archive::add_symbols): Change return type to bool. Check return
15181 value of include_member.
15182 (Archive::include_all_members): Likewise.
15183 (Archive::include_member): Change return type to bool. Return
15184 false if first included object has incompatible target. Set
15185 included_member_ field.
15186 (Add_archive_symbols::run): If add_symbols returns false, requeue
15187 Read_symbols task.
15188 * archive.h (class Archive): Add included_member_ field.
15189 Initialize it in constructor. Add input_file and searched_for
15190 methods. Update declarations.
15191 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15192 input_argument_ fields. Add them to constructor. Change all
15193 callers.
15194 * script.cc: Include "target-select.h".
15195 (class Parser_closure): Add skip_on_incompatible_target_ and
15196 found_incompatible_target_ fields. Add
15197 skip_on_incompatible_target parameter to constructor. Change all
15198 callers. Add methods skip_on_incompatible_target,
15199 clear_skip_on_incompatible_target, found_incompatible_target, and
15200 set_found_incompatible_target.
15201 (read_input_script): Add dirindex parameter. Change all callers.
15202 If parser finds an incompatible target, requeue Read_symbols
15203 task.
15204 (script_set_symbol): Clear skip_on_incompatible_target in
15205 closure.
15206 (script_add_assertion, script_parse_option): Likewise.
15207 (script_start_sections, script_add_phdr): Likewise.
15208 (script_check_output_format): New function.
15209 * script.h (read_input_script): Update declaration.
15210 * script-c.h (script_check_output_format): Declare.
15211 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15212 (ignore_cmd): Remove OUTPUT_FORMAT.
15213 * fileread.cc (Input_file::Input_file): Add explicit this.
15214 (Input_file::will_search_for): New function.
15215 (Input_file::open): Add pindex parameter. Change all callers.
15216 * fileread.h (class Input_file): Add input_file_argument method.
15217 Declare will_search_for. Update declarations.
15218 * object.cc (make_elf_object): Add punconfigured parameter.
15219 Change all callers.
15220 * object.h (class Object): Make input_file public. Add
15221 searched_for method.
15222 (make_elf_object): Update declaration.
15223 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15224 restart search.
15225 * dirsearch.h (class Dirsearch): Update declaration.
15226 * options.h (class General_options): Add --warn-search-mismatch.
15227 * parameters.cc (Parameters::is_compatible_target): New function.
15228 * parameters.h (class Parameters): Declare is_compatible_target.
15229 * workqueue.cc (Workqueue::add_blocker): New function.
15230 * workqueue.h (class Workqueue): Declare add_blocker.
15231
f1ed28fb
ILT
15232 * fileread.cc (Input_file::open): Remove options parameter.
15233 Change all callers.
15234 (Input_file::open_binary): Likewise.
15235 * script.cc (read_input_script): Likewise.
15236 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15237 options parameter from constructor. Change all callers.
15238 (class Read_script): Likewise.
15239 * fileread.h (class Input_file): Update declarations.
15240 * script.h (read_input_script): Update declaration.
15241
34dd024a
NC
152422009-03-10 Nick Clifton <nickc@redhat.com>
15243
15244 * po/es.po: New Spanish translation.
15245
6d71b17c
CC
152462009-03-06 Cary Coutant <ccoutant@google.com>
15247
15248 * options.cc (parse_short_option): Keep dash_z from registering itself.
15249
031cdbed
ILT
152502009-03-03 Ian Lance Taylor <iant@google.com>
15251
15252 PR 9918
15253 * target-reloc.h (relocate_section): Pass output_section to
15254 relocate.
15255 * i386.cc (Target_i386::should_apply_static_reloc): Add
15256 output_section parameter. Change all callers.
15257 (Target_i386::Relocate::relocate): Add output_section parameter.
15258 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15259 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15260 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15261 * testsuite/two_file_shared.sh: New script.
15262 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15263 (check_DATA): Add two_file_shared.dbg.
15264 (two_file_shared.dbg): New target.
15265 * testsuite/Makefile.in: Rebuild.
15266
15d5fa16
ILT
152672009-03-01 Ian Lance Taylor <iant@google.com>
15268
15269 * configure.ac: Check for byteswap.h.
15270 * configure: Rebuild.
15271 * config.in: Rebuild.
15272
8a4c0b0d
ILT
152732009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15274
15275 * layout.cc (Layout::find_or_add_kept_section): New function.
15276 (Layout::add_comdat): Removed.
15277 * layout.h (struct Kept_section): Move out of class Layout.
15278 Remove trailing underscores from field names. Add group_sections
15279 field. Rename group_ field to is_group. Change all uses.
15280 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15281 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15282 comdat_groups_ field.
15283 (Sized_relobj::include_section_group): Use
15284 find_or_add_kept_section and Kept_section::group_sections.
15285 (Sized_relobj::include_linkonce_section): Likewise.
15286 * object.cc (class Sized_relobj): Don't define Comdat_group or
15287 Comdat_group_table. Remove find_comdat_group and
15288 add_comdat_group. Remove comdat_groups_ field.
15289 * plugin.cc (include_comdat_group): Use
15290 Layout::find_or_add_kept_section.
15291
b4ecf66b
ILT
152922009-02-28 Ian Lance Taylor <iant@google.com>
15293
14359ca0
ILT
15294 * README: --gc-sections and map files are now supported. Document
15295 some build requirements.
15296
b4ecf66b
ILT
15297 PR 6992
15298 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15299 relocatable link set the value of the section symbol to zero.
15300 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15301 relocatable link don't include the section address in the local
15302 symbol value.
15303
0602e05a
ILT
153042009-02-27 Ian Lance Taylor <iant@google.com>
15305
fd9d194f
ILT
15306 PR 6811
15307 * options.h (class Search_directory): Add is_system_directory.
15308 (class General_options): Declare is_in_system_directory.
15309 * options.cc (get_relative_sysroot): Make static.
15310 (get_default_sysroot): Make static.
15311 (General_optoins::is_in_system_directory): New function.
15312 * fileread.cc (Input_file::is_in_system_directory): New function.
15313 * fileread.h (class Input_file): Declare is_in_system_directory.
15314 * object.h (class Object): Add is_in_system_directory.
15315 (class Input_objects): Remove system_library_directory_ field.
15316 * object.cc (Input_objects::add_object): Don't set
15317 system_library_directory_.
15318 (input_objects::found_in_system_library_directory): Remove.
15319 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15320 parameter. Change all callers.
15321 (Symbol_table::sized_write_globals): Likewise.
15322 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15323 Call Object::is_in_system_directory.
15324 * symtab.h (class Symbol_table): Update declarations.
15325
61edd21f
ILT
15326 PR 5990
15327 * descriptors.h (Open_descriptor): Add is_on_stack field.
15328 * descriptors.cc (Descriptors::open): If the descriptor is on the
15329 top of the stack, remove it. Initialize is_on_stack field.
15330 (Descriptors::release): Only add pod to stack if it is not on the
15331 stack already.
15332 (Descriptors::close_some_descriptor): Clear stack_next and
15333 is_on_stack fields.
15334
e29e076a
ILT
15335 PR 7091
15336 * output.cc (Output_section::find_starting_output_address): Rename
15337 from starting_output_address; add PADDR parameter; change return
15338 type.
15339 * output.h (class Output_section): Declare
15340 find_starting_output_address instead of starting_output_address.
15341 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15342 section symbol for which we can't find a merge section.
15343
0602e05a
ILT
15344 PR 9836
15345 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15346 hidden or internal, force the symbol to be local.
15347 * resolve.cc (Symbol::override_visibility): Define.
15348 (Symbol::override_base): Use override_visibility.
15349 (Symbol_table::resolve): Likewise.
15350 (Symbol::override_base_with_special): Likewise.
15351 (Symbol_table::override_with_special): If the visibility is hidden
15352 or internal, force the symbol to be local.
15353 * symtab.h (class Symbol): Add set_visibility and
15354 override_visibility.
15355 * testsuite/ver_test_1.sh: New file.
15356 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15357 (check_DATA): Add ver_test_1.syms.
15358 (ver_test_1.syms): New target.
15359 * testsuite/Makefile.in: Rebuild.
15360
401a9a73
CC
153612009-02-25 Cary Coutant <ccoutant@google.com>
15362
15363 * layout.cc (Layout::choose_output_section): Don't rename sections
15364 when using a linker script that has a SECTIONS clause.
15365 * Makefile.in: Regenerate.
15366
15367 * testsuite/Makefile.am (script_test_5.sh): New test case.
15368 * testsuite/Makefile.in: Regenerate.
15369 * testsuite/script_test_5.cc: New file.
15370 * testsuite/script_test_5.sh: New file.
15371 * testsuite/script_test_5.t: New file.
15372
f488e4b0
CC
153732009-02-13 Rafael Avila de Espindola <espindola@google.com>
15374
15375 * archive.cc (Archive::include_member): Update calls to add_symbols.
15376 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15377 the Layout argument.
15378 * dynobj.h (do_add_symbols): Add the Layout argument.
15379 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15380 Layout argument.
15381 * object.h (Object::add_symbols): Add the Layout argument.
15382 (Object::do_add_symbols): Add the Layout argument.
15383 (Sized_relobj::do_add_symbols): Add the Layout argument.
15384 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15385 Unify the two versions.
15386 (Add_plugin_symbols): Remove.
15387 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15388 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15389 (Add_plugin_symbols): Remove.
15390 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15391 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15392 (Add_symbols::run): Make it work with Pulginobj.
15393
89dd1680
ILT
153942009-02-06 Ian Lance Taylor <iant@google.com>
15395
15396 * object.cc (Sized_relobj::do_layout): Make info message start
15397 with lower case letter.
15398
266d0a74
ILT
153992009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15400
602b464e
ILT
15401 * binary.cc: Fix file comment.
15402
266d0a74
ILT
15403 * options.h (enum Incremental_disposition): Define.
15404 (class General_options): Add new options: --incremental,
15405 --incremental_changed, --incremental_unchanged,
15406 --incremental_unknown. Add incremental_disposition_ and
15407 implicit_incremental_ fields.
15408 (General_options::incremental_disposition): New function.
15409 (class Position_dependent_options): Add incremental_disposition
15410 option.
15411 (Position_dependent_options::copy_from_options): Set incremental
15412 dispositions.
15413 * options.cc (General_options::parse_incremental_changed): New
15414 function.
2e702c99
RM
15415 (General_options::parse_incremental_unchanged): New function.
15416 (General_options::parse_incremental_unknown): New function.
15417 (General_options::General_options): Initialize new fields
266d0a74 15418 incremental_disposition_ and implicit_incremental_.
2e702c99 15419 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15420 without --incremental.
15421
f073bbf7
CD
154222009-02-06 Chris Demetriou <cgd@google.com>
15423
15424 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15425 pointer and to report location as the file name associated with
15426 the symbol.
15427 (gold_undefined_symbol_at_location): New function to replace the
15428 old gold_undefined_symbol functionality.
15429 * target-reloc.h (relocate_section): Update to use
15430 gold_undefined_symbol_at_location.
15431 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15432 Call gold_undefined_symbol function rather than gold_error.
15433 * errors.h (Errors::undefined_symbol): Take location as a
15434 string, rather than calculating it from a relocation.
15435 * errors.cc (Errors::fatal): Print "fatal error:" before the
15436 formatted message.
15437 (Errors::error, Errors::error_at_location): Print "error: "
15438 before the formatted message.
15439 (Errors::undefined_symbol): Take location as a string, rather
15440 than calculating it from a relocation.
15441 (gold_undefined_symbol_at_location): New function akin to
15442 old gold_undefined_symbol, calculates location from relocation.
15443 (gold_undefined_symbol): Change to take only a Symbol pointer
15444 and to report location as the file name associated with the symbol.
15445 * testsuite/debug_msg.sh: Update for changed error messages.
15446 * testsuite/undef_symbol.sh: Likewise.
15447
8e94a90c
ILT
154482009-02-04 Duncan Sands <baldrick@free.fr>
15449
15450 PR 9812
15451 * reduced_debug_output.h
15452 (Output_reduced_debug_abbrev_section::failed): Use format for
15453 gold_warning.
15454 (Output_reduced_debug_info_section::faild): Likewise.
15455
88a0e15b
ILT
154562009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15457
15458 * script.cc (Lazy_demangler): New class.
2e702c99 15459 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15460 symbol only once.
15461
5efc7cd2
CC
154622009-01-29 Cary Coutant <ccoutant@google.com>
15463
15464 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15465 to __tls_get_addr.
15466 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15467
e0ebcf42
ILT
154682009-01-28 Ian Lance Taylor <iant@google.com>
15469
5efc7cd2 15470 * version.cc (version_string): Bump to 1.9.
75fe7426 15471
e0ebcf42
ILT
15472 * gold.h: Include <cstring> and <stdint.h>.
15473 * version.cc: Include <cstdio>.
15474 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15475 warning.
15476 * reduced_debug_output.cc (insert_into_vector): Rename from
15477 Insert_into_vector; change all callers. Use Swap_unaligned to
15478 avoid aliasing issue; remove union since it is unnecessary.
15479
8e2813be 154802009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15481
15482 * Makefile.am (CCFILES): Add gc.cc.
15483 (HFILES): Add gc.h.
15484 * Makefile.in: Regenerate.
15485 * gold.cc (Gc_runner): New class.
15486 (queue_initial_tasks): Call garbage collection related tasks
15487 when corresponding options are invoked.
15488 (queue_middle_gc_tasks): New function.
15489 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15490 processed early before laying out sections during garbage collection.
15491 * gold.h (queue_middle_gc_tasks): New function.
15492 (is_prefix_of): Move from "layout.cc".
15493 * i386.cc (Target_i386::gc_process_relocs): New function.
15494 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15495 * main.cc (main): Create object of class "Garbage_collection".
15496 * object.cc (Relobj::copy_symbols_data): New function.
15497 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15498 (Sized_relobj::do_layout): Allow this function to be called twice
15499 during garbage collection and defer layout of section during the
6d03d481
ST
15500 first call.
15501 * object.h (Relobj::get_symbols_data): New function.
15502 (Relobj::is_section_name_included): New function.
15503 (Relobj::copy_symbols_data): New function.
15504 (Relobj::set_symbols_data): New function.
15505 (Relobj::get_relocs_data): New function.
15506 (Relobj::set_relocs_data): New function.
15507 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15508 (Relobj::gc_process_relocs): New function.
15509 (Relobj::do_gc_process_relocs): New pure virtual function.
15510 (Relobj::sd_): New data member.
15511 (Sized_relobj::is_output_section_offset_invalid): New function.
15512 (Sized_relobj::do_gc_process_relocs): New function.
15513 * options.h (General_options::gc_sections): Modify to not be a no-op.
15514 (General_options::print_gc_sections): New option.
15515 * plugin.cc (Plugin_finish::run): Remove function call to
15516 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15517 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15518 * reloc.cc (Read_relocs::run): Add task to process relocs and
15519 determine unreferenced sections when doing garbage collection.
15520 (Gc_process_relocs): New class.
15521 (Sized_relobj::do_gc_process_relocs): New function.
15522 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15523 sections that are garbage collected.
15524 * reloc.h (Gc_process_relocs): New class.
15525 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15526 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15527 symbols whose corresponding sections are garbage collected.
15528 (Symbol_table::Symbol_table): Add new parameter for the garbage
15529 collection object.
15530 (Symbol_table::gc_mark_undef_symbols): New function.
15531 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15532 (Symbol_table::gc_mark_dyn_syms): New function.
15533 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15534 as garbage.
15535 (Symbol_table::add_from_object): Likewise.
15536 (Symbol_table::add_from_relobj): When building shared objects, do not
15537 treat externally visible symbols as garbage.
15538 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15539 table information for static and relocatable links.
15540 * symtab.h (Symbol_table::set_gc): New function.
15541 (Symbol_table::gc): New function.
15542 (Symbol_table::gc_mark_undef_symbols): New function.
15543 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15544 (Symbol_table::gc_mark_dyn_syms): New function.
15545 (Symbol_table::gc_): New data member.
e1df38aa 15546 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15547 function.
15548 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15549 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15550
3b293544
CF
155512009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15552
15553 * options.h (General_options::gc_sections): Define as a no-op for now.
15554 (General_options::no_keep_memory): Ditto.
15555 (General_options::Bshareable): Define.
15556 * options.cc (General_options::finalize): Honor -Bshareable.
15557
83d22aa8
AS
155582009-01-20 Andreas Schwab <schwab@suse.de>
15559
15560 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15561 read the value in the contents, since we don't use it. Use the
15562 template endianness when writing.
15563 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15564
cd536b21
AS
155652009-01-19 Andreas Schwab <schwab@suse.de>
15566
15567 * configure.tgt (powerpc64-*): Fix targ_obj.
15568
99e9a495
ILT
155692009-01-15 Ian Lance Taylor <iant@google.com>
15570
15571 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15572 local symbols when stripping all symbols.
15573
bbbfea06
CC
155742009-01-14 Cary Coutant <ccoutant@google.com>
15575
99e9a495 15576 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15577
0f7c0701
CC
155782009-01-14 Cary Coutant <ccoutant@google.com>
15579
15580 * archive.cc (Archive::get_elf_object_for_member): Remove call
15581 to File_read::claim_for_plugin.
15582 * descriptors.cc (Descriptors::open): Remove reference to
15583 is_claimed.
15584 (Descriptors::claim_for_plugin): Remove.
15585 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15586 (Descriptors::is_claimed): Remove.
15587 (claim_descriptor_for_plugin): Remove.
15588 * fileread.cc (File_read::claim_for_plugin): Remove.
15589 * fileread.h (File_read::claim_for_plugin): Remove.
15590 (File_read::descriptor): Reopen descriptor if necessary.
15591 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15592 (Plugin_manager::all_symbols_read): Add task parameter. Change
15593 all callers.
15594 (Plugin_manager::get_input_file): New function.
15595 (Plugin_manager::release_input_file): New function.
15596 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15597 corresponding data member.
15598 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15599 and pass to base constructor. Change all callers.
15600 (get_input_file, release_input_file): New functions.
15601 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15602 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15603 (Plugin_manager::all_symbols_read): Add task parameter.
15604 (Plugin_manager::get_input_file): New function.
15605 (Plugin_manager::release_input_file): New function.
15606 (Plugin_manager::task_): New data member.
15607 (Pluginobj::Pluginobj): Add filesize parameter.
15608 (Pluginobj::filename): New function.
15609 (Pluginobj::descriptor): New function.
15610 (Pluginobj::filesize): New function.
15611 (Pluginobj::filesize_): New data member.
15612 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15613 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15614 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15615
15616 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15617 with archive libraries.
15618 * testsuite/Makefile.in: Regenerate.
15619 * testsuite/plugin_test.c (struct sym_info): New type.
15620 (get_input_file, release_input_file): New static variables.
15621 (onload): Capture new transfer vector entries.
15622 (claim_file_hook): Stop reading at end of file according to filesize.
15623 Factor out parsing of readelf output into separate function.
15624 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15625 APIs and get the source file name from the symbol table. Convert
15626 source file name to corresponding object file name. Print info
15627 message when adding new input files.
15628 (parse_readelf_line): New function.
15629 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15630 * testsuite/plugin_test_2.sh: Likewise.
15631 * testsuite/plugin_test_3.sh: Likewise.
15632 * testsuite/plugin_test_4.sh: New test case.
15633
62a6d109
ILT
156342009-01-07 Ian Lance Taylor <iant@google.com>
15635
15636 * version.cc (version_string): Bump to 1.8.
15637
483620e8
CC
156382008-12-23 Cary Coutant <ccoutant@google.com>
15639
15640 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15641 * plugin.cc (Plugin_manager::finish): Rename as
15642 layout_deferred_objects. Move cleanup to separate function.
15643 (Plugin_manager::cleanup): New function.
15644 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15645 separately.
15646 * plugin.h (Plugin_manager::finish): Rename as
15647 layout_deferred_objects.
15648 (Plugin_manager::cleanup): New function.
15649 (Plugin_manager::cleanup_done): New field.
15650
d66a9eb3
CC
156512008-12-23 Cary Coutant <ccoutant@google.com>
15652
15653 * plugin.cc (is_visible_from_outside): New function.
15654 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15655 so we don't return "IR only" status for exported symbols or -r links.
15656
15657 * testsuite/Makefile.am (plugin_test_3): New test case.
15658 * testsuite/Makefile.in: Regenerate.
15659 * testsuite/plugin_test_3.sh: New file.
15660
5995b570
CC
156612008-12-22 Cary Coutant <ccoutant@google.com>
15662
15663 * object.cc (Sized_relobj::layout_section): New function.
15664 (Sized_relobj::do_layout): Defer layout of input sections until after
15665 plugin has provided replacement files.
15666 (Sized_relobj::do_layout_deferred_sections): New function.
15667 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15668 (Relobj::layout_deferred_sections): New function.
15669 (Relobj::do_layout_deferred_sections): New function.
15670 (Sized_relobj::do_layout_deferred_sections): New function.
15671 (Sized_relobj::layout_section): New function.
15672 (Sized_relobj::Deferred_layout): New structure.
15673 (Sized_relobj::deferred_layout_): New field.
15674 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15675 Change all callers. Layout deferred sections.
15676 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15677 references.
15678 (Plugin_hook::run): Move code from do_plugin_hook inline.
15679 (Plugin_hook::do_plugin_hook): Remove.
15680 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15681 (Plugin_manager::finish): Renamed, was cleanup.
15682 (Plugin_manager::should_defer_layout): New function.
15683 (Plugin_manager::add_deferred_layout_object): New function.
15684 (Plugin_manager::Deferred_layout_list): New type.
15685 (Plugin_manager::deferred_layout_objects_): New field.
15686 (Plugin_hook::do_plugin_hook): Remove.
15687
ee769c88
ILT
156882008-12-17 Ian Lance Taylor <iant@google.com>
15689
15690 * options.h (class General_options): Add --no case for
15691 --export-dynamic.
15692
abc8dcba
CC
156932008-12-16 Cary Coutant <ccoutant@google.com>
15694
15695 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15696 vector.
15697 (Plugin_manager::claim_file): Create plugin object even if
15698 plugin did not call the add_symbols callback.
15699 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15700 asking for more symbols than were added.
15701 * testsuite/Makefile.am (plugin_test_1): Add test case with
15702 no global symbols.
15703 (empty.syms): New target.
15704 * testsuite/Makefile.in: Regenerate.
15705 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15706 message. Don't call add_symbols if no globals.
15707 (all_symbols_read_hook): Don't provide replacement for empty
15708 claimed file.
15709
b0074644
ILT
157102008-12-12 Ian Lance Taylor <iant@google.com>
15711
68943102
ILT
15712 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15713 r_type == 0 for a local symbol with r_sym == 0.
15714 (scan_relocatable_relocs): Pass r_sym to
15715 local_non_section_strategy.
15716 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15717 r_sym parameter.
15718
b0074644
ILT
15719 * configure.ac: Update test for TLS descriptors: they are
15720 supported as of glibc 2.9.
15721 * configure: Rebuild.
15722
c2508178
ILT
157232008-12-11 Ian Lance Taylor <iant@google.com>
15724
15725 PR 7091
15726 * target-reloc.h (Default_scan_relocatable_relocs): For each
15727 function, map r_type == 0 to RELOC_DISCARD.
15728
2756a258
CC
157292008-12-10 Cary Coutant <ccoutant@google.com>
15730
15731 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15732 object to override a kept COMDAT group from a plugin object.
15733
bb6f53d3
ILT
157342008-12-09 Ian Lance Taylor <iant@google.com>
15735
fbc558e1
ILT
15736 PR 7088
15737 * yyscript.y (file_cmd): Handle INPUT.
15738
bb6f53d3
ILT
15739 * testsuite/initpri1.c: Change all declarations to be full
15740 prototypes by adding void, to avoid compiler warnings.
15741
4674ecfc
CC
157422008-12-05 Rafael Avila de Espindola <espindola@google.com>
15743
15744 * options.cc (General_options::parse_plugin_opt): New.
15745 (General_options::add_plugin): The argument now is just the filename.
15746 (General_options::add_plugin_option): New.
15747 * options.h (plugin_opt): New.
15748 (add_plugin): Change argument name.
15749 (add_plugin_option): New.
15750 * plugin.cc (Plugin::load): Don't parse the plugin option.
15751 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15752 (Plugin::add_option): New.
15753 (Plugin::args_): Change type.
15754 (Plugin::filename_): New.
15755 (Plugin_manager::add_plugin_option): New.
15756 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15757 * testsuite/Makefile.in: Regenerate.
15758
fd06b4aa
CC
157592008-12-05 Cary Coutant <ccoutant@google.com>
15760
15761 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15762 Handle --strip-lto-sections option.
15763 * options.h (strip_lto_sections): New option.
15764
6c52134c
CC
157652008-12-01 Cary Coutant <ccoutant@google.com>
15766
15767 * plugin.cc (ld_plugin_message): Change format parameter to const.
15768 Fix mismatch between new[] and delete.
15769
a45248e0
CC
157702008-11-14 Cary Coutant <ccoutant@google.com>
15771
15772 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15773 instead of -1U.
15774
c82fbeee
CS
157752008-11-05 Craig Silverstein <csilvers@google.com>
15776
15777 * options.cc (General_options::parse_dynamic_list): New function.
15778 * options.h (General_options): New flags dynamic_list,
15779 dynamic_list_data, dynamic_list_cpp_new, and
15780 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15781 (General_options::in_dynamic_list): New function.
15782 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15783 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15784 (Lex::can_continue_name): Likewise.
15785 (yylex): Likewise.
15786 (read_script_file): New parameter script_options.
15787 (read_dynamic_list): New function.
15788 (Script_options::define_dynamic_list): New function.
15789 (dynamic_list_keyword_parsecodes): New variable.
15790 (dynamic_list_keywords): New variable.
15791 * script.h (Script_options::define_dynamic_list): New function
15792 prototype.
15793 (read_dynamic_list): New function prototype.
15794 * symtab.cc (strprefix): New macro.
15795 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15796 dynamic_list_data, dynamic_list_cpp_new, and
15797 dynamic_list_cpp_typeinfo.
15798 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15799 (dynamic_list_expr): New rule.
15800 (dynamic_list_nodes): Likewise.
15801 (dynamic_list_node): Likewise.
15802 * testsuite/Makefile.am (dynamic_list): New test.
15803 * testsuite/Makefile.in: Regenerated.
15804 * testsuite/dynamic_list.t: New file.
15805 * testsuite/dynamic_list.sh: New file.
15806
e0bb29a5
CS
158072008-11-05 Craig Silverstein <csilvers@google.com>
15808
15809 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15810 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15811 (t11_last): Likewise.
15812 * testsuite/ver_test_6.c (main): Likewise.
15813
4e1e25e0
CC
158142008-10-07 Cary Coutant <ccoutant@google.com>
15815
15816 * options.c (General_options::finalize): Add check for -static and
15817 -shared.
15818 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15819 is not empty.
15820
92f03fcb
CC
158212008-10-02 Cary Coutant <ccoutant@google.com>
15822
15823 * plugin.cc (make_sized_plugin_object): Fix conditional
15824 compilation to work when not all targets are enabled.
15825
fbd8a257
CC
158262008-09-29 Cary Coutant <ccoutant@google.com>
15827
15828 * archive.cc (Archive::get_file_and_offset): Use filename instead
15829 of name to get library path.
15830 (Archive::include_member): Unlock external member of a thin archive.
15831
15832 * testsuite/Makefile.am (TEST_AR): New variable.
15833 (thin_archive_test_1): New test.
15834 (thin_archive_test_2): New test.
81636b3f
CC
15835 * testsuite/Makefile.in: Regenerate.
15836 * testsuite/thin_archive_main.cc: New file.
15837 * testsuite/thin_archive_test_1.cc: New file.
15838 * testsuite/thin_archive_test_2.cc: New file.
15839 * testsuite/thin_archive_test_3.cc: New file.
15840 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15841
eff45813
CC
158422008-09-29 Cary Coutant <ccoutant@google.com>
15843
15844 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15845 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15846 instead of -1U.
15847 (Sized_relobj::do_finalize_local_symbols): Likewise.
15848 (Sized_relobj::map_to_kept_section): Likewise.
15849 * object.h (Sized_relobj::invalid_address): New constant.
15850 (Sized_relobj::do_output_section_offset): Check for invalid_address
15851 and return -1ULL.
15852 * output.cc (Output_reloc::local_section_offset): Use constant
15853 invalid_address instead of -1U.
15854 (Output_reloc::get_address): Likewise.
15855 (Output_section::output_address): Change -1U to -1ULL.
15856 * output.h (Output_reloc::invalid_address): New constant.
15857 * reloc.cc (Sized_relobj::write_sections): Use constant
15858 invalid_address instead of -1U.
15859 (Sized_relobj::relocate_sections): Likewise.
15860 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15861 values for merge sections.
15862 * target-reloc.h (relocate_for_relocatable): Use constant
15863 invalid_address instead of -1U.
15864
89fc3421
CC
158652008-09-19 Cary Coutant <ccoutant@google.com>
15866
15867 Add plugin functionality for link-time optimization (LTO).
15868 * configure.ac (plugins): Add --enable-plugins option.
15869 * configure: Regenerate.
15870 * config.in: Regenerate.
15871 * Makefile.am (LIBDL): New variable.
15872 (CCFILES): Add plugin.cc.
15873 (HFILES): Add plugin.h.
15874 (ldadd_var): Add LIBDL.
15875 * Makefile.in: Regenerate.
15876
15877 * archive.cc: Include "plugin.h".
15878 (Archive::setup): Don't preread archive symbols when using a plugin.
15879 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15880 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15881 files.
15882 (Archive::include_member): Add symbols from plugin objects.
15883 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15884 * descriptors.cc (Descriptors::open): Check for file descriptors
15885 abandoned by plugins.
15886 (Descriptors::claim_for_plugin): New function.
15887 * descriptors.h (Descriptors::claim_for_plugin): New function.
15888 (Open_descriptor::is_claimed): New field.
15889 (claim_descriptor_for_plugin): New function.
15890 * fileread.cc (File_read::claim_for_plugin): New function.
15891 * fileread.h (File_read::claim_for_plugin): New function.
15892 (File_read::descriptor): New function.
15893 * gold.cc: Include "plugin.h".
15894 (queue_initial_tasks): Add task to call plugin hooks for generating
15895 new object files.
15896 * main.cc: Include "plugin.h".
15897 (main): Load plugin libraries.
15898 * object.h (Pluginobj): Declare.
15899 (Object::pluginobj): New function.
15900 (Object::do_pluginobj): New function.
15901 (Object::set_target): New function.
15902 * options.cc: Include "plugin.h".
15903 (General_options::parse_plugin): New function.
15904 (General_options::General_options): Initialize plugins_ field.
15905 (General_options::add_plugin): New function.
15906 * options.h (Plugin_manager): Declare.
15907 (General_options): Add --plugin option.
15908 (General_options::has_plugins): New function.
15909 (General_options::plugins): New function.
15910 (General_options::add_plugin): New function.
15911 (General_options::plugins_): New field.
15912 * plugin.cc: New file.
15913 * plugin.h: New file.
15914 * readsyms.cc: Include "plugin.h".
15915 (Read_symbols::do_read_symbols): Check for archive before checking
15916 for ELF file. Call plugin hooks to claim files.
15917 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15918 from a real object file; force override when processing replacement
15919 files.
15920 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15921 (Symbol::init_base_object): Likewise.
15922 (Symbol::init_base_output_data): Likewise.
15923 (Symbol::init_base_output_segment): Likewise.
15924 (Symbol::init_base_constant): Likewise.
15925 (Symbol::init_base_undefined): Likewise.
15926 (Symbol::output_section): Assert that object is not a plugin.
15927 (Symbol_table::add_from_pluginobj): New function.
15928 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15929 undefined.
15930 (Symbol_table::sized_write_globals): Likewise.
15931 (Symbol_table::add_from_pluginobj): Instantiate template.
15932 * symtab.h (Sized_pluginobj): Declare.
15933 (Symbol::in_real_elf): New function.
15934 (Symbol::set_in_real_elf): New function.
15935 (Symbol::in_real_elf_): New field.
15936 (Symbol_table::add_from_pluginobj): New function.
15937
15938 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15939 (LIBDL): New variable.
15940 (LDADD): Add LIBDL.
15941 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15942 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15943 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15944 (MOSTLYCLEANFILES): Likewise.
15945 * testsuite/Makefile.in: Regenerate.
15946 * testsuite/plugin_test.c: New file.
15947 * testsuite/plugin_test_1.sh: New file.
15948 * testsuite/plugin_test_2.sh: New file.
15949
de31bda5
ILT
159502008-09-16 Ian Lance Taylor <iant@google.com>
15951
9c2d0ef9
ILT
15952 * target-reloc.h (relocate_section): Check whether a symbol is
15953 defined by the ABI before reporting an undefined symbol error.
15954 * target.h (Target::is_defined_by_abi): Make parameter const.
15955 (Target::do_is_defined_by_abi): Likewise.
15956 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15957 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15958 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15959 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15960 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15961 * testsuite/Makefile.in: Rebuild.
15962
de31bda5
ILT
15963 * fileread.cc (make_view): Add casts to avoid warning.
15964
9fa33bee
AO
159652008-09-16 Alexandre Oliva <aoliva@redhat.com>
15966
15967 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15968 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15969
183fd0e3
AO
159702008-09-16 Alexandre Oliva <aoliva@redhat.com>
15971
15972 * options.h (General_options::output_is_executable): New.
15973 (General_options::output_is_pie): New.
15974 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15975 for shared libraries.
15976 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15977
7be8330a
CD
159782008-09-11 Chris Demetriou <cgd@google.com>
15979
15980 * options.h (origin): New -z option.
15981 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15982 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15983 in DT_FLAGS_1.
15984
a9caad02
CC
159852008-09-05 Cary Coutant <ccoutant@google.com>
15986
15987 * fileread.cc (File_read::make_view): Add check for attempt to map
15988 beyond end of file.
15989
ae6dce4d
CC
159902008-09-05 Cary Coutant <ccoutant@google.com>
15991
15992 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15993 explicit instantiations.
15994
d7ab2a47
KVH
159952008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15996
15997 PR gold/6858
15998 * options.cc (General_options::finalize): Allow undefined symbols
15999 in shlibs if linking -shared.
16000
16001 PR gold/6859
16002 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16003 symbols as not needing a dynsym entry.
16004
1e52a9c1
CS
160052008-08-20 Craig Silverstein <csilvers@google.com>
16006
16007 * fileread.cc (File_read::open): Do not lock the file unless it
16008 was successfully opened.
16009
d85c80a3
CC
160102008-08-14 Cary Coutant <ccoutant@google.com>
16011
16012 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16013 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16014 * testsuite/tls_test.cc (struct int128): 128-bit struct
16015 for testing TLS relocs with non-zero addend.
16016 (v12): New TLS variable.
16017 (t12): New test.
16018 (t_last): Add check for v12.
16019 * testsuite/tls_test.h (t12): New function.
16020 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16021
2d924fd9
ILT
160222008-08-13 Ian Lance Taylor <iant@google.com>
16023
16024 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16025 set tls_segment_ or relro_segment_.
16026 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16027 when appropriate.
16028 * output.h (Output_section::clear_is_relro): New function.
16029 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16030 sections specially even when output_data_ is empty.
16031 (Output_segment::maximum_alignment): When first section is relro,
16032 only force alignment for PT_LOAD segments.
16033 * script.cc (script_data_segment_align): New function.
16034 (script_data_segment_relro_end): New function.
16035 * script-c.h (script_data_segment_align): Declare.
16036 (script_data_segment_relro_end): Declare.
16037 * script-sections.h (class Script_sections): Declare
16038 data_segment_align and data_segment_relro_end. Add fields
16039 segment_align_index_ and saw_relro_end_.
16040 * script-sections.cc (class Sections_element): Add set_is_relro
16041 virtual function. Add new bool* parameter to place_orphan_here.
16042 Add get_output_section virtual function.
16043 (class Output_section_definition): Add set_is_relro. Add new
16044 bool* parameter to place_orphan_here. Add get_output_section.
16045 Add is_relro_ field.
16046 (Output_section_definition::Output_section_definition): Initialize
16047 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16048 and is_relro_ fields.
16049 (Output_section_definition::place_orphan_here): Add is_relro
16050 parameter.
16051 (Output_section_definition::set_section_addresses): Set relro for
16052 output section.
16053 (Output_section_definition::alternate_constraint): Likewise.
16054 (class Orphan_output_section): Add new bool* parameter to
16055 place_orphan_here. Add get_output_section.
16056 (Orphan_output_section::place_orphan_here): Add is_relro
16057 parameter.
16058 (Script_sections::Script_sections): Initialize
16059 data_segment_align_index_ and saw_relro_end_.
16060 (Script_sections::data_segment_align): New function.
16061 (Script_sections::data_segment_relro_end): New function.
16062 (Script_sections::place_orphan): Set or clear is_relro.
16063 (Script_sections::set_section_addresses): Force alignment of first
16064 TLS section.
16065 * yyscript.y (exp): Call script_data_segment_align and
16066 script_data_segment_relro_end.
16067 * testsuite/relro_script_test.t: New file.
16068 * testsuite/relro_test.cc (using_script): Declare.
16069 (t1, t2): Test using_script.
16070 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16071 (relro_script_test_SOURCES): Define.
16072 (relro_script_test_DEPENDENCIES): Define.
16073 (relro_script_test_LDFLAGS): Define.
16074 (relro_script_test_LDADD): Define.
16075 (relro_script_test.so): New target.
16076 * testsuite/Makefile.in: Rebuild.
16077
f827c9a9
CC
160782008-08-06 Cary Coutant <ccoutant@google.com>
16079
16080 * archive.cc (Archive::total_archives, Archive::total_members)
16081 (Archive::total_members_loaded): New variables.
16082 (Archive::setup): Add parameter. Add option to preread
16083 archive symbols.
16084 (Archive::read_armap): Add counter.
16085 (Archive::get_file_and_offset): New function.
16086 (Archive::get_elf_object_for_member): New function.
16087 (Archive::read_all_symbols): New function.
16088 (Archive::read_symbols): New function.
16089 (Archive::add_symbols): Add counters.
16090 (Archive::include_all_members): Use armap to find members if it's
16091 already built.
16092 (Archive::include_member): Skip reading symbols if already read.
16093 Factored code into Archive::get_file_and_offset and
16094 Archive::get_elf_object_for_member. Changed call to
16095 Mapfile::report_include_archive_member.
16096 (Archive::print_stats): New function.
16097 * archive.h: Declare Object and Read_symbols_data classes.
16098 (Archive::Archive): Add initializers for new members.
16099 (Archive::setup): Add parameter.
16100 (Archive::print_stats): New function.
16101 (Archive::total_archives, Archive::total_members)
16102 (Archive::total_members_loaded): New variables.
16103 (Archive::get_file_and_offset): New function.
16104 (Archive::get_elf_object_for_member): New function.
16105 (Archive::read_all_symbols): New function.
16106 (Archive::read_symbols): New function.
16107 (Archive::Archive_member): New class.
16108 (Archive::members_): New member.
16109 (Archive::num_members_): New member.
16110 * main.cc: Include archive.h.
16111 (main): Call Archive::print_stats.
16112 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16113 archive parameter; member_name is now the fully-decorated name.
16114 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16115 * options.h: (General_options): Add --preread-archive-symbols option.
16116 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16117 Archive::setup.
16118
de4c45bd
ILT
161192008-08-04 Ian Lance Taylor <iant@google.com>
16120
16121 * symtab.h (Symbol::use_plt_offset): New function.
16122 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16123 * powerpc.cc (Relocate::relocate): Likewise.
16124 * sparc.cc (Relocate::relocate): Likewise.
16125 * x86_64.cc (Relocate::relocate): Likewise.
16126 * testsuite/weak_plt.sh: New test.
16127 * testsuite/weak_plt_main.cc: New test.
16128 * testsuite/weak_plt_shared.cc: New test.
16129 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16130 (check_PROGRAMS): Add weak_plt.
16131 (check_DATA): Add weak_plt_shared.so.
16132 (weak_plt_main_pic.o, weak_plt): New targets.
16133 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16134 * testsuite/Makefile.in: Rebuild.
16135
16136 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16137 gcctestdir/ld.
16138 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16139 * testsuite/Makefile.in: Rebuild.
16140
323ee3f4
AM
161412008-08-04 Alan Modra <amodra@bigpond.net.au>
16142
16143 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16144 * Makefile.in: Regenerate.
16145 * po/POTFILES.in: Regenerate.
16146
7c07ecec
ILT
161472008-07-29 Ian Lance Taylor <iant@google.com>
16148
16149 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16150 symbols before other symbols.
16151 * testsuite/script_test_2.cc (test_addr): Declare.
16152 (test_addr_alias): Declare.
16153 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16154 values.
7c07ecec
ILT
16155 * testsuite/script_test_2.t: Define test_addr_alias and
16156 test_addr.
16157
5778530e
ILT
161582008-07-24 Ian Lance Taylor <iant@google.com>
16159
2a00e4fb
ILT
16160 PR 5990
16161 * descriptors.cc: New file.
16162 * descriptors.h: New file.
16163 * gold-threads.h (class Hold_optional_lock): New class.
16164 * fileread.cc: Include "descriptors.h".
16165 (File_read::~File_read): Release descriptor rather than closing
16166 it.
16167 (File_read::open) [file]: Call open_descriptor rather than open.
16168 Set is_descriptor_opened_.
16169 (File_read::open) [memory]: Assert that descriptor is not open.
16170 (File_read::reopen_descriptor): New function.
16171 (File_read::release): Release descriptor.
16172 (File_read::do_read): Make non-const. Reopen descriptor.
16173 (File_read::read): Make non-const.
16174 (File_read::make_view): Reopen descriptor.
16175 (File_read::do_readv): Likewise.
16176 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16177 Update declarations.
16178 * layout.cc: Include "descriptors.h".
16179 (Layout::create_build_id): Use open_descriptor rather than open.
16180 * output.cc: Include "descriptors.h".
16181 (Output_file::open): Use open_descriptor rather than open.
16182 * archive.cc (Archive::const_iterator): Change Archive to be
16183 non-const.
16184 (Archive::begin, Archive::end): Make non-const.
16185 (Archive::count_members): Likewise.
16186 * archive.h (class Archive): Update declarations.
16187 * object.h (Object::read): Make non-const.
16188 * Makefile.am (CCFILES): Add descriptors.cc.
16189 (HFILES): Add descriptors.h.
16190 * Makefile.in: Rebuild.
16191
801647d1
ILT
16192 PR 6716
16193 * gold.h: Always include <clocale>. Add Solaris workarounds
16194 following code in binutils/sysdep.h.
16195
5edd166e
ILT
16196 PR 6048
16197 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16198 this->eh_frame_hdr_ is NULL before using it.
16199
c89ad728
ILT
16200 * dynobj.cc (Versions::Versions): Update comment.
16201
aa86f06b
ILT
16202 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16203 the base version name.
16204
5778530e
ILT
16205 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16206 array size plus one.
16207 (Stringpool_template::set_string_offsets): Subtract one from key
16208 before using it as an array index.
16209 (Stringpool_template::get_offset_with_length): Likewise.
16210 (Stringpool_template::write_to_buffer): Likewise.
16211 * stringpool.h (Stringpool_template::get_offset_from_key):
16212 Likewise.
16213
057ead22
ILT
162142008-07-23 Ian Lance Taylor <iant@google.com>
16215
7f649c59
ILT
16216 PR 6658
16217 * object.h (Merged_symbol_value::value): Do our best to handle a
16218 negative addend.
16219
057ead22
ILT
16220 PR 6647
16221 * script.cc (Version_script_info::get_versions): Don't add empty
16222 version tag to return value.
16223 (Version_script_info::get_symbol_version_helper): Change return
16224 type to bool. Add pversion parameter. Change all callers.
16225 (script_register_vers_node): Don't require a non-NULL tag.
16226 * script.h (class Version_script_info): Update declarations.
16227 (Version_script_info::get_symbol_version): Change return type to
16228 bool. Add version parameter. Change all callers.
16229 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16230 handling. Handle an empty version from a version script.
16231 (Symbol_table::define_special_symbol): Likewise.
16232 * testsuite/ver_test_10.script: New file.
16233 * testsuite/ver_test_10.sh: New file.
16234 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16235 (check_DATA): Add ver_test_10.syms.
16236 (ver_test_10.syms, ver_test_10.so): New target.
16237 * testsuite/Makefile.in: Rebuild.
16238
58e54ac2
CD
162392008-07-23 Simon Baldwin <simonb@google.com>
16240
16241 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16242 to zero for undefined symbols from dynamic libraries.
16243
95d14cd3
ILT
162442008-07-23 Ian Lance Taylor <iant@google.com>
16245
16246 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16247 Change all callers.
16248 * symtab.h (class Symbol_table): Update declaration.
16249 * testsuite/ver_test_9.cc: New file.
16250 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16251 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16252 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16253 (ver_test_9.so, ver_test_9.o): New targets.
16254 * testsuite/Makefile.in: Rebuild.
16255
92de84a6
ILT
162562008-07-22 Ian Lance Taylor <iant@google.com>
16257
34810851
ILT
16258 * options.h (class General_options): Define --check-sections.
16259 * layout.cc (Layout::set_segment_offsets): Handle
16260 --check-sections.
16261
af6156ef
ILT
16262 * options.h (class General_options): Define -n/--nmagic and
16263 -N/--omagic.
16264 * options.cc (General_options::finalize): For -n/--nmagic or
16265 -N/--omagic, set -static.
16266 * layout.cc (Layout::attach_allocated_section_to_segment): If
16267 -N/--omagic, don't put read-only and read-write sections in
16268 different segments.
16269 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16270 finding a read-only segment.
16271 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16272 don't set the minimum segment alignment to the common page size,
16273 and don't set the file offset to the address modulo the page size.
16274 * script-sections.cc (Script_sections::create_segments): If
16275 -n/--omagic, don't put read-only and read-write sections in
16276 different segments.
16277
92de84a6
ILT
16278 * cref.cc: New file.
16279 * cref.h: New file.
16280 * options.h (class General_options): Add --print-symbol-counts.
16281 * main.cc (main): Issue defined symbol report if requested.
16282 * archive.cc (Archive::interpret_header): Make into a const member
16283 function.
16284 (Archive::add_symbols): Call Input_objects::archive_start and
16285 archive_stop.
16286 (Archive::const_iterator): Define new class.
16287 (Archive::begin, Archive::end): New functions.
16288 (Archive::include_all_members): Rewrite to use iterator.
16289 (Archive::count_members): New function.
16290 * archive.h (class Archive): Update declarations.
16291 (Archive::filename): New function.
16292 * object.cc: Include "cref.h".
16293 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16294 (Sized_relobj::do_get_global_symbol_counts): New function.
16295 (Input_objects::add_object): Add object to cross-referencer.
16296 (Input_objects::archive_start): New function.
16297 (Input_objects::archive_stop): New function.
16298 (Input_objects::print_symbol_counts): New function.
16299 * object.h: Declare Cref and Archive.
16300 (Object::get_global_symbol_counts): New function.
16301 (Object::do_get_global_symbol_counts): New pure virtual function.
16302 (class Sized_relobj): Add defined_count_ field. Update
16303 declarations.
16304 (class Input_objects): Add cref_ field. Update constructor.
16305 Update declarations.
16306 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16307 defined_count_.
16308 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16309 symbol counts.
16310 (Sized_dynobj::do_get_global_symbol_counts): New function.
16311 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16312 defined_count_. Update declarations. Define Symbols typedef.
16313 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16314 parameter. Change all callers.
16315 (Symbol_table::add_from_dynobj): Add sympointers and defined
16316 parameters. Change all callers.
16317 * symtab.h (class Symbol_table): Update declarations.
16318 * Makefile.am (CCFILES): Add cref.cc.
16319 (HFILES): Add cref.h.
16320 * Makefile.in: Rebuild.
16321
3f7c5e1d
CD
163222008-07-22 Simon Baldwin <simonb@google.com>
16323
16324 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16325 to zero when writing undefined symbols.
16326
e0b64032
ILT
163272008-07-22 Ian Lance Taylor <iant@google.com>
16328
16329 * output.cc (Output_section::add_input_section): Don't try to
16330 merge empty merge sections.
16331
096b02cf
CS
163322008-07-21 Craig Silverstein <csilvers@google.com>
16333
16334 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16335 Include symbol version in error message.
cd536b21 16336
1d1f116d
CD
163372008-07-20 Chris Demetriou <cgd@google.com>
16338
cd536b21 16339 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16340 (RANDOM_SEED_CFLAGS): New substituted variable.
16341 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16342 * configure: Rebuild.
16343 * Makefile.in: Likewise.
16344 * testsuite/Makefile.in: Likewise.
16345
a18f591e
ILT
163462008-07-18 Ian Lance Taylor <iant@google.com>
16347
16348 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16349 where we see NAME/NULL and NAME/VERSION as separate symbols.
16350 * testsuite/ver_test_main.cc (main): Call t4.
16351 (t4, t4_2a): Define.
16352 * testsuite/ver_test_2.cc (t4_2): Define.
16353 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16354 * testsuite/ver_test_4.cc (t4_2a): Define.
16355 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16356 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16357
c6e3f6ed
ILT
163582008-07-17 Ian Lance Taylor <iant@google.com>
16359
16360 * dynobj.cc (Versions::add_def): If we give an error about a
16361 missing version, go ahead and create the version anyhow.
16362
ef9beddf
ILT
163632008-07-10 Ian Lance Taylor <iant@google.com>
16364
16365 Handle output sections with more than 0x7fffffff bytes.
16366 * object.h (class Relobj): Change map_to_output_ to
16367 output_sections_, and just keep a section pointer. Change all
16368 uses. Move comdat group support to Sized_relobj.
16369 (Relobj::is_section_specially_mapped): Remove.
16370 (Relobj::output_section): Remove poff parameter. Change all
16371 callers.
16372 (Relobj::output_section_offset): New function.
16373 (Relobj::set_section_offset): Rewrite.
16374 (Relobj::map_to_output): Remove.
16375 (Relobj::output_sections): New function.
16376 (Relobj::do_output_section_offset): New pure virtual function.
16377 (Relobj::do_set_section_offset): Likewise.
16378 (class Sized_relobj): Add section_offsets_ field. Add comdat
16379 group support from Relobj. Update declarations.
16380 (Sized_relobj::get_output_section_offset): New function.
16381 (Sized_relobj::do_output_section_offset): New function.
16382 (Sized_relobj::do_set_section_offset): New function.
16383 * object.cc (Relobj::output_section_address): Remove.
16384 (Sized_relobj::Sized_relobj): Initialize new fields.
16385 (Sized_relobj::include_section_group): Cast find_kept_object to
16386 Sized_relobj.
16387 (Sized_relobj::include_linkonce_section): Likewise.
16388 (Sized_relobj::do_layout): Use separate arrays for output section
16389 and output offset.
16390 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16391 output_sections.
16392 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16393 output_sections and section_offsets.
16394 (Sized_relobj::write_local_symbols): Likewise.
16395 (map_to_kept_section): Compute output address directly.
16396 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16397 output_sections and section_offsets.
16398 (Sized_relobj::write_sections): Likewise.
16399 (Sized_relobj::relocate_sections): Likewise.
16400 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16401 * output.h (class Output_reloc): Update declarations. Change
16402 u2_.relobj to Sized_relobj*.
16403 (class Output_data_reloc): Change add functions to use
16404 Sized_relobj*.
16405 * output.cc (Output_reloc::Output_reloc): Change relobj to
16406 Sized_relobj*.
16407 (Output_reloc::local_section_offset): Change return type to
16408 Elf_Addr. Use get_output_section_offset.
16409 (Output_reloc::get_address): Likewise.
16410 (Output_section::is_input_address_mapped): Don't call
16411 is_section_specially_mapped.
16412 (Output_section::output_offset): Likewise.
16413 (Output_section::output_address): Likewise.
16414 (Output_section::starting_output_address): Likewise.
16415 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16416 parameter to Sized_relobj*.
16417 (Copy_relocs::need_copy_reloc): Likewise.
16418 (Copy_relocs::save): Likewise.
16419 * copy-relocs.h (class Copy_relocs): Update declarations.
16420 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16421 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16422 * target-reloc.h (relocate_for_relocatable): Change
16423 offset_in_output_section type to Elf_Addr. Change code that uses
16424 it as well.
16425 * layout.cc (Layout::layout): Always set *off.
16426 * mapfile.cc (Mapfile::print_input_section): Use
16427 output_section_offset.
16428 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16429 Sized_relobj*.
16430 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16431 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16432 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16433
5cb66f97
ILT
164342008-07-03 Ian Lance Taylor <iant@google.com>
16435
16436 * layout.cc (Layout::include_section): Do not discard unrecognized
16437 SHT_STRTAB sections.
16438
afe47622
CS
164392008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16440
16441 * script.cc (Lex::can_continue_name): Make '?' allowable in
16442 version-script names.
16443 * testsuite/version_script.map: Change glob pattern to use '?'
16444
5adf9721
ILT
164452008-06-30 Manish Singh <yosh@gimp.org>
16446
16447 PR 6585
16448 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16449 Correct typo.
16450
e6fde208
ILT
164512008-06-30 Ian Lance Taylor <iant@google.com>
16452
16453 PR 6660
16454 PR 6682
16455 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16456 versions]: Don't try to read the value in the contents, since we
16457 don't use it. Use the template endianness when writing.
16458
3f2e6a2d
CC
164592008-06-25 Cary Coutant <ccoutant@google.com>
16460
16461 * fileread.cc (File_read::make_view): Assert on zero-length view.
16462 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16463 symbol table when there are no symbols to read.
16464
c43d3a48
CS
164652008-06-23 Craig Silverstein <csilvers@google.com>
16466
16467 * version.cc (version_string): Bump to 1.7
16468
5f494ea0
CS
164692008-06-18 Craig Silverstein <csilvers@google.com>
16470
16471 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16472 constant 0xFFFF to type Valtype.
16473 (Powerpc_relocate_functions::rel16_ha): Likewise.
16474
c42e122e
ILT
164752008-06-17 Ian Lance Taylor <iant@google.com>
16476
f34787f8
ILT
16477 * output.h (Output_section::Input_section): Initialize p2align_ to
16478 zero for Output_section_data constructors.
16479 (Output_section::Input_section::addralign): If not an input
16480 section, return the alignment of the Output_section_data.
16481 * testsuite/copy_test.cc: New file.
16482 * testsuite/copy_test_1.cc: New file.
16483 * testsuite/copy_test_2.cc: New file.
16484 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16485 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16486 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16487 (copy_test_1_pic.o, copy_test_1.so): New targets.
16488 (copy_test_2_pic.o, copy_test_2.so): New targets.
16489 * testsuite/Makefile.in: Rebuild.
16490
c42e122e
ILT
16491 * script-sections.cc (Script_sections::place_orphan): Initialize
16492 local variable exact.
16493
ce3ac18a
DE
164942008-06-13 David Edelsohn <edelsohn@gnu.org>
16495
16496 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16497
42cacb20
DE
164982008-06-12 David Edelsohn <edelsohn@gnu.org>
16499 David S. Miller <davem@davemloft.net>
16500
16501 * powerpc.cc: New file.
16502 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16503 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16504 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16505 * Makefile.in: Rebuild.
16506
7b308235
ILT
165072008-06-09 Ian Lance Taylor <iant@google.com>
16508
16509 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16510 <exception>.
16511 (throwing, orig_terminate): New static variables.
16512 (terminate_handler): New static function.
16513 (t2): Set terminate handler.
16514
f0b886e3
ILT
165152008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16516
16517 PR 6584
cd536b21 16518 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16519 alignment.
16520
3e90f135
CC
165212008-05-30 Cary Coutant <ccoutant@google.com>
16522
16523 * archive.cc (Archive::include_all_members) Correct to step
16524 over symbol table and extended name table in thin archives.
16525
e09ad04a
ILT
165262008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16527
16528 PR 6407
16529 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16530 calculation.
16531
62b01cb5
ILT
165322008-05-28 Caleb Howe <cshowe@google.com>
16533
16534 * reduced_debug_output.cc: New file.
16535 * reduced_debug_output.h: New file.
92de84a6 16536 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16537 * options.cc (General_options::finalize): Add strip_debug_non_line
16538 to the strip heirarchy.
16539 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16540 fields.
16541 * layout.cc: Include "reduced_debug_output.h".
16542 (Layout::Layout): Initialize new fields.
16543 (line_only_debug_sections): New static array.
16544 (is_lines_only_debug_sections): New static inline function.
16545 (Layout::include_section): Handle --strip-debug-non-line.
16546 (Layout::make_output_section): If --strip-debug-non-line, build
16547 new output sections for .debug_abbrev and .debug_info.
16548 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16549 gold. Warn about possible overflow.
16550 (read_signed_LEB_128): Likewise.
16551 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16552 (read_signed_LEB_128): Declare.
16553 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16554 (HFILES): Add reduced_debug_output.h.
16555 * Makefile.in: Rebuild.
16556
7d9e3d98
ILT
165572008-05-21 Ian Lance Taylor <iant@google.com>
16558
16559 * mapfile.cc: New file.
16560 * mapfile.h: New file.
16561 * options.h (class General_options): Add -M/--print-map and -Map.
16562 * options.cc (General_options::finalize): Make -M equivalent to
16563 -Map -.
16564 * main.cc: Include <cstdio> and "mapfile.h".
16565 (main): Open mapfile if requested.
16566 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16567 constructor. Change caller.
16568 (queue_initial_tasks): Add mapfile parameter. Change caller.
16569 (queue_middle_tasks): Likewise.
16570 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16571 declarations.
16572 * archive.cc: Include "mapfile.h".
16573 (Archive::add_symbols): Add mapfile parameter. Change all
16574 callers. Pass mapfile, symbol, and reason to include_member.
16575 (Archive::include_all_members): Add mapfile parameter. Change all
16576 callers.
16577 (Archive::include_member): Add mapfile, sym, and why parameters.
16578 Change all callers. Report inclusion to map file.
16579 * archive.h: Include "fileread.h".
16580 (class Archive): Update declarations.
16581 (Archive::file): New const method.
16582 (class Add_archive_symbols): Add mapfile_ field. Update
16583 constructor. Change all callers.
16584 * readsyms.h (class Read_symbols): Likewise.
16585 (class Finish_group): Likewise.
16586 (class Read_script): Likewise.
16587 * common.cc: Include "mapfile.h".
16588 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16589 all callers.
16590 (Symbol_table::do_allocate_commons): Likewise.
16591 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16592 symbol allocation to mapfile.
16593 * common.h (class Allocate_commons_task): Add mapfile_ field.
16594 Update constructor. Change all callers.
16595 * symtab.h (class Symbol_table): Update declarations.
16596 * layout.cc: Include "mapfile.h".
16597 (Layout_task_runner::run): Print information to mapfile.
16598 (Layout::create_gold_note): Change Output_data_fixed_space to
16599 Output_data_zero_fill.
16600 (Layout::create_build_id): Likewise.
16601 (Layout::print_to_mapfile): New function.
16602 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16603 constructor. Change caller.
16604 (class Layout): Declare print_to_mapfile.
16605 * output.cc (Output_section::Input_section::print_to_mapfile): New
16606 function.
16607 (Output_section::add_input_section): If producing a map, always
16608 add to input_sections_ list.
16609 (Output_section::do_print_to_mapfile): New function.
16610 (Output_segment::print_sections_to_mapfile): New function.
16611 (Output_segment::print_section_list_to_mapfile): New function.
16612 * output.h: Include "mapfile.h".
16613 (Output_data::print_to_mapfile): New function.
16614 (Output_data::do_print_to_mapfile): New virtual function.
16615 (Output_segment_headers::do_print_to_mapfile): New function.
16616 (Output_file_header::do_print_to_mapfile): New function.
16617 (Output_data_const::do_print_to_mapfile): New function.
16618 (class Output_data_const_buffer): Add map_name_ field. Update
16619 constructor. Change all callers. Add do_print_to_mapfile
16620 function.
16621 (class Output_data_fixed_space): Likewise.
16622 (class Output_data_space): Likewise.
16623 (class Output_data_zero_fill): New class.
16624 (Output_data_strtab::do_print_to_mapfile): New function.
16625 (Output_data_reloc_base::do_print_to_mapfile): New function.
16626 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16627 (Output_data_group::do_print_to_mapfile): New function.
16628 (Output_data_got::do_print_to_mapfile): New function.
16629 (Output_data_dynamic::do_print_to_mapfile): New function.
16630 (Output_symtab_xindex::do_print_to_mapfile): New function.
16631 (class Output_section): Declare do_print_to_mapflie. Declare
16632 print_to_mapfile in Input_section.
16633 (class Output_segment): Declare new functions.
16634 * object.h (Sized_relobj::symbol_count): New function.
16635 * script-sections.cc
16636 (Output_section_element_dot_assignment::set_section_addresses):
16637 Change Output_data_fixed_space to Output_data_zero_fill.
16638 (Output_data_expression::do_print_to_mapfile): New function.
16639 * script.cc (read_input_script): Add mapfile parameter. Change
16640 all callers.
16641 * script.h (read_input_script): Update declaration.
16642 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16643 (Eh_frame::do_print_to_mapfile): New function.
16644 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16645 (Output_merge_string::do_print_to_mapfile): New function.
16646 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16647 function.
16648 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16649 function.
16650 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16651 function.
16652 * Makefile.am (CCFILES): Add mapfile.cc.
16653 (HFILES): Add mapfile.h.
16654 * Makefile.in: Rebuild.
16655
9f1d377b
ILT
166562008-05-19 Ian Lance Taylor <iant@google.com>
16657
16658 * options.h (class General_options): Add -z relro.
16659 * layout.cc (Layout::Layout): Initialize relro_segment_.
16660 (Layout::add_output_section_data): Return the output section.
16661 (Layout::make_output_section): Rcognize relro sections and mark
16662 them appropriately.
16663 (Layout::attach_allocated_section_to_segment): Put relro sections
16664 in a PT_GNU_RELRO segment.
16665 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16666 section as relro.
16667 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16668 PT_TLS segments.
16669 (Layout::linkonce_mapping): Map d.rel.ro.local to
16670 .data.rel.ro.local.
16671 (Layout::output_section_name): Us .data.rel.ro.local for any
16672 section which begins with that.
16673 * layout.h (class Layout): Update add_output_section_data
16674 declaration. Add relro_segment_ field.
16675 * output.cc (Output_section::Output_section): Initialize is_relro_
16676 and is_relro_local_ fields.
16677 (Output_segment::add_output_section): Group relro sections.
16678 (Output_segment::is_first_section_relro): New function.
16679 (Output_segment::maximum_alignment): If there is a relro section,
16680 align the segment to the common page size.
16681 (Output_segment::set_section_addresses): Track whether we are
16682 looking at relro sections. If the last section is a relro
16683 section, align to the common page size.
16684 (Output_segment::set_section_list_addresses): Add in_relro
16685 parameter. Change all callers. Align to the page size when
16686 moving from relro to non-relro section.
16687 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16688 segment.
16689 * output.h (class Output_section): Add is_relro_ and
16690 is_relro_local_ fields.
16691 (Output_section::is_relro): New function.
16692 (Output_section::set_is_relro): New function.
16693 (Output_section::is_relro_local): New function.
16694 (Output_section::set_is_relro_local): New function.
16695 (class Output_segment): Update declarations.
16696 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16697 * sparc.cc (Target_sparc::got_section): Likewise.
16698 * x86_64.cc (Target_x86_64::got_section): Likewise.
16699 * testsuite/relro_test_main.cc: New file.
16700 * testsuite/relro_test.cc: New file.
16701 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16702 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16703 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16704 (relro_test.so, relro_test_pic.o): New targets.
16705 * testsuite/Makefile.in: Rebuild.
16706
a984ee1d
ILT
167072008-05-16 Ian Lance Taylor <iant@google.com>
16708
01676dcd
ILT
16709 * output.cc (Output_segment::add_output_section): Remove front
16710 parameter.
16711 * output.h (class Output_segment): Remove
16712 add_initial_output_section and overloaded add_output_section.
16713 Update declaration of remaining add_output_section.
16714 * layout.cc (Layout::create_interp): Call add_output_section
16715 rather than add_initial_output_section.
16716 (Layout::finish_dynamic_section): Likewise.
16717
497897f9
ILT
16718 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16719 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16720 know the dynamic type.
16721 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16722 field. Initialize it in constructor.
16723 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16724 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16725 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16726 reloc.
16727
a984ee1d
ILT
16728 * output.cc (Output_reloc::get_address): Change return type to
16729 Elf_Addr.
16730 * output.h (class Output_reloc): Update get_address declaration.
16731 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16732 for section addresses.
16733
55ba0940
ILT
167342008-05-09 Ian Lance Taylor <iant@google.com>
16735
16736 PR 6493
16737 * gold.cc (gold_nomem): Use return value of write.
16738
75517b77
ILT
167392008-05-08 Ian Lance Taylor <iant@google.com>
16740
16741 * symtab.c (Symbol::init_base_output_data): Add version
16742 parameter. Change all callers.
16743 (Symbol::init_base_output_segment): Likewise.
16744 (Symbol::init_base_constant): Likewise.
16745 (Symbol::init_base_undefined): Likewise.
16746 (Sized_symbol::init_output_data): Likewise.
16747 (Sized_symbol::init_output_segment): Likewise.
16748 (Sized_symbol::init_constant): Likewise.
16749 (Sized_symbol::init_undefined): Likewise.
16750 (Symbol_table::do_define_in_output_data): If the new symbol has a
16751 version, mark it as the default.
16752 (Symbol_table::do_define_in_output_segment): Likewise.
16753 (Symbol_table::do_define_as_constant): Likewise.
16754 * symtab.h (class Symbol): Update declarations.
16755 (class Sized_symbol): Likewise.
16756 * resolve.cc (Symbol::override_version): New function.
c42e122e 16757 (Symbol::override_base): Call override_version.
75517b77
ILT
16758 (Symbol::override_base_with_special): Likewise.
16759 * testsuite/ver_script_8.script: New file.
16760 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16761 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16762 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16763 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16764
f1f70eae
ILT
167652008-05-06 Ian Lance Taylor <iant@google.com>
16766
f3e9c5c5
ILT
16767 PR 6049
16768 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16769 functions.
16770 (class General_options): Remove existing --undefined, and add
16771 --no-undefined instead. Add new --undefined as synonym for -u.
16772 * archive.cc (Archive::add_symbols): Check whether symbol was
16773 named with -u.
16774 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16775 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16776 all uses. Add IS_UNDEFINED. Update declarations to split
16777 different versions of init_base. Declare init_base_undefined.
16778 (Symbol::is_defined): Handle IS_UNDEFINED.
16779 (Symbol::is_undefined): Likewise.
16780 (Symbol::is_weak_undefined): Call is_undefined.
16781 (Symbol::is_absolute): Handle IS_CONSTANT.
16782 (class Sized_symbol): Update declarations to split different
16783 versions of init. Declare init_undefined.
16784 (class Symbol_table): Declare new functions.
16785 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16786 Change all callers.
16787 (Symbol::init_base_output_data): Likewise.
16788 (Symbol::init_base_output_segment): Likewise.
16789 (Symbol::init_base_constant): Likewise.
16790 (Symbol::init_base_undefined): New function.
16791 (Sized_symbol::init_object): Rename from init. Change all
16792 callers.
16793 (Sized_symbol::init_output_data): Likewise.
16794 (Sized_symbol::init_output_segment): Likewise.
16795 (Sized_symbol::init_constant): Likewise.
16796 (Sized_symbol::init_undefined): New function.
16797 (Symbol_table::add_undefined_symbols_from_command_line): New
16798 function.
16799 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16800 function.
16801 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16802 (Symbol::output_section): Likewise.
16803 (Symbol::set_output_section): Likewise.
16804 (Symbol_table::sized_finalize_symbol): Likewise.
16805 (Symbol_table::sized_write_globals): Likewise.
16806 * resolve.cc (Symbol_table::should_override): Likewise.
16807 (Symbol::override_base_with_special): Likewise.
16808
8bdcdf2c
ILT
16809 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16810 symbol, change it to have default visibility.
16811 * testsuite/protected_1.cc: New file.
16812 * testsuite/protected_2.cc: New file.
16813 * testsuite/protected_3.cc: New file.
16814 * testsuite/protected_main_1.cc: New file.
16815 * testsuite/protected_main_2.cc: New file.
16816 * testsuite/protected_main_3.cc: New file.
16817 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16818 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16819 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16820 (protected_1.so): New target.
16821 (protected_1_pic.o, protected_2_pic.o): New targets.
16822 (protected_3_pic.o): New target.
16823 (check_PROGRAMS): Add protected_2.
16824 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16825 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16826 * testsuite/Makefile.in: Rebuild.
16827
2b706932
ILT
16828 * options.h (DEFINE_var): Add set_user_set_##varname__.
16829 (DEFINE_bool_alias): New macro.
16830 (class General_options): Define -Bstatic using DEFINE_bool_alias
16831 rather than DEFINE_special. Add --undefined as an alias for -z
16832 defs.
16833 * options.cc (General_options::parse_Bstatic): Remove.
16834
d82a5bcc
ILT
16835 * options.h (class General_options): Add --fatal-warnings.
16836 * main.cc (main): Implement --fatal-warnings.
16837 * errors.h (Errors::warning_count): New function.
16838
f1f70eae
ILT
16839 * options.h (class General_options): Add -Bsymbolic-functions.
16840 * symtab.h (Symbol::is_preemptible): Check for
16841 -Bsymbolic-functions.
16842
8825ac63
ILT
168432008-05-05 Ian Lance Taylor <iant@google.com>
16844
d98bc257
ILT
16845 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16846 as noVARNAME rather than no-VARNAME.
16847 (class General_options): Add option -z combreloc.
16848 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16849 get_address.
16850 (Output_reloc::sort_before) [SHT_REL]: New function.
16851 (Output_reloc::sort_before) [SHT_RELA]: New function.
16852 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16853 Sort_relocs_comparison.
16854 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16855 parameter. Change all callers.
16856 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16857 sort_relocs parameter. Change all callers.
16858 * output.cc (Output_reloc::get_address): New function, broken out
16859 of write_rel.
16860 (Output_reloc::write_rel): Call it.
16861 (Output_reloc::compare): New function.
16862 (Output_data_reloc_base::do_write): Optionally sort relocs.
16863
60b2b4e7
ILT
16864 * configure.ac: If targ_extra_obj is set, link it in.
16865 * configure.tgt: Initialize all variables.
16866 (x86_64*): Set targ_extra_obj and targ_extra_size.
16867 * configure: Rebuild.
16868
8825ac63
ILT
16869 * object.cc (Sized_relobj::include_section_group): Adjust section
16870 indexes read from group data. Build vector to pass to
16871 layout_group.
16872 * layout.cc (Layout::layout_group): Add flags and shndxes
16873 parameters. Remove contents parameter. Change caller. Update
16874 explicit instantiations.
16875 * layout.h (class Layout): Update layout_group declaration.
16876 * output.cc (Output_data_group::Output_data_group): Add flags and
16877 input_shndxes parameters. Remove contents parameter. Change
16878 caller.
16879 (Output_data_group::do_write): Change input_sections_ to
16880 input_shndxes_.
16881 * output.h (class Output_data_group): Update constructor
16882 declaration. Rename input_sections_ to input_shndxes_.
16883 * testsuite/many_sections_test.cc: Add template.
16884
e94cf127
CC
168852008-04-30 Cary Coutant <ccoutant@google.com>
16886
4418b2d5
CC
16887 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16888
e94cf127
CC
16889 * layout.cc (Layout::include_section): Refactored check for debug
16890 info section.
16891 (Layout::add_comdat): Add new parameters. Change type
16892 of signature parameter. Add object and shndx to signatures table.
16893 (Layout::find_kept_object): New function.
16894 * layout.h: Include <cstring>.
16895 (Layout::is_debug_info_section): New function.
16896 (Layout::add_comdat): Add new parameters.
16897 (Layout::find_kept_object): New function.
16898 (Layout::Kept_section): New struct.
16899 (Layout::Signatures): Change type of map range.
16900 * object.cc (Relobj::output_section_address): New function.
16901 (Sized_relobj::include_section_group): Add new parameters. Change
16902 calls to Layout::add_comdat. Change to build table of kept comdat
16903 groups and table mapping discarded sections to kept sections.
16904 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16905 (Sized_relobj::do_layout): Change calls to include_section_group and
16906 include_linkonce_section.
16907 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16908 value to zero when section is discarded.
16909 (Sized_relobj::map_to_kept_section): New function.
16910 * object.h (Relobj::output_section_address): New function.
16911 (Relobj::Comdat_group): New type.
16912 (Relobj::find_comdat_group): New function.
16913 (Relobj::Comdat_group_table): New type.
16914 (Relobj::Kept_comdat_section): New type.
16915 (Relobj::Kept_comdat_section_table): New type.
16916 (Relobj::add_comdat_group): New function.
16917 (Relobj::set_kept_comdat_section): New function.
16918 (Relobj::get_kept_comdat_section): New function.
16919 (Relobj::comdat_groups_): New field.
16920 (Relobj::kept_comdat_sections_): New field.
16921 (Symbol_value::input_value): Update comment.
16922 (Sized_relobj::map_to_kept_section) New function.
16923 (Sized_relobj::include_linkonce_section): Add new parameter.
16924 * target-reloc.h (Comdat_behavior): New type.
16925 (get_comdat_behavior): New function.
16926 (relocate_section): Add code to map a discarded section to the
16927 corresponding kept section when applying a relocation.
16928
e4e5049b
CS
169292008-04-30 Craig Silverstein <csilvers@google.com>
16930
16931 * dwarf_reader.cc (next_generation_count): New static var.
16932 (Addr2line_cache_entry): New struct.
16933 (addr2line_cache): New static var.
16934 (Dwarf_line_info::one_addr2line): Added caching.
16935 (Dwarf_line_info::clear_addr2line_cache): New function.
16936 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16937 cache-size parameter.
16938 (Dwarf_line_info::one_addr2line_cache): New function.
16939 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16940 new cache-size argument to one_addr2line(), and clear cache.
16941
d09e9154
CC
169422008-04-28 Cary Coutant <ccoutant@google.com>
16943
16944 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16945 R_386_PC8 relocations.
16946
7ef73768
ILT
169472008-04-23 Ian Lance Taylor <iant@google.com>
16948
55438702
ILT
16949 * object.cc (Sized_relobj::include_section_group): Check for
16950 invalid section group.
16951
c165fb93
ILT
16952 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16953 header size.
16954
7ef73768
ILT
16955 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16956 than read for file header.
16957 * archive.cc (Archive::include_member): Likewise.
16958
6194aaab
L
169592008-04-23 Paolo Bonzini <bonzini@gnu.org>
16960
16961 * aclocal.m4: Regenerate.
16962 * configure: Regenerate.
16963
d491d34e
ILT
169642008-04-19 Ian Lance Taylor <iant@google.com>
16965
5ea2bac6
ILT
16966 * version.cc (version_string): Bump to 1.6.
16967
7bc3e21a
ILT
16968 * testsuite/Makefile.am (many_sections_r_test): New target.
16969 (many_sections_r_test_SOURCES): Remove.
16970 (many_sections_r_test_DEPENDENCIES): Remove.
16971 (many_sections_r_test_LDFLAGS): Remove.
16972 (many_sections_r_test_LDADD): Remove.
16973
7fcd3aa9
ILT
16974 * object.cc (Sized_relobj::do_add_symbols): Always pass
16975 local_symbol_count_ to add_from_relobj.
16976
4c94d6ae
ILT
16977 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16978 every thousand variables.
16979 * testsuite/Makefile.in: Rebuild.
16980
d491d34e
ILT
16981 * object.cc (Xindex::initialize_symtab_xindex): New function.
16982 (Xindex::read_symtab_xindex): New function.
16983 (Xindex::sym_xindex_to_shndx): New function.
16984 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16985 available.
16986 (Sized_relobj::do_initialize_xindex): New function.
16987 (Sized_relobj::do_read_symbols): Adjust section links.
16988 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16989 parameter. Change all callers.
16990 (Sized_relobj::include_section_group): Adjust section links and
16991 symbol section indexes.
16992 (Sized_relobj::do_layout): Adjust section links.
16993 (Sized_relobj::do_count_local_symbols): Adjust section links and
16994 symbol section indexes.
16995 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16996 ordinary and special symbols.
16997 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16998 dynsym_xindex parameters. Change all callers. Adjust section
16999 links. Use SHN_XINDEX when needed.
17000 (Sized_relobj::get_symbol_location_info): Adjust section links.
17001 Don't get fooled by special symbols.
17002 * object.h (class Xindex): Define.
17003 (class Object): Add xindex_ parameter. Declare virtual functoin
17004 do_initialize_xindex.
17005 (Object::adjust_sym_shndx): New function.
17006 (Object::set_xindex): New protected function.
17007 (class Symbol_value): Add is_ordinary_shndx_ field.
17008 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17009 (Symbol_value::value): Assert ordinary section.
17010 (Symbol_value::initialize_input_to_output_map): Likewise.
17011 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17012 Change all callers.
17013 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17014 all callers.
17015 (class Sized_relobj): Update declarations.
17016 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17017 parameter. Change all callers.
17018 (Sized_relobj::adjust_shndx): New function.
17019 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17020 field.
17021 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17022 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17023 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17024 (Sized_dynobj::read_dynsym_section): Adjust section links.
17025 (Sized_dynobj::read_dynamic): Likewise.
17026 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17027 section links.
17028 (Sized_dynobj::do_initialize_xindex): New function.
17029 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17030 do_initialize_xindex.
17031 (Sized_dynobj::adjust_shndx): New function.
17032 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17033 dynsym_xindex_ fields.
17034 (Layout::finalize): Add a call to set_section_indexes before
17035 creating the symtab sections.
17036 (Layout::set_section_indexes): Don't do anything if the section
17037 already has a section index.
17038 (Layout::create_symtab_sections): Add shnum parameter. Change
17039 caller. Create .symtab_shndx section if needed.
17040 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17041 caller.
17042 (Layout::allocated_output_section_count): New function.
17043 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17044 needed.
17045 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17046 fields. Update declarations.
17047 (Layout::symtab_xindex): New function.
17048 (Layout::dynsym_xindex): New function.
17049 (class Write_symbols_task): Add layout_ field.
17050 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17051 Change caller.
17052 * output.cc (Output_section_headers::Output_section_headers): Add
17053 shstrtab_section parameter. Change all callers.
17054 (Output_section_headers::do_sized_write): Store overflow values
17055 for section count and section string table section index in
17056 section header zero.
17057 (Output_file_header::do_sized_write): Check for overflow of
17058 section count and section string table section index.
17059 (Output_symtab_xindex::do_write): New function.
17060 (Output_symtab_xindex::endian_do_write): New function.
17061 * output.h (class Output_section_headers): Add shstrtab_section_.
17062 Update declarations.
17063 (class Output_symtab_xindex): Define.
17064 (Output_section::has_out_shndx): New function.
17065 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17066 field.
17067 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17068 Change all callers.
17069 (Sized_symbol::init): Likewise.
17070 (Symbol::output_section): Check for ordinary symbol.
17071 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17072 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17073 callers.
17074 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17075 Change all callers. Simplify handling of symbols from sections
17076 not included in the link.
17077 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17078 distinction.
17079 (Weak_alias_sorter::operator()): Assert that symbols are
17080 ordinary.
17081 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17082 distinction.
17083 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17084 parameters. Change all callers.
17085 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17086 symbol distinction. Use SHN_XINDEX when needed.
17087 (Symbol_table::write_section_symbol): Add symtab_xindex
17088 parameter. Change all callers.
17089 (Symbol_table::sized_write_section_symbol): Likewise. Use
17090 SHN_XINDEX when needed.
17091 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17092 declarations.
17093 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17094 (Symbol::is_defined): Check is_ordinary.
17095 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17096 (Symbol::is_absolute, Symbol::is_common): Likewise.
17097 (class Sized_symbol): Update declarations.
17098 (class Symbol_table): Update declarations.
17099 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17100 parameters. Change all callers.
17101 (Sized_symbol::override): Likewise.
17102 (Symbol_table::override): Likewise.
17103 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17104 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17105 is_ordinary, and orig_st_shndx parameters. Change all callers.
17106 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17107 to be in an ordinary section.
17108 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17109 object and is_ordinary parameters. Change all callers.
17110 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17111 Change all callers. Don't add undefined or non-ordinary symbols
17112 to reloc_map_.
17113 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17114 Change all callers.
17115 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17116 declarations.
17117 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17118 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17119 (Sized_relobj::relocate_sections): Likewise.
17120 * target-reloc.h (scan_relocs): Adjust section symbol index.
17121 (scan_relocatable_relocs): Likewise.
17122 * i386.cc (Scan::local): Check for ordinary symbols.
17123 * sparc.cc (Scan::local): Likewise.
17124 * x86_64.cc (Scan::local): Likewise.
17125 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17126 to symbol_section_and_value.
17127 * testsuite/many_sections_test.cc: New file.
17128 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17129 (check_PROGRAMS): Add many_sections_test.
17130 (many_sections_test_SOURCES): Define.
17131 (many_sections_test_DEPENDENCIES): Define.
17132 (many_sections_test_LDFLAGS): Define.
17133 (BUILT_SOURCES): Add many_sections_define.h.
17134 (many_sections_define.h): New target.
17135 (BUILT_SOURCES): Add many_sections_check.h.
17136 (many_sections_check.h): New target.
17137 (check_PROGRAMS): Add many_sections_r_test.
17138 (many_sections_r_test_SOURCES): Define.
17139 (many_sections_r_test_DEPENDENCIES): Define.
17140 (many_sections_r_test_LDFLAGS): Define.
17141 (many_sections_r_test_LDADD): Define.
17142 (many_sections_r_test.o): New target.
17143 * testsuite/Makefile.in: Rebuild.
17144
c5818ff1
CC
171452008-04-17 Cary Coutant <ccoutant@google.com>
17146
17147 * errors.cc (Errors::info): New function.
17148 (gold_info): New function.
17149 * errors.h (Errors::info): New function.
17150 * gold.h (gold_info): New function.
17151 * object.cc (Input_objects::add_object): Print trace output.
17152 * options.cc (options::parse_set): New function.
17153 (General_options::parse_wrap): Deleted.
17154 (General_options::General_options): Deleted initializer.
17155 * options.h (options::String_set): New typedef.
17156 (options::parse_set): New function.
17157 (DEFINE_set): New macro.
17158 (General_options::wrap): Changed to use DEFINE_set. Changed
17159 callers of any_wrap_symbols and is_wrap_symbol.
17160 (General_options::trace, General_options::trace_symbol):
17161 New options.
17162 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17163 (General_options::wrap_symbols_): Deleted.
17164 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17165
b5be4a7c
DM
171662008-04-17 David S. Miller <davem@davemloft.net>
17167
17168 * options.cc (General_options::parse_V): New function.
17169 * options.h: Add entries for -V and -Qy.
17170
155a0dd7
ILT
171712008-04-17 Ian Lance Taylor <iant@google.com>
17172
17173 * common.cc (Symbol_table::allocate_commons): Remove options
17174 parameter. Change caller.
17175 (Symbol_table::do_allocate_commons): Remove options parameter.
17176 Change caller. Just call do_allocate_commons_list twice.
17177 (Symbol_table::do_allocate_commons_list): New function, broken out
17178 of do_allocate_commons.
17179 * common.h (class Allocate_commons_task): Remove options_ field.
17180 Update constructor.
17181 * symtab.cc (Symbol_table::Symbol_table): Initialize
17182 tls_commons_.
17183 (Symbol_table::add_from_object): Put TLS common symbols on
17184 tls_commons_ list.
17185 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17186 which are IN_OUTPUT_DATA.
17187 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17188 allocate_commons and do_allocate_commons declarations. Declare
17189 do_allocate_commons_list.
17190 * gold.cc (queue_middle_tasks): Update creation of
17191 Allocate_commons_task to not pass options.
17192 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17193 (TLS_TEST_C_FLAGS): New variable.
17194 (tls_test_c_pic.o): New target.
17195 (tls_test_shared.so): Link in tls_test_c_pic.o.
17196 (tls_test_c_pic_ie.o): New target.
17197 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17198 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17199 (tls_test_c.o): New target.
17200 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17201 (tls_pic_test_LDADD): Likewise.
17202 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17203 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17204 (tls_test_c_gnu2.o): New target.
17205 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17206 tls_test_c_gnu2.o.
17207 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17208 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17209 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17210 * testsuite/tls_test.cc: Include "config.h".
17211 (t_last): Call t11_last.
17212 * testsuite/tls_test.h (t11, t11_last): Declare.
17213 * testsuite/tls_test_c.c: New file.
17214 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17215 * configure.ac: Check for OpenMP support.
17216 * configure, config.in, Makefile.in: Rebuild.
17217 * testsuite/Makefile.in: Rebuild.
17218
edfbb029
CC
172192008-04-16 Cary Coutant <ccoutant@google.com>
17220
17221 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17222 (Target_i386::tls_base_symbol_defined_): New field.
17223 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17224 (Target_i386::Scan::global): Likewise.
17225 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17226 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17227 (Target_x86_64::tls_base_symbol_defined_): New field.
17228 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17229 (Target_x86_64::Scan::global): Likewise.
17230
f3c69fca
CC
172312008-04-16 Cary Coutant <ccoutant@google.com>
17232
17233 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17234 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17235 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17236 building shared libraries.
17237 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17238 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17239 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17240 * testsuite/Makefile.in: Rebuild.
17241 * testsuite/weak_undef.h: New file.
17242 * testsuite/weak_undef_file1.cc: Add extra test cases.
17243 * testsuite/weak_undef_file2.cc: Likewise.
17244 * testsuite/weak_undef_test.cc: Likewise.
17245
7c414435
DM
172462008-04-16 David S. Miller <davem@davemloft.net>
17247
32b769e1
DM
17248 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17249 Add issued_non_pic_error_ field. Declare check_non_pic.
17250 (Target_sparc::Scan::check_non_pic): New function.
17251 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17252 (Target_sparc::Scan::global): Likewise.
17253
11936fb1
DM
17254 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17255 * configure: Rebuild.
17256
7c414435
DM
17257 * options.h (DEFINE_enable): New macro.
17258 (new_dtags): New enable option.
17259 (initfirst, interpose, loadfltr, nodefaultlib,
17260 nodelete, nodlopen, nodump): New -z options.
17261 * layout.cc (Layout:finish_dynamic_section): If new
17262 dtags enabled, emit DT_RUNPATH. Also, emit a
17263 DT_FLAGS_1 containing any specified -z flags.
17264
85c7bf8b
ILT
172652008-04-16 Ian Lance Taylor <iant@google.com>
17266
12c0daef
ILT
17267 * copy-relocs.cc: New file.
17268 * copy-relocs.h: New file.
17269 * reloc.cc: Remove Copy_relocs code.
17270 * reloc.h: Likewise.
17271 * reloc-types.h (struct Reloc_types) [both versions]: Add
17272 get_reloc_addend_noerror.
17273 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17274 variants of add_global which take an addend which must be zero.
17275 * i386.cc: Include "copy-relocs.h".
17276 (class Target_i386): Change type of copy_relocs_ to variable,
17277 update initializer.
17278 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17279 Change all callers.
17280 (Target_i386::do_finalize_sections): Change handling of
17281 copy_relocs_.
17282 * sparc.cc: Include "copy-relocs.h".
17283 (class Target_sparc): Change type of copy_relocs_ to variable,
17284 update initializer.
17285 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17286 Change all callers.
17287 (Target_sparc::do_finalize_sections): Change handling of
17288 copy_relocs_.
17289 * x86_64.cc: Include "copy-relocs.h".
17290 (class Target_x86_64): Change type of copy_relocs_ to variable,
17291 update initializer.
17292 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17293 class. Change all callers.
17294 (Target_x86_64::do_finalize_sections): Change handling of
17295 copy_relocs_.
17296 * Makefile.am (CCFILES): Add copy-relocs.cc.
17297 (HFILES): Add copy-relocs.h.
17298
4f4995b6
ILT
17299 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17300
85c7bf8b
ILT
17301 * testsuite/script_test_4.sh: Permit leading zeroes.
17302
4f2a9edd
ILT
173032008-04-15 Ian Lance Taylor <iant@google.com>
17304
e6188289
ILT
17305 * script-sections.cc (Script_sections::create_segments): Use
17306 header_size_adjustment even when there is enough room for the
17307 headers.
17308 * testsuite/script_test_4.sh: New file.
17309 * testsuite/script_test_4.t: New file.
17310 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17311 (check_DATA): Add script_test_4.stdout.
17312 (MOSTLYCLEANFILES): Likewise.
17313 (script_test_4): New target.
17314 (script_test_4.stdout): New target.
17315 * testsuite/Makefile.in: Rebuild.
17316
4f2a9edd
ILT
17317 * sparc.cc: Add definitions for Output_data_plt_sparc class
17318 constants.
17319
f5314dd5
DM
173202008-04-14 David S. Miller <davem@davemloft.net>
17321
17322 * sparc.cc: New file.
17323 * Makefile.am (TARGETSOURCES): Add sparc.cc
17324 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17325 * configure.tgt: Document targ_extra_size and
17326 targ_extra_big_endian. Add entries for sparc-* and
17327 sparc64-*.
17328 * configure.ac: Handle targ_extra_size and
17329 targ_extra_big_endian.
17330 * Makefile.in: Rebuild.
17331 * configure: Likewise.
17332 * po/POTFILES.in: Likewise.
17333 * po/gold.pot: Likewise.
17334
154e0e9a
ILT
173352008-04-14 Ian Lance Taylor <iant@google.com>
17336
17337 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17338 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17339 in the name/type/flags to section mapping. Don't call
17340 allocate_output_section.
17341 (Layout::choose_output_section): Change parameter from adjust_name
17342 to is_input_section. Don't permit input sections after sections
17343 are attached to segments. Don't call allocate_output_section.
17344 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17345 not write_enable_output_section.
17346 (Layout::make_output_section): Don't push to
17347 unattached_section_list_ nor call attach_to_segment. Call
17348 attach_section_to_segment if sections are attached.
17349 (Layout::attach_sections_to_segments): New function.
17350 (Layout::attach_section_to_segment): New function.
17351 (Layout::attach_allocated_section_to_segment): Rename from
17352 attach_to_segment. Remove flags parameter.
17353 (Layout::allocate_output_section): Remove function.
17354 (Layout::write_enable_output_section): Remove function.
17355 * layout.h (class Layout): Update for above changes. Add new
17356 field sections_are_attached_.
17357 * output.h (Output_section::update_flags_for_input_section): New
17358 function.
17359 * output.cc (Output_section::add_input_section): Call
17360 update_flags_for_input_section.
17361 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17362
009a67a2
CC
173632008-04-11 Cary Coutant <ccoutant@google.com>
17364
17365 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17366 thought unnecessary.
17367 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17368
759b1a24
ILT
173692008-04-11 Ian Lance Taylor <iant@google.com>
17370
17371 * output.h (class Output_section_data): Remove inline definition
17372 of set_addralign.
17373 * output.cc (Output_section_data::set_addralign): New function.
17374
c2b45e22
CC
173752008-04-11 Cary Coutant <ccoutant@google.com>
17376
17377 Add support for TLS descriptors for i386 and x86_64.
17378 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17379 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17380 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17381 GOT_TYPE_TLS_DESC.
17382 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17383 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17384 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17385 relocations.
17386 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17387 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17388 Fix problem with initial-exec relocations.
17389 (Target_i386::Relocate::relocate_tls): Likewise.
17390 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17391 relaxation.
17392 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17393 support for section-plus-offset dynamic table entries.
17394 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17395 (Output_data_dynamic::Dynamic_entry): Add support for
17396 section-plus-offset dynamic table entries.
17397 (Output_data_dynamic::Classification): Likewise.
17398 (Output_data_dynamic::classification_): Renamed offset_.
17399 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17400 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17401 (Target_x86_64::make_plt_section): New function.
17402 (Target_x86_64::reserve_tlsdesc_entries): New function.
17403 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17404 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17405 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17406 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17407 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17408 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17409 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17410 add extra PLT entry for TLS descriptors.
17411 (Output_data_plt_x86_64::got_): New field.
17412 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17413 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17414 fields.
17415 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17416 descriptors.
17417 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17418 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17419 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17420 R_386_TLS_DESC_CALL relocations.
17421 (Target_x86_64::Scan::global): Likewise.
17422 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17423 for TLS descriptors.
17424 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17425 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17426 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17427 GD-to-IE relaxation.
17428 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17429 and TLS_DESCRIPTORS.
17430 * Makefile.in: Rebuild.
17431 * configure: Rebuild.
17432 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17433 (tls_test_shared2.so): New target.
17434 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17435 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17436 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17437 (tls_shared_gd_to_ie_test_LDADD): New variable.
17438 (tls_shared_gnu2_gd_to_ie_test): New target.
17439 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17440 New targets.
17441 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17442 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17443 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17444 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17445 (tls_shared_gnu2_test): New target.
17446 (tls_test_gnu2_shared.so): New target.
17447 (tls_shared_gnu2_test_SOURCES): New variable.
17448 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17449 (tls_shared_gnu2_test_LDFLAGS): New variable.
17450 (tls_shared_gnu2_test_LDADD): New variable.
17451 * testsuite/Makefile.in: Rebuild.
17452 * testsuite/Makefile.
17453
83bfb6b7
ILT
174542008-04-11 Ian Lance Taylor <iant@google.com>
17455
17456 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17457 justsyms.t.
17458 * testsuite/Makefile.in: Rebuild.
17459
17460 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17461 long.
17462 * testsuite/script_test_2.cc (main): Adjust test.
17463
706e1f5e
ILT
174642008-04-11 David S. Miller <davem@davemloft.net>
17465 Ian Lance Taylor <iant@google.com>
17466
17467 * options.h (General_options): Add entries for '-Y' and
17468 '-relax'.
17469 * options.cc (General_options:finalize): If -Y was used, add those
17470 entries to the library path instead of the default "/lib" and
17471 "/usr/lib".
17472
7c98e6bb
DM
174732008-04-11 David S. Miller <davem@davemloft.net>
17474
17475 * testsuite/justsyms.t: Start at 0x100.
17476 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17477 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17478 long.
17479 * testsuite/script_test_2.cc: Adjust string and section length
17480 checks.
7c98e6bb 17481
99a37bfd
ILT
174822008-04-09 Ian Lance Taylor <iant@google.com>
17483
2cefc357
ILT
17484 PR gold/5996
17485 * script-sections.cc (Sections_element::allocate_to_segment): Add
17486 orphan parameter.
17487 (Output_section_definition::allocate_to_segment): Likewise.
17488 (Orphan_output_section::allocate_to_segment): Likewise.
17489 (Script_sections::attach_sections_using_phdrs_clause): Don't
17490 propagate non-PT_LOAD segments to orphan sections.
17491 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17492 readelf rather than objdump.
17493 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17494 .interp section and PT_INTERP segment are the same size.
17495 * testsuite/Makefile.in: Rebuild.
17496
99a37bfd
ILT
17497 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17498 aliases for symbols defined in the same object.
17499 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17500 (weak_alias_test_SOURCES): New variable.
17501 (weak_alias_test_DEPENDENCIES): New variable.
17502 (weak_alias_test_LDFLAGS): New variable.
17503 (weak_alias_test_LDADD): New variable.
17504 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17505 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17506 (weak_alias_test_3.o): New target.
17507 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17508 * testsuite/weak_alias_test_main.cc: New file.
17509 * testsuite/weak_alias_test_1.cc: New file.
17510 * testsuite/weak_alias_test_2.cc: New file.
17511 * testsuite/weak_alias_test_3.cc: New file.
17512
780e49c5
ILT
175132008-04-08 Ian Lance Taylor <iant@google.com>
17514
cdb0b8f5
ILT
17515 * options.h (class General_options): Add --noinhibit-exec option.
17516 * main.cc (main): Check --noinhibit-exec.
17517
0864d551
ILT
17518 * options.h (class General_options): Define --wrap as a special
17519 option. Add wrap_symbols_ field.
17520 (General_options::any_wrap_symbols): New function.
17521 (General_options::is_wrap_symbol): New function.
17522 * options.cc (General_options::parse_wrap): New function.
17523 (General_options::General_options): Initialize wrap_symbols_.
17524 * symtab.cc (Symbol_table::wrap_symbol): New function.
17525 (Symbol_table::add_from_object): Handle --wrap.
17526 * symtab.h (class Symbol_table): Declare wrap_symbol.
17527 * target.h (Target::wrap_char): New function.
17528 (Target::Target_info): Add wrap_char field.
17529 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17530 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17531 * testsuite/testfile.cc (Target_test::test_target_info):
17532 Likewise.
17533
789aa6de
ILT
17534 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17535 there is one.
17536
2c38906f
ILT
17537 * layout.h (class Layout): Add added_eh_frame_data_ field.
17538 * layout.cc (Layout::Layout): Initialize new field.
17539 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17540 output section until we find a section we merged successfully.
17541 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17542 that the size be non-zero.
17543
780e49c5
ILT
17544 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17545 qualifier.
17546
7fcd0256
ILT
175472008-04-08 Craig Silverstein <csilvers@google.com>
17548
17549 * configure.ac: Export new conditional variable HAVE_ZLIB.
17550 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17551 on HAVE_ZLIB.
17552 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17553 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17554
6835af53
ILT
175552008-04-07 Ian Lance Taylor <iant@google.com>
17556
e24f324c
ILT
17557 * version.cc (version_string): Set to "1.5".
17558
a036edd8
ILT
17559 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17560 Add issued_non_pic_error_ field. Declare check_non_pic.
17561 (Target_x86_64::Scan::check_non_pic): New function.
17562 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17563 (Target_x86_64::Scan::global): Likewise.
17564
624f8810
ILT
17565 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17566 addend parameter. Change caller. Handle merge sections.
17567 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17568 Address to Addend. Don't add in the result of
17569 local_section_offset, pass down the addend and use the returned
17570 value.
17571 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17572 Update declarations of local_section_offset and symbol_value.
17573 * testsuite/two_file_test_1.cc (t18): New function.
17574 * testsuite/two_file_test_2.cc (f18): New function.
17575 * testsuite/two_file_test_main.cc (main): Call t18.
17576 * testsuite/two_file_test.h (t18, f18): Declare.
17577
6835af53
ILT
17578 * configure.ac: Don't test for objdump, c++filt, or readelf.
17579 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17580 conditionals.
17581 (TEST_READELF): New variable.
17582 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17583 (check_PROGRAMS): Add two_file_strip_test.
17584 (two_file_strip_test): New target.
17585 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17586 (two_file_same_shared_strip_test_SOURCES): New variable.
17587 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17588 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17589 (two_file_same_shared_strip_test_LDADD): New variable.
17590 (two_file_shared_strip.so): New target.
17591 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17592 (ver_test_5.syms, ver_test_7.syms): Likewise.
17593 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17594 (strip_test_3.stdout): Use TEST_OBJDUMP.
17595 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17596
86925eef
CC
175972008-04-04 Cary Coutant <ccoutant@google.com>
17598
17599 * symtab.h (Symbol::is_weak_undefined): New function.
17600 (Symbol::is_strong_undefined): New function.
17601 (Symbol::is_absolute): New function.
17602 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17603 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17604 absolute symbols.
17605 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17606 (weak_undef_test): New target.
17607 * testsuite/Makefile.in: Rebuild.
17608 * testsuite/weak_undef_file1.cc: New file.
17609 * testsuite/weak_undef_file2.cc: New file.
17610 * testsuite/weak_undef_test.cc: New file.
17611
126f3ece
ILT
176122008-04-03 Craig Silverstein <csilvers@google.com>
17613
17614 * compressed_output.h (class Output_compressed_section): Use
17615 unsigned buffer.
17616 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17617 add zlib header.
17618 (zlib_compressed_suffix): Removed.
17619 (Output_compressed_section::set_final_data_size): Use unsigned
17620 buffers.
17621 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17622 Fix linker invocation.
17623 (flagstest_o_specialfile_and_compress_debug_sections):
17624 Likewise.
17625 * testsuite/Makefile.in: Regenerated.
17626
deae2a14
DM
176272008-04-02 David S. Miller <davem@davemloft.net>
17628
17629 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17630 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17631
70752818
ILT
176322008-04-02 Craig Silverstein <csilvers@google.com>
17633
17634 * TODO: New file.
17635
39d0cb0e
ILT
176362008-04-02 Ian Lance Taylor <iant@google.com>
17637
17638 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17639 parameters. Update for new key type to views_. Change all
17640 callers.
17641 (File_read::read): Adjust for byteshift in returned view.
17642 (File_read::add_view): New function, broken out of
17643 find_and_make_view.
17644 (File_read::make_view): New function, broken out of
17645 find_and_make_view.
17646 (File_read::find_or_make_view): Add offset and aligned
17647 parameters. Rewrite accordingly. Change all callers.
17648 (File_read::get_view): Add offset and aligned parameters. Adjust
17649 for byteshift in return value.
17650 (File_read::get_lasting_view): Likewise.
17651 * fileread.h (class File_read): Update declarations.
17652 (class File_read::View): Add byteshift_ field. Add byteshift to
17653 constructor. Add byteshift method.
17654 * archive.h (Archive::clear_uncached_views): New function.
17655 (Archive::get_view): Add aligned parameter. Change all callers.
17656 * object.h (Object::get_view): Add aligned parameter. Change all
17657 callers.
17658 (Object::get_lasting_view): Likewise.
17659
17660 * fileread.cc (File_read::release): Don't call clear_views if
17661 there are multiple objects.
17662 * fileread.h (File_read::clear_uncached_views): New function.
17663 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17664 on the archive.
17665
a1207466
CC
176662008-03-31 Cary Coutant <ccoutant@google.com>
17667
17668 Add thin archive support.
17669 * archive.cc (Archive::armagt): New const.
17670 (Archive::setup): Remove task parameter and calls to unlock.
17671 (Archive::unlock_nested_archives): New function.
17672 (Archive::read_header): Add nested_off parameter. Change
17673 all callers.
17674 (Archive::interpret_header): Likewise.
17675 (Archive::include_all_members): Change to handle thin
17676 archives.
17677 (Archive::include_member): Likewise.
17678 * archive.h (Archive::Archive): Add new parameters and
17679 initializers.
17680 (Archive::armagt): New const.
17681 (Archive::setup): Remove task parameter.
17682 (Archive::unlock_nested_archives): New function.
17683 (Archive::read_header): Add nested_off parameter.
17684 (Archive::interpret_header): Likewise.
17685 (Archive::Nested_archive_table): New typedef.
17686 (Archive::is_thin_archive_): New field.
17687 (Archive::nested_archives_): New field.
17688 (Archive::options_): New field.
17689 (Archive::dirpath_): New field.
17690 (Archive::task_): New field.
17691 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17692 for thin archives. Pass additional parameters to
17693 Archive::Archive. Unlock the archive file after calling
17694 Archive::setup.
cd536b21 17695
479f6503
ILT
176962008-03-29 Ian Lance Taylor <iant@google.com>
17697
686c8caf
ILT
17698 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17699 version symbol to be local.
17700 * testsuite/ver_test_4.sh: New file.
17701 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17702 (check_DATA): Add ver_test_4.syms.
17703 (ver_test_4.syms): New target.
17704 * testsuite/Makefile.in: Rebuild.
17705
ab794b6b
ILT
17706 * output.cc
17707 (Output_section::Input_section_sort_entry::has_priority): New
17708 function.
17709 (Output_section::Input_section_sort_entry::match_file_name): New
17710 function.
17711 (Output_section::Input_section_sort_entry::match_section_name):
17712 Remove.
17713 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17714 Remove.
17715 (Output_section::Input_section_sort_entry::match_section_file):
17716 Remove.
17717 (Output_section::Input_section_sort_compare::operator()): Rewrite
17718 using new Input_section_sort_entry functions. Sort crtbegin and
17719 crtend first. Sort sections with no priority before sections with
17720 a priority.
17721 * testsuite/initpri1.c (d3): Check j != 4.
17722 (cd5): New constructor/destructor function.
17723 (main): Check j != 2.
17724
479f6503
ILT
17725 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17726 new symbol when resolving, don't call set_is_default.
17727 * testsuite/ver_test_7.cc: New file.
17728 * testsuite/ver_test_7.sh: New file.
17729 * testsuite/Makefile.am (ver_test_7.so): New target.
17730 (ver_test_7.o): New target.
17731 (check_SCRIPTS): Add ver_test_7.sh.
17732 (check_DATA): Add ver_test_7.syms.
17733 (ver_test_7.syms): New target.
17734
2fd32231
ILT
177352008-03-28 Ian Lance Taylor <iant@google.com>
17736
17737 * layout.cc (Layout::layout): If we see an input section with a
17738 name that needs sorting, set the must_sort flag for the output
17739 section.
17740 (Layout::make_output_section): If the name of the output section
17741 indicates that it might require sorting, set the may_sort flag.
17742 * output.h (Output_section::may_sort_attached_input_sections): New
17743 function.
17744 (Output_section::set_may_sort_attached_input_sections): New
17745 function.
17746 (Output_section::must_sort_attached_input_sections): New
17747 function.
17748 (Output_section::set_must_sort_attached_input_sections): New
17749 function.
17750 (class Output_section): Declare Input_section_sort_entry. Define
17751 Input_section_sort_compare. Declare
17752 sort_attached_input_sections. Add new fields:
17753 may_sort_attached_input_sections_,
17754 must_sort_attached_input_sections_,
17755 attached_input_sections_are_sorted_.
17756 * output.cc (Output_section::Output_section): Initialize new
17757 fields.
17758 (Output_section::add_input_section): Add an entry to
17759 input_sections_ if may_sort or must_sort are true.
17760 (Output_section::set_final_data_size): Call
17761 sort_attached_input_sections if necessary.
17762 (Output_section::Input_section_sort_entry): Define new class.
17763 (Output_section::Input_section_sort_compare::operator()): New
17764 function.
17765 (Output_section::sort_attached_input_sections): New function.
17766 * configure.ac: Check whether the compiler supports constructor
17767 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17768 * testsuite/initpri1.c: New file.
17769 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17770 CONSTRUCTOR_PRIORITY.
17771 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17772 (initpri1_LDFLAGS): New variable.
17773 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17774
18e6b24e
ILT
177752008-03-27 Ian Lance Taylor <iant@google.com>
17776
49bdd526
ILT
17777 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17778 * testsuite/common_test_1.c: New file.
17779 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17780 (common_test_1_SOURCES): New variable.
17781 (common_test_1_DEPENDENCIES): New variable.
17782 (common_test_1_LDFLAGS): New variable.
17783
18e6b24e
ILT
17784 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17785 and commons_ correctly when NAME/VERSION does not override
17786 NAME/NULL.
17787 * testsuite/ver_test_6.c: New file.
17788 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17789 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17790 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17791
04bf7072
ILT
177922008-03-26 Ian Lance Taylor <iant@google.com>
17793
5871526f
ILT
17794 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17795 of an undefined symbol from a version script.
17796 * testsuite/Makefile.am (ver_test_5.so): New target.
17797 (ver_test_5.o): New target.
17798 (check_SCRIPTS): Add ver_test_5.sh.
17799 (check_DATA): Add ver_test_5.syms.
17800 (ver_test_5.syms): New target.
17801 * testsuite/ver_test_5.cc: New file.
17802 * testsuite/ver_test_5.script: New file.
17803 * testsuite/ver_test_5.sh: New file.
17804 * Makefile.in, testsuite/Makefile.in: Rebuild.
17805
04bf7072
ILT
17806 PR gold/5986
17807 Fix problems building gold with gcc 4.3.0.
17808 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17809 (gold_error_at_location, gold_warning_at_location): Use it.
17810 * configure.ac: Check whether we can compile and use a template
17811 function with a printf attribute.
17812 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17813 when jumping over bytes.
17814 * object.cc: Instantiate Object::read_section_data.
17815 * debug.h: Include <cstring>
17816 * dwarf_reader.cc: Include <algorithm>
17817 * main.cc: Include <cstring>.
17818 * options.cc: Include <cstring>.
17819 * output.cc: Include <cstring>.
17820 * script.cc: Include <cstring>.
17821 * script.h: Include <string>.
17822 * symtab.cc: Include <cstring> and <algorithm>.
17823 * target-select.cc: Include <cstring>.
17824 * version.cc: Include <string>.
17825 * testsuite/testmain.cc: Include <cstdlib>.
17826 * configure, config.in: Rebuild.
17827
874c5b28
ILT
178282008-03-25 Ian Lance Taylor <iant@google.com>
17829
819d6c3a
ILT
17830 * options.cc: Include "../bfd/bfdver.h".
17831 (options::help): Print bug reporting address.
17832
f4b2c6f5
ILT
17833 * version.cc (print_version): Adjust output for current value of
17834 BFD_VERSION_STRING.
17835
17836 * NEWS: New file.
17837
e96caa79
ILT
17838 * options.cc (options::help): Print list of supported targets.
17839 * target-select.h: Include <vector>.
17840 (class Target_selector): Make machine_, size_, and is_big_endian_
17841 fields const. Add bfd_name_ and instantiated_target_ fields.
17842 (Target_selector::Target_selector): Add bfd_name parameter.
17843 (Target_selector::recognize): Make non-virtual, call
17844 do_recognize.
17845 (Target_selector::recognize_by_name): Make non-virtual, call
17846 do_recognize_by_name.
17847 (Target_selector::supported_names): New function.
17848 (Target_selector::bfd_name): New function.
17849 (Target_selector::do_instantiate_target): New pure virtual
17850 function.
17851 (Target_selector::do_recognize): New virtual function.
17852 (Target_selector::do_recognize_by_name): New virtual function.
17853 (Target_selector::instantiate_target): New private function.
17854 (supported_target_names): Declare.
17855 * target-select.cc (Target_selector::Target_selector): Update for
17856 new parameter and fields.
17857 (select_target_by_name): Check that the name matches before
17858 calling recognize_by_name.
17859 (supported_target_names): New function.
17860 * i386.cc (class Target_selector_i386): Update Target_selector
17861 constructor call. Remove recognize and recognize_by_name. Add
17862 do_instantiate_target.
17863 * x86_64.cc (class Target_selector_x86_64): Likewise.
17864 * testsuite/testfile.cc (class Target_selector_test): Update for
17865 changes to Target_selector.
17866
874c5b28
ILT
17867 * README: Rewrite, with some notes on unsupported features.
17868
0a65a3a7
CC
178692008-03-24 Cary Coutant <ccoutant@google.com>
17870
17871 * i386.cc (Target_i386::Got_type): New enum declaration.
17872 (Target_i386::Scan::local): Updated callers of Output_data_got
17873 member functions.
17874 (Target_i386::Scan::global): Likewise.
17875 (Target_i386::Relocate::relocate): Likewise.
17876 (Target_i386::Relocate::relocate_tls): Likewise.
17877 * object.h (Got_offset_list): New class.
17878 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17879 (Sized_relobj::local_got_offset): Likewise.
17880 (Sized_relobj::set_local_got_offset): Likewise.
17881 (Sized_relobj::local_has_tls_got_offset): Removed.
17882 (Sized_relobj::local_tls_got_offset): Removed.
17883 (Sized_relobj::set_local_tls_got_offset): Removed.
17884 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17885 * output.cc (Output_data_got::add_global): Added got_type parameter.
17886 (Output_data_got::add_global_with_rel): Likewise.
17887 (Output_data_got::add_global_with_rela): Likewise.
17888 (Output_data_got::add_global_pair_with_rel): New function.
17889 (Output_data_got::add_global_pair_with_rela): New function.
17890 (Output_data_got::add_local): Added got_type parameter.
17891 (Output_data_got::add_local_with_rel): Likewise.
17892 (Output_data_got::add_local_with_rela): Likewise.
17893 (Output_data_got::add_local_pair_with_rel): New function.
17894 (Output_data_got::add_local_pair_with_rela): New function.
17895 (Output_data_got::add_global_tls): Removed.
17896 (Output_data_got::add_global_tls_with_rel): Removed.
17897 (Output_data_got::add_global_tls_with_rela): Removed.
17898 (Output_data_got::add_local_tls): Removed.
17899 (Output_data_got::add_local_tls_with_rel): Removed.
17900 (Output_data_got::add_local_tls_with_rela): Removed.
17901 * output.h (Output_data_got::add_global): Added got_type parameter.
17902 (Output_data_got::add_global_with_rel): Likewise.
17903 (Output_data_got::add_global_with_rela): Likewise.
17904 (Output_data_got::add_global_pair_with_rel): New function.
17905 (Output_data_got::add_global_pair_with_rela): New function.
17906 (Output_data_got::add_local): Added got_type parameter.
17907 (Output_data_got::add_local_with_rel): Likewise.
17908 (Output_data_got::add_local_with_rela): Likewise.
17909 (Output_data_got::add_local_pair_with_rel): New function.
17910 (Output_data_got::add_local_pair_with_rela): New function.
17911 (Output_data_got::add_global_tls): Removed.
17912 (Output_data_got::add_global_tls_with_rel): Removed.
17913 (Output_data_got::add_global_tls_with_rela): Removed.
17914 (Output_data_got::add_local_tls): Removed.
17915 (Output_data_got::add_local_tls_with_rel): Removed.
17916 (Output_data_got::add_local_tls_with_rela): Removed.
17917 * resolve.cc (Symbol::override_base_with_special): Removed
17918 reference to has_got_offset_ field.
17919 * symtab.cc (Symbol::init_fields): Replaced initialization
17920 of got_offset_ with got_offsets_. Removed initialization
17921 of has_got_offset_
53fcba31 17922 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17923 (Symbol::got_offset): Likewise.
17924 (Symbol::set_got_offset): Likewise.
17925 (Symbol::has_tls_got_offset): Removed.
17926 (Symbol::tls_got_offset): Removed.
17927 (Symbol::set_tls_got_offset): Removed.
17928 (Symbol::got_offset_): Removed.
17929 (Symbol::tls_mod_got_offset_): Removed.
17930 (Symbol::tls_pair_got_offset_): Removed.
17931 (Symbol::got_offsets_): New field.
17932 (Symbol::has_got_offset): Removed.
17933 (Symbol::has_tls_mod_got_offset): Removed.
17934 (Symbol::has_tls_pair_got_offset): Removed.
17935 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17936 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17937 member functions.
17938 (Target_x86_64::Scan::global): Likewise.
17939 (Target_x86_64::Relocate::relocate): Likewise.
17940 (Target_x86_64::Relocate::relocate_tls): Likewise.
17941
bd52eafb
BE
179422008-03-25 Ben Elliston <bje@au.ibm.com>
17943
17944 * yyscript.y: Fix spelling error in comment.
17945
8b105e34
ILT
179462008-03-24 Ian Lance Taylor <iant@google.com>
17947
8ed814a9
ILT
17948 * options.h (class General_options): Define build_id option.
17949 * layout.h (class Layout): Declare write_build_id, create_note,
17950 create_build_id. Add build_id_note_ member.
17951 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17952 "libiberty.h", "md5.h", "sha1.h".
17953 (Layout::Layout): Initialize eh_frame_data_,
17954 eh_frame_hdr_section_, and build_id_note_.
17955 (Layout::finalize): Call create_build_id.
17956 (Layout::create_note): New function, broken out of
17957 Layout::create_gold_note.
17958 (Layout::create_gold_note): Call create_note.
17959 (Layout::create_build_id): New function.
17960 (Layout::write_build_id): New function.
17961 (Close_task_runner::run): Call write_build_id.
17962
8b105e34
ILT
17963 * x86_64.cc: Correct license to GPLv3.
17964
086a1841
ILT
179652008-03-23 Ian Lance Taylor <iant@google.com>
17966
17967 * options.cc: Include "demangle.h".
17968 (parse_optional_string): New function.
17969 (parse_long_option): Handle takes_optional_argument.
17970 (parse_short_option): Update dash_z initializer. Handle
17971 takes_optional_argument.
17972 (General_options::General_options): Initialize do_demangle_.
17973 (General_options::finalize): Set do_demangle_. Handle demangling
17974 style.
17975 * options.h (parse_optional_string): Declare.
17976 (struct One_option): Add optional_arg field. Update constructor.
17977 Update call constructor calls. Add takes_optional_argument
17978 function.
17979 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17980 (DEFINE_optional_string): Define.
17981 (General_options::demangle): Change from DEFINE_bool to
17982 DEFINE_optional_string.
17983 (General_options::no_demangle): New function.
17984 (General_options::do_demangle): New function.
17985 (General_options::set_do_demangle): New function.
17986 (General_options::execstack_status_): Move definition to end of
17987 class definition.
17988 (General_options::static_): Likewise.
17989 (General_options::do_demangle_): New field.
17990 * object.cc (big_endian>::get_symbol_location_info): Call
17991 Options::do_demangle, not Options::demangle.
17992 * symtab.cc (demangle): Likewise.
17993
cbb93e63
ILT
179942008-03-22 Ian Lance Taylor <iant@google.com>
17995
17996 * gold.h: Include <cstddef> and <sys/types.h>
17997 * options.h: Include <cstring>.
17998
ec531623
ILT
179992008-03-21 Ian Lance Taylor <iant@google.com>
18000
18001 * Added source code to GNU binutils.
752937aa 18002\f
b90efa5b 18003Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
18004
18005Copying and distribution of this file, with or without modification,
18006are permitted in any medium without royalty provided the copyright
18007notice and this notice are preserved.
18008
18009Local Variables:
18010mode: change-log
18011left-margin: 8
18012fill-column: 74
18013version-control: never
18014End:
This page took 1.148506 seconds and 4 git commands to generate.