Recent powerpc testcase fails
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
db1ff028
CC
12015-11-14 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/19244
4 PR gold/18548
5 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
6 local symbols only for predefined symbols.
7
a680de9a
PB
82015-11-11 Alan Modra <amodra@gmail.com>
9 Peter Bergner <bergner@vnet.ibm.com>
10
11 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
12 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
13 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
14 (Target_powerpc::Scan::global): Likewise.
15 (Target_powerpc::Relocate::relocate): Likewise.
16
cc203475
VR
172015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
18
19 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
20 sections.
21
859d7987
CC
222015-11-09 Cary Coutant <ccoutant@gmail.com>
23 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
24
25 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
26 with type, offset, addend.
27 (Copy_relocs::save): Likewise.
28 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
29 (Copy_relocs::save): Likewise.
30 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
31 and r_addend to Copy_relocs::copy_reloc.
32 * arm.cc (Target_arm::copy_reloc): Likewise.
33 * i386.cc (Target_i386::copy_reloc): Likewise.
34 * mips.cc (Target_mips::copy_reloc): Likewise.
35 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
36 * s390.cc (Target_s390::copy_reloc): Likewise.
37 * sparc.cc (Target_sparc::copy_reloc): Likewise.
38 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
39 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
40
96f9814d
CC
412015-11-05 Cary Coutant <ccoutant@gmail.com>
42
43 PR gold/19119
44 PR gold/19172
45 PR gold/19197
46 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
47 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
48 * options.h (General_options): Remove "obsolete" from -m.
49 * parameters.cc (set_parameters_target): Check if input target
50 is compatible with output emulation set by "-m emulation".
51
0eccf19f
CC
522015-11-05 Cary Coutant <ccoutant@gmail.com>
53
54 PR gold/19163
55 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
56 certain relocations if --no-apply-dynamic-relocs is set.
57 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
58
c1e7d6a8
AM
592015-11-03 Alan Modra <amodra@gmail.com>
60
61 * po/POTFILES.in: Regenerate.
62
26f187cd
NC
632015-10-30 Nick Clifton <nickc@redhat.com>
64
65 * po/zh_CN.po: New (simplified) Chinese translation.
66
41e83f2b
L
672015-10-29 H.J. Lu <hongjiu.lu@intel.com>
68
69 PR gold/19184
70 * incremental.cc (Got_plt_view_info): Add got_entry_size.
71 (Local_got_offset_visitor::visit): Replace got_entry_size_
72 with info_.got_entry_size.
73 (Local_got_offset_visitor::got_entry_size_): Removed.
74 (Global_got_offset_visitor::visit): Replace got_entry_size_
75 with info_.got_entry_size.
76 (Global_got_offset_visitor::got_entry_size_): Removed.
77 (Output_section_incremental_inputs::write_got_plt): Initialize
78 view_info.got_entry_size.
79 * target.h (Sized_target::got_entry_size): New virtual function.
80 * x86_64.cc (Target_x86_64::got_entry_size): New function.
81
238830c6
MK
822015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
83
84 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
85 * testsuite/script_test_12a.c: Likewise.
86 * testsuite/script_test_1a.cc: Likewise.
87 * testsuite/script_test_2.cc: Likewise.
88
bd890911
MK
892015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
90
91 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
92
a817ff49
MK
932015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
94
95 PR gold/18959
96 * stringpool.cc (Stringpool_template::new_key_offset): Align all
97 strings, even zero-length.
98 (Stringpool_template::set_string_offsets): Likewise.
99
e79a4bad
MK
1002015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
101
102 * s390.cc: New file.
103 * Makefile.am (TARGETSOURCES): Add s390.cc.
104 (ALL_TARGETOBJS): Add s390.o.
105 * Makefile.in: Regenerate.
106 * configure.ac: Add s390 support.
107 * configure: Regenerate.
108 * configure.tgt: Add s390-*-* and s390x-*-*.
109 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
110 support.
111
6f97897d
MK
1122015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
113
114 * archive.cc (Archive::sym64name): New const.
115 (Archive::setup): Add support for SYM64 armap.
116 (Archive::read_armap): Likewise.
117 (Archive::interpret_header): Likewise.
118 (Archive::const_iterator::read_next_header): Likewise.
119 * archive.h (Archive::sym64name): New const.
120 (Archive::read_armap): Add mapsize template parameter.
121
8d9743bd
MK
1222015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
123
124 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
125 target-specific entry size.
126 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
127 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
128 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
129 hash_entry_size.
130 * target.h (Target::hash_entry_size): New method.
131 (Target::Target_info::hash_entry_size): New data member.
132
133 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
134 * arm.cc (Target_arm::arm_info): Likewise.
135 (Target_arm_nacl::arm_nacl_info): Likewise.
136 * i386.cc (Target_i386::i386_info): Likewise.
137 (Target_i386_nacl::i386_nacl_info): Likewise.
138 (Target_iamcu::iamcu_info): Likewise.
139 * mips.cc (Target_mips::mips_info): Likewise.
140 (Target_mips_nacl::mips_nacl_info): Likewise.
141 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
142 * sparc.cc (Target_sparc::sparc_info): Likewise.
143 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
144 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
145 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
146 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
147
3043c1ab
L
1482015-10-28 H.J. Lu <hongjiu.lu@intel.com>
149
150 PR gold/19177
151 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
152 and R_386_GOT32X relocations without base register.
153
4d2f5d58
HS
1542015-10.27 Han Shen <shenhan@google.com>
155
156 PR gold/19042 - unsupported reloc 311/312.
157
158 * aarch64.cc (Target_aarch64::Scan::local): Add support for
159 reloc 311/312.
160
2891b491
L
1612015-10-22 H.J. Lu <hongjiu.lu@intel.com>
162
163 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
164 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
165 as R_X86_64_GOTPCREL.
166 (Target_x86_64<size>::Scan::local): Likewise.
167 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
168 Likewise.
169 (Target_x86_64<size>::Scan::global): Likewise.
170 (Target_x86_64<size>::Relocate::relocate): Likewise.
171 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
172 Likewise.
173
493d4b48
L
1742015-10-22 H.J. Lu <hongjiu.lu@intel.com>
175
176 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
177 R_386_GOT32X the same as R_386_GOT32.
178 (Target_i386::Scan::local): Likewise.
179 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
180 (Target_i386::Scan::global): Likewise.
181 (Target_i386::Relocate::relocate): Likewise.
182 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
183 Likewise.
184
0fd15345
L
1852015-10-20 H.J. Lu <hongjiu.lu@intel.com>
186
187 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
188 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
189 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
190 x86_64_mov_to_lea1.o.
191 * testsuite/Makefile.in: Regenerated.
192
64571972
L
1932015-10-16 H.J. Lu <hongjiu.lu@intel.com>
194
195 PR gold/19119
196 * options.h (General_options): Remove "obsolete" from -m.
197 * parameters.cc (set_parameters_target): Check if input target
198 is compatible with output emulation set by "-m emulation".
199
01f573ad
L
2002015-10-13 H.J. Lu <hongjiu.lu@intel.com>
201
202 PR gold/19118
203 * i386.cc (Target_iamcu): New class.
204 (Target_selector_iamcu): Likewise.
205 (Target_iamcu::iamcu_info): New variable.
206 (target_selector_iamcu): Likewise.
207
3b0357da
AS
2082015-10-07 Andreas Schwab <schwab@suse.de>
209
210 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
211
9eacb935
CC
2122015-10-06 Cary Coutant <ccoutant@gmail.com>
213
214 PR gold/18855
215 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
216 parameter.
217 (Sparc_relocate_functions::gdop_lox10): Likewise.
218 (Target_sparc::Relocate::relocate): Use addend when computing
219 symbol value for R_SPARC_GOTDATA_OP*.
220
3d4fde69
CC
2212015-09-07 Cary Coutant <ccoutant@gmail.com>
222
223 PR gold/18930
224 PR gold/18886
225 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
226 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
227
358de988
L
2282015-09-02 H.J. Lu <hongjiu.lu@intel.com>
229
230 PR gold/18886
231 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
232 shared libraries into normal FUNC symbols.
233 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
234 symbols aren't from shared libraries.
235
d49044c7
AM
2362015-09-02 Alan Modra <amodra@gmail.com>
237
238 PR 18878
239 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
240 (Target_powerpc::Branch_info::make_stub): Determine whether long
241 branch stub is for save/restore function.
242 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
243 (Stub_table): Add need_save_res_.
244 (Stub_table:clear_stubs): Clear need_save_res_.
245 (Stub_table:set_address_and_size): Add save/restore section size.
246 (Stub_table::add_long_branch_entry): Add save_res param. Set
247 need_save_res_, but don't add space for save/restore stubs.
248 (Stub_table::find_long_branch_entry): Return offset to local copy
249 of save/restore func.
250 (Stub_table::do_write): Don't output save/restore stubs. Instead
251 copy the save/restore functions.
252 (Output_data_save_res:contents): New accessor.
253 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
254
7c61d651
CC
2552015-08-25 Cary Coutant <ccoutant@gmail.com>
256
257 PR gold/18847
258 * script-sections.cc (Memory_region::set_address): New method.
259 (Script_sections::find_memory_region): Add explicit_only parameter.
260 (Output_section_definition::set_section_addresses): Handle case where
261 script specifies both address and vma region.
262 * script-sections.h (Script_sections::find_memory_region): Add
263 explicit_only parameter.
264
4bfacfd3
CC
2652015-08-25 Cary Coutant <ccoutant@gmail.com>
266
267 PR gold/18859
268 * object.cc (Input_objects::add_object): Store objects in a map,
269 indexed by soname; update as-needed flag when necessary.
270 * object.h (Object::clear_as_needed): New method.
271 (Input_objects::so_names_): Change from set to map.
272
1757d35c
CC
2732015-08-25 Cary Coutant <ccoutant@gmail.com>
274
275 PR gold/14746
276 * expression.cc (Expression::Expression_eval_info): Add
277 is_valid_pointer field.
278 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
279 Adjust all callers.
280 (Addr_expression::value_from_output_section): Check whether address
281 is valid.
282 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
283 if evaluation failed due to address that is not yet valid.
284 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
285 parameter.
286
3ac0a36c
CC
2872015-08-25 Cary Coutant <ccoutant@gmail.com>
288
289 PR gold/18866
290 PR gold/18703
291 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
292
9215b98b
AM
2932015-08-20 Alan Modra <amodra@gmail.com>
294
295 PR gold/18846
296 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
297 Subtract os->address() from addend.
298 * powerpc.cc (relocate_relocs): Likewise.
299
40fc1451
SD
3002015-08-12 Simon Dardis <simon.dardis@imgtec.com>
301
302 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
303 lazy_stub_normal_1, lazy_stub_normal_1_n64,
304 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
305 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
306 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
307 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
308 of 'addu/daddu'.
309
37a42ee9
L
3102015-07-27 H.J. Lu <hongjiu.lu@intel.com>
311
312 * configure: Regenerated.
313
ab3b14b0
DK
3142015-07-26 Doug Kwan <dougkwan@google.com>
315
316 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
317 disassembler output format.
318
cdb06167
HS
3192015-07-23 Ian Coolidge <icoolidge@google.com>
320 Plumb --pic-veneer option for gold.
321
322 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
323 generation.
324 * options.h (General_options): Add --pic-veneer option.
325
5b2af7dd
L
3262015-07-22 H.J. Lu <hongjiu.lu@intel.com>
327
328 PR gold/18663
329 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
330 script_test_1a.cc script_test_1b.cc.
331 (script_test_11_r.o): Replace script_test_11.o with
332 script_test_11a.o script_test_11b.o.
333 (script_test_11.o): Removed.
334 (script_test_11a.o): New.
335 (script_test_11b.o): Likewise.
336 * testsuite/Makefile.in: Regenerated.
337 * testsuite/script_test_1.h: New file.
338 * testsuite/script_test_1b.cc: Likewise.
339 * testsuite/script_test_11.h: Likewise.
340 * testsuite/script_test_11b.c: Likewise.
341 * testsuite/script_test_1.cc: Renamed to ...
342 * testsuite/script_test_1a.cc: This.
343 Include "script_test_1.h".
344 (main): Call check_int and check_ptr.
345 * testsuite/script_test_11.c: Renamed to ...
346 * testsuite/script_test_11a.c: This.
347 Include "script_test_11.h".
348 (main): Call ptr_equal.
349
cd78ea77
L
3502015-07-22 H.J. Lu <hongjiu.lu@intel.com>
351
352 PR gold/18628
353 * testsuite/ifuncdep2.c (global): Change protected to hidden.
354 * testsuite/ifuncmod1.c (global): Likewise.
355 * testsuite/ifuncmod5.c (global): Likewise.
356
f945ba50
AM
3572015-07-22 Alan Modra <amodra@gmail.com>
358
359 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
360
5417c94d
CC
3612015-07-21 Cary Coutant <ccoutant@gmail.com>
362
363 PR gold/18548
364 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
365 forced local symbol even when oldsym != NULL.
366 (Symbol_table::do_define_in_output_segment): Likewise.
367 (Symbol_table::do_define_as_constant): Likewise.
368
cb5cf5e2
CC
3692015-07-21 Cary Coutant <ccoutant@gmail.com>
370
b8c6c5ef 371 PR gold/18698
cb5cf5e2
CC
372 * archive.cc (Library_base::should_include_member): Don't use entry
373 point for relocatable links, or if target is not yet valid.
374 * parameters.cc (Parameters::entry): Check target_valid().
375
0ef3814f
HS
3762015-07-20 Han Shen <shenhan@google.com>
377
378 Optimize erratum 843419 fix.
379
380 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
381 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
382 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
383 (E843419_stub): New sub-class of Erratum_stub.
384 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
385 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
386 (AArch64_relobj::create_erratum_stub): Add 1 argument.
387 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
388
2bca0377
HS
3892015-07-20 Han Shen <shenhan@google.com>
390
391 Fix arm elf header flags wrt hardfp bit.
392
393 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
394
f54f5e31
L
3952015-07-20 H.J. Lu <hongjiu.lu@intel.com>
396
397 PR gold/18689
398 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
399 from input group section for relocatable link.
400 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
401 (check_DATA): Add pr18689.stdout.
402 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
403 (pr18689.stdout): New rule.
404 (pr18689a.o): Likewise.
405 (pr18689b.o): Likewise.
406 (pr18689.o): Likewise.
407 * testsuite/pr18689.c: New file.
408 * testsuite/pr18689.sh: Likewise.
409 * testsuite/Makefile.in: Regenerated.
410
c20ceeb2
YW
4112015-07-20 Yiran Wang <yiran@google.com>
412 Cary Coutant <ccoutant@gmail.com>
413
414 PR gold/15574
415 * resolve.cc (Symbol_table): Remove warning about references
416 from shared objects to hidden symbols.
417 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
418 * testsuite/Makefile.in: Regenerate.
419 * testsuite/hidden_test.sh: Check dynamic symbol table; update
420 expected error messages.
421
19a7fe52
L
4222015-07-14 H.J. Lu <hongjiu.lu@intel.com>
423
424 * compressed_output.cc (Output_compressed_section::set_final_data_size):
425 Make --compress-debug-sections=zlib the same as
426 --compress-debug-sections=zlib-gabi.
427 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
428 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
429 ".zdebug_".
430 * testsuite/Makefile.in: Regenerated.
431
fb8b9dbc
L
4322015-07-12 H.J. Lu <hongjiu.lu@intel.com>
433
434 PR gold/18322
435 * compressed_output.cc (zlib_compress): Add argument for
436 compression header size. Set header size to compression header
437 size if it isn't 0. Don't write out the zlib header here.
438 (Output_compressed_section::set_final_data_size): Support
439 zlib-gnu and zlib-gabi compressions. Pass compression header
440 size to zlib_compress and write out compression header. Set
441 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
442 clear the SHF_COMPRESSED bit
443 * options.h (compress_debug_sections): Add zlib-gnu and
444 zlib-gabi.
445 * output.h (Output_section::set_flags): New.
446 * testsuite/Makefile.am (check_PROGRAMS): Add
447 flagstest_compress_debug_sections_none,
448 flagstest_compress_debug_sections_gnu and
449 flagstest_compress_debug_sections_gabi.
450 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
451 flagstest_compress_debug_sections.stdout,
452 flagstest_compress_debug_sections.cmp,
453 flagstest_compress_debug_sections.check,
454 flagstest_compress_debug_sections_gnu.stdout,
455 flagstest_compress_debug_sections_gnu.cmp,
456 flagstest_compress_debug_sections_gnu.check,
457 flagstest_compress_debug_sections_gabi.stdout,
458 flagstest_compress_debug_sections_gabi.cmp and
459 flagstest_compress_debug_sections_gabi.check.
460 (flagstest_compress_debug_sections_none): New.
461 (flagstest_compress_debug_sections_none.stdout): Likewise.
462 (flagstest_compress_debug_sections.stdout): Likewise.
463 (flagstest_compress_debug_sections.check): Likewise.
464 (flagstest_compress_debug_sections.cmp): Likewise.
465 (flagstest_compress_debug_sections_gnu): Likewise.
466 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
467 (flagstest_compress_debug_sections_gnu.check): Likewise.
468 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
469 (flagstest_compress_debug_sections_gabi): Likewise.
470 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
471 (flagstest_compress_debug_sections_gnu.check): Likewise.
472 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
473 * testsuite/Makefile.in: Regenerated.
474
48058663
L
4752015-07-12 H.J. Lu <hongjiu.lu@intel.com>
476
477 PR gold/18321
478 * compressed_output.h (decompress_input_section): Add arguments
479 for ELF class, big endian and sh_flags.
480 * compressed_output.cc (decompress_input_section): Likewise.
481 Support the SHF_COMPRESSED section.
482 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
483 functions.
484 * plugin.h (Pluginobj): Likewise.
485 * layout.cc (Layout::get_output_section_flags): Also clear the
486 SHF_COMPRESSED bit.
487 * object.h (Compressed_section_info): Add flag to store sh_flags.
488 (Object): Add pure virtual elfsize and is_big_endian member
489 functions.
490 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
491 prefix here.
492 (build_compressed_section_map): Check SHF_COMPRESSED for
493 uncompressed size. Store sh_flags in Compressed_section_info.
494 Pass size, big_endian and sh_flags to decompress_input_section.
495 Skip the ".debug"/".zdebug" prefix when passing section name to
496 need_decompressed_section.
497 (Sized_relobj_file<size, big_endian>::do_find_special_section):
498 Don't check ".zdebug_*" sections.
499 (Object::decompressed_section_contents): Pass ELF class, big
500 endian and sh_flags to decompress_input_section.
501 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
502 Likewise.
503 * testsuite/Makefile.am (check_DATA): Add
504 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
505 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
506 gdb_index_test_2_gabi.stdout.
507 (debug_msg_cdebug_gabi.o): New.
508 (odr_violation1_cdebug_gabi.o): Likewise.
509 (odr_violation2_cdebug_gabi.o): Likewise.
510 (debug_msg_cdebug_gabi.err): Likewise.
511 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
512 (gdb_index_test_cdebug_gabi.o): Likewise.
513 (gdb_index_test_2_gabi): Likewise.
514 (gdb_index_test_2_gabi.stdout): Likewise.
515 * testsuite/gdb_index_test_2_gabi.sh: New file.
516 * testsuite/Makefile.in: Regenerated.
517
73854cdd
HS
5182015-07-09 Han Shen <shenhan@google.com>
519
520 Use "gold_info" instead of "gold_warning" for erratum fix.
521
522 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
523 'gold_info'.
524 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
525
61163dfa
HS
5262015-07-09 Han Shen <shenhan@google.com>
527
528 Drop missing symbol warning for arm/aarch64.
529
530 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
531 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
532 symbol warning.
533
b91deca9
HS
5342015-07-07 Han Shen <shenhan@google.com>
535
536 Make gold aarch64 accept long form of mapping symbols.
537
538 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
539 of mapping symbols.
540
15162bef
DK
5412015-06-29 Doug Kwan <dougkwan@google.com>
542
543 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
544 at address expected by test.
545 * testsuite/arm_cortex_a8_b.s: Ditto.
546 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
547 * testsuite/arm_cortex_a8_bl.s: Ditto.
548 * testsuite/arm_cortex_a8_blx.s: Ditto.
549 * testsuite/arm_cortex_a8_local.s: Ditto.
550 * testsuite/arm_fix_v4bx.s: Ditto.
551 * testsuite/arm_unaligned_reloc.s: Ditto.
552 * testsuite/thumb_bl_out_of_range.s: Ditto.
553 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
554 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 555
56b06706
HS
5562015-06-29 Han Shen <shenhan@google.com>
557
558 Patch for erratum 843419 internal error.
559
72f4393d
L
560 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
561 (Erratum_stub::update_erratum_insn): New method.
562 (Stub_table::relocate_stubs): Modified to place relocated insn.
563 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 564
2f0c79aa
HS
5652015-06-12 Han Shen <shenhan@google.com>
566
567 Fix erratum 835769.
568
72f4393d
L
569 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
570 defintion outside class definition.
571 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
572 (AArch64_insn_utilities::aarch64_op31): New member.
573 (AArch64_insn_utilities::aarch64_ra): New member.
574 (AArch64_insn_utilities::aarch64_mac): New member.
575 (AArch64_insn_utilities::aarch64_mlxl): New member.
576 (ST_E_835769): New global enum member.
577 (Stub_table::relocate_stubs): Add 835769 handler.
578 (Stub_template_repertoire::Stub_template_repertoire): Install new
579 stub type.
580 (AArch64_relobj::scan_errata): This func is renamed from
581 scan_erratum_843419.
582 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
583 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
584 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
585 (Target_aarch64::scan_erratum_835769_span): New method.
586 (Target_aarch64::create_erratum_stub): New method.
587 (Target_aarch64::is_erratum_835769_sequence): New method.
588 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
589 code into create_erratum_stub.
590 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 591
5d7908e0
CC
5922015-06-11 Cary Coutant <ccoutant@gmail.com>
593
594 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
595 outside class body.
596 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
597
dd68f8fa
CC
5982015-06-11 Cary Coutant <ccoutant@gmail.com>
599
600 PR gold/17731
601 * layout.cc (corresponding_uncompressed_section_name): New function.
602 (Layout::choose_output_section): Call it.
603 * layout.h (corresponding_uncompressed_section_name): New function.
604 * script-sections.cc (Input_section_info::set_section_name): Check
605 for compressed debug section (.zdebug style).
606
a3a0c391
JY
6072015-06-11 Jing Yu <jingyu@google.com>
608
609 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
610 * testsuite/Makefile.in: Regenerate.
611
970cdef2
DI
6122015-06-11 Davide Italiano <dccitaliano@gmail.com>
613
614 * gold.h (is_cident): Correct typo.
615
a48d0c12
HS
6162015-06-10 Han Shen <shenhan@google.com>
617 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
618
619 Now fixing for 843419 is fully functional.
620
621 The first part of the erratum fix CL is here -
622 https://sourceware.org/ml/binutils/2015-04/msg00229.html
623
624 * aarch64.cc(global enum): New constants representing stub types.
625 (Stub_template): New POD struct.
626 (Stub_template_repertoire): New class.
627 (Stub_base): New class.
628 (Erratum_stub): New class.
629 (Reloc_stub): Refactored to be a subclass of Stub_base.
630 (Reloc_stub::Stub_type): Removed.
631 (Reloc_stub::offset): Moved to Stub_base.
632 (Reloc_stub::set_offset): Moved to Stub_base.
633 (Reloc_stub::destination_address): Moved to Stub_base.
634 (Reloc_stub::set_destination_address): Moved to Stub_base.
635 (Reloc_stub::reset_destination_address): Moved to Stub_base.
636 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
637 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
638 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
639 (Reloc_stub::write): Moved to Stub_base.
640 (Reloc_stub::invalid_offset): Moved to Stub_base.
641 (Reloc_stub::invalid_address): Moved to Stub_base.
642 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
643 (Reloc_stub::stub_insns_): Moved to Stub_base.
644 (Reloc_stub::offset_): Moved to Stub_base.
645 (Reloc_stub::destination_address_): Moved to Stub_base.
646 (Stub_table::The_aarch64_relobj): New typedef.
647 (Stub_table::The_erratum_stub): New typedef.
648 (Stub_table::The_erratum_stub_less): New typedef.
649 (Stub_table::The_erratum_stub_set): New typedef.
650 (Stub_table::The_erratum_stub_set_iter): New typedef.
651 (Stub_table::empty): Added emptiness testing for erratum stubs.
652 (Stub_table::add_erratum_stub): New method to add an erratum stub.
653 (Stub_table::find_erratum_stub): New method.
654 (Stub_table::find_erratum_stubs_for_input_section): New method.
655 (Stub_table::erratum_stub_address): New method.
656 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
657 (Stub_table::do_addralign): Modified to handle erratum stubs.
658 (Stub_table::erratum_stubs_): New member.
659 (Stub_table::erratum_stub_size_): New member.
660 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
661 (Stub_table::do_write): Modified to handle erratum stubs.
662 (AArch64_relobj::The_erratum_stub): New typedef.
663 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
664 (AArch64_relobj::fix_errata): New method.
665 (Target_aarch64::The_reloc_stub_type): Removed.
666 (Target_aarch64::The_erratum_stub): New typede.
667 (AArch64_relocate_functions::construct_b): New method.
668
1e1b2efc
NC
6692015-06-08 Nick Clifton <nickc@redhat.com>
670
671 * po/fr.po: New French Translation.
672
b8cf5075
CC
6732015-06-07 Cary Coutant <ccoutant@gmail.com>
674
675 PR gold/18288
676 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
677 callers. Don't use STT_COMMON to check for common symbols.
678 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
679 symbol that's not in a common section.
680 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
681 common symbols.
682
bdd2d2b7
CC
6832015-06-04 Cary Coutant <ccoutant@gmail.com>
684
685 PR gold/18200
686 * Makefile.am (diststuff): Add target.
687 * Makefile.in: Regenerate.
688
cd3c333f
CC
6892015-06-04 Cary Coutant <ccoutant@gmail.com>
690
691 PR gold/17498
692 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
693 temporary locals in merge sections.
694 * options.cc (General_options::parse_discard_all): New method.
695 (General_options::parse_discard_locals): New method.
696 (General_options::parse_discard_none): New method.
697 (General_options::General_options): Initialize discard_locals_.
698 * options.h (--discard-all): Convert to special option.
699 (--discard-locals): Likewise.
700 (--discard-none): New option.
701 (General_options::discard_all): New method.
702 (General_options::discard_locals): New method.
703 (General_options::discard_sec_merge): New method.
704 (General_options::Discard_locals): New enum.
705 (General_options::discard_locals_): New data member.
706
8086551f
CC
7072015-06-03 Cary Coutant <cary@google.com>
708
709 * script-sections.cc (Script_sections::Script_sections): Initialize
710 segments_created_.
711 (Script_sections::create_note_and_tls_segments): Set flag when
712 segments are created.
713 (Script_sections::expected_segment_count): Count PT_INTERP.
714 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
715 segments are created.
716 * script-sections.h (Script_sections::segments_created_): New data
717 member.
718
374082df
CC
7192015-06-03 Cary Coutant <ccoutant@gmail.com>
720
721 PR gold/15370
722 * script-sections.cc
723 (Output_section_element_input::set_section_addresses): When there
724 are several patterns with no sort spec, put all sections in the same
725 bin.
726 * testsuite/Makefile.am (script_test_12): New testcase.
727 (script_test_12i): New testcase.
728 * testsuite/Makefile.in: Regenerate.
729 * testsuite/script_test_12.t: New test linker script.
730 * testsuite/script_test_12i.t: New test linker script.
731 * testsuite/script_test_12a.c: New test source file.
732 * testsuite/script_test_12b.c: New test source file.
733
775ed62e
CC
7342015-06-02 Cary Coutant <ccoutant@gmail.com>
735
736 * nacl.h (Sniff_file): Switch parameters to get_view to get an
737 aligned view.
738
9c7fe3c5
CC
7392015-06-03 Cary Coutant <ccoutant@gmail.com>
740
72f4393d
L
741 PR gold/17819
742 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
743 separate task to schedule the build id computation.
744 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
745 add Output_file and offset.
746 (Hash_task::run): Get and release the input views.
747 (Hash_task::is_runnable): Always return NULL (always runnable).
748 (Layout::queue_build_id_tasks): Remove.
749 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
750 parameters; use them instead of class members.
751 (Build_id_task_runner::run): New function.
752 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
753 to write_build_id.
754 * layout.h (Layout::queue_build_id_tasks): Remove.
755 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
756 parameters.
757 (Layout::array_of_hashes_): Remove.
758 (Layout::size_of_array_of_hashes_): Remove.
759 (Layout::input_view_): Remove.
760 (Build_id_task_runner): New class.
761 (Close_task_runner::Close_task_runner): Add array_of_hashes and
762 size_of_hashes parameters.
763 (Close_task_runner::array_of_hashes_): New data member.
764 (Close_task_runner::size_of_hashes_): New data member.
765 * testsuite/Makefile.am
766 (flagstest_compress_debug_sections_and_build_id_tree): New test.
767 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 768
400f8944
RÁE
7692015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
770
771 * merge.cc (get_input_merge_map): Update for data structure change.
772 (get_or_make_input_merge_map): Update for data structure change.
773 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
774 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
775
bbec1a5d
AM
7762015-05-16 Alan Modra <amodra@gmail.com>
777
778 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
779 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
780 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
781 (lis_0): Rename from lis_0_0.
782
efc6fa12
CC
7832015-04-29 Cary Coutant <cary@google.com>
784 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
785
786 * gc.h (Garbage_collection::is_section_garbage): Change Object*
787 to Relobj*.
788 (Garbage_collection::add_reference): Likewise.
789 (Garbage_collection::gc_process_relocs): Likewise. Don't push
790 object/shndx pair onto *secvec for dynamic objects. Don't follow
791 relocations pointing to dynamic objects for GC.
792 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
793 (Icf::unfold_section): Likewise.
794 (Icf::is_section_folded): Likewise.
795 (Icf::get_folded_section): Likewise.
796 * icf.h: (Icf::get_folded_section): Likewise.
797 (Icf::unfold_section): Likewise.
798 (Icf::is_section_folded): Likewise.
799 (Icf::section_has_function_pointers): Likewise.
800 (Icf::set_section_has_function_pointers): Likewise.
801 * object.h (Section_id): Likewise.
802 (Const_section_id): Likewise.
803 * output.cc (Output_section::update_section_layout): Likewise.
804 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
805 Likewise.
806 * plugin.cc (update_section_order): Likewise.
807 (unique_segment_for_sections): Likewise.
808 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
809 (Target_powerpc::do_gc_add_reference): Likewise.
810 (Target_powerpc::gc_process_relocs): Likewise.
811 (Target_powerpc::do_gc_add_reference): Likewise.
812 * symtab.cc (Symbol_table::is_section_folded): Likewise.
813 (Symbol_table::gc_mark_symbol): Likewise.
814 * symtab.h: (Symbol_table::is_section_folded): Likewise.
815 * target.h: (Sized_target::gc_add_reference): Likewise.
816 (Sized_target::do_gc_add_reference): Likewise.
817
f9d3ecaa
NC
8182015-04-29 Nick Clifton <nickc@redhat.com>
819
820 * po/fi.po: Updated Finnish translation.
821
faa2211d
AM
8222015-04-28 Alan Modra <amodra@gmail.com>
823
824 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
825 than unsigned int for find_global_entry result temp. Compare
826 against invalid_address.
827 (Target_powerpc::do_plt_address_for_global): Likewise.
828 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
829 on plt call stub existence for debug info. Do assert for plt
830 and global entry stub existence if an alloc section.
831
6ec65f28
AM
8322015-04-28 Alan Modra <amodra@gmail.com>
833
834 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
835 on missing global entry stub due to bogus debug info.
836
7a2a1c79
HS
8372015-04-27 Han Shen <shenhan@google.com>
838
839 * options.h (--fix-cortex-a53-843419): Rename option.
840 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
841 option.
842 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
843
cfbf0e3c
RÁE
8442015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
845
846 PR gold/18327
847 * output.cc (Output_section::is_input_address_mapped): Assume a missing
848 entry is mapped.
849 * testsuite/Makefile.am: Add the eh_test test.
850 * testsuite/Makefile.in: Regenerate.
851 * testsuite/eh_test_a.cc: New test.
852 * testsuite/eh_test_b.cc: New test.
853
6ec65f28
AM
8542015-04-23 Sriraman Tallam <tmsriram@google.com>
855
a100d66f
ST
856 * options.h (--weak-unresolved-symbols): New option.
857 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
858 binding to weak with new option.
859 * symtab.h (is_weak_undefined): Check for new option.
860 (is_strong_undefined): Check for new option.
861 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
862 * testsuite/Makefile.in: Regenerate.
863 * testsuite/weak_unresolved_symbols_test.cc: New file.
864
4b889c30
IC
8652015-04-20 Ian Coolidge <icoolidge@google.com>
866
867 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
868 GNU_UNIQUE.
869
4277535c
RÁE
8702015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
871
872 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
873 push_back.
874 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
875 * object.cc (Sized_relobj_file::do_layout): Use push_back.
876 * powerpc.cc (process_gc_mark): Use push_back.
877 (Target_powerpc::do_gc_mark_symbol): Use push_back.
878 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
879
7a2a1c79 8802015-04-16 Han Shen <shenhan@google.com>
5019d64a 881
6ec65f28
AM
882 * aarch64.cc (AArch64_insn_utilities): New utility class.
883 (AArch64_relobj::Mapping_symbol_position): New struct.
884 (AArch64_relobj::Mapping_symbol_info): New typedef.
885 (AArch64_relobj::do_count_local_symbols): New function overriding
886 parent's implementation.
887 (AArch64_relobj::mapping_symbol_info_): New member
888 (AArch64_relobj::scan_erratum_843419): New method.
889 (Target_aarch64::scan_erratum_843419_span): New method.
890 (Target_aarch64::is_erratum_843419_sequence): New method.
891 * options.h (fix_cortex_a53): New option.
5019d64a 892
a6a17750
CC
8932015-04-09 Cary Coutant <ccoutant@google.com>
894
895 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
896 in a PIE link.
897 * testsuite/Makefile.am (tls_pie_test.sh): New test.
898 * testsuite/Makefile.in: Regenerate.
899 * testsuite/tls_pie_test.sh: New.
900
437ddf0c
CC
9012015-04-09 Cary Coutant <ccoutant@google.com>
902
903 * debug.h (DEBUG_LOCATION): New.
904 (DEBUG_ALL): Include DEBUG_LOCATION.
905 (debug_string_to_enum): Add DEBUG_LOCATION.
906 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
907 output to print correct context.
908 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
909 up to 4 more locations at the beginning of the function.
910 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
911 result before sorting list of line numbers.
912 * testsuite/debug_msg.sh: Allow range of line numbers for
913 canonical results on optimized code.
914
24491327
HS
9152015-04-07 HC Yen <hc.yen@mediatek.com>
916
917 Add AArch32 support for gold linker.
918 gold/
919 * arm.cc: Add V8 arch combine table.
920
7fa5525f
RÁE
9212015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
922
923 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
924
5368dcf2
RÁE
9252015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
926
927 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
928 to find by using the return value of insert.
929
9dbb4b02
RÁE
9302015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
931
932 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
933 constructor call.
934
1fa29f10
IT
9352015-04-06 Ilya Tocar <ilya.tocar@intel.com>
936
937 PR gold/17641
938 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
939 (Target_x86_64::Scan::local): Don't create GOT entry, when we
940 can convert mov to lea.
941 (Target_x86_64::Scan::global): Ditto.
942 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
943 %reg to lea foo(%rip), %reg if possible.
944 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
945 * testsuite/x86_64_mov_to_lea1.s: New.
946 * testsuite/x86_64_mov_to_lea2.s: Ditto.
947 * testsuite/x86_64_mov_to_lea3.s: Ditto.
948 * testsuite/x86_64_mov_to_lea4.s: Ditto.
949 * testsuite/x86_64_mov_to_lea.sh: Ditto.
950
39f3de7c
L
9512015-04-02 H.J. Lu <hongjiu.lu@intel.com>
952
953 * configure: Regenerated.
954
c4fc4724
IT
9552015-04-01 Ilya Tocar <ilya.tocar@intel.com>
956
957 PR gold/17640
958 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
959 (Target_i386::Scan::local): Don't create GOT entry, when we
960 can convert GOT to GOTOFF.
961 (Target_i386::Scan::global): Ditto.
962 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
963 lea foo@GOTOFF(%reg), %reg if possible.
964 * testsuite/Makefile.am (i386_mov_to_lea): New test.
965 * testsuite/i386_mov_to_lea1.s: New.
966 * testsuite/i386_mov_to_lea2.s: Ditto.
967 * testsuite/i386_mov_to_lea3.s: Ditto.
968 * testsuite/i386_mov_to_lea4.s: Ditto.
969 * testsuite/i386_mov_to_lea5.s: Ditto.
970 * testsuite/i386_mov_to_lea.sh: Ditto.
971
918357b9
L
9722015-04-01 H.J. Lu <hongjiu.lu@intel.com>
973
974 * Makefile.am (ZLIB): New.
975 (ZLIBINC): Likewise.
976 (AM_CFLAGS): Add $(ZLIBINC).
977 (AM_CXXFLAGS): Likewise.
978 (ldadd_varldadd_var): Add $(ZLIB).
979 (incremental_dump_LDADD): Likewise.
980 (dwp_LDADD): Likewise.
981 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
982 <zlib.h>.
983 (zlib_compress): Don't check HAVE_ZLIB_H.
984 (zlib_decompress): Likewise.
985 * options.h (compress_debug_sections): Likewise.
986 * configure.ac (AM_CONDITIONAL): Removed.
987 * testsuite/Makefile.am (ZLIB): New.
988 (LDADD): Add $(ZLIB).
989 Don't check HAVE_ZLIB.
990 * Makefile.in: Regenerated.
991 * config.in: Likewise.
992 * configure: Likewise.
993 * testsuite/Makefile.in: Likewise.
994
6b0ad2eb
JY
9952015-03-30 Jing Yu <jingyu@google.com>
996
997 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
998 TLSLD_ADD_DTPREL_LO12_NC.
999 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1000 _TLS_MODULE_BASE_ point to the start of tls segment.
1001 (Target_aarch64::optimize_tls_reloc): Add cases for
1002 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1003 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1004 (Target_aarch64::Scan::local): Likewise.
1005 (Target_aarch64::Scan::global): Likewise.
1006 (Target_aarch64::Relocate::relocate): Likewise.
1007 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1008 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1009 relocations.
1010
0916f9e7
RÁE
10112015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1012
1013 * merge.cc (Object_merge_map::add_mapping): call
1014 Object_merge_map::Input_merge_map::add_mapping.
1015 (Object_merge_map::Input_merge_map::add_mapping): New.
1016 (Output_merge_data::do_add_input_section): Call
1017 get_or_make_input_merge_map before a loop.
1018 (Output_merge_string<Char_type>::finalize_merged_data): Call
1019 get_or_make_input_merge_map before a loop.
1020 * merge.h (Object_merge_map): Make Input_merge_map public.
1021 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1022 (Relobj::get_or_create_merge_map): New.
1023 * object.h (Relobj::get_or_create_merge_map): New.
1024
282c9750
AM
10252015-03-24 Alan Modra <amodra@gmail.com>
1026
1027 PR 18147
1028 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1029 relocation errors for branches to strong undefined symbols.
1030
67f95b96
RÁE
10312015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1032
1033 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1034 (Object_merge_map::is_merge_section_for): Remove.
1035 (Object_merge_map::find_merge_section): New.
1036 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1037 (Object_merge_map::find_merge_section): New.
1038 (Object_merge_map::get_input_merge_map): Add a const version.
1039 * object.cc (Relobj::is_merge_section_for): Remove.
1040 (Relobj::find_merge_section): New.
1041 * object.h (Relobj::is_merge_section_for): Remove.
1042 (Relobj::find_merge_section): New.
1043 * output.cc
1044 (Output_section::Input_section::is_merge_section_for): Remove.
1045 (Output_section::add_merge_input_section): Don't call
1046 add_merge_input_section.
1047 (Output_section::find_merge_section): Return const. Use
1048 object->find_merge_section.
1049 (Output_section::build_lookup_maps): Don't build a map for
1050 merge sections.
1051 (Output_section::is_input_address_mapped): Return false if
1052 section is not found.
1053 (Output_section::find_starting_output_address): Use
1054 find_merge_section instead of is_merge_section_for.
1055 (Output_section::add_script_input_section): Don't build a map for
1056 merge sections.
1057 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1058 (Output_section_lookup_maps::find_merge_section): Remove.
1059 (Output_section_lookup_maps::add_merge_input_section) Remove.
1060 (Output_section::find_merge_section): Return const.
1061
152f7024
CC
10622015-03-22 Cary Coutant <cary@google.com>
1063
1064 PR gold/18106
1065 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1066 non-SIB form of lea, with nop after the call.
1067
bccffdfd
CC
10682015-03-21 Cary Coutant <cary@google.com>
1069
1070 PR gold/14217
1071 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1072 .tdata section.
1073 (Output_segment::set_section_addresses): Don't align size of relro
1074 segment for .tbss.
1075
1c582fe7
CC
10762015-03-21 Cary Coutant <cary@google.com>
1077
1078 PR gold/18010
1079 * stringpool.cc (Stringpool_template): Don't optimize if section
1080 alignment is greater than sizeof(char).
1081
410da591
CC
10822015-03-21 Cary Coutant <cary@google.com>
1083
1084 PR gold/18048
1085 * script-c.h (script_include_directive): Add first_token parameter.
1086 * script.cc (script_include_directive): Add first_token parameter, and
1087 pass it to read_script_file.
1088 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1089 (PARSING_MEMORY_DEF): New tokens.
1090 (top): Add new productions for INCLUDE files.
1091 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1092 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1093 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1094 (section_cmd): Pass PARSING_SECTION_CMDS.
1095 (file_or_sections_cmd): Remove.
1096 (memory_def): Pass PARSING_MEMORY_DEF.
1097 * testsuite/Makefile.am (memory_test_2): New test.
1098 * testsuite/Makefile.in: Regenerate.
1099 * testsuite/memory_test_inc.t: New script file.
1100 * testsuite/memory_test_inc_1.t.src: New script file.
1101 * testsuite/memory_test_inc_2.t.src: New script file.
1102 * testsuite/memory_test_inc_3.t.src: New script file.
1103
0d5bbdb0
CC
11042015-03-21 Cary Coutant <cary@google.com>
1105
1106 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1107 (Sized_relobj_dwo::setup): Build compressed section map.
1108 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1109 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1110 section map.
1111 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1112 compressed_sections_ field.
1113 (build_compressed_section_map): Take Object instead of
1114 Sized_relobj_file parameter; add decompress_if_needed parameter.
1115 (Sized_relobj_file::do_find_special_sections): Store compressed
1116 section map in parent Object.
1117 (Sized_relobj_file::do_decompressed_section_contents): Move
1118 implementation to Object::decompressed_section_contents.
1119 (Sized_relobj_file::do_discard_decompressed_sections): Move
1120 implementation to Object::discard_decompressed_sections.
1121 * object.h (build_compressed_section_map): Declare.
1122 (Object::Object): Add compressed_sections_ field.
1123 (Object::section_is_compressed): Move implementation here.
1124 (Object::decompressed_section_contents): De-virtualize.
1125 (Object::discard_decompressed_sections): De-virtualize.
1126 (Object::do_section_is_compressed): Delete.
1127 (Object::do_decompressed_section_contents): Delete.
1128 (Object::set_compressed_sections): New method.
1129 (Object::compressed_sections): New method.
1130 (Object::compressed_sections_): New data member.
1131 (Compressed_section_info, Compressed_section_map): Move to top of file.
1132 (Sized_relobj_file::do_section_is_compressed): Delete.
1133 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1134 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1135 (Sized_relobj_file::compressed_sections_): Move to Object class.
1136
bd9e0d46
CC
11372015-03-21 Cary Coutant <ccoutant@google.com>
1138
1139 PR gold/18152
1140 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1141 deferred objects.
1142
943c8b43
CC
11432015-03-11 Cary Coutant <ccoutant@google.com>
1144
1145 * options.cc (General_options::finalize): Don't allow -z relro
1146 with incremental linking.
1147 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1148 (incremental_test_2): Likewise.
1149 (incremental_test_3): Likewise.
1150 (incremental_test_4): Likewise.
1151 (incremental_test_5): Likewise.
1152 (incremental_test_6): Likewise.
1153 (incremental_copy_test): Likewise.
1154 (incremental_common_test_1): Likewise.
1155 (incremental_comdat_test_1): Likewise.
1156 * testsuite/Makefile.in: Regenerate.
1157
e1663197
CC
11582015-03-09 Cary Coutant <ccoutant@google.com>
1159
1160 PR gold/14675
1161 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1162 return enum indicating whether .eh_frame section is empty, optimizable,
1163 unrecognized, or an end marker. Adjust explicit instantiations.
1164 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1165 (Eh_frame::add_ehframe_input_section): Change return type.
1166 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1167 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1168 to the .eh_frame output section until we see the end marker.
1169 (Layout::finalize_eh_frame_section): New.
1170 * layout.h: (Layout::finalize_eh_frame_section): New.
1171
beb8418f
L
11722015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1173
1174 * output.cc (Relobj::initialize_input_to_output_map<size>):
1175 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1176
48c73428
CC
11772015-03-04 Cary Coutant <ccoutant@google.com>
1178
1179 * parameters.cc (Parameters::set_target_once): Call
1180 Target::select_as_default_target just once from here...
1181 (set_parameters_target): ...instead of from here.
1182
11832015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1184
1185 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1186 Output_section_data instead of a Merge_map.
1187 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1188 (Eh_frame::read_cie): Use add_merge_mapping instead of
1189 Merge_map::add_mapping.
1190 (Eh_frame::read_fde): Ditto.
1191 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1192 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1193 merge_map_->get_output_offset.
1194 (Eh_frame::do_is_merge_section_for): Delete.
1195 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1196 instead of a Merge_map.
1197 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1198 Merge_map.
1199 (Eh_frame::do_is_merge_section_for): Delete.
1200 (Eh_frame::merge_map_): Delete.
1201 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1202 and use a Output_section_data instead of a Merge_map.
1203 (Object_merge_map::add_mapping): Ditto.
1204 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1205 (Object_merge_map::is_merge_section_for): Pass in and use a
1206 Output_section_data instead of a Merge_map.
1207 (Merge_map): Delete.
1208 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1209 of merge_map_.get_output_offset.
1210 (Output_merge_base::do_is_merge_section_for): Delete.
1211 (Output_merge_data::do_add_input_section): Use
1212 object->add_merge_mapping instead of add_mapping.
1213 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1214 * merge.h (Merge_map): Delete forward declaration.
1215 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1216 instead of a Merge_map.
1217 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1218 (Object_merge_map::is_merge_section_for): Pass in and use a
1219 Output_section_data instead of a Merge_map.
1220 (Input_merge_map::Object_merge_map::merge_map): Replace with
1221 output_data.
1222 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1223 Output_section_data instead of a Merge_map.
1224 (Merge_map): Delete.
1225 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1226 (Output_merge_base::do_is_merge_section_for): Delete.
1227 (Output_merge_base::add_mapping): Delete.
1228 (Output_merge_base::merge_map_): Delete.
1229 * object.cc (Relobj::initialize_input_to_output_map): New.
1230 (Relobj::initialize_input_to_output_map): New.
1231 (Relobj::merge_output_offset): New.
1232 (Relobj::is_merge_section_for): New.
1233 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1234 bits.
1235 * object.h (Relobj::merge_map): Delete.
1236 (initialize_input_to_output_map): New.
1237 (set_merge_map): Delete.
1238 (add_merge_mapping): New.
1239 (merge_output_offset): New.
1240 (is_merge_section_for): New.
1241 * output.cc (Output_section::Input_section::is_merge_section_for):
1242 Use object->is_merge_section_for.
1243 * output.h (Output_section_data::is_merge_section_for): Delete.
1244 (Output_section_data::do_is_merge_section_for): Delete.
1245 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1246 Use object->initialize_input_to_output_map.
1247 (Merged_symbol_value<size>::value_from_output_section): Use
1248 object->merge_output_offset.
1249
48c73428 12502015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1251 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1252
1253 * output.cc (Output_section::add_merge_input_section): Do not
1254 attempt to merge sections with an entsize of 0.
1255
48c73428 12562015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1257
1258 * attributes.h (class Output_attributes_section_data ): Add
1259 do_print_to_mapfile function.
1260
ec86f434
AM
12612015-02-24 Alan Modra <amodra@gmail.com>
1262
1263 PR 18010
1264 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1265 complain if value is not a multiple of four.
1266 (Target_powerpc::Relocate::relocate): Correct handling of
1267 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1268
be66981e
L
12692015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1270
1271 * configure.ac (default_size): Set to 32 for x32.
1272 * configure: Regenerated.
1273
e3ee8ed4
AM
12742015-02-18 Alan Modra <amodra@gmail.com>
1275
1276 PR 17954
1277 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1278 visibility.
1279
3a935c6c
RÁE
12802015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1281
1282 * gc.h (Garbage_collection::add_reference): Don't use find.
1283
e0a1e121
RÁE
12842015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1285
1286 * object.cc (write_local_symbols): avoid std::vector copy.
1287
45a4fb1a
RÁE
12882015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1289
1290 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1291
2d9afefe
MW
12922015-02-09 Mark Wielaard <mjw@redhat.com>
1293
1294 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1295 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1296
e9c1bdad
CC
12972015-02-16 Cary Coutant <ccoutant@google.com>
1298
1299 PR gold/13577
1300 PR gold/16992
1301 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1302 DF_SYMBOLIC if --dynamic-list option is used.
1303 * options.cc (General_options::finalize): --dynamic-list is not
1304 mutually exclusive with -Bsymbolic.
1305 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1306 listed in --dynamic-list.
1307 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1308 -Bsymbolic-functions.
1309 * testsuite/Makefile.in: Regenerate.
1310
0ed4b0bf
CC
13112015-02-16 Cary Coutant <ccoutant@google.com>
1312
1313 PR gold/17971
1314 * incremental.cc: Remove redundant include of "output.h".
1315
1a920511
JY
13162015-02-12 Jing Yu <jingyu@google.com>
1317
1318 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1319 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1320 New relocation.
1321 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1322 TLSLE_MOVW_* relocations.
1323 (Target_aarch64::Scan::global): Likewise.
1324 (Target_aarch64::Relocate::relocate): Likewise.
1325 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1326 for new TLSLE_MOVW_* relocations.
1327
07f107f3
WN
13282015-02-11 Will Newton <will.newton@linaro.org>
1329
1330 PR gold/13321
1331 * arm.cc (Target_arm::make_plt_section): Create an ARM
1332 state mapping symbol at the start of the PLT.
1333
e051a5b5
L
13342015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1335
1336 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1337 Replace two_file_shared_2.so with two_file_shared_1.so.
1338 * testsuite/Makefile.in: Regenerated.
1339
dddcc5b9
AM
13402015-02-09 Alan Modra <amodra@gmail.com>
1341
1342 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1343 plugin_test_thin.a and defsym_test.
1344 * testsuite/Makefile.in: Regenerate.
1345
b39b8b9d
RÁE
13462015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1347
1348 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1349 body.
1350
b66d1c52
CC
13512015-02-04 Peter Collingbourne <pcc@google.com>
1352
1353 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1354 forwarding symbols when computing symbol resolution info for plugins.
1355 * plugin.h (Plugin_manager::symtab): New method.
1356 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1357
23081de0
CC
13582015-02-03 Cary Coutant <ccoutant@google.com>
1359 Peter Collingbourne <pcc@google.com>
1360
1361 PR gold/15660
1362 * archive.cc (Thin_archive_object_unlocker): New class.
1363 (Archive::include_member): Unlock external members of thin archives.
1364 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1365 (plugin_test_2): Likewise.
1366 (plugin_test_3): Likewise.
1367 (plugin_test_4): Likewise.
1368 (plugin_test_5): Likewise.
1369 (plugin_test_6): Likewise.
1370 (plugin_test_7): Likewise.
1371 (plugin_test_8): Likewise.
1372 (plugin_test_9): Likewise.
1373 (plugin_test_10): Likewise.
1374 (plugin_test_11): New test case.
1375 * testsuite/Makefile.in: Regenerate.
1376 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1377 file to decide whether to claim file.
1378 (all_symbols_read_hook): Likewise.
1379 * testsuite/plugin_test_1.sh: Adjust expected output.
1380 * testsuite/plugin_test_2.sh: Likewise.
1381 * testsuite/plugin_test_3.sh: Likewise.
1382 * testsuite/plugin_test_6.sh: Likewise.
1383 * testsuite/plugin_test_tls.sh: Likewise.
1384 * testsuite/plugin_test_11.sh: New testcase.
1385
13862015-02-03 Cary Coutant <ccoutant@google.com>
1387
1388 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1389 file descriptors when debugging enabled. Add debug output.
1390 (Descriptors::release): Add debug output.
1391 (Descriptors::close_some_descriptor): Likewise.
1392 (Descriptors::close_all): Likewise.
1393 * fileread.cc (File_read::lock): Likewise.
1394 (File_read::unlock): Likewise.
1395
24dd5808
CC
13962015-02-02 Cary Coutant <ccoutant@google.com>
1397
1398 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1399 executable output file.
1400
fa89cc82
HS
14012015-01-22 Han Shen <shenhan@google.com>
1402
1403 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1404 (Target_arm::do_plt_address_for_global): New method.
1405 (Target_arm::do_plt_address_for_local): New method.
1406 (Target_arm::rel_irelative_section): New method.
1407 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1408 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1409 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1410 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1411 (Target_arm::Scan::check_non_pic): Add ifunc support.
1412 (Target_arm::Scan::local): Add ifunc support.
1413 (Target_arm::Scan::global): Add ifunc support.
1414 (Target_arm::make_plt_section): New method.
1415 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1416 (Target_arm::make_local_ifunc_plt_entry): New method.
1417 (Target_arm::got_irelative_): New member.
1418 (Target_arm::rel_irelative_): New member.
1419 (Target_arm::got_section): Add creation for got_irelative_.
1420 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1421 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1422 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1423 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1424 (Output_data_plt_arm::IRelative_data): New type.
1425 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1426 (Output_data_plt_arm::add_entry): Add more parameters.
1427 (Output_data_plt_arm::add_relocation): New method.
1428 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1429 (Output_data_plt_arm::rel_irelative): New method.
1430 (Output_data_plt_arm::entry_count): Modified.
1431 (Output_data_plt_arm::address_for_global): New method.
1432 (Output_data_plt_arm::address_for_local): New method.
23081de0 1433gold/
fa89cc82
HS
1434 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1435 (Output_data_plt_arm::insert_irelative_data): New method.
1436 (Output_data_plt_arm::irelative_rel_): New member.
1437 (Output_data_plt_arm::got_): New member.
1438 (Output_data_plt_arm::got_irelative_): New member.
1439 (Output_data_plt_arm::irelative_count_): New member.
1440 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1441 (Output_data_plt_arm::irelative_data_vec_): New member.
1442 (Output_data_plt_arm::do_write): Write out irelative entries.
1443 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1444 more parameters to ctor.
1445 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1446 more parameters to ctor.
1447 * output.h (Output_data_reloc::add_local_relative): New method.
1448 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1449
0f81d3f0
AM
14502015-01-29 Alan Modra <amodra@gmail.com>
1451
1452 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1453 and GOT_TLSGD to LE optimization.
1454
65d92137
CC
14552015-01-28 Cary Coutant <ccoutant@google.com>
1456
1457 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1458 for undef TLS symbols.
1459 (Target_x86_64::Relocate::relocate_tls): Likewise.
1460 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1461
5485698a
CC
14622015-01-25 Cary Coutant <ccoutant@google.com>
1463
1464 * output.cc (Output_segment::set_section_addresses): Fix calculation
1465 of size of relro segment.
1466
b01a4b04
AM
14672015-01-22 Alan Modra <amodra@gmail.com>
1468
1469 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1470 condition for need of ifunc plt entry.
1471 (Target_powerpc::Scan::global <got relocs>): Likewise.
1472
3d0064a9
CC
14732015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1474
1475 * mips.cc (reloc_high): Add r_sym.
1476 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1477 reloc_high constructor.
1478 (Mips_relocate_functions::relgot16_local): Likewise.
1479 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1480 r_type to decide whether LO16 matches HI16.
1481 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1482 rello16 and relgot16_local.
1483
a5cd8f05
CC
14842015-01-09 Cary Coutant <ccoutant@google.com>
1485
1486 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1487 unless alignment is larger than page size.
1488
4fc1b9d4
L
14892015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1490 Cary Coutant <ccoutant@google.com>
1491
1492 PR gold/17729
1493 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1494 (DEFAULT_TARGET_X32): Set for x32.
1495 * x86_64.cc (cmp_insn_32): New.
1496 (lea_r10_insn_32): Likewise.
1497 (lea_r11_insn_32): Likewise.
1498 (cmp_insn_64): Likewise.
1499 (lea_r10_insn_64): Likewise.
1500 (lea_r11_insn_64): Likewise.
1501 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1502 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1503 (check_DATA): Add split_x32 files.
1504 (split_x32_[1234n].o): New targets.
1505 (split_x32_[124]): New targets.
1506 (split_x32_[1234r].stdout): New targets.
1507 * testsuite/split_x32.sh: New file.
1508 * testsuite/split_x32_1.s: Likewise.
1509 * testsuite/split_x32_2.s: Likewise.
1510 * testsuite/split_x32_3.s: Likewise.
1511 * testsuite/split_x32_4.s: Likewise.
1512 * testsuite/split_x32_n.s: Likewise.
1513 * configure: Regenerated.
1514 * testsuite/Makefile.in: Likewise.
1515
e749cab8
L
15162015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1517
1518 PR gold/17809
1519 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1520 x32.
1521
af759df0
AM
15222015-01-02 Alan Modra <amodra@gmail.com>
1523
1524 * version.cc (print_version): Just print current year.
1525 * dwp.cc (print_version): Likewise.
1526
b90efa5b
AM
15272015-01-01 Alan Modra <amodra@gmail.com>
1528
1529 Update year range in copyright notice of all files.
1530
f12d1e8a
AM
15312014-12-25 Alan Modra <amodra@gmail.com>
1532
1533 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1534 new enums.
1535 (Target_arm::merge_object_attributes, ): Likewise.
1536
5c294fee
TG
15372014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1538
1539 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1540 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1541 AEABI_VFP_args_vfp to check that.
1542 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1543 value and replace hardcoded values by enum values.
1544
e30880c2
CC
15452014-12-22 Cary Coutant <ccoutant@google.com>
1546
1547 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1548
bd040da1
L
15492014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1550
1551 PR gold/14608
1552 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1553 to "return i * i * 3;".
1554
e02a4046
CC
15552014-12-16 Cary Coutant <ccoutant@google.com>
1556
1557 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1558 (Mapfile::print_output_data): Use current_data_size() to avoid
1559 assert for sections requiring postprocessing; if address is not valid,
1560 print 0.
1561 (Mapfile::print_output_section): Use current_data_size(); print note
1562 that addresses and sizes are before compression.
1563
add6016b
L
15642014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1565
1566 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1567 Cast current_group_size to unsigned long when reporting error.
1568
0bf32ea9
JY
15692014-12-10 Jing Yu <jingyu@google.com>
1570
1571 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1572 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1573 Update error message.
1574 (Target_aarch64::do_relax): Use absolute value of option
1575 stub_group_size. Replace local variable with class member
1576 stub_group_size_.
1577
cbcb23fa
AM
15782014-12-04 Alan Modra <amodra@gmail.com>
1579
1580 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1581 addend of PLTREL24 reloc when not generating a plt stub. Make
1582 max_branch_offset an "Address".
fbad6518 1583 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1584 (Target_powerpc::Relocate::relocate): Likewise.
1585
1611bc4a
AM
15862014-12-04 Alan Modra <amodra@gmail.com>
1587
1588 PR 17670
1589 * symtab.cc (Symbol::set_undefined): Remove assertion.
1590 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1591 on symbols defined in discarded sections, instead return false.
1592 Rearrange params, update all callers.
1593 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1594 branches to syms in discarded sections.
1595 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1596 undefined and flag as discarded.
1597 (Target_powerpc::Relocate::relocate): Localize variable.
1598
4759c34e
L
15992014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1600
1601 PR gold/17675
1602 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1603 * testsuite/Makefile.in: Regenerated.
1604
1f98a074
AM
16052014-12-03 Alan Modra <amodra@gmail.com>
1606
1607 PR 17566
1608 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1609 when adding dynamic relocations against section symbols.
1610
fb257835
DI
16112014-12-01 Dimitry Ivanov <dimitry@google.com>
1612
1613 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1614 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1615 * options.h (General_options): New -z option (global).
1616
d8e60314
CC
16172014-12-01 Cary Coutant <ccoutant@google.com>
1618
1619 PR gold/17578
1620 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1621 is given.
1622 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1623 given but some inputs require executable stack.
1624
982bbd97
CC
16252014-11-26 Cary Coutant <ccoutant@google.com>
1626
1627 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1628 .debug_str_offsets; strip .debug_gnu_pubnames and
1629 .debug_gnu_pubtypes.
1630 (lines_only_debug_sections): Strip all four new sections.
1631
bb779192
HS
16322014-11-26 Jing Yu <jingyu@google.com>
1633
1634 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1635 register to be x0 when to relax TLSDESC_LD64_LO12.
1636
a3e60ddb
AM
16372014-11-26 Alan Modra <amodra@gmail.com>
1638
1639 * powerpc.cc (struct Stub_table_owner): New.
1640 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1641 unsigned int vector. Update all references.
1642 (powerpc_relobj::set_stub_table): Take an unsigned int param
1643 rather than a Stub_table. Update callers.
1644 (Powerpc_relobj::clear_stub_table): New function.
1645 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1646 stub_group_size_ vars.
1647 (Target_powerpc::new_stub_table): Delete.
1648 (max_branch_delta): New function, extracted from..
1649 (Target_powerpc::Relocate::relocate): ..here..
1650 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1651 status on whether stub created successfully.
1652 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1653 default sizing to..
1654 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1655 reduce on relax failure.
1656 (Target_powerpc::group_sections): Add "no_size_errors" param.
1657 Use stub_group_size_. Set up group info in a temp vector,
1658 before building Stub_table vector. Account for input sections
1659 possibly already converted to relaxed sections.
1660 (Stub_table::init): Delete. Merge into..
1661 (Stub_table::Stub_table): ..here.
1662 (Stub_table::can_reach_stub): New function.
1663 (Stub_table::add_plt_call_entry): Add "from" parameter and
1664 return true iff stub could be reached.
1665 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1666 param too.
1667 (Stub_table::clear_stubs): Add "all" param.
1668
a20605cf
AM
16692014-11-26 Alan Modra <amodra@gmail.com>
1670
1671 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1672 (Target_powerpc::group_sections): Use it.
1673
43b64deb
CC
16742014-11-25 Cary Coutant <ccoutant@google.com>
1675
1676 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1677 (Binary_to_elf::write_symbol): Add st_size parameter.
1678 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1679
c924eb67
CC
16802014-11-25 Cary Coutant <ccoutant@google.com>
1681
1682 PR gold/17639
1683 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1684 (Sized_relobj_file::do_layout): Handle deferred sections properly
1685 during GC pass 1. Don't add reloc sections to deferred list twice.
1686 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1687 (Sized_relobj_file::is_deferred_layout_): New data member.
1688
9d585188
L
16892014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1690
1691 PR gold/17619
1692 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1693 Check PC-relative offset overflow in PLT entry.
1694
3ffaac20
AM
16952014-11-21 Alan Modra <amodra@gmail.com>
1696
1697 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1698 for undefined weaks.
1699
0cfb0717
AM
17002014-11-20 Alan Modra <amodra@gmail.com>
1701
1702 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1703 from --stub-group-size parameter divided by 1024.
1704 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1705 template parameter. Update all uses.
1706 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1707 has_stub_value. Set for long branches. Don't report overflow for
1708 branch to undefined weak symbols. Print info message on
1709 overflowing branch to stub.
1710
f9dffbf0
AM
17112014-11-20 Alan Modra <amodra@gmail.com>
1712
1713 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1714
e88ba8d5
L
17152014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1716
1717 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1718 entry for R_X86_64_GOTPLT64.
1719 (Target_x86_64<size>::Relocate::relocate): Update comments for
1720 R_X86_64_GOTPLT64.
1721
d37ffe25
ED
17222014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1723
1724 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1725 * plugin.h: add lock definition
1726
9726c3c1
HS
17272014-10-29 Han Shen <shenhan@google.com>
1728 Jing Yu <jingyu@google.com>
1729
1730 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1731 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1732 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1733 Symbol::TLS_REF.
1734 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1735 method.
1736 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1737 (Target_aarch64::tls_ld_to_le): New method.
1738 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1739 for 64bit targets.
1740 (Output_data_plt_aarch64::irelative_rel_): New data member.
1741 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1742 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1743 (Output_data_plt_aarch64::add_relocation): New method.
1744 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1745 offset. Add got_irelative size to got size.
1746 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1747 type string with the new typename.
1748 (AArch64_relocate_functions::update_adr): Replace parameter x with
1749 immed.
1750 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1751 (AArch64_relocate_functions::reloc_common): New method.
1752 (AArch64_relocate_funcsions::rela_general): Extract common part out
1753 into reloc_common method.
1754 (AArch64_relocate_functions::rela_general): Likewise.
1755 (AArch64_relocate_functions::pcrela_general): Likewise.
1756 (AArch64_relocate_functions::adr): New method.
1757 (AArch64_relocate_functions::adrp): Calculate immed before calling
1758 update_adr.
1759 (AArch64_relocate_functions::adrp): Likewise.
1760 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1761 comparing x to 0. Calculate immed from ~x when x < 0.
1762 (Target_aarch64::optimize_tls_reloc): Add new cases for
1763 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1764 TLSLD_MOVW_DTPREL_G0_NC.
1765 (Target_aarch64::possible_function_pointer_reloc): Implement this
1766 method.
1767 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1768 comment.
1769 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1770 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1771 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1772 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1773 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1774 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1775 (Target_aarch64::make_plt_entry): Call add_entry with two more
1776 parameters.
1777 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1778 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1779 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1780 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1781 (Target_aarch64::Relocate::relocate_tls): Add cases for
1782 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1783 TLSLD_MOVW_DTPREL_G0_NC.
1784 * testsuite/icf_safe_so_test.cc: Correct test comment.
1785 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1786
80272b8c
AM
17872014-10-22 Alan Modra <amodra@gmail.com>
1788
1789 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1790 thread_starter.
1791
998a69f4
AS
17922014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1793
1794 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1795
aed56ec5
CC
17962014-10-17 Cary Coutant <ccoutant@google.com>
1797
1798 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1799 Add "typename" keyword.
1800
bb779192 18012014-10-15 Han Shen <shenhan@google.com>
72f4393d 1802 Jing Yu <jingyu@google.com>
83a01957
HS
1803
1804 Patch for gold aarch64 backend to support relaxation.
1805 * aarch64-reloc.def: Change format.
1806 * aarch64.cc (class Reloc_stub): New class.
1807 (class Stub_table): New class.
1808 (class AArch64_relobj): New class.
1809 (class AArch64_input_section): New class.
1810 (class AArch64_output_section): New class.
1811 (Target_aarch64::new_stub_table): New method.
1812 (Target_aarch64::new_aarch64_input_section): New method.
1813 (Target_aarch64::find_aarch64_input_section): New method.
1814 (Target_aarch64::scan_section_for_stubs): New method.
1815 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1816 (Target_aarch64::relocate_stub): New method.
1817 (Target_aarch64::current_target): New method.
1818 (Target_aarch64::do_make_elf_object): New method.
1819 (Target_aarch64::do_may_relax): New method.
1820 (Target_aarch64::do_relax): New method.
1821 (Target_aarch64::group_sections): New method.
1822 (Target_aarch64::scan_reloc_for_stub): New method.
1823 (Target_aarch64::do_make_output_section): New method.
1824 (Target_aarch64::stub_tables_): New data member.
1825 (Target_aarch64::aarch64_input_section_map_): New data member.
1826 (AArch64_relocate_functions::maybe_apply_stub): New method.
1827
db4c9594
CC
18282014-09-30 Cary Coutant <ccoutant@google.com>
1829
1830 PR gold/17432
1831 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1832
cd6da036
KC
18332014-09-30 Kito Cheng <kito@0xlab.org>
1834
1835 PR gold/13597
1836 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1837 hash table before sysv-style hash table.
1838
5f772412
ST
18392014-09-29 Sriraman Tallam <tmsriram@google.com>
1840
1841 * options.h (--pic-executable): Add negative to alias to -no-pie.
1842
5efeedf6
CC
18432014-09-26 Cary Coutant <ccoutant@google.com>
1844
1845 PR gold/16773
1846 * object.cc (Sized_relobj_file): Compute value of section symbols
1847 for TLS sections the same as TLS symbols.
1848
1707f183
CC
18492014-09-25 Cary Coutant <ccoutant@google.com>
1850
1851 PR gold/17432
1852 * resolve.cc (Symbol_table::resolve): Override common placeholder
1853 symbols, but adjust sizes.
1854 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1855 symbols to common lists.
1856
00cac886
AM
18572014-09-24 Alan Modra <amodra@gmail.com>
1858
1859 * po/POTFILES.in: Regenerate.
1860
635aa30e 18612014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1862 Cary Coutant <ccoutant@google.com>
635aa30e 1863
71b9b91b 1864 PR gold/14860
635aa30e
CC
1865 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1866 on input_sections_blocker.
1867 * layout.cc (Write_sections_task::locks): Unblock
1868 input_sections_blocker_.
1869 * layout.h (Write_sections_task::Write_sections_task): Add
1870 input_sections_blocker.
1871 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1872 to DEPENDENCIES.
1873 * testsuite/Makefile.in: Regenerate.
1874
c0c71592
RÁE
18752014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1876
1877 * testsuite/Makefile.am (plugin_test_10): New test.
1878 * testsuite/Makefile.in: Regenerate
1879 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1880 * testsuite/plugin_test_10.sh: New file.
1881
6168c2a1
RÁE
18822014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1883
1884 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1885 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1886 during the replacement phase.
1887
3a531937
JY
18882014-09-17 Han Shen <shenhan@google.com>
1889 Jing Yu <jingyu@google.com>
1890
1891 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1892 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1893 * aarch64.cc (Target_aarch64): Add data members
1894 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1895 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1896 constructor.
1897 (Target_aarch64::do_reloc_symbol_index): New method.
1898 (Target_aarch64::do_reloc_addend): New method.
1899 (Target_aarch64::add_tlsdesc_info): New method.
1900 (Target_aarch64::do_dynsym_value): New method.
1901 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1902 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1903 (Target_aarch64::make_data_plt): Add new parameters: got,
1904 got_irelative. Pass them to do_make_data_plt.
1905 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1906 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1907 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1908 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1909 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1910 (Target_aarch64::got_tlsdesc_section): New method.
1911 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1912 (Target_aarch64::define_tls_base_symbol): New method.
1913 (Target_aarch64::reserve_tlsdesc_entries): New method.
1914 (Target_aarch64::got_mod_index_entry): New method.
1915 (Target_aarch64::rela_tlsdesc_section): New method.
1916 (Target_aarch64::rela_irelative_section): New method.
1917 (Target_aarch64::Tlsdesc_info): New struct.
1918 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1919 relocations and tlsdesc relocations.
1920 (Target_aarch64::optimize_tls_reloc): Implement method.
1921 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1922 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1923 in constructor.
1924 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1925 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1926 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1927 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1928 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1929 (Output_data_plt_aarch64::rela_irelative): New method.
1930 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1931 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1932 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1933 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1934 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1935 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1936 (Output_data_plt_aarch64_standard): New member variables:
1937 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1938 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1939 New parameter: got, got_irelative.
1940 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1941 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1942 (Output_data_plt_aarch64::do_write): Replace got_address with
1943 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1944 (AArch64_relocate_functions::update_movnz): New method.
1945 (AArch64_relocate_functions): Correct format.
1946 (AArch64_relocate_functions::movnz): New method.
1947 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1948 before the switch. Add new cases to switch.
00cac886 1949 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1950 tlsgd tlsdesc cases.
1951 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1952 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1953 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1954 Call reloc_name_in_error_message to print unsupported reloc.
1955 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1956 make_data_plt.
1957 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1958 relocs. Fill in some more dynamic tags.
1959 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1960 Skip call tls_get_addr when tlsgd is relaxed.
1961 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1962 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1963 tlsdesc->ie relaxation.
1964
62661c93
SS
19652014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1966
1967 * mips.cc (Target_mips_nacl): New class.
1968 (Target_selector_mips_nacl): New class.
1969 (target_selector_mips32): Rename from target_selector_mips32be and use
1970 Target_selector_mips_nacl instead of Target_selector_mips.
1971 (target_selector_mips32el): Rename from target_selector_mips32 and use
1972 Target_selector_mips_nacl instead of Target_selector_mips.
1973 (target_selector_mips64): Rename from target_selector_mips64be and use
1974 Target_selector_mips_nacl instead of Target_selector_mips.
1975 (target_selector_mips64el): Rename from target_selector_mips64 and use
1976 Target_selector_mips_nacl instead of Target_selector_mips.
1977 (Target_mips::mips_info): Add const attribute.
1978
54674d38
CC
19792014-09-02 Cary Coutant <ccoutant@google.com>
1980
1981 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1982 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1983 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1984 (Sized_incr_dynobj::do_section_name): Likewise.
1985 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1986 (Sized_incr_dynobj::do_section_name): Likewise.
1987 * object.h (Object::section_name): Likewise.
1988 (Object::do_section_name): Likewise.
1989 (Sized_relobj_file::do_section_name): Likewise.
1990 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1991 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1992
9860cbcf
CC
19932014-09-02 Cary Coutant <ccoutant@google.com>
1994
1995 PR gold/17005
1996 * ehframe.cc (Fde::write): Add output_offset parameter.
1997 (Cie::write): Likewise.
1998 (Eh_frame::set_final_data_size): Account for offset within output
1999 section.
2000 (Eh_frame::do_sized_write): Likewise.
2001 * ehframe.h (Fde::write): Add output_offset parameter.
2002 (Cie::write): Likewise.
2003 * output.cc (Output_section::Input_section_sort_entry): Remove
2004 section_has_name_; add output_section_name parameter. Use
2005 output section name for non-input sections.
2006 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2007 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2008 (Output_section::Input_section_sort_compare): Remove logic for
2009 sections without names.
2010 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2011 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2012 Likewise.
2013 (Output_section::Input_section_sort_section_name_compare): Likewise.
2014
8e33481e
HS
20152014-08-29 Han Shen <shenhan@google.com>
2016 Jing Yu <jingyu@google.com>
2017
2018 * aarch64-reloc-property.cc
2019 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2020 reference reloc property in the table.
2021 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2022 3 other entries.
2023 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2024 2 new overloaded methods.
2025 (Output_data_got_aarch64::do_write): Add code to write out
2026 static relocs.
2027 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2028 static relocs.
2029 (Output_data_got_aarch64::static_relocs): New vector to
2030 hold static relocs.
2031 (Target_aarch64::TCB_SIZE): New const static memeber.
2032 (Target_aarch64::tcb_size): New method.
2033 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2034 (Target_aarch64::Relocate::relocate_tls): New method.
2035 (Target_aarch64::Scan::local): Add code handling new reloc types.
2036 (Target_aarch64::Scan::global): Add code handling new reloc types.
2037
81233653
ST
20382014-08-13 Sriraman Tallam <tmsriram@google.com>
2039
2040 * options.h (-no-pie): Add option.
2041
9363c7c3
JY
20422014-08-08 Jing Yu <jingyu@google.com>
2043 Han Shen <shenhan@google.com>
2044
2045 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2046 (DEFFILES): add aarch64-reloc.def.
2047 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2048 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2049 * Makefile.in: Regenerate.
2050 * aarch64-reloc-property.cc: New file.
2051 * aarch64-reloc-property.h: New file.
2052 * aarch64-reloc.def: New file.
2053 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2054 with tab to make the format consistent.
2055 (Output_data_got_aarch64::symbol_table_): New method.
2056 (Target_aarch64::do_plt_address_for_global): New method.
2057 (Target_aarch64::do_plt_address_for_local): New method.
2058 (Target_aarch64::do_select_as_default_target): New method.
2059 (Target_aarch64::do_make_data_plt): New method.
2060 (Target_aarch64::make_data_plt): New method.
2061 (Output_data_plt_aarch64::has_irelative_section): New method.
2062 (Output_data_plt_aarch64::address_for_global): New method.
2063 (Output_data_plt_aarch64::address_for_local): New method.
2064 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2065 (Output_data_plt_aarch64::add_entry): Implement contents.
2066 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2067 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2068 the got_pov entry to plt0.
2069 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2070 Implement contents.
2071 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2072 (AArch64_howto): New struct.
2073 (aarch64_howto[]): New static const array.
2074 (AArch64_relocate_functions): New class.
2075 (Target_aarch64::Scan::get_reference_flags): Remove method.
2076 (Target_aarch64::Scan::local): Implement to support a few relocations.
2077 (Target_aarch64::Scan::global): Implement to support a few relocations.
2078 (Target_aarch64::make_plt_section): Implement contents.
2079 (Target_aarch64::make_plt_entry): Implement contents.
2080 (Target_aarch64::do_finalize_sections): Implement contents.
2081 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2082 (Target_aarch64::relocate_section): Implement contents.
2083
ad9fe6c1
AM
20842014-08-06 Alan Modra <amodra@gmail.com>
2085
2086 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2087
7cd4e5b7
AM
20882014-08-06 Alan Modra <amodra@gmail.com>
2089
2090 PR 13227
2091 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2092
5ad9b0a7
ST
20932014-07-21 Sriraman Tallam <tmsriram@google.com>
2094
2095 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2096 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2097
e051745c
CC
20982014-07-08 Cary Coutant <ccoutant@google.com>
2099
2100 * expression.cc (struct Expression::Expression_eval_info): Add
2101 new fields type_pointer, vis_pointer, and nonvis_pointer.
2102 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2103 nonvis_pointer parameters. Adjust all calls.
2104 (Symbol_expression::value): Update type, visibility, and nonvis bits
2105 in caller.
2106 * script.cc (Symbol_assignment::sized_finalize): Update type,
2107 visibility, and remaining st_other bits for new symbol.
2108 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2109 vis_pointer, and nonvis_pointer parameters.
2110 * symtab.h (Symbol::set_type): New method.
2111
2112 * testsuite/Makefile.am (defsym_test): New test.
2113 * testsuite/Makefile.in: Regenerate.
2114 * testsuite/defsym_test.c: New file.
2115 * testsuite/defsym_test.sh: New file.
2116
f35c4853
CC
21172014-07-08 Cary Coutant <ccoutant@google.com>
2118
2119 PR gold/15639
2120 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2121 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2122 (Sized_dynobj::base_read_symbols): ...new method.
2123 * object.h (Sized_relobj_file::base_read_symbols): New method.
2124 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2125 (Sized_relobj_file::base_read_symbols): ...new method.
2126 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2127 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2128 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2129
2900af2d
AM
21302014-07-04 Alan Modra <amodra@gmail.com>
2131
2132 * po/POTFILES.in: Regenerate.
2133
053a4d68
JY
21342014-07-02 Jing Yu <jingyu@google.com>
2135
2136 * aarch64.cc: New file
2137 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2138 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2139 * Makefile.in: Regenerate.
2140 * configure.tgt: Add entries for aarch64*.
2141 * configure.ac: Likewise.
2142 * configure: Likewise.
2143
7b549045
AM
21442014-06-27 Alan Modra <amodra@gmail.com>
2145
2146 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2147
cb818dbf
CC
21482014-06-24 Cary Coutant <ccoutant@google.com>
2149
2150 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2151 sections.
2152 (Dwo_file::sized_read_unit_index): Likewise.
2153
9810d34d
SS
21542014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2155
2156 * mips.cc: New file.
2157 * Makefile.am (TARGETSOURCES): Add mips.cc
2158 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2159 * configure.tgt: Add entries for mips*.
2160 * configure.ac: Likewise.
2161 * Makefile.in: Regenerate.
2162 * configure: Likewise.
2163
9baa787b
CC
21642014-06-09 Cary Coutant <ccoutant@google.com>
2165
2166 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2167 unit_length is within section bounds.
2168
8f89af0a
CC
21692014-06-09 Cary Coutant <ccoutant@google.com>
2170
2171 PR gold/16980
2172 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2173 map.
2174
a47622ac
AM
21752014-06-07 Alan Modra <amodra@gmail.com>
2176
2177 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2178
4320c691
CC
21792014-06-06 Cary Coutant <ccoutant@google.com>
2180
2181 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2182 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2183 (Dwarf_pubnames_table::read_header): Likewise.
2184 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2185 .debug_gnu_pubtypes.
2186
270c9937
JB
21872014-06-05 Joel Brobecker <brobecker@adacore.com>
2188
2189 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2190 * Makefile.in, configure: Regenerate.
2191
397998fc
AM
21922014-06-03 Alan Modra <amodra@gmail.com>
2193
2194 * powerpc.cc (addis_12_2): Define.
2195 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2196
61f5c66f
AM
21972014-06-03 Alan Modra <amodra@gmail.com>
2198
2199 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2200 st_other output.
2201
f6971787
AM
22022014-06-02 Alan Modra <amodra@gmail.com>
2203
2204 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2205 Only ignore relocs on ELFv1.
2206 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2207
f6fb8322
CC
22082014-05-30 Cary Coutant <ccoutant@google.com>
2209
2210 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2211 * testsuite/Makefile.in: Regenerate.
2212 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2213
c23dd342
L
22142014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2215
2216 PR gold/16945
2217 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2218 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2219
5fe7ffdc
AM
22202014-05-15 Alan Modra <amodra@gmail.com>
2221
2222 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2223 Compare FDE contents with DW_CFA_nop rather than 0.
2224
a82bef93
ST
22252014-05-13 Sriraman Tallam <tmsriram@google.com>
2226
2227 * symtab.h (may_need_copy_reloc): Remove check for position independent
2228 code.
2229 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2230 position independence before pc absolute may_need_copy_reloc call.
2231 Add check for executable output befor pc relative may_need_copy_reloc
2232 call.
2233 * i386.cc: Ditto.
2234 * arm.cc: Ditto.
2235 * sparc.cc: Ditto.
2236 * tilegx.cc: Ditto.
2237 * powerpc.cc: Add check for no position independence before
2238 may_need_copy_reloc calls.
2239 * testsuite/pie_copyrelocs_test.cc: New file.
2240 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2241 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2242 * Makefile.in: Regenerate.
a82bef93 2243
53c66605
ML
22442014-05-08 Martin Liška <mliska@suse.cz>
2245
2246 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2247
57b2284c
CC
22482014-05-06 Cary Coutant <ccoutant@google.com>
2249
2250 PR gold/16900
2251 * i386.cc (Output_data_got_plt_i386): New class.
2252 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2253 parameter. Change all callers.
2254 (Output_data_plt_i386::layout_): Remove.
2255 (Output_data_plt_i386::got_plt_): Change type.
2256 (Target_i386::got_plt_): Change type. Change all references.
2257 (Target_i386::got_section): Create instance of new class.
2258 (Output_data_got_plt_i386::do_write): New function.
2259 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2260 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2261 parameter. Change all callers.
2262 (Output_data_plt_x86_64::layout_): Remove.
2263 (Output_data_plt_x86_64::got_plt_): Change type.
2264 (Target_x86_64::got_plt_): Change type. Change all references.
2265 (Target_x86_64::got_section): Create instance of new class.
2266 (Output_data_got_plt_x86_64::do_write): New function.
2267 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2268 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2269 class.
2270
6b97515d 22712014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2272
6b97515d
CC
2273 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2274 if we have pubnames/pubtypes.
2275
d1bddd3c
CC
22762014-05-02 Cary Coutant <ccoutant@google.com>
2277
5fe7ffdc
AM
2278 * defstd.cc (in_segment): Define __ehdr_start here...
2279 * layout.cc (Layout::finalize): ...Instead of here. Set the
2280 output segment when known.
2281 * resolve.cc (Symbol::override_base_with_special): Remember
2282 the original binding.
2283 * symtab.cc (Symbol::set_output_segment): New function.
2284 (Symbol::set_undefined): New function.
2285 * symtab.h (Symbol::is_weak_undefined): Check original undef
2286 binding.
2287 (Symbol::is_strong_undefined): New function.
2288 (Symbol::set_output_segment): New function.
2289 (Symbol::set_undefined): New function.
2290 * target-reloc.h (is_strong_undefined): Remove.
2291 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2292 Check for hidden undefs.
2293 (relocate_section): Call Symbol::is_strong_undefined.
2294
2295 * testsuite/Makefile.am (ehdr_start_test_1)
2296 (ehdr_start_test_2, ehdr_start_test_3)
2297 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2298 * testsuite/Makefile.in: Regenerate.
2299 * testsuite/ehdr_start_def.cc: New source file.
2300 * testsuite/ehdr_start_test.cc: New source file.
2301 * testsuite/ehdr_start_test.t: New linker script.
2302 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2303
7849f6d8
CC
23042014-04-23 Cary Coutant <ccoutant@google.com>
2305
bf2cc635 2306 PR gold/16870
7849f6d8
CC
2307 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2308
99fd8cff
CC
23092014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2310
2311 * layout.cc (Layout::include_section): Allow a target to decide
2312 whether to include a section.
2313 * target.h (Target::should_include_section): New function.
2314 (Target::do_should_include_section): New function.
2315
91f43acd
CC
23162014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2317
2318 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2319 inline into ...
2320 (Copy_relocs::emit): ... here.
2321 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2322 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2323 (Copy_reloc_entry::entries_): Change from private to protected.
2324
c4eb27e1
ST
23252014-04-02 Sriraman Tallam <tmsriram@google.com>
2326
2327 * icf.cc (get_section_contents): Replace copies of reloc
2328 vectors with const references.
2329
ae447ddd
CC
23302014-04-02 Cary Coutant <ccoutant@google.com>
2331
2332 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2333 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2334 * configure: Regenerate.
2335 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2336 -fno-use-linker-plugin.
2337 (LINK1, CXXLINK1): Add it to the link command.
2338 * testsuite/Makefile.in: Regenerate.
2339
fa47fa92
AM
23402014-03-12 Alan Modra <amodra@gmail.com>
2341
2342 * Makefile.in: Regenerate.
2343
9b12c500
CC
23442014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2345
2346 * symtab.h (Symbol::set_nonvis): New function.
2347
beacaa96
CC
23482014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2349
2350 * symtab.cc (Sized_symbol<32>::init_output_data):
2351 Instantiate the template.
2352 (Sized_symbol<64>::init_output_data): Likewise.
2353
800d9823
CC
23542014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2355
2356 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2357 adjust dynamic symbol value.
2358 * target.h (Target::adjust_dyn_symbol): New function.
2359 (Target::do_adjust_dyn_symbol): New function.
2360
918fc1f8 23612014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2362
918fc1f8
CC
2363 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2364 Get the value of DYNAMIC_CUSTOM dynamic entry.
2365 * output.h (Output_data_dynamic::add_custom): New function.
2366 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2367 dynamic entry.
2368 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2369 * target.h (Target::dynamic_tag_custom_value): New function.
2370 (Target::do_dynamic_tag_custom_value): New function.
2371
98ff9231
CC
23722014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2373
2374 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2375 dynsym indexes.
2376 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2377 (Target::do_has_custom_set_dynsym_indexes): New function.
2378 (Target::set_dynsym_indexes): New function.
2379 (Target::do_set_dynsym_indexes): New function.
2380
b80eed39
AM
23812014-03-07 Alan Modra <amodra@gmail.com>
2382
2383 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2384 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2385 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2386 (Powerpc_relocate_functions::has_overflow_bitfield,
2387 overflowed): Use the above.
2388 (Target_powerpc::Relocate::relocate): Correct overflow checking
2389 for a number of relocations. Modify overflow test for 16-bit
2390 fields in instructions to signed/unsigned according to whether
2391 the field takes a signed or unsigned value.
2392
4b95cf5c
AM
23932014-03-05 Alan Modra <amodra@gmail.com>
2394
2395 Update copyright years.
2396
45965137
AM
23972014-03-05 Alan Modra <amodra@gmail.com>
2398
2399 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2400 R_PPC64_ADDR64_LOCAL.
2401 (Target_powerpc::Relocate::relocate): Likewise.
2402
2c80b753
AM
24032014-03-03 Alan Modra <amodra@gmail.com>
2404
2405 * dwp.cc (print_version): Update copyright year to current.
2406
c1c69e83
AM
24072014-02-10 Alan Modra <amodra@gmail.com>
2408
2409 * po/gold.pot: Regenerate.
2410
dd0c4e70
CC
24112014-02-06 Cary Coutant <ccoutant@google.com>
2412
2413 Fix problem where -u is ignored when a weak undef is seen.
2414
2415 * archive.cc (Library_base::should_include_member): Reorder
2416 code to check for -u option if a weak undef has already been seen.
2417 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2418 * testsuite/Makefile.in: Regenerate.
2419 * testsuite/weak_undef_file3.cc: New file.
2420 * testsuite/weak_undef_file4.cc: New file.
2421 * testsuite/weak_undef_test_2.cc: New file.
2422
1a221d3d
CC
24232014-02-05 Cary Coutant <ccoutant@google.com>
2424
2425 Fix issues with gold undefined symbol diagnostics.
2426
2427 PR binutils/15435
2428 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2429 check to here.
2430 * target-reloc.h (is_strong_undefined): New function.
2431 (relocate_section): Move undef vtable symbol check from here.
2432 Check for is_strong_undefined.
2433
e889f0a4 24342014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2435
e889f0a4
CC
2436 Fix problems with the --dynamic-list option.
2437
2438 PR gold/13577
2439 * options.cc (General_options::parse_dynamic_list):
2440 Set have_dynamic_list_.
2441 (General_options::General_options): Initialize have_dynamic_list_.
2442 (General_options::finalize): Turn off -Bsymbolic and
2443 -Bsymbolic-functions if --dynamic-list provided.
2444 * options.h (General_options::have_dynamic_list): New function.
2445 (General_options::have_dynamic_list_): New data member.
2446 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2447 correctly.
5fe7ffdc 2448
e889f0a4
CC
2449 PR gold/16530
2450 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2451 in --dynamic-list, mark it.
5fe7ffdc 2452
e889f0a4
CC
2453 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2454 (dynamic_list_2): New test case.
2455 * testsuite/Makefile.in: Regenerate.
2456 * testsuite/dynamic_list_2.cc: New file.
2457 * testsuite/dynamic_list_2.t: New file.
2458 * testsuite/dynamic_list_lib1.cc: New file.
2459 * testsuite/dynamic_list_lib2.cc: New file.
2460 * testsuite/gc_dynamic_list_test.c: New file.
2461 * testsuite/gc_dynamic_list_test.sh: New file.
2462 * testsuite/gc_dynamic_list_test.t: New file.
2463
ec673e64
CC
24642014-01-28 Cary Coutant <ccoutant@google.com>
2465
2466 Add .gdb_index version 7 support.
2467
2468 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2469 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2470 debug sections.
2471 (Dwarf_ranges_table::read_ranges_table): Likewise.
2472 (Dwarf_pubnames_table::read_section): Check for GNU-style
2473 sections, and for compressed debug sections.
2474 (Dwarf_pubnames_table::read_header): Compute end address of table.
2475 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2476 for end of list by offset, not by offset == 0.
2477 (Dwarf_info_reader::do_read_string_table): Check for compressed
2478 debug sections.
2479 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2480 Initialize new data members.
2481 (Dwarf_pubnames_table::next_name): return flag_byte.
2482 (Dwarf_pubnames_table::end_of_table_): New data member.
2483 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2484 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2485 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2486 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2487 read skeleton type unit DIEs.
2488 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2489 (Gdb_index::do_write): Write flag_byte.
2490 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2491 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2492 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2493 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2494
221fd5d5
L
24952014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2496
2497 * version.cc (print_version): Update copyright year to 2014.
2498
6c09fb0b
ILT
24992013-12-19 Dimitry Andric <dimitry@andric.com>
2500
2501 * stringpool.cc (Stringpool_template::reserve): Add
2502 HAVE_UNORDERED_MAP case.
2503 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2504
8356f2d0
CC
25052013-12-18 Cary Coutant <ccoutant@google.com>
2506
2507 * configure.ac: Check for <unordered_set> and <unordered_map>.
2508 * config.in: Regenerate.
2509 * configure: Regenerate.
2510 * system.h: Use <unordered_set> and <unordered_map> if available.
2511
f2c7d7ee
RM
25122013-12-10 Roland McGrath <mcgrathr@google.com>
2513
2514 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2515 with $(INSTALL_PROGRAM_ENV).
2516 * Makefile.in: Regenerate.
2517
6632e8cc
CC
25182013-11-22 Cary Coutant <ccoutant@google.com>
2519
2520 * configure.ac: Add check for which library is needed for
2521 dlopen.
2522 * configure: Regenerate.
2523
0c075858
CC
25242013-11-22 Cary Coutant <ccoutant@google.com>
2525
2526 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2527 assembler.
2528 * testsuite/Makefile.in: Regenerate.
2529
f49fe902
L
25302013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2531
2532 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2533 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2534 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2535 (Target_x86_64<size>::Scan::local): Likewise.
2536 (Target_x86_64<size>::Scan::global): Likewise.
2537 (Target_x86_64<size>::Relocate::relocate): Likewise.
2538 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2539 Likewise.
2540 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2541 R_X86_64_PC32_BND.
2542
2543 * testsuite/Makefile.am (check_PROGRAMS): Add
2544 exception_x86_64_bnd_test.
2545 (exception_x86_64_bnd_test_SOURCES): New macro.
2546 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2547 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2548 (exception_x86_64_bnd_test_LDADD): Likewise.
2549 (exception_x86_64_bnd_1.o): New rule.
2550 (exception_x86_64_bnd_2.o): Likewise.
2551 * testsuite/Makefile.in: Regenerated.
2552
9055360d
AM
25532013-11-15 Alan Modra <amodra@gmail.com>
2554
2555 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2556 accessor.
2557 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2558 Only call ppc64_local_entry_offset for 64-bit. Restrict
2559 symval_for_branch lookup to ELFv1.
2560 (Stub_table::add_plt_call_entry): Use unsigned int off.
2561 (Output_data_glink::Address, invalid_address): New.
2562 (Output_data_glink::add_eh_frame): Move out of line. Add
2563 support for ELFv2.
2564 (Output_data_glink::add_global_entry, find_global_entry,
2565 global_entry_address): New functions.
2566 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2567 ge_size): New variables.
2568 (Output_data_glink::set_final_data_size): Add global entry
2569 stub sizing.
2570 (Output_data_glink::do_write): Write global entry stubs.
2571 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2572 parameter. Return true for ELFv2. Adjust callers.
2573 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2574 ELFv1. Similarly for ifunc and dynamic relocation processing
2575 specific to ELFv1. Recognize that symbols are defined on
2576 their plt entries for ELFv2.
2577 (Target_powerpc::symval_for_branch): Assert if called for
2578 ELFv2 or ppc32.
2579 (Target_powerpc::Relocate::relocate): Use global entry plt
2580 stub for symbol value if such exists on ELFv2.
2581 (Target_powerpc::Relocate::relocate): Don't call
2582 symval_for_branch when ELFv2. Do adjust for local entry
2583 offset when ELFv2.
2584 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2585 plt stub for ELFv2.
2586 (Target_powerpc::do_plt_address_for_global): Similarly.
2587
cafdd569
CC
25882013-11-14 Cary Coutant <ccoutant@google.com>
2589
2590 Revert patch -- this did not fix the problem, and there is
2591 no race there.
2592
2593 2013-11-14 Cary Coutant <ccoutant@google.com>
2594
2595 PR gold/14860
2596 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2597 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2598 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2599 updating fde_offsets_.
2600 (Eh_frame_hdr::lock_): New data member.
2601
94e49e16
CC
26022013-11-14 Cary Coutant <ccoutant@google.com>
2603
2604 * dwp.cc (Dwo_file_entry): New type.
2605 (File_list): Use Dwo_file_entry.
2606 (Dwo_file::verify): New function.
2607 (Dwo_file::verify_dwo_list): New function.
2608 (Dwo_file::sized_verify_dwo_list): New function.
2609 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2610 list.
2611 (Dwp_options): New enum type.
2612 (dwp_options): Add --verify-only.
2613 (usage): Likewise.
2614 (main): Likewise.
2615 * dwp.h (gold_info): Add declaration.
2616
7cdd7d57
CC
26172013-11-14 Cary Coutant <ccoutant@google.com>
2618
2619 PR gold/14860
2620 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2621 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2622 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2623 updating fde_offsets_.
2624 (Eh_frame_hdr::lock_): New data member.
2625
1d946cb3
CC
26262013-11-06 Cary Coutant <ccoutant@google.com>
2627
2628 PR gold/15758
2629 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2630 before reloc sections.
2631
4f65b40e
AM
26322013-11-04 Alan Modra <amodra@gmail.com>
2633
2634 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2635 (Symbol::needs_dynamic_reloc): Test new flag.
2636 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2637 (Target_powerpc::Scan::get_reference_flags): Add target param.
2638 Return FUNC_DESC_ABI for 64-bit ELFv1.
2639 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2640 call.
2641 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2642 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2643
908794a9
CC
26442013-10-31 Cary Coutant <ccoutant@google.com>
2645
2646 Restore support for dwp v2 DWARF package file format.
2647
2648 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2649 tu_length parameter. Adjust all callers.
2650 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2651 * dwp.cc: Include dwarf.h.
2652 (Section_bounds): New struct type.
2653 (Unit_set): New struct type.
2654 (Dwo_file::Dwo_file): Initialize new data member.
2655 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2656 Combine and rename to...
2657 (Dwo_file::read_unit_index): ...this.
2658 (Dwo_file::sized_read_compunit_index)
2659 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2660 (Dwo_file::sized_read_unit_index): ...this.
2661 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2662 parameters; add section_id parameter.
2663 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2664 (Dwo_file::add_unit_set): ...this.
2665 (Dwo_file::shndx_map_): Remove.
2666 (Dwo_file::sect_offsets_): New data member.
2667 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2668 (Dwp_output_file::add_section): Rename to...
2669 (Dwp_output_file::add_contribution): ...this.
2670 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2671 (Dwp_output_file::add_tu_set): Likewise.
2672 (Dwp_output_file::Contribution): New type.
2673 (Dwp_output_file::Section::contributions): New data member.
2674 (Dwp_output_file::Cu_or_tu_set): Remove.
2675 (Dwp_output_file::Section::Section): New ctor.
2676 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2677 (Dwp_output_file::Dwp_index::Section_table): New type.
2678 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2679 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2680 parameter.
2681 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2682 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2683 (Dwp_output_file::Dwp_index::section_table): New member function.
2684 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2685 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2686 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2687 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2688 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2689 (Dwp_output_file::Dwp_index::section_table_): New data member.
2690 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2691 (Dwp_output_file::add_output_section): New member function.
2692 (Dwp_output_file::write_new_section): New member function.
2693 (Dwp_output_file::write_contributions): New member function.
2694 (Dwp_output_file::section_id_map_): New data member.
2695 (class Dwo_id_info_reader): Remove.
2696 (class Unit_reader): New class.
2697 (get_dwarf_section_name): New function.
2698 (Dwo_file::read_executable): Adjust initializations of class data.
2699 (Dwo_file::read): Add support for v2 package file format.
2700 (Dwo_file::read_unit_index): Likewise.
2701 (Dwo_file::sized_read_unit_index): Likewise.
2702 (Dwo_file::copy_section): Likewise.
2703 (Dwo_file::add_unit_set): Likewise.
2704 (Dwp_output_file::add_output_section): Likewise.
2705 (Dwp_output_file::add_contribution): Likewise.
2706 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2707 for empty slot.
2708 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2709 file format.
2710 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2711 slot.
2712 (Dwp_output_file::initialize): Remove unused function.
2713 (Dwp_output_file::finalize): Add support for v2 package file format.
2714 (Dwp_output_file::write_index): Likewise.
2715 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2716 function prototype.
2717
2500c017
CC
27182013-10-31 Cary Coutant <ccoutant@google.com>
2719
2720 * configure.ac: Fix check for -fmerge-constants.
2721 * configure.ac: Regenerate.
2722
dd0845d7
RM
27232013-10-30 Roland McGrath <mcgrathr@google.com>
2724
2725 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2726 Correct 9-byte nop sequence to match what the assembler generates.
2727
b4f7960d
AM
27282013-10-30 Alan Modra <amodra@gmail.com>
2729
2730 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2731 ppc64_local_entry_offset, ppc64_local_entry_offset,
2732 do_read_symbols): New functions.
2733 (Powerpc_relobj::e_flags_, st_other_): New vars.
2734 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2735 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2736 (Powerpc_relobj::e_flags_): New var.
2737 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2738 and adjust for ELFv2.
2739 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2740 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2741 (Powerpc_dynobj::do_find_special_sections): Likewise.
2742 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2743 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2744 to ELFv2 local entry.
2745 (Target_powerpc::do_relax): No thread safe barriers needed for
2746 ELFv2.
2747 (Output_data_plt_powerpc::initial_plt_entry_size_,
2748 plt_entry_size): Delete. Replace all uses with
2749 first_plt_entry_offset() and plt_entry_size().
2750 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2751 reserved_size parm. Update callers.
2752 (Output_data_plt_powerpc::entry_count): Update.
2753 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2754 and use Target_powerpc::first_plt_entry_offset().
2755 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2756 rename to plt_entry_size.
2757 (Output_data_plt_powerpc::add_ifunc_entry,
2758 add_local_ifunc_entry): Adjust reloc for ELFv2.
2759 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2760 (glink_eh_frame_fde_64v2): New.
2761 (Stub_table::plt_call_size): Support ELFv2 sizing.
2762 (Output_data_glink::add_eh_frame): Use the new FDE.
2763 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2764 (Stub_table::do_write): Write ELFv2 stubs and glink.
2765 (Target_powerpc::Relocate::relocate): Replaces nop after call
2766 with ld 2,24(1) and adjust local offset destination for ELFv2.
2767
f9c6b907
AM
27682013-10-30 Alan Modra <amodra@gmail.com>
2769
2770 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2771 (Target_powerpc::Scan::global, local): Likewise.
2772 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2773 on all ppc64 @h and @ha relocs.
2774
e84fe78f
AM
27752013-10-14 Alan Modra <amodra@gmail.com>
2776
2777 * output.h (Output_data_got::add_constant): Tidy.
2778 (Output_data_got::add_constant_pair): New function.
2779 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2780 methods used so as to first call reserve_ent().
2781
679e4abf
RM
27822013-10-11 Roland McGrath <mcgrathr@google.com>
2783
44dcb735
RM
2784 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2785 add_got_entry and add_got_entry_pair.
2786
13323c49
RM
2787 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2788 (HAVE_PUBNAMES): Likewise.
2789 * configure: Regenerate.
2790
1496b446
RM
2791 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2792 * testsuite/Makefile.in: Regenerate.
2793
cc84c10b
RM
2794 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2795 Remove const from declaration.
2796 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2797 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2798 * output.h (Output_file_header): Remove const from member target_
2799 and corresponding constructor argument.
2800 * output.cc (Output_file_header::Output_file_header): Update prototype.
2801 (Output_file_header::do_sized_write): Use this->target_ in place
2802 of parameters()->target().
2803
52f66a2c
RM
2804 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2805
2b64b551
RM
2806 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2807 * configure: Regenerate.
2808 * Makefile.in: Regenerate.
2809 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2810 * testsuite/merge_string_literals_2.c: Likewise.
2811 * testsuite/Makefile.am
2812 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2813 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2814 literal -fmerge-constants.
2815 * testsuite/Makefile.in: Regenerate.
2816
43819297
RM
2817 * i386.cc (Target_i386): Remove unused member dynbss_.
2818 * arm.cc (Target_arm): Likewise.
2819 * powerpc.cc (Target_powerpc): Likewise.
2820 * sparc.cc (Target_sparc): Likewise.
2821 * tilegx.cc (Target_tilegx): Likewise.
2822 * x86_64.cc (Target_x86_64): Likewise.
2823 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2824 type_signature_, type_offset_.
2825 * plugin.h (Plugin_hook): Remove unused member layout_.
2826 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2827 mapfile_.
2828 (Read_member): Remove unused members input_objects_, symtab_,
2829 mapfile_, layout_.
2830 (Check_library): Remove unused member symtab_.
2831 * archive.h (Lib_group): Remove unused member lib_.
2832 * archive.cc (Lib_group::Lib_group): Update initializer.
2833 * incremental.h (Incremental_binary): Remove unused member target_.
2834 (Incremental_script_entry): Removed unused member script_.
2835 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2836 * icf.h (Icf): Remove unused member num_tracked_relocs.
2837
39d9ead7
RM
2838 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2839 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2840 its only use.
2841 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2842
679e4abf
RM
2843 * archive.h: Use struct rather than class for forward declaration
2844 of Read_symbols_data.
2845
54de2ea6
CC
28462013-10-07 Cary Coutant <ccoutant@google.com>
2847
2848 PR gold/16010
2849 * testsuite/Makefile.am (icf_test): Fix dependencies.
2850 (icf_safe_test): Likewise.
2851 (icf_safe_so_test): Likewise.
2852 (large_symbol_alignment): Add empty _LDADD rule.
2853 * testsuite/Makefile.in: Regenerate.
2854
b14016f0
L
28552013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2856
2857 PR gold/15927
2858 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2859 relocation for R_X86_64_32 on x32.
2860
eb426534
RM
28612013-08-27 Roland McGrath <mcgrathr@google.com>
2862
2863 * output.cc (Output_segment::set_section_addresses): Take new
2864 Target* argument. If target->isolate_execinstr() and the segment
2865 is executable and starts at a target->abi_pagesize() boundary,
2866 pad its end out to a target->abi_pagesize() boundary with code fill.
2867 * output.h (Output_segment::set_section_addresses): Update decl.
2868 * layout.h (Layout::check_output_data_for_reset_values): Take new
2869 argument RELAX_OUTPUTS.
2870 (Layout): New member relax_output_list_.
2871 (Layout::add_relax_output): New method.
2872 * layout.cc (Layout::Layout): Update constructor.
2873 (Layout::reset_relax_output): New method.
2874 (Layout::clean_up_after_relaxation): Call it.
2875 (Layout::prepare_for_relaxation): Update caller.
2876 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2877 Call reset_relax_output before re-processing segments for
2878 isolate_execinstr case.
2879 (Layout::write_data): Handle relax_output_list_.
2880 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2881 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2882
9aff4b7a
NC
28832013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2884
2885 PR binutils/15834
2886 * object.h: Fix typos.
2887
93f8221c
RM
28882013-08-16 Roland McGrath <mcgrathr@google.com>
2889
2890 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2891 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2892
e44c3715
CC
28932013-08-07 Cary Coutant <ccoutant@google.com>
2894
2895 Revert support for v2 DWP files:
2896
2897 2013-03-01 Cary Coutant <ccoutant@google.com>
2898
2899 Add dwp support for v2 DWARF package file format.
2900 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2901 tu_length parameter. Adjust all callers.
2902 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2903 * dwp.cc: Include dwarf.h.
2904 (Section_bounds): New struct type.
2905 (Unit_set): New struct type.
2906 (Dwo_file::Dwo_file): Initialize new data member.
2907 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2908 Combine and rename to...
2909 (Dwo_file::read_unit_index): ...this.
2910 (Dwo_file::sized_read_compunit_index)
2911 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2912 (Dwo_file::sized_read_unit_index): ...this.
2913 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2914 parameters; add section_id parameter.
2915 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2916 (Dwo_file::add_unit_set): ...this.
2917 (Dwo_file::shndx_map_): Remove.
2918 (Dwo_file::sect_offsets_): New data member.
2919 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2920 (Dwp_output_file::add_section): Rename to...
2921 (Dwp_output_file::add_contribution): ...this.
2922 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2923 (Dwp_output_file::add_tu_set): Likewise.
2924 (Dwp_output_file::Contribution): New type.
2925 (Dwp_output_file::Section::contributions): New data member.
2926 (Dwp_output_file::Cu_or_tu_set): Remove.
2927 (Dwp_output_file::Section::Section): New ctor.
2928 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2929 (Dwp_output_file::Dwp_index::Section_table): New type.
2930 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2931 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2932 parameter.
2933 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2934 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2935 (Dwp_output_file::Dwp_index::section_table): New member function.
2936 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2937 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2938 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2939 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2940 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2941 (Dwp_output_file::Dwp_index::section_table_): New data member.
2942 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2943 (Dwp_output_file::add_output_section): New member function.
2944 (Dwp_output_file::write_new_section): New member function.
2945 (Dwp_output_file::write_contributions): New member function.
2946 (Dwp_output_file::section_id_map_): New data member.
2947 (class Dwo_id_info_reader): Remove.
2948 (class Unit_reader): New class.
2949 (get_dwarf_section_name): New function.
2950 (Dwo_file::read_executable): Adjust initializations of class data.
2951 (Dwo_file::read): Add support for v2 package file format.
2952 (Dwo_file::read_unit_index): Likewise.
2953 (Dwo_file::sized_read_unit_index): Likewise.
2954 (Dwo_file::copy_section): Likewise.
2955 (Dwo_file::add_unit_set): Likewise.
2956 (Dwp_output_file::add_output_section): Likewise.
2957 (Dwp_output_file::add_contribution): Likewise.
2958 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2959 for empty slot.
2960 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2961 file format.
2962 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2963 slot.
2964 (Dwp_output_file::initialize): Remove unused function.
2965 (Dwp_output_file::finalize): Add support for v2 package file format.
2966 (Dwp_output_file::write_index): Likewise.
2967 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2968 function prototype.
2969
c6905c28
CC
29702013-07-31 Cary Coutant <ccoutant@google.com>
2971
2972 * object.cc (Sized_relobj::do_output_section_address): New function.
2973 (Sized_relobj): Instantiate explicitly.
2974 * object.h (Object::output_section_address): New function.
2975 (Object::do_output_section_address): New function.
2976 (Sized_relobj::do_output_section_address): New function.
2977 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2978
29792013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2980 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2981
2982 * parameters.cc (Parameters::entry): Return target-specific entry
2983 symbol name.
2984 * target.h (Target::entry_symbol_name): New function.
2985 (Target_info::entry_symbol_name): New data member.
2986
2987 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2988 * i386.cc (Target_i386::i386_info): Likewise.
2989 (Target_i386_nacl::i386_nacl_info): Likewise.
2990 * sparc.cc (Target_sparc::sparc_info): Likewise.
2991 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2992 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2993 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2994 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2995
234d4ab8
SA
29962013-07-22 Sterling Augustine <saugustine@google.com>
2997
2998 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2999 Convert parameter shndx to local variable. Add parameters symtab
3000 and symtab_size. Scan over section names. Find relocation
3001 section corresponding to current section. Create and initialize
3002 reloc_mapper_ and reloc_type_.
3003 (Dwarf_pubnames_table::read_header): Add assertion. Change
3004 unit_length to off_t. Initialize member unit_length_. Fill in field
3005 cu_offset_.
3006 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3007 Initialize new fields unit_length_ and cu_offset_.
3008 (Dwarf_pubnames_table::read_section): Update prototype.
3009 (Dwarf_pubnames_table::cu_offset): New member function.
3010 (Dwarf_pubnames_table::subsection_size): Likewise.
3011 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3012 New fields.
3013 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3014 member functions public.
3015 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3016 Update comment. Rework logic. Move repeated parts to...
3017 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3018 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3019 pubtypes_table_, and stmt_list_offset.
3020 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3021 Gdb_index::find_pubtype_offset,
3022 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3023 (Gdb_index::pubnames_read): Update prototype and rework logic.
3024 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3025 Forward declare.
3026 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3027 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3028 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3029 Gdb_index::map_pubtable_to_dies):
3030 Declare functions.
3031 (Gdb_index::pubnames_read): Update declaration.
3032 (Gdb_index::Pubname_offset_map): New type.
3033 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3034 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3035 Gdb_index::stmt_list_offset): Declare.
3036 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3037 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3038 Gdb_index::pubtypes_offset_): Remove.
3039
a3ed37d8
RM
30402013-07-19 Roland McGrath <mcgrathr@google.com>
3041
3042 * options.h (General_options): Add -Trodata-segment option.
3043 * parameters.cc (Parameters::check_rodata_segment): New function.
3044 (Parameters::set_target_once): Call it.
3045 * parameters.h (Parameters): Declare it (private member function).
3046 * layout.cc (load_seg_unusable_for_headers): New function, broken
3047 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3048 then validate rodata segment rather than text segment.
3049 (relaxation_loop_body): Call that.
3050 (is_text_segment): New function. Don't admit a non-executable
3051 segment if TARGET->isolate_execinstr().
3052 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3053
eb5b4ded
CC
30542013-07-15 Shawn Landden <shawnlandden@gmail.com>
3055
3056 PR gold/15070
3057 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3058 * nacl.h (Sniff_file::View::View): Request aligned view.
3059
4d5effb9
CC
30602013-07-11 Cary Coutant <ccoutant@google.com>
3061
3062 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3063 correct BRLT entry size.
3064
ba8ca3e7
AM
30652013-07-03 Alan Modra <amodra@gmail.com>
3066
3067 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3068 comment.
3069
267257d2
CC
30702013-07-01 Cary Coutant <ccoutant@google.com>
3071
3072 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3073 reloc_type_.
3074 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3075 (Dwarf_ranges_table::lookup_reloc): New function.
3076 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3077 reloc_type_.
3078 (Dwarf_ranges_table::lookup_reloc): New function.
3079 (Dwarf_ranges_table::reloc_type_): New data member.
3080
06f30c9d
CC
30812013-06-27 Jing Yu <jingyu@google.com>
3082
3083 PR gold/15662
3084 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3085 function.
3086 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3087 (Target_powerpc::do_relax): Call the above.
3088
a2d7bf59
AM
30892013-06-27 Cary Coutant <ccoutant@google.com>
3090
3091 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3092 on garbage collected .opd section.
3093
30942013-06-27 Alan Modra <amodra@gmail.com>
3095
3096 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3097 is non-zero.
3098 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3099 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3100
32364e50
CC
31012013-06-14 Cary Coutant <ccoutant@google.com>
3102
3103 * resolve.cc (Symbol::override_base): Don't override st_type
3104 from plugin placeholder symbols.
3105 (Symbol_table::resolve): Likewise.
3106 (Symbol_table::should_override): Don't complain about TLS mismatch
3107 if the TO symbol is a plugin placeholder.
3108 * testsuite/Makefile.am (plugin_test_tls): New test.
3109 * testsuite/Makefile.in: Regenerate.
3110 * testsuite/plugin_test_tls.sh: New test script.
3111 * testsuite/two_file_test_2_tls.cc: New test source.
3112 * testsuite/two_file_test_tls.cc: New test source.
3113
7fb47cc9
CC
31142013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3115
3116 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3117 the maximum segment alignment is larger than the page size.
3118 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3119 correctly aligns the symbols with large alignemnt.
3120 * testsuite/Makefile.in: Regenerate.
3121 * testsuite/large_symbol_alignment.cc: New file.
3122
6934001a
CC
31232013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3124 Sriraman Tallam <tmsriram@google.com>
3125
3126 * options.h (sort_section): New option.
3127 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3128 Rename from Input_section_sort_section_name_special_ordering_compare.
3129 (Input_section_sort_section_name_compare): New struct.
3130 * output.cc (Output_section::Input_section_sort_section_name_compare::
3131 operator()): New function.
3132 (Output_section::sort_attached_input_sections): Use new sort function
3133 for .text if --sort-section=name is specified.
3134 * layout.cc (Layout::make_output_section):
3135 Add sorting by name when --sort-section=name is specified.
3136 * testsuite/Makefile.am (text_section_grouping): Test option
3137 --sort-section=name.
3138 * testsuite/Makefile.in: Regenerate.
3139 * testsuite/section_sorting_name.cc: New file.
3140 * testsuite/section_sorting_name.sh: New file.
3141
93acabad
CC
31422013-05-21 Cary Coutant <ccoutant@google.com>
3143
3144 * symtab.h (Symbol::is_cxx_vtable): New function.
3145 * target-reloc.h (relocate_section): Check for vtable symbol.
3146 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3147 * testsuite/Makefile.in: Regenerate.
3148 * testsuite/missing_key_func.cc: New test source.
3149 * testsuite/missing_key_func.sh: New test script.
3150
60e8b3fc
CC
31512013-05-21 Cary Coutant <ccoutant@google.com>
3152
2b64b551
RM
3153 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3154 type of enclosing symbol.
3155 (Relocate_info::location): Check symbol type when describing symbol.
3156 * object.h (Symbol_location_info): Remove unused line_number;
3157 add enclosing_symbol_type.
3158 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3159
9df9de2c
CC
31602013-05-13 Cary Coutant <ccoutant@google.com>
3161
2b64b551
RM
3162 * configure.ac: Export DEFAULT_TARGET.
3163 * configure: Regenerate.
3164 * Makefile.in: Regenerate.
3165 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3166 * testsuite/Makefile.in: Regenerate.
3167 * testsuite/debug_msg.sh: Delete duplicate tests.
3168 Don't check undef_int error message match for powerpc where the
3169 source file and line number aren't available.
9df9de2c 3170
bbc5ae17
RM
31712013-05-10 Roland McGrath <mcgrathr@google.com>
3172
3173 * options.h (General_options): Add --rosegment-gap option.
3174 * options.cc (finalize): --rosegment-gap implies --rosegment.
3175 * layout.cc (set_segment_offsets): Let user option override
3176 target->rosegment_gap().
3177
0c6e6c39
RM
31782013-05-10 Roland McGrath <mcgrathr@google.com>
3179
3180 * options.h (General_options): Remove leading space from help
3181 messages for -nostdlib and --rosegment.
3182
cde7cb01
MR
31832013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3184
3185 PR ld/15365
3186 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3187
f31ae5b8
AM
31882013-05-03 Alan Modra <amodra@gmail.com>
3189
3190 * merge.cc (Output_merge_string::do_add_input_section): Correct
3191 scan for number of strings. Rename vars to avoid shadowing.
3192 Include missing terminator in input_size_.
3193
d3a7cd45
L
31942013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3195
3196 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3197 Restore empty string handling.
3198
6ad3daba
CC
31992013-05-01 Cary Coutant <ccoutant@google.com>
3200
3201 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3202 uninitialized warning.
3203
e31908b6
CC
32042013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3205
3206 * output.cc (Output_section::add_merge_input_section): Allow
3207 to merge sections if the alignment is more than character size.
3208 * merge.h (Output_merge_string::Output_merge_string): Remove
3209 assert.
3210 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3211 only not-null strings. Check the alignment of strings.
3212 * stringpool.h
3213 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3214 alignment as the argument.
3215 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3216 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3217 Align non-zero length strings according to the addralign_.
3218 (Stringpool_template<Stringpool_char>::set_string_offsets):
3219 Updating offsets according to the given alignment.
3220 * testsuite/Makefile.am (text_section_grouping): Test if string
3221 literals are getting merged.
3222 * testsuite/Makefile.in: Regenerate.
3223 * testsuite/merge_string_literals_1.c: New file.
3224 * testsuite/merge_string_literals_2.c: Ditto.
3225 * testsuite/merge_string_literals.sh: Ditto.
3226
0e804863
ILT
32272013-04-26 Ian Lance Taylor <iant@google.com>
3228
3229 * target-reloc.h (relocate_section): If the reloc offset is out of
3230 range, pass VIEW as NULL to relocate.relocate.
3231 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3232 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3233 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3234 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3235 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3236 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3237
e7c5ea40
CC
32382013-04-26 Geoff Pike <gpike@chromium.org>
3239
3240 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3241 * layout.cc (Hash_task): New class.
3242 (Layout::queue_build_id_tasks): New function.
3243 (Layout::write_build_id): Handle single-thread portion of build ID
3244 computation. (In some cases, all of it is single-threaded.) Replace
3245 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3246 functionality in fewer lines of code.
3247 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3248 * options.h (General_options): make "--build-id" default to tree
3249 rather than sha1. Add two new options related to --build-id=tree:
3250 --build-id-chunk-size-for-treehash and
3251 --build-id-min-file-size-for-treehash.
3252 * Makefile.am: add testing of --build-id=tree and related new options
3253 (these tests will be invoked by "make check").
3254 * Makefile.in: Regenerate.
3255
49926cd0
AM
32562013-04-25 Alan Modra <amodra@gmail.com>
3257
3258 * configure.tgt: Add powerpcle and powerpc64le.
3259
a4034750
AM
32602013-04-22 Alan Modra <amodra@gmail.com>
3261
3262 PR gold/15355
3263 * layout.cc (Layout::segment_precedes): Allow more than one
3264 segment with the same type and flags.
3265
e79c84aa
CC
32662013-04-15 Cary Coutant <ccoutant@google.com>
3267
3268 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3269 allocate space in file for BSS sections.
3270
2199fbe7
CC
32712013-04-15 Cary Coutant <ccoutant@google.com>
3272
3273 * script-sections.cc (Orphan_output_section): Reset address
3274 to zero after each orphaned section for relocatable links.
3275
502e8a84
CC
32762013-04-15 Cary Coutant <ccoutant@google.com>
3277
a4034750
AM
3278 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3279 section starting address for relocatable link.
3280 * testsuite/Makefile.am (script_test_11): New test.
3281 * testsuite/Makefile.in: Regenerate.
3282 * testsuite/script_test_11.c: New source file.
3283 * testsuite/script_test_11.t: New linker script.
502e8a84 3284
0cfdc767
AM
32852013-04-13 Alan Modra <amodra@gmail.com>
3286
3287 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3288 owner when sections are not adjacent and exceed group size.
3289 (Target_powerpc::group_sections): Handle corner case.
3290 (Target_powerpc::Branch_info::make_stub): Handle case where
3291 stub table doesn't exist due to branches in non-exec sections.
3292 (Target_powerpc::Relocate::relocate): Likewise.
3293
6830ee24
AM
32942013-04-11 Alan Modra <amodra@gmail.com>
3295
3296 PR gold/15354
3297 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3298 .branch_lt to match bfd ld. Adjust comments throughout file.
3299
54a3d865
ILT
33002013-04-04 Ian Lance Taylor <iant@google.com>
3301
3302 GCC PR c++/56840
3303 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3304 sections before checking whether they are included in the link.
3305
9993ba11
ST
33062013-03-29 Sriraman Tallam <tmsriram@google.com>
3307
3308 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3309 object before calling the plugin claim_file handler. Pass the elf
3310 object of the archive to the plugin. Delete the elf object if the
3311 plugin claims the file.
3312
ebacd51e
AM
33132013-03-21 Alan Modra <amodra@gmail.com>
3314
3315 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3316 segment when omagic.
3317
117be58f
AM
33182013-03-21 Alan Modra <amodra@gmail.com>
3319
3320 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3321 comparison warning.
3322 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3323 uninitialized" warning.
3324
32e2b61d
AM
33252013-03-20 Alan Modra <amodra@gmail.com>
3326
3327 * symtab.h (Symbol::clear_version): New function.
3328 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3329 is_needed by weak references. Clear version for symbols defined
3330 in as-needed objects that are not needed.
3331
b3ccdeb5
AM
33322013-03-15 Alan Modra <amodra@gmail.com>
3333
3334 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3335 static and public. Add report_err param. Return false for data refs.
3336 (Target_powerpc::rela_dyn_section): New overloaded function.
3337 (Target_powerpc::plt_, iplt_): Elucidate.
3338 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3339 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3340 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3341 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3342 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3343 push_branch and make_plt_entry for ifunc syms when
3344 reloc_needs_plt_for_ifunc.
3345 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3346 for ifunc unless reloc_needs_plt_for_ifunc.
3347
ad3d8a2f
AM
33482013-03-15 Alan Modra <amodra@gmail.com>
3349
3350 * gc.h (gc_process_relocs): Don't look through function descriptors.
3351 * icf.cc (get_section_contents): Do so here instead.
3352
4d9aa155
AM
33532013-03-13 Alan Modra <amodra@gmail.com>
3354
3355 * powerpc.cc (is_branch_reloc): Forward declare.
3356 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3357 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3358 false for 64-bit, true for 32-bit non-branch relocs.
3359 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3360 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3361 nm output.
3362 (icf_safe_test): Generate linker map file as well as nm output.
3363 (icf_safe_so_test): Likewise.
3364 * testsuite/Makefile.in: Regenerate.
3365 * testsuite/icf_test.sh: Parse linker map file to determine
3366 section folding.
3367 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3368 * testsuite/icf_safe_so_test.sh: Likewise.
3369 (X86_32_or_ARM_specific_safe_fold): Merge into..
3370 (arch_specific_safe_fold): ..this.
3371 (X86_64_specific_safe_fold): Delete unused function.
3372
57420c20
AM
33732013-03-12 Alan Modra <amodra@gmail.com>
3374
3375 * gc.h (gc_process_relocs): Look through function descriptors
3376 to determine shndx, symvalue and addend used by ICF. Tidy
3377 variable duplication.
3378
dc3714f3
AM
33792013-03-11 Alan Modra <amodra@gmail.com>
3380
3381 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3382 * layout.cc (Layout_task_runner::run): ..to here.
3383 * symtab.h (struct Symbol_location): Extract from..
3384 (class Symbol_table): ..here.
3385 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3386 * target.h (class Target): Add function_location and
3387 do_function_location functions.
3388 (class Sized_target): Add do_function_location.
3389 * object.h (class Sized_relobj_file): Move find_shdr..
3390 (class Object): ..to here.
3391 * object.cc: Likewise. Update to suit. Instantiate.
3392 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3393 * powerpc.cc (class Powerpc_dynobj): New.
3394 (Target_powerpc::do_function_location): New function.
3395 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3396 (Powerpc_dynobj::do_read_symbols): New function.
3397 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3398
956b03bb
ILT
33992013-03-08 Ian Lance Taylor <iant@google.com>
3400
3401 * options.cc (General_options::string_to_object_format): Accept
3402 "default".
3403
4bead2d5
AM
34042013-03-08 Alan Modra <amodra@gmail.com>
3405
3406 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3407 pointer to Post_fde.
3408 (struct Post_fde): Move definition to here..
3409 * ehframe.cc (struct Post_fde): ..from here.
3410 (Cie::write): Don't alloc Post_fde.
3411 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3412
02e60bf7
AM
34132013-03-07 Alan Modra <amodra@gmail.com>
3414
3415 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3416 relocation referencing .LC0.
3417 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3418
8343f03a
AM
34192013-03-07 Alan Modra <amodra@gmail.com>
3420
3421 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3422 always_inline. Add assembly for powerpc to avoid GOT.
3423
3366d57c
AM
34242013-03-07 Alan Modra <amodra@gmail.com>
3425
3426 * testsuite/script_test_10.sh: Don't test .bss section
3427 header number.
3428
6c77229c
AM
34292013-03-06 Alan Modra <amodra@gmail.com>
3430
3431 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3432 (Target_powerpc::symval_for_branch): Add symtab param. Update
3433 all callers. Handle folded sections.
3434 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3435 to Powerpc_relobj.
3436 (Global_symbol_visitor_opd::operator()): Likewise.
3437
a39e4af6
AM
34382013-03-04 Alan Modra <amodra@gmail.com>
3439
3440 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3441 * testsuite/Makefile.in: Regenerate.
3442
d5834edb
CC
34432013-03-01 Cary Coutant <ccoutant@google.com>
3444
3445 Add dwp support for v2 DWARF package file format.
3446 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3447 tu_length parameter. Adjust all callers.
3448 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3449 * dwp.cc: Include dwarf.h.
3450 (Section_bounds): New struct type.
3451 (Unit_set): New struct type.
3452 (Dwo_file::Dwo_file): Initialize new data member.
3453 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3454 Combine and rename to...
3455 (Dwo_file::read_unit_index): ...this.
3456 (Dwo_file::sized_read_compunit_index)
3457 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3458 (Dwo_file::sized_read_unit_index): ...this.
3459 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3460 parameters; add section_id parameter.
3461 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3462 (Dwo_file::add_unit_set): ...this.
3463 (Dwo_file::shndx_map_): Remove.
3464 (Dwo_file::sect_offsets_): New data member.
3465 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3466 (Dwp_output_file::add_section): Rename to...
3467 (Dwp_output_file::add_contribution): ...this.
3468 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3469 (Dwp_output_file::add_tu_set): Likewise.
3470 (Dwp_output_file::Contribution): New type.
3471 (Dwp_output_file::Section::contributions): New data member.
3472 (Dwp_output_file::Cu_or_tu_set): Remove.
3473 (Dwp_output_file::Section::Section): New ctor.
3474 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3475 (Dwp_output_file::Dwp_index::Section_table): New type.
3476 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3477 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3478 parameter.
3479 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3480 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3481 (Dwp_output_file::Dwp_index::section_table): New member function.
3482 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3483 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3484 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3485 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3486 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3487 (Dwp_output_file::Dwp_index::section_table_): New data member.
3488 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3489 (Dwp_output_file::add_output_section): New member function.
3490 (Dwp_output_file::write_new_section): New member function.
3491 (Dwp_output_file::write_contributions): New member function.
3492 (Dwp_output_file::section_id_map_): New data member.
3493 (class Dwo_id_info_reader): Remove.
3494 (class Unit_reader): New class.
3495 (get_dwarf_section_name): New function.
3496 (Dwo_file::read_executable): Adjust initializations of class data.
3497 (Dwo_file::read): Add support for v2 package file format.
3498 (Dwo_file::read_unit_index): Likewise.
3499 (Dwo_file::sized_read_unit_index): Likewise.
3500 (Dwo_file::copy_section): Likewise.
3501 (Dwo_file::add_unit_set): Likewise.
3502 (Dwp_output_file::add_output_section): Likewise.
3503 (Dwp_output_file::add_contribution): Likewise.
3504 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3505 for empty slot.
3506 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3507 file format.
3508 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3509 slot.
3510 (Dwp_output_file::initialize): Remove unused function.
3511 (Dwp_output_file::finalize): Add support for v2 package file format.
3512 (Dwp_output_file::write_index): Likewise.
3513 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3514 function prototype.
3515
a68a081d
CC
35162013-03-01 Cary Coutant <ccoutant@google.com>
3517
3518 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3519 function into class definition in header file.
3520 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3521 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3522 New function.
3523 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3524
9d5781f8
AM
35252013-02-28 Alan Modra <amodra@gmail.com>
3526
3527 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3528 * target.cc (Target::do_plt_fde_location): New function.
3529 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3530 accessor function, and constructor param.
3531 (struct Post_fde, Post_fdes): Declare.
3532 (Cie::write): Add post_fdes param.
3533 * ehframe.cc (Fde::write): Use plt_fde_location.
3534 (struct Post_fde): Define.
3535 (Cie::write): Stash FDEs added post merge mapping.
3536 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3537 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3538 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3539 other FDEs.
3540 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3541 (Target_powerpc::has_glink): New function.
3542 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3543 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3544 glink_eh_frame_fde_32, default_fde): New data.
3545 (Stub_table::eh_frame_added_): New var.
3546 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3547 Make const.
3548 (Stub_table::add_eh_frame): New function.
3549 (Output_data_glink::add_eh_frame): New function.
3550 (Target_powerpc::make_glink_section): Call add_eh_frame.
3551
214383dd
ILT
35522013-02-15 Ian Lance Taylor <iant@google.com>
3553
3554 * options.h (DEFINE_uint64_alias): Define.
3555 (class General_options): Add -Ttext-segment as an alias for
3556 -Ttext.
3557
91c2b899
AM
35582013-02-15 Alan Modra <amodra@gmail.com>
3559
3560 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3561 (Stub_table::do_write): ..here, two places.
3562 (Stub_table::plt_call_size): Use it here too.
3563
20e2a8aa
ILT
35642013-02-11 Ian Lance Taylor <iant@google.com>
3565
3566 * descriptors.cc (Descriptors::close_all): New function.
3567 * descriptors.h (class Descriptors): Declare close_all.
3568 (close_all_descriptors): New inline function.
3569 * plugin.cc: Include "descriptors.h".
3570 (Plugin_manager::cleanup): Call close_all_descriptors.
3571
8952bc69
AM
35722013-02-06 Alan Modra <amodra@gmail.com>
3573
3574 * README: Update coding style link.
3575
29bd8b6b
CC
35762013-01-28 Cary Coutant <ccoutant@google.com>
3577
a4034750
AM
3578 * dwp.cc (File_list): New typedef.
3579 (Dwo_name_info_reader): New class.
3580 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3581 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3582 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3583 (Dwo_file::read_executable): New function.
3584 (Dwo_file::read): Move common setup code to ...
3585 (Dwo_file::make_object): ... here.
3586 (dwp_options): Add --exec/-e.
3587 (usage): Likewise.
3588 (main): Likewise.
29bd8b6b 3589
c6ac678d
ST
35902013-01-24 Sriraman Tallam <tmsriram@google.com>
3591
3592 * layout.cc (Layout::layout): Check for option text_reorder.
3593 (Layout::make_output_section): Ditto.
3594 * options.h (text_reorder): New option.
3595 * output.cc (Input_section_sort_compare): Remove special ordering
3596 of section names.
3597 (Output_section::
3598 Input_section_sort_section_name_special_ordering_compare::
3599 operator()): New function.
3600 (Output_section::sort_attached_input_sections): Use new sort function
3601 for .text.
3602 * output.h (Input_section_sort_section_name_special_ordering_compare):
3603 New struct.
3604 * testsuite/Makefile.am (text_section_grouping): Test option
3605 --no-text-reorder
3606 * testsuite/Makefile.in: Regenerate.
3607 * testsuite/text_section_grouping.sh: Check order of functions without
3608 default text reordering.
3609
50701cc1
MF
36102013-01-18 Mike Frysinger <vapier@gentoo.org>
3611
3612 * options.h (General_options): Change default to true for new_dtags.
3613
b1b00fcc
MF
36142013-01-18 Mike Frysinger <vapier@gentoo.org>
3615
3616 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3617 when enable_new_dtags is false. Only add DT_RUNPATH when
3618 enable_new_dtags is true.
3619
ec5b8187
AM
36202013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3621
3622 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3623 used in declaration and definition consistent.
3624 (Target_powerpc::symval_for_branch): Ditto.
3625
a880d4c4
ST
36262013-01-16 Sriraman Tallam <tmsriram@google.com>
3627
3628 * testsuite/plugin_final_layout.cc: Fix comment.
3629
7c381248
ST
36302013-01-16 Sriraman Tallam <tmsriram@google.com>
3631
3632 * layout.cc (Layout::layout): Do not do default sorting for
3633 text sections when section ordering is specified.
3634 (make_output_section): Ditto.
3635 * testsuite/plugin_final_layout.cc: Name the function sections
3636 to catch reordering issues.
3637
e2458743
AM
36382013-01-15 Alan Modra <amodra@gmail.com>
3639
3640 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3641 plt-thread-safe.
3642
431ed302
AM
36432013-01-15 Alan Modra <amodra@gmail.com>
3644
3645 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3646 * testsuite/Makefile.in: Regenerate.
3647
0ec6429b
AM
36482013-01-14 Alan Modra <amodra@gmail.com>
3649
3650 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3651 * testsuite/Makefile.in: Regenerate.
3652
0bf402d5
ILT
36532013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3654
36af3926 3655 PR bfd/14430
0bf402d5
ILT
3656 Fix mingw gold build with plugins enabled
3657 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3658 * configure.ac: Export DLOPEN_LIBS and add headers check.
3659 * plugin.cc: Handle non-dlfcn case.
3660 * Makefile.in: Regenerate.
3661 * config.in: Regenerate.
3662 * configure: Regenerate.
3663 * testsuite/Makefile.in: Regenerate.
3664
9e9143bc
ST
36652013-01-09 Sriraman Tallam <tmsriram@google.com>
3666
3667 * output.h (sort_attached_input_sections): Change to be public.
3668 * script-sections.cc
3669 (Output_section_definition::set_section_addresses): Sort
3670 attached input sections according to section order before linker
3671 script assigns section addresses.
3672 (Orphan_output_section::set_section_addresses): Sort
3673 attached input sections according to section order before linker
3674 script assigns section addresses.
3675 * Makefile.am (final_layout.sh): Use a simple linker script to
3676 check if section ordering still works.
3677 * Makefile.in: Regenerate.
3678
679af368
ILT
36792013-01-09 Ben Cheng <bccheng@google.com>
3680
3681 * arm.cc (Target_arm::attributes_accept_div): New function.
3682 (Target_arm::attributes_forbid_div): New function.
3683 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3684 attribute using the same new functions as what bfd/elf32_arm.c
3685 does.
3686
3136a00e
CC
36872013-01-07 Cary Coutant <ccoutant@google.com>
3688
3689 PR gold/14993
3690 * output.cc (Output_section::add_input_section): For incremental
3691 updates, don't track input sections that are allocated from patch
3692 space.
3693
f2a6224b
L
36942013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3695 Ian Lance Taylor <iant@google.com>
3696
3697 PR gold/14897
3698 * configure.ac (--enable-ld): Removed.
3699 (install_as_default): Set to yes only for --enable-gold=default
3700 or --disable-ld.
3701 * configure: Regenerated.
3702
4f46f626
L
37032013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3704
3705 * options.h (General_options): Add -fuse-ld= for GCC linker
3706 option compatibility.
3707
26e4ef59
CC
37082013-01-04 Cary Coutant <ccoutant@google.com>
3709
3710 * configure.ac: Fix typo restoring CXXFLAGS.
3711 * configure: Regenerate.
3712
3d587466
CC
37132013-01-04 Cary Coutant <ccoutant@google.com>
3714
4f46f626
L
3715 * testsuite/Makefile.am (CXXLINK_S): New macro.
3716 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3717 * testsuite/Makefile.in: Regenerate.
3d587466 3718
44db6695
L
37192013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3720
3721 * version.cc (print_version): Update copyright year to 2013.
3722
edcac0c1
ILT
37232012-12-20 Ian Lance Taylor <iant@google.com>
3724
3725 * layout.cc (Layout::special_ordering_of_input_section): New
3726 function.
3727 (Layout::layout): If input section requires special ordering, must
3728 sort input sections.
3729 (Layout::make_output_section): May sort .text input sections.
3730 (Layout::is_section_name_prefix_grouped): Remove.
3731 * layout.h (class Layout): Declare
3732 special_ordering_of_input_section. Don't declare
3733 is_section_name_prefix_grouped.
3734 * output.cc (Output_section::add_input_section): Revert last
3735 change.
3736 (Output_section::Input_section_sort::match_file_name): Don't crash
3737 if called on output section data.
3738 (Output_section::Input_section_sort_compare): Sort based on
3739 special ordering.
3740 (Output_section::Input_section_sort_section_order_index_compare):
3741 Revert last patch.
3742 (Output_section::sort_attached_input_sections): Likewise.
3743
28f2a4ac
ST
37442012-12-18 Sriraman Tallam <tmsriram@google.com>
3745
edcac0c1 3746 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3747 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3748 * output.cc (Output_section::add_input_section): Check if section
3749 name contains special prefix. Keep input sections to sort such
3750 sections.
3751 (Output_section::Input_section_sort_section_order_index_compare
3752 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3753 (Output_section::sort_attached_input_sections): Add condition to
3754 Input_section_entry constructor call.
28f2a4ac
ST
3755 * testsuite/Makefile.am (text_section_grouping): New test.
3756 * testsuite/Makefile.in: Regenerate.
3757 * testsuite/text_section_grouping.cc: New file.
3758 * testsuite/text_section_grouping.sh: New file.
3759
5bf135a7
NC
37602012-12-17 Nick Clifton <nickc@redhat.com>
3761
3762 * Makefile.am: Add copyright notice.
3763 * NEWS: Likewise.
3764 * README: Likewise.
3765 * configure.ac: Likewise.
3766 * ftruncate.c: Likewise.
3767 * Makefile.in: Regenerate.
3768
59965708
CC
37692012-12-14 Cary Coutant <ccoutant@google.com>
3770
a4034750
AM
3771 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3772 --no-as-needed flag.
3773 (exception_separate_shared_12_test): Likewise.
3774 (incremental_copy_test): Likewise.
3775 * testsuite/Makefile.in: Regenerate.
59965708 3776
2a77e2ab
CC
37772012-12-14 Cary Coutant <ccoutant@google.com>
3778
3779 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3780 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3781
e3deeb9c
AM
37822012-12-12 Alan Modra <amodra@gmail.com>
3783
3784 * powerpc.cc (class Track_tls): New.
3785 (class Relocate, class Scan): Inherit Track_tls.
3786 (Target_powerpc::Scan::local, global): Track tls optimization
3787 and avoid creating plt entry for __tls_get_addr if all uses
3788 are optimized away.
3789 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3790
d8f5a274
AM
37912012-12-12 Alan Modra <amodra@gmail.com>
3792
3793 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3794 Replace no_toc_optimize with toc_optimize.
3795 * output.h (Output_section::input_sections): Provide non-const variant.
3796 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3797 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3798 accessors.
3799 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3800 (class Sort_toc_sections): New.
3801 (Target_powerpc::do_finalize_sections): Sort toc sections.
3802 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3803
4c8a1de1
RM
38042012-12-10 Roland McGrath <mcgrathr@google.com>
3805
3806 * testsuite/binary_unittest.cc (read_all): New function.
3807 (Sized_binary_test): Use it instead of ::read.
3808 * fileread.cc (do_read): Don't assume pread always reads the whole
3809 amount in a single call.
3810
edc27beb
AM
38112012-12-10 Alan Modra <amodra@gmail.com>
3812
3813 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3814 Set EM_PPC64 or EM_PPC here.
3815 (Target_selector_powerpc::do_recognize): Delete.
3816
906b9150
AM
38172012-12-10 Alan Modra <amodra@gmail.com>
3818
3819 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3820 stub_table_.
3821 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3822
418c15ae
RM
38232012-12-07 Roland McGrath <mcgrathr@google.com>
3824
3825 * testsuite/binary_unittest.cc (Sized_binary_test):
3826 Use open_descriptor rather than ::open.
3827
decdd3bc
AM
38282012-12-07 Alan Modra <amodra@gmail.com>
3829
3830 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3831 typedef and invalid_address constant.
3832 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3833 instantiate constants.
3834
db399005
ILT
38352012-12-06 Roland McGrath <mcgrathr@google.com>
3836
3837 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3838 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3839 * aclocal.m4: Regenerate.
3840 * configure: Regenerate.
3841 * Makefile.in: Regenerate.
3842 * testsuite/Makefile.in: Regenerate.
3843
aba6bc71
AM
38442012-12-07 Alan Modra <amodra@gmail.com>
3845
3846 * options.h (General_options): Add no_toc_optimize.
3847 * powerpc.cc (ok_lo_toc_insn): New function.
3848 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3849
9e69ed50
AM
38502012-12-06 Alan Modra <amodra@gmail.com>
3851
3852 * options.h (General_options): Add plt_align, plt_static_chain,
3853 plt_thread_safe. Update stub_group_size help text.
3854 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3855 for new plt_thread_safe_ var.
3856 (use_plt_offset): Correct comments.
3857 (Target_powerpc::do_relax): Look for thread creation symbols to
3858 determine default plt_thread_safe value. Clear plt call stubs
3859 as well as branch stubs each iteration.
3860 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3861 insn constants.
3862 (l, hi, ha, write_insn): Move earlier.
3863 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3864 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3865 plt stubs too.
3866 (Stub_table::update_size): Adjust.
3867 (Stub_table::prev_size, set_prev_size): Delete.
3868 (Stub_table::stub_align): Let --plt-align affect result.
3869 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3870 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3871 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3872 (Stub_table::do_write): Support more stub variants.
3873
f43ba157
AM
38742012-12-04 Alan Modra <amodra@gmail.com>
3875
3876 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3877 (Target_powerpc::do_define_standard_symbols): New function.
3878
34171bc5
AM
38792012-12-03 Alan Modra <amodra@gmail.com>
3880
3881 * output.h: Formatting, whitespace.
3882
dc9589e9 38832012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3884
3885 * layout.h (Layout::get_executable_sections): Declare.
3886 * layout.cc (Layout::get_executable_sections): New function.
3887 * arm.cc (Target_arm::group_sections): Use it.
3888 (Arm_output_section::group_sections): Delete now redundant test.
3889 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3890 param to handle relative relocs.
3891 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3892 (Output_data_reloc::add_absolute): Adjust.
3893 (Output_data_reloc::add_relative): New function.
3894 (Output_data::reset_data_size): New function.
3895 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3896 (Output_section::set_addralign): New function.
3897 (Output_section::checkpoint_set_addralign): New function.
3898 (Output_section::clear_section_offsets_need_adjustment): New function.
3899 (Output_section::input_sections): Make public.
3900 * powerpc.cc (class Output_data_brlt_powerpc): New.
3901 (class Stub_table, class Stub_control): New.
3902 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3903 stub_table_, set_stub_table, stub_table): New vectors and accessor
3904 functions.
3905 (Target_powerpc::do_may_relax, do_relax, push_branch,
3906 new_stub_table, stub_tables, brlt_section, group_sections,
3907 add_branch_lookup_table, find_branch_lookup_table,
3908 write_branch_lookup_table, make_brlt_section): New functions.
3909 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3910 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3911 branch_info_): New vars.
3912 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3913 make call stubs here.
3914 (Output_data_glink): Remove all call stub handling from this class.
3915 (Target_powerpc::Scan::local, global): Save interesting branch
3916 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3917 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3918 functions on final link.
3919 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3920 Handle long branch destinations too.
3921 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3922 do_plt_address_for_local): Adjust lookup of plt call stubs.
3923
627b30b7
AM
39242012-11-30 Alan Modra <amodra@gmail.com>
3925
3926 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3927 relocs against protected symbols when building 32-bit shared libs.
3928
40b469d7
AM
39292012-11-30 Alan Modra <amodra@gmail.com>
3930
3931 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3932 param. Call got_section() to make .got. Update all callers
3933 and their callers and so on.
3934
bb66a627
AM
39352012-11-30 Alan Modra <amodra@gmail.com>
3936
3937 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3938 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3939 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3940 value if it already exists.
3941
d2cf1c6c
L
39422012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3943
3944 PR gold/14858
3945 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3946
edccdf7c
RM
39472012-11-14 Roland McGrath <mcgrathr@google.com>
3948
3949 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3950 than bfc instruction for data sandboxing.
3951
6febeb74
AM
39522012-11-08 Alan Modra <amodra@gmail.com>
3953
3954 * po/POTFILES.in: Regenerate.
3955
0a6f1bf2
AM
39562012-11-05 Alan Modra <amodra@gmail.com>
3957
3958 * configure.ac: Apply 2012-09-10 change to config.in here.
3959 * configure: Regenerate.
3960
26a4e9cb
AM
39612012-11-05 Alan Modra <amodra@gmail.com>
3962
3963 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3964 (struct Opd_ent): Use "Address" rather than "Offset".
3965 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3966 (Target_powerpc::got_section): Make public.
3967 (Target_powerpc::scan_relocs): Move code setting symbols..
3968 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3969 Create _SDA_BASE_ only when referenced.
3970
cc928013
RM
39712012-11-02 Roland McGrath <mcgrathr@google.com>
3972
3973 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3974 from last change.
3975
50ed5eb1
RM
39762012-11-01 Roland McGrath <mcgrathr@google.com>
3977
62fe925a
RM
3978 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3979 for offset_in_output_section parameter.
3980 (Sized_target::relocate_special_relocatable): Likewise.
3981 * arm.cc (Target_arm::relocate_relocs): Likewise.
3982 (Target_arm::relocate_special_relocatable): Likewise.
3983 * i386.cc (Target_i386::relocate_relocs): Likewise.
3984 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3985 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3986 * target-reloc.h (relocate_relocs): Likewise.
3987 * testsuite/testfile.cc (Target_test): Likewise.
3988 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3989 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3990
3991 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3992 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3993
3994 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3995 parameter, which is unused in the [!F_SETFD] case.
3996
50ed5eb1
RM
3997 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3998 SYMNDX to off_t before comparing it to this->data_size().
3999 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4000 * incremental.cc (Output_section_incremental_inputs::do_write):
4001 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4002
2cadc0bf
RM
4003 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4004
3bfcb652
NC
40052012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4006
4007 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4008 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4009 in EABI_VER5.
4010
c1a8d56e
CC
40112012-10-29 Cary Coutant <ccoutant@google.com>
4012
4013 * dwp.cc (usage): Add file and exit status parameters;
4014 add --help and --version options.
4015 (print_version): New function.
4016 (main): Add --help and --version options.
4017
b2490a7b
L
40182012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4019
4020 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4021 final_layout_sequence.txt.
4022 * testsuite/Makefile.in: Regenerated.
4023
aa543512
L
40242012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4025
4026 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4027 COMPILE generated by automake.
4028 (LINK1): Likewise.
4029 (CXXCOMPILE1): Likewise.
4030 (CXXLINK1): Likewise.
4031 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4032 (LINK): Likewise.
4033 (CXXCOMPILE): Likewise.
4034 (CXXLINK): Likewise.
4035 * testsuite/Makefile.in: Regenerated.
4036
d361fafb
L
40372012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4038
4039 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4040 on bad fwrite return.
4041
598c7410
L
40422012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4043
4044 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4045 on val.
4046
35c813e2
CC
40472012-10-23 Cary Coutant <ccoutant@google.com>
4048
4049 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4050 * testsuite/Makefile.in: Regenerate.
4051 * testsuite/dwp_test.h: New source file.
4052 * testsuite/dwp_test_1.cc: New source file.
4053 * testsuite/dwp_test_1.s: New source file.
4054 * testsuite/dwp_test_1.sh: New source file.
4055 * testsuite/dwp_test_1b.cc: New source file.
4056 * testsuite/dwp_test_1b.s: New source file.
4057 * testsuite/dwp_test_2.cc: New source file.
4058 * testsuite/dwp_test_2.s: New source file.
4059 * testsuite/dwp_test_2.sh: New source file.
4060 * testsuite/dwp_test_main.cc: New source file.
4061 * testsuite/dwp_test_main.s: New source file.
4062
77429909
CC
40632012-10-23 Cary Coutant <ccoutant@google.com>
4064
4065 * dwp.h: New header file.
4066 * dwp.cc: New source file.
4067 * gold.h: Move shared declarations to system.h.
4068 * system.h: New header file.
4069 * Makefile.am: Add dwp.
4070 * Makefile.in: Regenerate.
4071
ed5d6712
CC
40722012-10-23 Cary Coutant <ccoutant@google.com>
4073
4074 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4075 Dwarf_info_reader::read_from_pointer.
4076 (Dwarf_pubnames_table::read_header): Likewise.
4077 (Dwarf_pubnames_table::next_name): Likewise.
4078 (Dwarf_die::read_attributes): Likewise.
4079 (Dwarf_die::skip_attributes): Likewise.
4080 (Dwarf_info_reader::read_from_pointer): New function template.
4081 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4082 (Dwarf_pubnames_table): Likewise.
4083 (Dwarf_info_reader::read_from_pointer): New function template.
4084 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4085 Dwarf_pubnames_table ctor.
4086
8787852d
CC
40872012-10-23 Cary Coutant <ccoutant@google.com>
4088
4089 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4090 abbrev_shndx.
4091 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4092 abbrev_shndx_.
4093 (Dwarf_info_reader::set_abbrev_shndx): New method.
4094 (Dwarf_info_reader::abbrev_shndx_): New data member.
4095
9fc236f3
CC
40962012-10-23 Cary Coutant <ccoutant@google.com>
4097
4098 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4099 from object, not parameters.
4100 (Dwarf_info_reader::parse): Likewise.
4101 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4102 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4103 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4104 methods.
4105
effe8365
CC
41062012-10-23 Cary Coutant <ccoutant@google.com>
4107
4108 * fileread.cc (Input_file::Input_file): New constructor.
4109 * fileread.h (class Input_file): Add new constructor.
4110
1698990d
AM
41112012-10-18 Alan Modra <amodra@gmail.com>
4112
4113 PR gold/14727
4114 * object.cc (Relobj::is_section_name_included): Also match
4115 .sdata personality section.
4116
168a4726
AM
41172012-10-18 Alan Modra <amodra@gmail.com>
4118
4119 * target-reloc.h (class Default_comdat_behavior): New, package up..
4120 (get_comdat_behaviour): ..this.
4121 (relocate_section): Add Relocate_comdat_behavior template arg,
4122 adjust code to suit.
4123 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4124 (Target_arm::scan_reloc_section): Likewise.
4125 * i386.cc (Target_i386::relocate_section): Likewise.
4126 * sparc.cc (Target_sparc::relocate_section): Likewise.
4127 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4128 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4129 * powerpc.cc (class Relocate_comdat_behavior): New.
4130 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4131 gold::relocate_section with new template arg.
4132
acc276d8
AM
41332012-10-18 Alan Modra <amodra@gmail.com>
4134
4135 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4136 dynamic relocs for GOT_TPREL got entries, without symbol if
4137 resolving locally.
4138 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4139 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4140 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4141
e10f9870
AM
41422012-10-17 Alan Modra <amodra@gmail.com>
4143
4144 PR gold/14726
4145 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4146
ae034989
ST
41472012-10-16 Sriraman Tallam <tmsriram@google.com>
4148
4149 * layout.cc (Layout::include_section): Keep sections marked
4150 SHF_EXCLUDE when doing relocatable links.
4151
f3a0ed29
AM
41522012-10-16 Alan Modra <amodra@gmail.com>
4153
4154 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4155 (Target_powerpc::do_finalize_sections): Call it.
4156 (Output_data_save_res): New class and supporting functions.
4157 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4158 normal symbols defined in object files.
4159
c6de8ed4
AM
41602012-10-12 Alan Modra <amodra@gmail.com>
4161
4162 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4163 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4164 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4165 section if scan_opd_relocs not yet called.
4166 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4167
03e25981
AM
41682012-10-12 Alan Modra <amodra@gmail.com>
4169
4170 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4171 add_local_ifunc_entry): Revert last change.
4172 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4173
c9824451
AM
41742012-10-05 Alan Modra <amodra@gmail.com>
4175
4176 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4177 do_plt_address_for_global): New functions.
4178 (Output_data_got_powerpc::do_write): Don't segfault when linking
4179 statically.
4180 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4181 add_local_ifunc_entry): Return true on adding entry..
4182 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4183 glink->add_entry call. Remove unused symtab param. Adjust calls.
4184 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4185 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4186 set up symbols here.
4187 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4188 syms here. Do so even when no .iplt. Don't segfault when linking
4189 statically.
4190 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4191 new variants without reloc param.
4192 (Glink_sym_ent::Glink_sym_ent): Likewise.
4193 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4194 reloc when refs will resolve to plt call stub.
4195 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4196 R_PPC_PLTREL24 to resolve locally.
4197 (Target_powerpc::Scan::global): Correct ifunc handling.
4198 (Target_powerpc::Relocate::relocate): Correct local sym glink
4199 lookup. Don't destroy "value" when we have a plt call stub,
4200 and when checking plt call validity.
4201 (Target_powerpc::do_dynsym_value): Simplify.
4202
19fec8c1
AM
42032012-10-05 Alan Modra <amodra@gmail.com>
4204
4205 * i386.cc (Output_data_plt_i386::address_for_global,
4206 address_for_local): Add plt offset to returned value. Adjust uses.
4207 * sparc.cc (Output_data_plt_sparc::address_for_global,
4208 address_for_local): Likewise.
4209 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4210 address_for_local): Likewise.
4211 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4212 address_for_local): Likewise.
4213 * target.h (Target::plt_address_for_global, plt_address_for_local):
4214 Update comment.
4215 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4216 (Output_data_got::Got_entry::write): Nor here.
4217 * output.h: Comment fix.
4218
e867b647
WL
42192012-10-02 Jiong Wang <jiwang@tilera.com>
4220
4221 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4222 global_offset_table_ value for larget got.
4223 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4224
e5d5f5ed
AM
42252012-09-29 Alan Modra <amodra@gmail.com>
4226
4227 * powerpc.cc (Target_powerpc::iplt_): New output section.
4228 (Target_powerpc::iplt_section, make_iplt_section,
4229 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4230 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4231 Target_powerpc::plt_entry_count): Count iplt entries too.
4232 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4233 reloc section in constructor. New params.
4234 (Target_powerpc::make_plt_section): Create reloc section here instead.
4235 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4236 functions.
4237 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4238 (Output_data_glink::add_entry, find_entry): New functions to
4239 deal with local syms.
4240 (Glink_sym_ent): Add support for local syms.
4241 (Output_data_glink::do_write): Handle ifunc plt entries.
4242 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4243 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4244 (Target_powerpc::Relocate::relocate): Likewise.
4245 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4246
ec4dbad3
AM
42472012-09-25 Alan Modra <amodra@gmail.com>
4248
4249 * object.h (Sized_relobj_file::adjust_local_symbol,
4250 do_adjust_local_symbol): New functions.
4251 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4252 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4253 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4254 and irregular opd entry spacing.
4255 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4256 (Global_symbol_visitor_opd): New functor.
4257 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4258 on deleted opd entries.
4259
5c0b3823
WL
42602012-09-15 Jiong Wang <jiwang@tilera.com>
4261
4262 * tilegx.cc: New file.
4263 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4264 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4265 * configure.tgt: Add entries for tilegx*.
4266 * configure.ac: Likewise.
4267 * Makefile.in: Rebuild.
4268 * configure: Likewise.
4269 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4270 tilegx.
4271
bfdfa4cd
AM
42722012-09-13 Alan Modra <amodra@gmail.com>
4273
4274 * target-reloc.h (scan_relocs): Call scan.local for relocs
4275 against symbols in discarded sections. Pass is_discarded
4276 param.
4277 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4278 Add is_discarded param.
4279 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4280 is_discarded to flag opd entry as discarded. Don't emit dyn
4281 relocs on such entries.
4282 (Target_powerpc::Scan::global): Similarly detect and handle
4283 such opd entries.
4284 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4285 opd_ent_. Update all uses.
4286 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4287 (Target_powerpc::relocate_section): Zero out discarded opd
4288 entry relocs.
4289
d77a0555
ILT
42902012-09-12 Ian Lance Taylor <iant@google.com>
4291
4292 PR gold/14570
4293 * output.cc: Rename Output_data_got template parameter from size
4294 to got_size for all functions. Compile all variants of
4295 Output_data_got.
4296 (Output_data_got::Got_entry::write): Correct use of size for
4297 symbol value. Use local_is_tls rather than casting to
4298 Sized_relobj_file.
4299 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4300 (class Sized_relobj_file): Add do_local_is_tls.
4301 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4302
815a1205
AM
43032012-09-11 Alan Modra <amodra@gmail.com>
4304
4305 PR gold/14566
4306 * layout.cc (Layout::set_segment_offsets): When using
4307 common-page-size alignment, ensure we are on a new max-page-size
4308 page.
4309 * output.cc (Output_segment::set_section_addresses): Use
4310 abi_pagesize, not common_pagesize for relro boundary.
4311 (Output_segment::set_offset): Likewise.
4312
bd73a62d
AM
43132012-09-11 Alan Modra <amodra@gmail.com>
4314
4315 * output.h (Output_data_got::add_global_tls, add_local_tls,
4316 add_local_tls_pair): New functions.
4317 (Output_data_got::add_local_pair_with_rel): Remove second
4318 reloc param. Expand comment.
4319 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4320 use_plt_or_tls_offset_, similarly for constructor param.
4321 (Output_data_got::Got_entry::write): Add got_index param.
4322 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4323 add_local_tls_pair): New functions.
4324 (Output_data_got::Got_entry::write): Handle tls symbols
4325 with use_plt_or_tls_offset_ set specially.
4326 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4327 (Output_data_got::do_write): Replace iterator with index, pass
4328 index to entry write function.
4329 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4330 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4331 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4332 call.
4333 * i386.cc (Target_i386::Scan::local): Likewise.
4334 * sparc.cc (Target_sparc::Scan::local): Likewise.
4335 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4336 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4337 do_tls_offset_for_global): New functions.
4338 (Target_powerpc::Scan::local): Correct TLS relocations and got
4339 entry values.
4340 (Target_powerpc::Scan::global): Don't emit unnecessary
4341 dynamic relocations on TLS GOT entries.
4342
00716ab1
AM
43432012-09-10 Matthias Klose <doko@ubuntu.com>
4344
4345 * config.in: Disable sanity check for kfreebsd.
4346
c891b3f9
SA
43472012-09-10 Sterling Augustine <saugustine@google.com>
4348
4349 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4350 (Gdb_index::pubtypes_read): New parameter.
4351 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4352 to calls.
4353 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4354 pubtypes_object_.
4355
e81fea4d
AM
43562012-09-09 Alan Modra <amodra@gmail.com>
4357
4358 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4359 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4360 * gc.h (gc_process_relocs): Call target gc_add_reference.
4361 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4362 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4363 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4364 unnecessary cast.
4365 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4366 to cater for when we don't need code offset. Update use.
4367 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4368 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4369 set_opd_valid): New functions.
4370 (Target_powerpc::do_gc_add_reference): New function.
4371 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4372 stashed refs.
4373 (Target_powerpc::do_gc_mark_symbol): New function.
4374
d2d60eef
CC
43752012-09-06 Cary Coutant <ccoutant@google.com>
4376
4377 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4378 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4379 (Dwarf_die::skip_attributes): Likewise.
4380 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4381 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4382 (main): Call it.
4383 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4384
32ed4573
L
43852012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4386
4387 * testsuite/script_test_3.t: Add .got.plt output section
4388 statement.
4389 * testsuite/script_test_4.t: Likewise.
4390
f4baf0d4
AM
43912012-09-05 Alan Modra <amodra@gmail.com>
4392
4393 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4394 update all uses and lose "enum" when using type.
4395
864a1b56
AM
43962012-09-05 Alan Modra <amodra@gmail.com>
4397
4398 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4399 * configure: Regenerate.
4400 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4401 (plugin_final_layout.stdout): Likewise.
4402 (memory_test): Set page sizes to 0x1000.
4403 * testsuite/Makefile.in: Regenerate.
4404 * testsuite/discard_locals_test.sh: Add FIXME comment.
4405 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4406 * testsuite/pr14265.t: Add .got output section statement.
4407 * testsuite/script_test_2.t: Likewise.
4408 * testsuite/script_test_3.t: Likewise.
4409 * testsuite/script_test_4.t: Likewise.
4410 * testsuite/script_test_5.t: Likewise.
4411 * testsuite/script_test_6.t: Likewise.
4412 * testsuite/script_test_7.t: Likewise.
4413 * testsuite/script_test_9.t: Likewise.
4414
3ea0a085
AM
44152012-09-05 Alan Modra <amodra@gmail.com>
4416
4417 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4418 (Powerpc_relocate_functions::Status): New typedef.
4419 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4420 (Target_powerpc::Scan::local): Handle REL64.
4421 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4422 for REL32 and REL64.
4423 (Target_powerpc::symval_for_branch): New function, extracted from..
4424 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4425 checks. Report overflow errors.
4426
7404fe1b
AM
44272012-09-05 Alan Modra <amodra@gmail.com>
4428
4429 * object.h (Sized_relobj_file::emit_relocs): Delete.
4430 (Sized_relobj_file::emit_relocs_reltype): Delete.
4431 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4432 relocate_relocs for --emit-relocs.
4433 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4434 * output.h: Update comment.
4435 (Output_segment::first_section): New function.
4436 (Output_segment::first_section_load_address): Use first_section.
4437 * output.cc (Output_segment::first_section): New function extracted..
4438 (Output_segment::first_section_load_address): ..from here. Delete.
4439 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4440 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4441 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4442 adjust call to target.h function.
4443 * i386.cc (Target_i386): Likewise.
4444 * sparc.cc (Target_sparc): Likewise.
4445 * x86_64.cc (Target_x86_64): Likewise.
4446 * powerpc.cc (Target_powerpc): Likewise.
4447 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4448 first tls section has section symbol for optimised local dynamic
4449 output relocs.
4450 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4451 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4452 optimised tls code.
4453 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4454 Rename to relocate_relocs. Update error message.
4455
957564c9
AS
44562012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4457
4458 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4459 --just-symbols.
4460
dd93cd0a
AM
44612012-08-31 Alan Modra <amodra@gmail.com>
4462
4463 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4464 (Powerpc_relobj::toc_base_offset): New stub function.
4465 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4466 got_mod_index_offset to tlsld_got_offset. Update all refs.
4467 (Target_powerpc::Relocate::enum skip_tls): New.
4468 (Target_powerpc::call_tls_get_addr_): New var.
4469 (Target_powerpc::is_branch_reloc): Move to file scope.
4470 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4471 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4472 New functions.
4473 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4474 (powerpc_info): Correct common_pagesize for ppc64.
4475 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4476 (Powerpc_relocate_functions): Add overflow check enums and functions.
4477 Add non-shift version of rela, rela_ua. Delete all rel public
4478 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4479 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4480 addr16_ha3, addr14 functions.
4481 (Output_data_got_powerpc::add_constant_pair): New function.
4482 (Output_data_got_powerpc::got_base_offset): Likewise.
4483 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4484 (instruction constants): Sort, add some more.
4485 (Output_data_glink::do_write): Add and use Address typedef. Use
4486 object->toc_base_offset() stub for 64-bit.
4487 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4488 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4489 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4490 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4491 Always treat .opd relocs as against locally defined symbol.
4492 Correct condition for RELATIVE relocs.
4493 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4494 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4495 for 32-bit syms with a plt entry. Correct ppc64 toc base
4496 calculations. Handle TLS relocs, and more. Add overflow
4497 checking and adjust for Powerpc_relocate_functions changes.
4498 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4499 Reinstate --emit-relocs code with FIXME.
4500
a1373b60
AM
45012012-08-30 Alan Modra <amodra@gmail.com>
4502
4503 * layout.cc (Layout::set_segment_offsets): Set p_align to
4504 abi_pagesize, not common_pagesize.
4505 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4506 to determine whether file header can go in segment.
4507
703d02da
AM
45082012-08-30 Alan Modra <amodra@gmail.com>
4509
4510 * output.h (Output_reloc::Output_reloc <output section>): Add
4511 is_relative param. Adjust calls.
4512 (Output_reloc::add_output_section_relative): New functions.
4513 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4514 is_relative.
4515 (Output_reloc::symbol_value): Handle SECTION_CODE.
4516
16164a6b
ST
45172012-08-24 Sriraman Tallam <tmsriram@google.com>
4518
4519 * gold.cc (queue_middle_tasks): Call layout again when unique
4520 segments for sections is desired.
4521 * layout.cc (Layout::Layout): Initialize new members.
4522 (Layout::get_output_section_flags): New function.
4523 (Layout::choose_output_section): Call get_output_section_flags.
4524 (Layout::layout): Make output section for mapping to a unique segment.
4525 (Layout::insert_section_segment_map): New function.
4526 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4527 output sections marked so.
16164a6b
ST
4528 (Layout::segment_precedes): Check for unique segments when sorting.
4529 * layout.h (Layout::Unique_segment_info): New struct.
4530 (Layout::Section_segment_map): New typedef.
4531 (Layout::insert_section_segment_map): New function.
4532 (Layout::get_output_section_flags): New function.
4533 (Layout::is_unique_segment_for_sections_specified): New function.
4534 (Layout::set_unique_segment_for_sections_specified): New function.
4535 (Layout::unique_segment_for_sections_specified_): New member.
4536 (Layout::section_segment_map_): New member.
4537 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4538 Rename is_gc_pass_one to is_pass_one.
4539 Rename is_gc_pass_two to is_pass_two.
4540 Rename is_gc_or_icf to is_two_pass.
4541 Check for which pass based on whether symbols data is present.
4542 Make it two pass when unique segments for sections is desired.
4543 * output.cc (Output_section::Output_section): Initialize new
4544 members.
4545 * output.h (Output_section::is_unique_segment): New function.
4546 (Output_section::set_is_unique_segment): New function.
4547 (Output_section::is_unique_segment_): New member.
4548 (Output_section::extra_segment_flags): New function.
4549 (Output_section::set_extra_segment_flags): New function.
4550 (Output_section::extra_segment_flags_): New member.
4551 (Output_section::segment_alignment): New function.
4552 (Output_section::set_segment_alignment): New function.
4553 (Output_section::segment_alignment_): New member.
4554 (Output_segment::Output_segment): Initialize is_unique_segment_.
4555 (Output_segment::is_unique_segment): New function.
4556 (Output_segment::set_is_unique_segment): New function.
4557 (Output_segment::is_unique_segment_): New member.
4558 * plugin.cc (allow_unique_segment_for_sections): New function.
4559 (unique_segment_for_sections): New function.
4560 (Plugin::load): Add new functions to transfer vector.
4561 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4562 * Makefile.in: Regenerate.
4563 * testsuite/plugin_final_layout.sh: Check if unique segment
4564 functionality works.
4565 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4566 are available.
4567 (allow_unique_segment_for_sections): New global.
4568 (unique_segment_for_sections): New global.
4569 (claim_file_hook): Call allow_unique_segment_for_sections.
4570 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4571
1e2bee4f
CC
45722012-08-22 Cary Coutant <ccoutant@google.com>
4573
4574 * layout.cc (Layout::include_section): Don't assert on GROUP
4575 sections with --emit-relocs.
4576
1d5dfe78
CC
45772012-08-21 Cary Coutant <ccoutant@google.com>
4578
4579 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4580 if --export-dynamic-symbol names an undef symbol.
4581
c9269dff
AM
45822012-08-18 Alan Modra <amodra@gmail.com>
4583
4584 * powerpc.cc: Formatting and white space.
4585 (Powerpc_relobj): Rename got2_section_ to special_.
4586 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4587 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4588 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4589 (Target_powerpc): Add Address typedef and invalid_address. Use
4590 throughout.
4591 (Target_powerpc::is_branch_reloc): New function.
4592 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4593 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4594 for dst_mask, value and addend.
4595 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4596 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4597 (Output_data_glink::do_write): Correct toc base. Don't try to use
4598 uint16_t for 24-bit offset. Use get_output_section_offset and
4599 check return.
4600 (Target_powerpc::Scan::local): Handle more relocs.
4601 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4602 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4603 Plug in toc restoring insn after plt calls. Translate branches
4604 to function descriptor symbols to corresponding entry point.
4605 (Target_powerpc::relocate_for_relocatable): Check return from
4606 get_output_section_offset.
4607 * symtab.h: Comment typo.
4608
b1759dce
ILT
46092012-08-14 Ian Lance Taylor <iant@google.com>
4610
4611 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4612 unsupported_relocal_local to call unsupported_reloc_global.
4613
b9b2ae8b
NC
46142012-08-14 Nick Clifton <nickc@redhat.com>
4615
4616 PR ld/14265
4617 * script-sections.cc (Sections_element::output_section_name): Add
4618 keep return parameter.
4619 (Output_section_element::match_name): Add keep return parameter.
4620 Return the value of the keep_ member.
4621 * script-sections.h (class Output_section): Update
4622 output_section_name prototype.
4623 * layout.cc (Layout::keep_input_section): New public member
4624 function.
4625 (Layout::choose_output_section): Pass keep parameter to
4626 output_section_name.
4627 * layout.h (class Layout): Add keep_input_section.
4628 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4629 sections.
4630 * testsuite/Makefile.am: Add a test.
4631 * testsuite/Makefile.in: Regenerate.
4632 * testsuite/pr14265.c: Source file for the test.
4633 * testsuite/pr14265.t: Linker script for the test.
4634 * testsuite/pr14265.sh: Shell script for the test.
4635
921b5322
AM
46362012-08-14 Alan Modra <amodra@gmail.com>
4637
4638 * target.h (Target::output_section_name): New function.
4639 (Target::do_output_section_name): New function.
4640 * layout.cc (Layout::choose_output_section): Call the above.
4641 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4642
6ce78956
AM
46432012-08-14 Alan Modra <amodra@gmail.com>
4644
4645 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4646 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4647 for replace_constant call.
4648 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4649 (Output_data_glink::do_print_to_mapfile): New function.
4650 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4651 (Target_powerpc::Relocate::relocate): Likewise.
4652
d1a8cabd
AM
46532012-08-14 Alan Modra <amodra@gmail.com>
4654
4655 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4656 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4657 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4658 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4659 all references to shndx_. Handle special case for R_PPC_PLTREL24
4660 here.
4661 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4662 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4663 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4664 here.
4665 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4666 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4667
d83ce4e3
AM
46682012-08-12 Alan Modra <amodra@gmail.com>
4669
4670 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4671 (glink insn constants): Use uint32_t.
4672 (Output_data_glink::add_entry): Use insert, not [] operator.
4673
cf43a2fe
AM
46742012-08-11 Alan Modra <amodra@gmail.com>
4675
4676 * object.h (Sized_relobj_file::find_shdr): New function.
4677 (Sized_relobj_file::find_special_sections): New function.
4678 * object.cc (Sized_relobj_file::find_shdr): New function.
4679 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4680 (Sized_relobj_file::find_special_sections): New function, split out..
4681 (Sized_relobj_file::do_read_symbols): ..from here.
4682 * output.h (Output_data_got::replace_constant): New function.
4683 (Output_data_got::num_entries): New function.
4684 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4685 (Output_data_got::got_offset): Protected rather than private.
4686 (Output_data_got::replace_got_entry): New function.
4687 * output.cc (Output_data_got::replace_got_entry): New function.
4688 * powerpc.cc (class Powerpc_relobj): New.
4689 (class Powerpc_relocate_functions): Delete all psymval variants or
4690 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4691 Implement _ha functions using corresponding _hi function.
4692 (Powerpc_relobj::find_special_sections): New function.
4693 (Target_powerpc::do_make_elf_object): New function.
4694 (class Output_data_got_powerpc): New.
4695 (class Output_data_glink): New.
4696 (class Powerpc_scan_relocatable_reloc): New.
4697 Many more changes througout file.
4698
3c892704
NC
46992012-08-09 Nick Clifton <nickc@redhat.com>
4700
4701 * po/vi.po: Updated Vietnamese translation.
4702
82435b3b
ILT
47032012-08-07 Ian Lance Taylor <iant@google.com>
4704
4705 * layout.cc (Layout::add_target_dynamic_tags): If
4706 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4707 plt_rel.
4708
a6dc81d2
NC
47092012-07-30 Nick Clifton <nickc@redhat.com>
4710
4711 * po/gold.pot: Updated template.
4712 * po/es.po: Updated Spanish translation.
4713
f1415016
CC
47142012-07-18 Cary Coutant <ccoutant@google.com>
4715
4716 PR gold/14344
4717 * configure.ac: Add check for -gpubnames support.
4718 * configure: Regenerate.
4719 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4720 support; force -gno-pubnames.
4721 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4722 support.
4723 (gdb_index_test_4): New test.
4724 * testsuite/Makefile.in: Regenerate.
4725 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4726 * testsuite/gdb_index_test_2.sh: Likewise.
4727 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4728 * testsuite/gdb_index_test_4.sh: New script.
4729 * testsuite/gdb_index_test_comm.sh: New script with common code;
4730 don't look for space after colon.
4731
b7fd7c37
ST
47322012-07-16 Sriraman Tallam <tmsriram@google.com>
4733
4734 * gold.cc (queue_middle_tasks): Update function order only after
4735 deferred objects due to plugins are processed.
4736
1f3212db
ILT
47372012-07-11 Ian Lance Taylor <iant@google.com>
4738
4739 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4740 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4741 (Target_arm::scan_reloc_for_stub): Likewise.
4742 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4743 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4744 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4745 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4746 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4747
81c82a68
ILT
47482012-07-10 Dodji Seketeli <dodji@redhat.com>
4749 Ian Lance Taylor <iant@google.com>
4750
4751 PR gold/14309
4752 * configure.ac: Test whether std::tr1::hash<off_t> works.
4753 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4754 needed.
4755 * output.h (class Output_fill): Add virtual destructor.
4756 * configure, config.in: Rebuild.
4757
eabc84f4
RM
47582012-06-22 Roland McGrath <mcgrathr@google.com>
4759
4760 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4761
370e30b6
RÁE
47622012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4763
4764 * plugin.cc (Plugin::load): Handle position independent executables.
4765
fb1b895d
CC
47662012-06-06 Cary Coutant <ccoutant@google.com>
4767
4768 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4769 add .debug_macro.
4770 (lines_only_debug_sections): Likewise.
4771 (gdb_fast_lookup_sections): New static array.
4772 (is_gdb_debug_section): Rename formal parameter.
4773 (is_lines_only_debug_section): Likewise.
4774 (is_gdb_fast_lookup_section): New function.
4775 (Layout::include_section): Check for ".zdebug_" prefix; pass
4776 section name suffix to is_gdb_debug_section, et al.; check for
4777 fast-lookup sections when building .gdb_index.
4778 * options.h (--strip-debug-gdb): Update GDB version number.
4779
7c0640fa
CC
47802012-06-06 Cary Coutant <ccoutant@google.com>
4781
4782 * configure.ac: Add check for fallocate.
4783 * configure: Regenerate.
4784 * config.in: Regenerate.
4785
4786 * options.h (class General_options): Add --mmap-output-file and
4787 --posix-fallocate options.
4788 * output.cc: (posix_fallocate): Remove; replace with...
4789 (gold_fallocate): New function.
4790 (Output_file::map_no_anonymous): Call gold_fallocate.
4791 (Output_file::map): Check --mmap-output-file option.
4792
2a49eb69
DK
47932012-06-05 Jing Yu <jingyu@google.com>
4794
4795 * gold.h (textdomain): Add do {} to empty while(0).
4796 (bindtextdomain): Likewise.
4797
fad072ac
CC
47982012-06-04 Cary Coutant <ccoutant@google.com>
4799
4800 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4801 has_dynsym_index.
4802
8cc69fb6
ST
48032012-05-25 Sriraman Tallam <tmsriram@google.com>
4804
4805 * symtab.cc (Symbol_table::define_special_symbol):
4806 Initialize *poldsym to prevent uninitialized variable errors.
4807
1be75daa
CC
48082012-05-23 Cary Coutant <ccoutant@google.com>
4809
4810 * layout.cc (Layout::section_name_mapping): Add rules to handle
4811 exact match on .data.rel.ro.local or .data.rel.ro.
4812 (Layout::output_section_name): Check for exact matches.
4813
9b689de0
CC
48142012-05-23 Cary Coutant <ccoutant@google.com>
4815
4816 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4817 more carefully.
4818
b24fdbf5
CC
48192012-05-22 Cary Coutant <ccoutant@google.com>
4820
4821 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4822 object before exporting symbol.
4823
e550e1a2
L
48242012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4825
4826 * testsuite/tls_test.cc: Include "config.h" first.
4827 * testsuite/tls_test_c.c: Likewise.
4828
df7b86aa
NC
48292012-05-17 Daniel Richard G. <skunk@iskunk.org>
4830 Nick Clifton <nickc@redhat.com>
4831
4832 PR 14072
4833 * configure.in: Add check that sysdep.h has been included before
4834 any system header files.
4835 * configure: Regenerate.
4836 * config.in: Regenerate.
4837
1007b503
CC
48382012-05-14 Cary Coutant <ccoutant@google.com>
4839
4840 * layout.cc (Layout::make_output_section): Mark .tdata section
4841 as RELRO.
4842 * testsuite/relro_test.cc: Add a TLS variable.
4843
fd885f3a
L
48442012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4845
4846 PR gold/14091
4847 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4848 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4849 R_X86_64_64.
4850
80f5885c
CC
48512012-05-08 Cary Coutant <ccoutant@google.com>
4852
4853 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4854 (lines_only_debug_sections): Likewise.
4855
2e702c99
RM
48562012-05-02 Roland McGrath <mcgrathr@google.com>
4857
4858 * nacl.cc: New file.
4859 * nacl.h: New file.
4860 * Makefile.am (CCFILES, HFILES): Add them.
4861 * Makefile.in: Regenerate.
4862 * i386.cc (Output_data_plt_i386_nacl): New class.
4863 (Output_data_plt_i386_nacl_exec): New class.
4864 (Output_data_plt_i386_nacl_dyn): New class.
4865 (Target_i386_nacl): New class.
4866 (Target_selector_i386_nacl): New class.
4867 (target_selector_i386): Use it instead of Target_selector_i386.
4868 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4869 (Target_x86_64_nacl): New class.
4870 (Target_selector_x86_64_nacl): New class.
4871 (target_selector_x86_64, target_selector_x32): Use it instead of
4872 Target_selector_x86_64.
4873 * arm.cc (Output_data_plt_arm_nacl): New class.
4874 (Target_arm_nacl): New class.
4875 (Target_selector_arm_nacl): New class.
4876 (target_selector_arm, target_selector_armbe): Use it instead of
4877 Target_selector_arm.
4878
4879 * target-select.cc (select_target): Take new Input_file* and off_t
4880 arguments, pass them on to recognize method of selector.
4881 * object.cc (make_elf_sized_object): Update caller.
4882 * parameters.cc (parameters_force_valid_target): Likewise.
4883 * incremental.cc (make_sized_incremental_binary): Likewise.
4884 * target-select.h: Update decl.
4885 (Target_selector::recognize): Take new Input_file* argument,
4886 pass it on to do_recognize.
4887 (Target_selector::do_recognize): Take new Input_file* argument.
4888 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4889 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4890 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4891 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4892
4893 * target.h (Target::Target_info): New members isolate_execinstr
4894 and rosegment_gap.
4895 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4896 * arm.cc (Target_arm::arm_info): Update initializer.
4897 * i386.cc (Target_i386::i386_info): Likewise.
4898 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4899 * sparc.cc (Target_sparc::sparc_info): Likewise.
4900 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4901 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4902 * layout.cc (Layout::attach_allocated_section_to_segment):
4903 Take new const Target* argument. If target->isolate_execinstr(), act
4904 like --rosegment.
4905 (Layout::find_first_load_seg): Take new const Target* argument;
4906 if target->isolate_execinstr(), reject PF_X segments.
4907 (Layout::relaxation_loop_body): Update caller.
4908 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4909 reset file offset to zero when we hit LOAD_SEG, and then do a second
4910 loop over the segments before LOAD_SEG to reassign offsets after
4911 addresses have been determined. Handle target->rosegment_gap().
4912 (Layout::attach_section_to_segment): Take new const Target* argument;
4913 pass it to attach_allocated_section_to_segment.
4914 (Layout::make_output_section): Update caller.
4915 (Layout::attach_sections_to_segments): Take new const Target* argument;
4916 pass it to attach_section_to_segment.
4917 * gold.cc (queue_middle_tasks): Update caller.
4918 * layout.h (Layout): Update method decls with new arguments.
4919
4920 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4921 Target_info pointer to use.
4922 (Target_arm::do_make_data_plt): New virtual method.
4923 (Target_arm::make_data_plt): New method that calls it.
4924 (Target_arm::make_plt_entry): Use it.
4925 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4926 for the section alignment.
4927 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4928 method.
4929 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4930 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4931 method.
4932 (Output_data_plt_arm::get_plt_entry_size): Call it.
4933 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4934 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4935 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4936 method.
4937 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4938 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4939 method instead of sizeof(plt_entry).
4940 (Output_data_plt_arm::add_entry): Likewise.
4941 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4942 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4943 than static method.
4944 (Target_arm::plt_entry_size): Likewise.
4945 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4946 Move to ...
4947 (Output_data_plt_arm_standard): ... here, new class.
4948 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4949 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4950 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4951
4952 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4953 Take additional argument for the PLT entry size.
4954 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4955 Use get_plt_entry_size method rather than plt_entry_size variable.
4956 (Output_data_plt_x86_64::reserve_slot): Likewise.
4957 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4958 (Output_data_plt_x86_64::add_entry): Likewise.
4959 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4960 (Output_data_plt_x86_64::address_for_global): Likewise.
4961 (Output_data_plt_x86_64::address_for_local): Likewise.
4962 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4963 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4964 Make method non-static.
4965 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4966 method.
4967 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4968 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4969 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4970 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4971 virtual method.
4972 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4973 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4974 virtual method.
4975 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4976 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4977 virtual method.
4978 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4979 (Output_data_plt_x86_64::plt_entry_size)
4980 (Output_data_plt_x86_64::first_plt_entry)
4981 (Output_data_plt_x86_64::plt_entry)
4982 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4983 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4984 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4985 (Output_data_plt_x86_64_standard): ... here, new class.
4986 (Target_x86_64::Target_x86_64): Take optional argument for the
4987 Target_info pointer to use.
4988 (Target_x86_64::do_make_data_plt): New virtual method.
4989 (Target_x86_64::make_data_plt): New method to call it.
4990 (Target_x86_64::init_got_plt_for_update): Use that.
4991 Call this->plt_->add_eh_frame method here.
4992 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4993 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4994 rather than static method.
4995 (Target_x86_64::plt_entry_size): Likewise.
4996 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4997 rather than plt_entry_size variable. Move guts of PLT filling to...
4998 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4999 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5000 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5001
5002 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5003 additional argument for the section alignment.
5004 Don't do add_eh_frame_for_plt here.
5005 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5006 non-static. Use get_plt_entry_size method rather than plt_entry_size
5007 variable.
5008 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5009 method.
5010 (Output_data_plt_i386::get_plt_entry_size): Call it.
5011 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5012 (Output_data_plt_i386::add_eh_frame): New method to call it.
5013 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5014 method.
5015 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5016 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5017 method.
5018 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5019 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5020 method instead of plt_entry_size.
5021 (Output_data_plt_i386::plt_entry_size)
5022 (Output_data_plt_i386::plt_eh_frame_fde_size)
5023 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5024 (Output_data_plt_i386_standard): ... here, new class.
5025 (Output_data_plt_i386_exec): New class.
5026 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5027 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5028 (Output_data_plt_i386::exec_plt_entry): Move to ...
5029 (Output_data_plt_i386_exec::plt_entry): ... here.
5030 (Output_data_plt_i386_dyn): New class.
5031 (Output_data_plt_i386::first_plt_entry): Move to ...
5032 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5033 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5034 (Output_data_plt_i386_dyn::plt_entry): ... here.
5035 (Target_i386::Target_i386): Take optional argument for the Target_info
5036 pointer to use.
5037 (Target_i386::do_make_data_plt): New virtual method.
5038 (Target_i386::make_data_plt): New method to call it.
5039 (Target_i386::make_plt_section): Use that.
5040 Call this->plt_->add_eh_frame method here.
5041 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5042 rather than plt_entry_size variable.
5043 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5044 (Output_data_plt_i386::address_for_local): Likewise.
5045 (Output_data_plt_i386::do_write): Likewise.
5046 Move guts of PLT filling to...
5047 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5048 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5049 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5050 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5051
b9b9f2ee
CC
50522012-05-01 Cary Coutant <ccoutant@google.com>
5053
5054 * dwarf_reader.cc (Dwarf_die::read_attributes)
5055 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5056 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5057 * reduced_debug_output.cc
5058 (Output_reduced_debug_info_section::get_die_end): Remove
5059 DW_FORM_GNU_ref_index. Add default case.
5060
57923f48
MW
50612012-04-26 Mark Wielaard <mjw@redhat.com>
5062
5063 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5064 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5065 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5066 DW_AT_high_pc as offset from DW_AT_low_pc.
5067
5068 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5069 * testsuite/Makefile.in: Regenerate.
5070 * testsuite/gdb_index_test_3.c: New test source file.
5071 * testsuite/gdb_index_test_3.sh: New test source file.
5072
2c54b4f4
ILT
50732012-04-25 Ian Lance Taylor <iant@google.com>
5074
5075 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5076 pointer.
5077 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5078 as a class, not a struct.
5079 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5080 (Target_arm::apply_cortex_a8_workaround): Likewise.
5081 * gc.h: Declare Reloc_types as a struct, not a class.
5082 * object.h: Declare Symbols_data as a struct.
5083 * reloc.h: Declare Read_relocs_data as a struct.
5084 * target.h: Declare Relocate_info as a struct.
5085
a5a5f7a3
DM
50862012-04-24 David S. Miller <davem@davemloft.net>
5087
5088 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5089 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5090 and R_SPARC_WPLT30.
5091
f038d496
CC
50922012-04-24 Cary Coutant <ccoutant@google.com>
5093
5094 * incremental-dump.cc (find_input_containing_global): Replace
5095 magic number with symbolic constant.
5096 (dump_incremental_inputs): Update version number.
5097 * incremental.cc (Output_section_incremental_inputs): Update version
5098 number; import symbolic constants from Incremental_inputs_reader.
5099 (Incremental_inputs::create_data_sections): Align relocations
5100 section correctly for 64-bit targets.
5101 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5102 constants; add padding.
5103 (Output_section_incremental_inputs::write_header): Add assert for
5104 header_size.
5105 (Output_section_incremental_inputs::write_input_files): Add assert
5106 for input_entry_size.
5107 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5108 add assert for object_info_size, input_section_entry_size,
5109 global_sym_entry_size.
5110 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5111 for data structure sizes; use them.
5112 (Incremental_input_entry_reader): Import symbolic constants from
5113 Incremental_inputs_reader; use them.
5114
a4d85145
DM
51152012-04-23 David S. Miller <davem@davemloft.net>
5116
5117 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5118 and elf_flags_set_.
5119 (Target_sparc::Target_sparc): Initialize new fields.
5120 (Target_sparc::do_make_elf_object): New function.
5121 (Target_sparc::do_adjust_elf_header): New function.
5122
1d509098
CC
51232012-04-23 Cary Coutant <ccoutant@google.com>
5124
5125 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5126 CU range table of gdb index.
5127
7ebeff7f
DM
51282012-04-20 David S. Miller <davem@davemloft.net>
5129
5130 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5131 instead of false.
5132
13cf9988
DM
51332012-04-16 David S. Miller <davem@davemloft.net>
5134
2a1079e8
DM
5135 * sparc.cc (Target_sparc::got_address): New function.
5136 (Sparc_relocate_functions::gdop_hix22): New function.
5137 (Sparc_relocate_functions::gdop_lox10): New function.
5138 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5139 relocs.
5140 (Target_sparc::Scan::local): Likewise if the global symbol is not
5141 preemptible and is not IFUNC.
5142 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5143 transformations for local and non-preemptible non-IFUNC global
5144 symbols.
5145
0bc964fc
DM
5146 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5147 writing out 64-bit part of ranges.
5148
661d7a80
DM
5149 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5150 -fpic and -fpie respectively.
5151 * Makefile.in: Regenerate.
5152
8c2bf391
DM
5153 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5154 (Target_sparc::Target_sparc): Initialize new field.
5155 (Target_sparc::do_plt_section_for_global): New function.
5156 (Target_sparc::do_plt_section_for_local): New function.
5157 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5158 (Target_sparc::make_plt_section): New function, broken out of
5159 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5160 (Target_sparc::make_plt_entry): Call make_plt_section.
5161 (Target_sparc::make_local_ifunc_plt_entry): New function.
5162 (Target_sparc::rela_ifunc_section): New function.
5163 (Target_sparc::plt_section): Remove const.
5164 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5165 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5166 and ifunc_count_ fields.
5167 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5168 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5169 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5170 (Output_data_plt_sparc::rela_ifunc): New function.
5171 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5172 (Output_data_plt_sparc::has_ifunc_section): New function.
5173 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5174 (Output_data_plt_sparc::address_for_global): New function.
5175 (Output_data_plt_sparc::address_for_local): New function.
5176 (Output_data_plt_sparc::plt_index_to_offset): New function.
5177 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5178 and entry_count.
5179 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5180 entry_count.
5181 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5182 R_SPARC_JMP_IREL to switch.
5183 (Target_sparc::Scan::check_non_pic): Likewise.
5184 (Target_sparc::Scan::local): Handle IFUNC symbols.
5185 (Target_sparc::Scan::local): Likewise.
5186 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5187 and plt_address_for_local.
5188 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5189 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5190
13cf9988
DM
5191 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5192 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5193 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5194 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5195 global relocs too.
5196 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5197 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5198 calls.
5199 * sparc.cc (Target_sparc::Scan::global): Likewise.
5200 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5201
31821be0
CC
52022012-04-16 Cary Coutant <ccoutant@google.com>
5203
5204 * archive.cc (Library_base::should_include_member): Check for
5205 --export-dynamic-symbol.
5206 * options.h (class General_options): Add --export-dynamic-symbol.
5207 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5208 --export-dynamic-symbol.
5209 (Symbol_table::gc_mark_undef_symbols): Likewise.
5210 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5211
2615994e
DM
52122012-04-12 David S. Miller <davem@davemloft.net>
5213
5214 * sparc.cc (Reloc::wdisp10): New relocation method.
5215 (Reloc::h34): Likewise.
5216 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5217 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5218 R_SPARC_WDISP10.
5219 (Target_sparc::Scan::local): Likewise.
5220 (Target_sparc::Scan::global): Likewise.
5221 (Target_sparc::Relocate::relocate): Likewise.
5222
6782735d
CC
52232012-04-09 Cary Coutant <ccoutant@google.com>
5224
5225 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5226 low_pc == 0.
5227
8c7a0b00
ILT
52282012-04-06 Ian Lance Taylor <iant@google.com>
5229
5230 * timer.cc: #include <unistd.h>.
5231
58797674
RM
52322012-04-06 Roland McGrath <mcgrathr@google.com>
5233
5234 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5235 * config.in: Regenerate.
5236 * configure: Regenerate.
5237
44350750
NC
52382012-04-05 Nick Clifton <nickc@redhat.com>
5239
5240 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5241 (AM_LC_MESSAGES): Add.
5242 * aclocal.m4: Regenerate.
5243 * config.in: Regenerate.
5244 * configure: Regenerate.
5245
c1027032
CC
52462012-03-21 Cary Coutant <ccoutant@google.com>
5247
5248 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5249 * Makefile.in: Regenerate.
5250 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5251 (Sized_elf_reloc_mapper::symbol_section): New function.
5252 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5253 (make_elf_reloc_mapper): New function.
5254 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5255 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5256 (Dwarf_abbrev_table::do_get_abbrev): New function.
5257 (Dwarf_ranges_table::read_ranges_table): New function.
5258 (Dwarf_ranges_table::read_range_list): New function.
5259 (Dwarf_pubnames_table::read_section): New function.
5260 (Dwarf_pubnames_table::read_header): New function.
5261 (Dwarf_pubnames_table::next_name): New function.
5262 (Dwarf_die::Dwarf_die): New function.
5263 (Dwarf_die::read_attributes): New function.
5264 (Dwarf_die::skip_attributes): New function.
5265 (Dwarf_die::set_name): New function.
5266 (Dwarf_die::set_linkage_name): New function.
5267 (Dwarf_die::attribute): New function.
5268 (Dwarf_die::string_attribute): New function.
5269 (Dwarf_die::int_attribute): New function.
5270 (Dwarf_die::uint_attribute): New function.
5271 (Dwarf_die::ref_attribute): New function.
5272 (Dwarf_die::child_offset): New function.
5273 (Dwarf_die::sibling_offset): New function.
5274 (Dwarf_info_reader::check_buffer): New function.
5275 (Dwarf_info_reader::parse): New function.
5276 (Dwarf_info_reader::do_parse): New function.
5277 (Dwarf_info_reader::do_read_string_table): New function.
5278 (Dwarf_info_reader::lookup_reloc): New function.
5279 (Dwarf_info_reader::get_string): New function.
5280 (Dwarf_info_reader::visit_compilation_unit): New function.
5281 (Dwarf_info_reader::visit_type_unit): New function.
5282 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5283 Sized_elf_reloc_mapper.
5284 (Sized_dwarf_line_info::symbol_section): Remove function.
5285 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5286 (Sized_dwarf_line_info::read_line_mappings): Remove object
5287 parameter, adjust callers.
5288 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5289 * dwarf_reader.h: Include <sys/types.h>.
5290 (class Track_relocs): Remove forward declaration.
5291 (class Elf_reloc_mapper): New class.
5292 (class Sized_elf_reloc_mapper): New class.
5293 (class Dwarf_abbrev_table): New class.
5294 (class Dwarf_range_list): New class.
5295 (class Dwarf_ranges_table): New class.
5296 (class Dwarf_pubnames_table): New class.
5297 (class Dwarf_die): New class.
5298 (class Dwarf_info_reader): New class.
5299 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5300 (Sized_dwarf_line_info::symbol_section): Remove member function.
5301 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5302 base class.
5303 * gdb-index.cc: New source file.
5304 * gdb-index.h: New source file.
5305 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5306 and .debug_types sections, call Layout::add_to_gdb_index.
5307 (Sized_relobj_incr::do_section_name): Implement.
5308 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5309 return type; Implement.
5310 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5311 return type.
5312 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5313 parameter list and return type.
5314 (Sized_incr_dynobj::do_section_contents): Likewise.
5315 * layout.cc: Include gdb-index.h.
5316 (Layout::Layout): Initialize gdb_index_data_.
5317 (Layout::init_fixed_output_section): Check for .gdb_index section.
5318 (Layout::add_to_gdb_index): New function. Instantiate.
5319 * layout.h: Add forward declaration for class Gdb_index.
5320 (Layout::add_to_gdb_index): New member function.
5321 (Layout::gdb_index_data_): New data member.
5322 * main.cc: Include gdb-index.h.
5323 (main): Print statistics for gdb index.
5324 * object.cc (Object::section_contents): Move code into
5325 do_section_contents.
5326 (need_decompressed_section): Check for sections needed when building
5327 gdb index.
5328 (build_compressed_section_map): Likewise.
5329 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5330 gdb index.
5331 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5332 sections; call Layout::add_to_gdb_index.
5333 (Sized_relobj_file::do_decompressed_section_contents): Call
5334 do_section_contents directly.
5335 * object.h (Object::do_section_contents): Adjust parameter list and
5336 return type.
5337 (Object::do_decompressed_section_contents): Call do_section_contents
5338 directly.
5339 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5340 return type.
5341 * options.h (class General_options): Add --gdb-index option.
5342 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5343 list and return type.
5344 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5345 * reloc.h (Track_relocs::checkpoint): New function.
5346 (Track_relocs::reset): New function.
5347
5348 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5349 New test cases.
5350 * testsuite/Makefile.in: Regenerate.
5351 * testsuite/gdb_index_test.cc: New test source file.
5352 * testsuite/gdb_index_test_1.sh: New test source file.
5353 * testsuite/gdb_index_test_2.sh: New test source file.
5354
647f1574
DK
53552012-03-19 Doug Kwan <dougkwan@google.com>
5356
5357 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5358 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5359 __exidx_start and __exidx_end. Make symbol table parameter
5360 anonymous as it is not used.
5361 * gold.cc (queue_middle_tasks): Call target hook to define any
5362 target-specific symbols.
5363 * target.h (Target::define_standard_symbols): New method.
5364 (Target::do_define_standard_symbols): Same.
5365 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5366 * testsuite/Makefile.in: Regenerate.
5367 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5368 and __exidx_end.
5369 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5370 relocations are generated for __exidx_start and __exidx_end.
5371
7c6109da
DK
53722012-03-16 Doug Kwan <dougkwan@google.com>
5373
5374 * testsuite/Makefile.am: Disable test initpri3b.
5375 * testsuite/Makefile.in: Regenerate.
5376
7b8957f8
DK
53772012-03-15 Doug Kwan <dougkwan@google.com>
5378
5379 * arm.cc (Target_arm::got_section): Make .got section read-only
5380 if -z now is given.
5381
14dc9ef7
ILT
53822012-03-15 Ian Lance Taylor <iant@google.com>
5383
5384 PR gold/13850
5385 * layout.cc (Layout::make_output_section): Correctly mark
5386 SHT_INIT_ARRAY, et. al., as relro.
5387
fa40b62a
DK
53882012-03-14 Doug Kwan <dougkwan@google.com>
5389
5390 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5391 dynamic relocations for protected symbols in shared objects.
5392
fd325007
ILT
53932012-03-13 Ian Lance Taylor <iant@google.com>
5394
5395 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5396 keep the larger alignment.
5397
e8dd54e1
CC
53982012-03-12 Cary Coutant <ccoutant@google.com>
5399
5400 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5401 handling of DW_LNE_define_file.
5402
feb5f3b0
CC
54032012-03-12 Cary Coutant <ccoutant@google.com>
5404
5405 * reduced_debug_output.cc
5406 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5407 codes to switch.
5408
a1fb4256
CC
54092012-02-29 Cary Coutant <ccoutant@google.com>
5410
5411 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5412
5dd8762a
CC
54132012-02-29 Cary Coutant <ccoutant@google.com>
5414
5415 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5416 Call Object::decompressed_section_contents.
5417 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5418 New dtor.
5419 (Sized_dwarf_line_info::buffer_start_): New data member.
5420 * merge.cc (Output_merge_data::do_add_input_section): Call
5421 Object::decompressed_section_contents.
5422 (Output_merge_string::do_add_input_section): Likewise.
5423 * object.cc (need_decompressed_section): New function.
5424 (build_compressed_section_map): Decompress sections needed later.
5425 (Sized_relobj_file::do_decompressed_section_contents): New function.
5426 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5427 * object.h (Object::decompressed_section_contents): New function.
5428 (Object::discard_decompressed_sections): New function.
5429 (Object::do_decompressed_section_contents): New function.
5430 (Object::do_discard_decompressed_sections): New function.
5431 (Compressed_section_info): New type.
5432 (Compressed_section_map): Include decompressed section contents.
5433 (Sized_relobj_file::do_decompressed_section_contents): New function.
5434 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5435
7b5de7ee
CC
54362012-02-16 Cary Coutant <ccoutant@google.com>
5437
5438 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5439 * testsuite/Makefile.in: Regenerate.
5440
f9fa4a63
CC
54412012-02-14 Cary Coutant <ccoutant@google.com>
5442
5443 * options.cc (General_options::finalize): Disallow -pie and -static.
5444
2c175ebc
DK
54452012-02-03 Doug Kwan <dougkwan@google.com>
5446
5447 * arm.cc (Arm_relocate_functions::abs8,
5448 Arm_relocate_functions::abs16): Use
5449 Bits::has_signed_unsigned_overflow32.
5450 (Arm_relocate_functions::thm_abs8): Correct range of
5451 overflow check.
5452 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5453 in assertions.
5454
90cff06f
DK
54552012-02-02 Doug Kwan <dougkwan@google.com>
5456
5457 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5458 position independent outputs, not just shared objects.
5459
63887f3d
L
54602012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5461
5462 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5463 * configure: Regenerated.
5464
bef2b434
ILT
54652012-01-27 Ian Lance Taylor <iant@google.com>
5466
5467 * reloc.h (Bits): New class with static functions, copied from
5468 namespace utils in arm.cc.
5469 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5470 instead.
5471
c335b55d
L
54722012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5473
5474 * incremental.cc (write_info_blocks): Correct relocation offset.
5475
41194d9f
L
54762012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5477
5478 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5479 (Relocate::tls_gd_to_le): Likewise.
5480
1bae613c
L
54812012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5482
5483 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5484
24482ca0
L
54852012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5486
5487 * configure.ac: Check if -mcmodel=medium works.
5488 * configure: Regenerated.
5489
c2c7840a
CC
54902012-01-24 Cary Coutant <ccoutant@google.com>
5491
5492 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5493 definition and ...
5494 (read_unsigned_LEB_128_x): ... this new function.
5495 (read_signed_LEB_128): Replaced with inline definition and ...
5496 (read_signed_LEB_128_x): ... this new function.
5497 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5498 (read_unsigned_LEB_128): Add inline definition.
5499 (read_signed_LEB_128_x): New function.
5500 (read_signed_LEB_128): Add inline definition.
5501 * testsuite/Makefile.am (leb128_unittest): New unit test.
5502 * testsuite/Makefile.in: Regenerate.
5503 * testsuite/leb128_unittest.cc: New unit test.
5504
833de760 55052012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5506
5507 PR gold/13617
5508 * i386.cc (Target_i386::do_code_fill): When using a jmp
5509 instruction, pad with nop instructions.
5510 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5511
618d6666
L
55122012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5513
5514 * x86_64.cc (gc_process_relocs): Add typename on types used in
5515 template.
5516 (scan_relocs): Likewise.
5517 (relocate_section): Likewise.
5518 (apply_relocation): Likewise.
5519
3660ff06
L
55202012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5521
5522 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5523 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5524 under x32.
5525
fc51264f
L
55262012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5527
5528 * x86_64.cc: Initial support for x32.
5529
dd74ae06
CC
55302012-01-03 Cary Coutant <ccoutant@google.com>
5531
5532 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5533 Use abstract base class for GOT.
5534 * gold/output.h (class Output_data_got_base): New abstract base class.
5535 (class Output_data_got): Derive from new base class, adjust ctors.
5536 (Output_data_got::reserve_slot): Make virtual; rename to
5537 do_reserve_slot; Adjust callers.
5538 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5539 pointer to abstract base class.
5540 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5541
83896202
ILT
55422011-12-18 Ian Lance Taylor <iant@google.com>
5543
5544 * object.h (Relobj::local_symbol_value): New function.
5545 (Relobj::local_plt_offset): New function.
5546 (Relobj::local_has_got_offset): New function.
5547 (Relobj::local_got_offset): New function.
5548 (Relobj::set_local_got_offset): New function.
5549 (Relobj::do_local_symbol_value): New pure virtual function.
5550 (Relobj::do_local_plt_offset): Likewise.
5551 (Relobj::do_local_has_got_offset): Likewise.
5552 (Relobj::do_local_got_offset): Likewise.
5553 (Relobj::do_set_local_got_offset): Likewise.
5554 (Sized_relobj::do_local_has_got_offset): Rename from
5555 local_has_got_offset.
5556 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5557 (Sized_relobj::do_set_local_got_offset): Rename from
5558 set_local_got_offset.
5559 (Sized_relobj_file::do_local_plt_offset): Rename from
5560 local_plt_offset.
5561 (Sized_relobj_file::do_local_symbol_value): New function.
5562 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5563 local_plt_offset.
5564 * output.cc (Output_data_got::Got_entry::write): Change object to
5565 Relobj. Use local_symbol_value.
5566 (Output_data_got::add_global_with_rel): Change rel_dyn to
5567 Output_data_reloc_generic*. Use add_global_generic.
5568 (Output_data_got::add_global_with_rela): Remove. Change all
5569 callers to use add_global_with_rel.
5570 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5571 Output_data_reloc_generic*. Use add_global_generic.
5572 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5573 callers to use add_global_pair_with_rel.
5574 (Output_data_got::add_local): Change object to Relobj*.
5575 (Output_data_got::add_local_plt): Likewise.
5576 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5577 change rel_dyn to Output_data_reloc_generic*. Use
5578 add_local_generic.
5579 (Output_data_got::add_local_with_rela): Remove. Change all
5580 callers to use all_local_with_rel.
5581 (Output_data_got::add_local_pair_with_rel): Change object to
5582 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5583 add_output_section_generic.
5584 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5585 callers to use add_local_pair_with_rel.
5586 (Output_data_got::reserve_local): Change object to Relobj*.
5587 * output.h: (class Output_data_reloc_generic): Add pure virtual
5588 declarations for add_global_generic, add_local_generic,
5589 add_output_section_generic.
5590 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5591 functions for Output_data_reloc_generic. Update declarations for
5592 changes listed in output.cc.
5593 (class Output_data_got): Change template parameter to got_size.
5594 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5595 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5596 function.
5597 (Sized_relobj_incr::do_local_plt_offset): New function.
5598 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5599 add_global_generic.
5600
76677ad0
CC
56012011-12-17 Cary Coutant <ccoutant@google.com>
5602
5603 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5604 * resolve.cc (Symbol_table::resolve): Likewise.
5605 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5606 arrays.
5607 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5608
8b8dd8d5
ILT
56092011-12-16 Ian Lance Taylor <iant@google.com>
5610
5611 * output.h (Output_data_reloc_generic::add): Only call
5612 add_dynamic_reloc if this is a dynamic reloc section.
5613
d55525b9
L
56142011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5615
5616 PR gold/13505
5617 * target-reloc.h (apply_relocation): Replace <64, false> with
5618 <size, big_endian>.
5619
ff81c7c1
NC
56202011-11-25 Nick Clifton <nickc@redhat.com>
5621
5622 * po/it.po: New Italian translation.
5623
628f39be
SA
56242011-11-17 Sterling Augustine <saugustine@google.com>
5625
5626 * script.cc (script_include_directive): Implement.
5627 (read_script_file): New local variables name and search_path. Update
5628 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5629 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5630 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5631
98ef3ea4
SA
56322011-11-11 Sterling Augustine <saugustine@google.com>
5633
5634 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5635 (file_or_sections_cmd): Likewise.
5636
f4a8b6d7
DK
56372011-11-11 Doug Kwan <dougkwan@google.com>
5638
5639 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5640 if --just-symbols is given.
5641
29ab395d
DK
56422011-11-10 Doug Kwan <dougkwan@google.com>
5643
5644 PR gold/13362
5645 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5646 when processing data relocs.
5647 * reloc.h (Relocate_functions::rel_unaligned): New method.
5648 (Relocate_functions::pcrel_unaligned): Ditto.
5649 (Relocate_functions::rel32_unaligned): Ditto.
5650 (Relocate_functions::pcrel32_unaligned): Ditto.
5651
2c339f71
DK
56522011-11-09 Doug Kwan <dougkwan@google.com>
5653
5654 PR gold/13362
5655 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5656 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5657 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5658 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5659 (Relocate_functions::rel_unaligned): New.
5660 (Relocate_functions::rel32_unaligned): New.
5661 * target-reloc.h (relocate_for_relocatable): Add code to handle
5662 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5663 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5664 arm_unaligned_reloc_r): New targets.
5665 * testsuite/Makefile.in: Regenerate.
5666 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5667 linking.
5668
3f3cddf1
ILT
56692011-11-02 Ian Lance Taylor <iant@google.com>
5670
5671 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5672 NATIVE_LINKER.
5673 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5674 * options.cc (General_options::finalize): Use library search path
5675 from configure script if specified. If not native and no sysroot,
5676 only search TOOLLIBDIR.
5677 * options.h (Search_directory::Search_directory): Change name to
5678 const std::string&.
5679 (General_options::add_to_library_path_with_sysroot): Change arg to
5680 const std::string&.
5681 * configure, Makefile.in, config.in: Rebuild.
5682
a8e2273b
ILT
56832011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5684
5685 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5686 we are working around the ARM1176 Erratum.
5687 * options.h (General_options::fix_arm1176): Add option.
5688 * testsuite/Makefile.am: Add testcases, and keep current ones
5689 working.
5690 * testsuite/Makefile.in: Regenerate.
5691 * testsuite/arm_fix_1176.s: New file.
5692 * testsuite/arm_fix_1176.sh: Likewise.
5693
cd6eab1c
ILT
56942011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5695
5696 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5697 may_use_blx_.
5698 (Target_arm::may_use_blx): Remove method.
5699 (Target_arm::set_may_use_blx): Likewise.
5700 (Target_arm::may_use_v4t_interworking): New method.
5701 (Target_arm::may_use_v5t_interworking): Likewise.
5702 (Target_arm::may_use_blx_): Remove member variable.
5703 (Arm_relocate_functions::arm_branch_common): Check for v5T
5704 interworking.
5705 (Arm_relocate_functions::thumb_branch_common): Likewise.
5706 (Reloc_stub::stub_type_for_reloc): Likewise.
5707 (Target_arm::do_finalize_sections): Correct interworking checks.
5708 * testsuite/Makefile.am: Add new tests.
5709 * testsuite/Makefile.in: Regenerate.
5710 * testsuite/arm_farcall_arm_arm.s: New test.
5711 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5712 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5713 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5714 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5715 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5716 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5717 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5718
286adcf4
CC
57192011-10-31 Cary Coutant <ccoutant@google.com>
5720
5721 PR gold/13023
5722 * expression.cc (Expression::eval_with_dot): Add
5723 is_section_dot_assignment parameter.
5724 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5725 absolute and assigning to dot within a section.
5726 * script-sections.cc
5727 (Output_section_element_assignment::set_section_addresses): Pass
5728 dot_section to set_if_absolute.
5729 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5730 as is_section_dot_assignment flag to eval_with_dot.
5731 (Output_section_element_dot_assignment::set_section_addresses):
5732 Likewise.
5733 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5734 parameter. Also set value if relative to dot_section; set the
5735 symbol's output_section.
5736 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5737 parameter. Adjust all callers.
5738 (Expression::eval_maybe_dot): Likewise.
5739 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5740 Adjust all callers.
5741 * testsuite/script_test_2.t: Test assignment of an absolute value
5742 to dot within an output section element.
5743
9634ed06
CC
57442011-10-31 Cary Coutant <ccoutant@google.com>
5745
5746 * options.h (class General_options): Add --[no-]gnu-unique options.
5747 * symtab.cc (Symbol_table::sized_write_globals): Convert
5748 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5749
de4101c7
CC
57502011-10-31 Cary Coutant <ccoutant@google.com>
5751
5752 PR gold/13359
5753 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5754 unnecessary assertion.
5755 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5756
7257cc92
ST
57572011-10-31 Sriraman Tallam <tmsriram@google.com>
5758
5759 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5760 gc_mark_symbol.
5761 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5762 gc_mark_symbol.
5763 Change to just keep the section associated with symbol.
5764 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5765 they are externally visible and --export-dynamic is turned on.
5766 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5767
bfc34b3f
ILT
57682011-10-19 Ian Lance Taylor <iant@google.com>
5769
5770 PR gold/13163
5771 * script-sections.cc
5772 (Output_section_element_dot_assignment::needs_output_section): New
5773 function.
5774
ea0d8c47
ILT
57752011-10-19 Ian Lance Taylor <iant@google.com>
5776
5777 PR gold/13204
5778 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5779 --section-start option was seen.
5780 * options.h (General_options::any_section_start): New function.
5781
abd242a9
DM
57822011-10-18 David S. Miller <davem@davemloft.net>
5783
5784 PR binutils/13301
5785 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5786 member to track relocation locations that have moved during TLS
5787 reloc optimizations.
5788 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5789 (Target_sparc::Relocate::relocate): Adjust view down by 4
5790 bytes if it matches reloc_adjust_addr_.
5791 (Target_sparc::Relocate::relocate_tls): Always move the
5792 __tls_get_addr call delay slot instruction forward 4 bytes when
5793 performing relaxation.
5794
bab9090f
CC
57952011-10-18 Cary Coutant <ccoutant@google.com>
5796
5797 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5798 (Output_file::map_no_anonymous): Check for non-zero
5799 return code from posix_fallocate.
5800
f7c5b166
CC
58012011-10-17 Cary Coutant <ccoutant@google.com>
5802
5803 PR gold/13245
5804 * plugin.cc (is_visible_from_outside): Check for symbols
5805 referenced from dynamic objects.
5806 * resolve.cc (Symbol_table::resolve): Don't count references
5807 from dynamic objects as references from real ELF files.
5808 * testsuite/plugin_test_2.sh: Adjust expected result.
5809
b490c0bb
CC
58102011-10-17 Cary Coutant <ccoutant@google.com>
5811
5812 * gold.cc: Include timer.h.
5813 (queue_middle_tasks): Stamp time.
5814 (queue_final_tasks): Likewise.
5815 * main.cc (main): Store timer in parameters. Print timers
5816 for each pass.
5817 * parameters.cc (Parameters::Parameters): Initialize timer_.
5818 (Parameters::set_timer): New function.
5819 (set_parameters_timer): New function.
5820 * parameters.h (Parameters::set_timer): New function.
5821 (Parameters::timer): New function.
5822 (Parameters::timer_): New data member.
5823 (set_parameters_timer): New function.
5824 * timer.cc (Timer::stamp): New function.
5825 (Timer::get_pass_time): New function.
5826 * timer.h (Timer::stamp): New function.
5827 (Timer::get_pass_time): New function.
5828 (Timer::pass_times_): New data member.
5829
f475cf7b
CC
58302011-10-17 Cary Coutant <ccoutant@google.com>
5831
5832 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5833 task for members of lib groups.
5834
cdd7e244
CC
58352011-10-17 Cary Coutant <ccoutant@google.com>
5836
5837 PR gold/13288
4f95c8b4 5838 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5839 (File_read::make_view): Move bounds check (replace with assert)...
5840 (File_read::find_or_make_view): ... to here.
5841
dfb45471
CC
58422011-10-12 Cary Coutant <ccoutant@google.com>
5843
4f95c8b4 5844 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5845 ::read returns less than requested size.
5846
53bbcc1b
CC
58472011-10-10 Cary Coutant <ccoutant@google.com>
5848
4f95c8b4 5849 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5850 Initialize defined_count_.
5851 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5852 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5853 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5854 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5855 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5856 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5857 member.
5858 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5859 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5860 Return zeroes instead of internal error.
5861
397b129b
CC
58622011-10-10 Cary Coutant <ccoutant@google.com>
5863
5864 PR gold/13249
4f95c8b4 5865 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5866 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5867 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5868 (Output_reloc::type_): Adjust size of bit field.
5869 (Output_reloc::use_plt_offset_): New bit field.
5870 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5871 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5872 flag. Adjust all callers.
4f95c8b4 5873 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5874 creating RELATIVE relocations.
5875
d5698657
NC
58762011-10-10 Nick Clifton <nickc@redhat.com>
5877
5878 * po/es.po: Updated Spanish translation.
5879 * po/fi.po: Updated Finnish translation.
5880
6a59a5c2
DN
58812011-10-03 Diego Novillo <dnovillo@google.com>
5882
5883 * options.cc (parse_uint): Fix dereference of RETVAL.
5884
f0558624
ST
58852011-09-29 Sriraman Tallam <tmsriram@google.com>
5886
5887 * layout.h (section_order_map_): New member.
5888 (get_section_order_map): New member function.
5889 * output.cc (Output_section::add_input_section): Check for patterns
5890 only when --section-ordering-file is specified.
5891 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5892 output_sections have been formed.
5893 * layout.cc (Layout_Layout): Initialize section_order_map_.
5894 * plugin.cc (update_section_order): Store order in order_map. Do not
5895 update the order.
5896 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5897 * testsuite/Makefile.in: Regenerate.
5898 * testsuite/plugin_section_order.c: New file.
5899 * testsuite/plugin_final_layout.cc: New file.
5900 * testsuite/plugin_final_layout.sh: New file.
5901
a7dac153
CC
59022011-09-29 Cary Coutant <ccoutant@google.com>
5903
4f95c8b4 5904 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5905 Check for NULL.
4f95c8b4 5906 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5907 symbols during incremental update.
5908 (Symbol_table::add_from_dynobj): Likewise.
5909
eebd87a5
ILT
59102011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5911 Ian Lance Taylor <iant@google.com>
5912
5913 * symtab.cc (Symbol_table::define_special_symbol): Always
5914 canonicalize version string.
5915
403a3331
CC
59162011-09-26 Cary Coutant <ccoutant@google.com>
5917
4f95c8b4
CC
5918 * gold.cc (queue_initial_tasks): Move option checks ...
5919 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5920 some options; make others fatal.
5921
235061c2
CC
59222011-09-26 Cary Coutant <ccoutant@google.com>
5923
5924 gcc PR lto/47247
5925 * plugin.cc (get_symbols_v2): New function.
5926 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5927 (is_referenced_from_outside): New function.
5928 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5929 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5930 (get_symbols): Pass version parameter.
5931 (get_symbols_v2): New function.
5932 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5933 parameter.
5934 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5935 (onload): Add LDPT_GET_SYMBOLS_V2.
5936 (all_symbols_read_hook): Use get_symbols_v2; check for
5937 LDPR_PREVAILING_DEF_IRONLY_EXP.
5938 * testsuite/plugin_test_3.sh: Update expected results.
5939
dc87f620
ILT
59402011-09-23 Simon Baldwin <simonb@google.com>
5941
5942 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5943 configuration options.
5944 * configure: Regenerate.
5945 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5946 * Makefile.in: Regenerate.
5947 * testsuite/Makefile.in: Regenerate.
5948
a8279f82
ST
59492011-09-19 Sriraman Tallam <tmsriram@google.com>
5950
5951 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5952
0c9350c8
CC
59532011-09-19 Cary Coutant <ccoutant@google.com>
5954
5955 * incremental.cc (can_incremental_update): Fix typo in comment.
5956 * incremental.h (can_incremental_update): Likewise.
5957
aa06ae28
CC
59582011-09-18 Cary Coutant <ccoutant@google.com>
5959
5960 * incremental.cc (can_incremental_update): New function.
5961 * incremental.h (can_incremental_update): New function.
5962 * layout.cc (Layout::init_fixed_output_section): Call it.
5963 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5964 * object.cc (Sized_relobj_file::do_layout): Call
5965 can_incremental_update.
5966
ebb300b2
CC
59672011-09-13 Cary Coutant <ccoutant@google.com>
5968
5969 * configure.ac: Check for glibc support for gnu_indirect_function
5970 support with static linking, setting automake conditional
5971 IFUNC_STATIC.
5972 * Makefile.in: Regenerate.
5973 * configure: Regenerate.
5974
5975 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5976 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5977 for IFUNC_STATIC.
5978 * testsuite/Makefile.in: Regenerate.
5979
1206d0d5
CC
59802011-09-13 Cary Coutant <ccoutant@google.com>
5981
5982 * incremental.cc (Sized_relobj_incr::do_layout): Call
5983 report_comdat_group for kept comdat sections.
5984 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5985 * testsuite/Makefile.in: Regenerate.
5986 * testsuite/incr_comdat_test_1.cc: New source file.
5987 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5988 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5989 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5990
40b29874
ILT
59912011-09-13 Ian Lance Taylor <iant@google.com>
5992
5993 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5994 variable external_symbols_offset.
5995
1b045aac
ILT
59962011-09-12 Ian Lance Taylor <iant@google.com>
5997
5998 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5999 triggered if object has no symbols.
6000
24c6c55a
DM
60012011-09-09 David S. Miller <davem@davemloft.net>
6002
6003 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6004 (Output_fill_debug_line::do_write): Likewise.
6005
66570254
CC
60062011-08-29 Cary Coutant <ccoutant@google.com>
6007
6008 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6009 casts to match formatting specs.
6010 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6011
8ea8cd50
CC
60122011-08-26 Cary Coutant <ccoutant@google.com>
6013
6014 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6015 remaining hole size when allocating.
6016 (Layout::make_output_section): Set fill methods for debug sections.
6017 * layout.h (Free_list::Free_list_node): Move from private to
6018 public.
6019 (Free_list::set_min_hole_size): New function.
6020 (Free_list::begin, Free_list::end): New functions.
6021 (Free_list::min_hole_): New data member.
6022 * output.cc: Include dwarf.h.
6023 (Output_fill_debug_info::do_minimum_hole_size): New function.
6024 (Output_fill_debug_info::do_write): New function.
6025 (Output_fill_debug_line::do_minimum_hole_size): New function.
6026 (Output_fill_debug_line::do_write): New function.
6027 (Output_section::Output_section): Initialize new data member.
6028 (Output_section::set_final_data_size): Ensure patch space is larger
6029 than minimum hole size.
6030 (Output_section::do_write): Fill holes in debug sections.
6031 * output.h (Output_fill): New class.
6032 (Output_fill_debug_info): New class.
6033 (Output_fill_debug_line): New class.
6034 (Output_section::set_free_space_fill): New function.
6035 (Output_section::free_space_fill_): New data member.
6036 * testsuite/Makefile.am (incremental_test_3): Add
6037 --incremental-patch option.
6038 (incremental_test_4): Likewise.
6039 (incremental_test_5): Likewise.
6040 (incremental_test_6): Likewise.
6041 (incremental_copy_test): Likewise.
6042 (incremental_common_test_1): Likewise.
6043 * testsuite/Makefile.in: Regenerate.
6044
7cf80422
NC
60452011-08-26 Nick Clifton <nickc@redhat.com>
6046
6047 * po/es.po: Updated Spanish translation.
6048
c3f7b0e5
CC
60492011-08-01 Cary Coutant <ccoutant@google.com>
6050
6051 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6052 * gold/testsuite/Makefile.in: Regenerate.
6053 * gold/testsuite/justsyms_exec.c: New source file.
6054 * gold/testsuite/justsyms_lib.c: New source file.
6055
9590bf25
CC
60562011-08-01 Cary Coutant <ccoutant@google.com>
6057
6058 * layout.cc (Layout::set_segment_offsets): Don't realign text
6059 segment if -Ttext was specified.
6060 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6061 file type.
6062 * object.h (Sized_relobj_file::e_type): New function.
6063 (Sized_relobj_file::e_type_): New data member.
6064 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6065 base address for ET_EXEC files.
6066 * target.cc (Target::do_make_elf_object_implementation): Allow
6067 ET_EXEC files with --just-symbols option.
6068
dcd8d12e
CC
60692011-07-28 Cary Coutant <ccoutant@google.com>
6070
6071 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6072 Add thread_number parameter.
6073 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6074 * workqueue-threads.cc
6075 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6076 current thread if its thread number is greater than desired thread
6077 count.
6078 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6079 Add thread_number parameter.
6080 (Workqueue::should_cancel_thread): Likewise.
6081 (Workqueue::find_runnable_or_wait): Pass thread_number to
6082 should_cancel_thread.
6083 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6084 parameter.
6085
804eb480
ST
60862011-07-22 Sriraman Tallam <tmsriram@google.com>
6087
6088 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6089 only after checking if it cannot be forced local.
6090 * symtab.h (is_externally_visible): Check if the symbol is not forced
6091 local.
6092
f1ddb600
ILT
60932011-07-15 Ian Lance Taylor <iant@google.com>
6094
6095 * options.h (class General_options): Add --print-output-format.
6096 Move -EL next to -EB, for better --help output.
6097 * target-select.cc: Include <cstdio>, "options.h", and
6098 "parameters.h".
6099 (Target_selector::do_target_bfd_name): New function.
6100 (print_output_format): New function.
6101 * target-select.h (class Target_selector): Update declarations.
6102 (Target_selector::target_bfd_name): New function.
6103 (print_output_format): Declare.
6104 * main.cc: Include "target-select.h".
6105 (main): Handle --print-output-format.
6106 * gold.cc: Include "target-select.h".
6107 (queue_initial_tasks): Handle --print-output-format when there are
6108 no input files.
6109 * parameters.cc (parameters_force_valid_target): Give a better
6110 error message if -EB/-EL does not match target.
6111 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6112 function.
6113
7d172687
ILT
61142011-07-15 Ian Lance Taylor <iant@google.com>
6115
6116 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6117 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6118 (Output_data_plt_i386::do_write): Write address of .dynamic
6119 section to first entry in .got.plt section.
6120 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6121 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6122 Initialize layout_.
6123 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6124 section to first entry in .got.plt section.
6125 * layout.h (Layout::dynamic_section): New function.
6126
e9552f7e
ST
61272011-07-13 Sriraman Tallam <tmsriram@google.com>
6128
6129 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6130 to claim_file call.
6131 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6132 input_section_position_, and input_section_glob_.
6133 (read_layout_from_file): Call function section_ordering_specified.
6134 * layout.h (is_section_ordering_specified): New function.
6135 (section_ordering_specified): New function.
6136 (section_ordering_specified_): New boolean member.
6137 * main.cc(main): Call load_plugins after layout object is defined.
6138 * output.cc (Output_section::add_input_section): Use
6139 function section_ordering_specified to check if section ordering is
6140 needed.
6141 * output.cc (Output_section::add_relaxed_input_section): Use
6142 function section_ordering_specified to check if section ordering is
6143 needed.
6144 (Output_section::update_section_layout): New function.
6145 (Output_section::sort_attached_input_sections): Check if input section
6146 must be reordered.
6147 * output.h (Output_section::update_section_layout): New function.
6148 * plugin.cc (get_section_count): New function.
6149 (get_section_type): New function.
6150 (get_section_name): New function.
6151 (get_section_contents): New function.
6152 (update_section_order): New function.
58797674 6153 (allow_section_ordering): New function.
e9552f7e
ST
6154 (Plugin::load): Add the new interfaces to the transfer vector.
6155 (Plugin_manager::load_plugins): New parameter.
6156 (Plugin_manager::all_symbols_read): New parameter.
6157 (Plugin_manager::claim_file): New parameter. Save the elf object for
6158 unclaimed objects.
6159 (Plugin_manager::get_elf_object): New function.
6160 (Plugin_manager::get_view): Change to directly use the bool to check
6161 if get_view is called from claim_file_hook.
6162 * plugin.h (input_objects): New function
6163 (Plugin__manager::load_plugins): New parameter.
6164 (Plugin_manager::claim_file): New parameter.
6165 (Plugin_manager::get_elf_object): New function.
6166 (Plugin_manager::in_claim_file_handler): New function.
6167 (Plugin_manager::in_claim_file_handler_): New member.
6168 (layout): New function.
6169 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6170 handler with an extra parameter. Make the elf object before calling
6171 claim_file handler.
6172 * testsuite/plugin_test.c (get_section_count): New function pointer.
6173 (get_section_type): New function pointer.
6174 (get_section_name): New function pointer.
6175 (get_section_contents): New function pointer.
6176 (update_section_order): New function pointer.
6177 (allow_section_ordering): New function pointer.
6178 (onload): Check if the new interfaces exist.
6179
9446efde
ILT
61802011-07-13 Ian Lance Taylor <iant@google.com>
6181
6182 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6183 relro section.
6184 * x86_64.cc (Target_x86_64::got_section): Likewise.
6185 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6186 (relro_now_test_SOURCES): New variable.
6187 (relro_now_test_DEPENDENCIES): New variable.
6188 (relro_now_test_LDFLAGS): New variable.
6189 (relro_now_test_LDADD): New variable.
6190 (relro_now_test.so): New target.
6191 * testsuite/Makefile.in: Rebuild.
6192
07aa62f2
ILT
61932011-07-12 Ian Lance Taylor <iant@google.com>
6194
6195 PR gold/12980
6196 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6197 GLOB_DAT relocation rather than a RELATIVE relocation for a
6198 protected symbol when creating a shared library.
6199 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6200 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6201 * testsuite/protected_main_1.cc (main): Test that protected
6202 function has same address.
6203
e2153196
ILT
62042011-07-11 Ian Lance Taylor <iant@google.com>
6205
6206 PR gold/12979
6207 * options.h (class General_options): Add -Bgroup.
6208 * options.cc (General_options::finalize): If -Bgroup is set,
6209 default to --unresolved-symbols=report-all.
6210 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6211 * target-reloc.h (issue_undefined_symbol_error): Handle
6212 --unresolved-symbols=report-all.
6213
6daf5215
ILT
62142011-07-08 Ian Lance Taylor <iant@google.com>
6215
6216 PR gold/11985
6217 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6218 if linker script discards key sections.
6219 (Layout::create_dynamic_symtab): Likewise.
6220 (Layout::assign_local_dynsym_offsets): Likewise.
6221 (Layout::sized_create_version_sections): Likewise.
6222 (Layout::create_interp): Likewise.
6223 (Layout::finish_dynamic_section): Likewise.
6224 (Layout::set_dynamic_symbol_size): Likewise.
6225
beabb2c6
ILT
62262011-07-08 Ian Lance Taylor <iant@google.com>
6227
6228 PR gold/12386
6229 * options.h (class General_options): Add --unresolved-symbols.
6230 * target-reloc.h (issue_undefined_symbol_error): Check
6231 --unresolved-symbols. Add comments.
6232
9c16daf1
ILT
62332011-07-08 Ian Lance Taylor <iant@google.com>
6234
6235 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6236 expression more complex.
6237
191f1a2d
ILT
62382011-07-08 Ian Lance Taylor <iant@google.com>
6239
6240 PR gold/11317
6241 * target-reloc.h (issue_undefined_symbol_error): New inline
6242 function, broken out of relocate_section.
6243 (relocate_section): Call issue_undefined_symbol_error.
6244 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6245 there is no TLS segment if we are about to issue an undefined
6246 symbol error.
6247 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6248
62855347
ILT
62492011-07-08 Ian Lance Taylor <iant@google.com>
6250
6251 PR gold/12279
6252 * resolve.cc (Symbol_table::should_override): Add fromtype
6253 parameter. Change all callers. Give error when linking together
6254 TLS and non-TLS symbol.
6255 (Symbol_table::should_override_with_special): Add fromtype
6256 parameter. Change all callers.
6257 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6258 there is no TLS segment if we have reported some errors.
6259 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6260
67181c72
ILT
62612011-07-08 Ian Lance Taylor <iant@google.com>
6262
6263 PR gold/12372
6264 * target.h (Target::plt_address_for_global): New function.
6265 (Target::plt_address_for_local): New function.
6266 (Target::plt_section_for_global): Remove.
6267 (Target::plt_section_for_local): Remove.
6268 (Target::do_plt_address_for_global): New virtual function.
6269 (Target::do_plt_address_for_local): New virtual function.
6270 (Target::do_plt_section_for_global): Remove.
6271 (Target::do_plt_section_for_local): Remove.
6272 (Target::register_global_plt_entry): Add Symbol_table and Layout
6273 parameters.
6274 * output.cc (Output_data_got::Got_entry::write): Use
6275 plt_address_for_global and plt_address_for_local.
6276 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6277 address of output section.
6278 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6279 got_irelative_, and irelative_count_ fields. Update
6280 declarations.
6281 (Output_data_plt_i386::has_irelative_section): New function.
6282 (Output_data_plt_i386::entry_count): Add irelative_count_.
6283 (Output_data_plt_i386::set_final_data_size): Likewise.
6284 (class Target_i386): Add got_irelative_ and rel_irelative_
6285 fields. Update declarations.
6286 (Target_i386::Target_i386): Initialize new fields.
6287 (Target_i386::do_plt_address_for_global): New function replacing
6288 do_plt_section_for_global.
6289 (Target_i386::do_plt_address_for_local): New function replacing
6290 do_plt_section_for_local.
6291 (Target_i386::got_section): Create got_irelative_.
6292 (Target_i386::rel_irelative_section): New function.
6293 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6294 fields. Don't define __rel_iplt_{start,end}.
6295 (Output_data_plt_i386::add_entry): Add symtab and layout
6296 parameters. Change all callers. Use different PLT and GOT for
6297 IFUNC symbols.
6298 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6299 layout parameters. Change all callers. Use different PLT and
6300 GOT.
6301 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6302 (Output_data_plt_i386::rel_irelative): New function.
6303 (Output_data_plt_i386::address_for_global): New function.
6304 (Output_data_plt_i386::address_for_local): New function.
6305 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6306 IRELATIVE GOT when changing IFUNC GOT entries.
6307 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6308 reloc.
6309 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6310 if we didn't create an IRELATIVE GOT.
6311 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6312 plt_address_for_local.
6313 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6314 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6315 got_irelative_, and irelative_count_ fields. Update
6316 declarations.
6317 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6318 Initialize new fields. Remove symtab parameter. Change all
6319 callers.
6320 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6321 irelative_count_.
6322 (Output_data_plt_x86_64::has_irelative_section): New function.
6323 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6324 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6325 fields. Update declarations.
6326 (Target_x86_64::Target_x86_64): Initialize new fields.
6327 (Target_x86_64::do_plt_address_for_global): New function replacing
6328 do_plt_section_for_global.
6329 (Target_x86_64::do_plt_address_for_local): New function replacing
6330 do_plt_section_for_local.
6331 (Target_x86_64::got_section): Create got_irelative_.
6332 (Target_x86_64::rela_irelative_section): New function.
6333 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6334 all callers. Don't create __rel_iplt_{start,end}.
6335 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6336 parameters. Change all callers. Use different PLT and GOT for
6337 IFUNC symbols.
6338 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6339 layout parameters. Change all callers. Use different PLT and
6340 GOT.
6341 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6342 parameters. Change all callers. Use different PLT and GOT for
6343 IFUNC symbols.
6344 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6345 (Output_data_plt_x86_64::rela_irelative): New function.
6346 (Output_data_plt_x86_64::address_for_global): New function.
6347 (Output_data_plt_x86_64::address_for_local): New function.
6348 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6349 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6350 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6351 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6352 parameters.
6353 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6354 reloc.
6355 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6356 symbols if we didn't create an IRELATIVE GOT.
6357 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6358 plt_address_for_local.
6359 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6360 * testsuite/ifuncvar1.c: New test file.
6361 * testsuite/ifuncvar2.c: New test file.
6362 * testsuite/ifuncvar3.c: New test file.
6363 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6364 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6365 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6366 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6367 * testsuite/Makefile.in: Rebuild.
6368
33c15b45
CC
63692011-07-07 Cary Coutant <ccoutant@google.com>
6370
6371 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6372 (two_file_test_1_ndebug.o): Likewise.
6373 (two_file_test_1b_ndebug.o): Likewise.
6374 (two_file_test_2_ndebug.o): Likewise.
6375 (two_file_test_main_ndebug.o): Likewise.
6376 (incremental_test_2): Link with no-debug versions.
6377
f48b5fb7
CC
63782011-07-06 Cary Coutant <ccoutant@google.com>
6379
6380 * gold/incremental.cc
6381 (Output_section_incremental_inputs::write_info_blocks): Check for
6382 hidden and internal symbols.
6383
221597a5
CC
63842011-07-06 Cary Coutant <ccoutant@google.com>
6385
6386 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6387 Check disposition for startup file.
6388 (Incremental_inputs::report_command_line): Ignore
6389 --incremental-startup-unchanged option.
6390 * options.cc (General_options::parse_incremental_startup_unchanged):
6391 New function.
6392 (General_options::General_options): Initialize new data member.
6393 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6394 (General_options): Add --incremental-startup-unchanged option.
6395 (General_options::incremental_startup_disposition): New function.
6396 (General_options::incremental_startup_disposition_): New data member.
6397
e24719f6
CC
63982011-07-06 Cary Coutant <ccoutant@google.com>
6399
6400 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6401 input file index to Script_info ctor.
6402 (Sized_incremental_binary::do_file_has_changed): Find the
6403 command-line argument for files named in scripts.
6404 * incremental.h (Script_info::Script_info): New ctor
6405 with input file index.
6406 (Script_info::input_file_index): New function.
6407 (Script_info::input_file_index_): New data member.
6408 (Incremental_binary::get_library): Add const.
6409 (Incremental_binary::get_script_info): Add const.
6410 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6411 * testsuite/Makefile.am (incremental_test_5): New test case.
6412 (incremental_test_6): New test case.
6413 * testsuite/Makefile.in: Regenerate.
6414
8f7c81e8
CC
64152011-07-06 Cary Coutant <ccoutant@google.com>
6416
6417 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6418 debug output when command lines differ.
6419
9fbd3822
CC
64202011-07-06 Cary Coutant <ccoutant@google.com>
6421
6422 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6423 --incremental-patch option.
6424 * layout.cc (Free_list::allocate): Extend allocation beyond original
6425 end if enabled.
6426 (Layout::make_output_section): Mark sections that should get
6427 patch space.
6428 * options.cc (parse_percent): New function.
6429 * options.h (parse_percent): New function.
6430 (DEFINE_percent): New macro.
6431 (General_options): Add --incremental-patch option.
6432 * output.cc (Output_section::Output_section): Initialize new data
6433 members.
6434 (Output_section::add_input_section): Print section name when out
6435 of patch space.
6436 (Output_section::add_output_section_data): Likewise.
6437 (Output_section::set_final_data_size): Add patch space when
6438 doing --incremental-full.
6439 (Output_section::do_reset_address_and_file_offset): Remove patch
6440 space.
6441 (Output_segment::set_section_list_addresses): Print debug output
6442 only if --incremental-update.
6443 * output.h (Output_section::set_is_patch_space_allowed): New function.
6444 (Output_section::is_patch_space_allowed_): New data member.
6445 (Output_section::patch_space_): New data member.
6446 * parameters.cc (Parameters::incremental_full): New function.
6447 * parameters.h (Parameters::incremental_full): New function
6448 * testsuite/Makefile.am (incremental_test_2): Add test for
6449 --incremental-patch option.
6450 * testsuite/Makefile.in: Regenerate.
6451 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6452 (t18): Remove function body.
6453
f6cccc2c
DK
64542011-07-05 Doug Kwan <dougkwan@google.com>
6455
6456 PR gold/12771
6457 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6458 Arm_Address type for relocation result.
6459 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6460 overflow check.
6461 (Arm_relocate_functions::abs32): Use unaligned access.
6462 (Arm_relocate_functions::rel32): Ditto.
6463 (Arm_relocate_functions::prel31): Ditto.
6464 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6465 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6466 static data relocations.
6467 * testsuite/Makefile.in: Regnerate.
6468 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6469
28a13fec
ILT
64702011-07-05 Ian Lance Taylor <iant@google.com>
6471
6472 PR gold/12392
6473 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6474 symbols if necessary.
6475 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6476
24d47b34
ILT
64772011-07-05 Ian Lance Taylor <iant@google.com>
6478
6479 PR gold/12952
6480 * resolve.cc (Symbol::override_base_with_special): Simply override
6481 version with special symbol version, ignoring previous version.
6482
41f9cbbe
ILT
64832011-07-05 Ian Lance Taylor <iant@google.com>
6484
6485 * object.cc (Sized_relobj_file::include_section_group): Add
6486 information to comment about signature location.
6487
886288f1
ILT
64882011-07-02 Ian Lance Taylor <iant@google.com>
6489
6490 PR gold/12957
6491 * options.h (class General_options): Add -f and -F.
6492 * options.cc (General_options::finalize): Fatal error if -f/-F
6493 are used without -shared.
6494 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6495
ae3a6d4f
ILT
64962011-07-02 Ian Lance Taylor <iant@google.com>
6497
6498 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6499
21131061
ILT
65002011-07-01 Ian Lance Taylor <iant@google.com>
6501
6502 PR gold/12525
6503 PR gold/12952
6504 * resolve.cc (Symbol::override_base_with_special): Don't override
6505 the version if the overriding symbol has a different name.
6506 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6507 all callers. If we give an error about an undefined version,
6508 define the base version if necessary.
6509 * dynobj.h (class Versions): Update declaration.
6510 * testsuite/weak_alias_test_5.cc: New file.
6511 * testsuite/weak_alias_test.script: New file.
6512 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6513 and versioned_alias have the right value, and call t2.
6514 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6515 weak_alias_test_5.so.
6516 (weak_alias_test_LDADD): Likewise.
6517 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6518 * testsuite/Makefile.in: Rebuild.
6519
611062c0
ILT
65202011-07-01 Ian Lance Taylor <iant@google.com>
6521
6522 PR gold/12525
6523 * options.h (class General_options): Support -z notext.
6524 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6525 -Wl,-z,notext.
6526 (two_file_shared_nonpic.so): Likewise.
6527 (two_file_shared_mixed.so): Likewise.
6528 (two_file_shared_mixed_1.so): Likewise.
6529 (weak_undef_lib_nonpic.so): Likewise.
6530 (alt/weak_undef_lib_nonpic.so): Likewise.
6531 (tls_test_shared_nonpic.so): Likewise.
6532 * testsuite/Makefile.in: Rebuild.
6533
328c7c2f
ILT
65342011-07-01 Ian Lance Taylor <iant@google.com>
6535
6536 PR gold/12525
6537 * configure.ac: Test whether static linking works, setting
6538 the automake conditional HAVE_STATIC.
6539 * testsuite/Makefile.am: Disable tests using -static if
6540 HAVE_STATIC is not true.
6541 * configure, testsuite/Makefile.in: Rebuild.
6542
02d7cd44
ILT
65432011-07-01 Ian Lance Taylor <iant@google.com>
6544
6545 PR gold/12525
6546 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6547 Assert if we see DW_EH_PE_indirect.
6548 * target.h (Target::ehframe_datarel_base): New function.
6549 (Target::do_ehframe_datarel_base): New target function.
6550 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6551 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6552 function.
6553
07a60597
ILT
65542011-07-01 Ian Lance Taylor <iant@google.com>
6555
6556 PR gold/12571
6557 * options.h (class General_options): Add
6558 --ld-generated-unwind-info.
6559 * ehframe.cc (Fde::write): Add address parameter. Change all
6560 callers. If associated with PLT, fill in address and size.
6561 (Cie::set_output_offset): Only add merge mapping if there is an
6562 object.
6563 (Cie::write): Add address parameter. Change all callers.
6564 (Eh_frame::add_ehframe_for_plt): New function.
6565 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6566 input_offset_ fields into union u_, with new plt field.
6567 (Fde::Fde): Adjust for new union field.
6568 (Fde::Fde) [Output_data version]: New constructor.
6569 (Fde::add_mapping): Only add merge mapping if there is an object.
6570 (class Cie): Update declarations.
6571 (class Eh_frame): Declare add_ehframe_for_plt.
6572 * layout.cc (Layout::layout_eh_frame): Break out code into
6573 make_eh_frame_section, and call it.
6574 (Layout::make_eh_frame_section): New function.
6575 (Layout::add_eh_frame_for_plt): New function.
6576 * layout.h (class Layout): Update declarations.
6577 * merge.cc (Merge_map::add_mapping): Add assertion.
6578 * i386.cc: Include "dwarf.h".
6579 (class Output_data_plt_i386): Make first_plt_entry,
6580 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6581 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6582 and plt_eh_frame_fde.
6583 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6584 boundary. Call add_eh_frame_for_plt if appropriate.
6585 * x86_64.cc: Include "dwarf.h".
6586 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6587 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6588 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6589 and plt_eh_frame_fde.
6590 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6591 appropriate.
6592
14788a3f
ILT
65932011-06-29 Ian Lance Taylor <iant@google.com>
6594
6595 PR gold/12629
6596 * object.cc (Sized_relobj_file::layout_section): Change shdr
6597 parameter to be const.
6598 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6599 out of do_layout.
6600 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6601 appropriate. Call layout_eh_frame_section.
6602 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6603 sections.
6604 * object.h (class Sized_relobj_file): Update declarations.
6605
6c21fce1
ILT
66062011-06-29 Ian Lance Taylor <iant@google.com>
6607
37e41b03 6608 PR gold/12652
6c21fce1
ILT
6609 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6610 modifier.
6611 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6612
4d5e4e62
ILT
66132011-06-29 Ian Lance Taylor <iant@google.com>
6614
6615 PR gold/12675
6616 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6617 SHT_X86_64_UNWIND.
6618 * layout.cc (Layout::layout_eh_frame): Likewise.
6619
886f533a
ILT
66202011-06-29 Ian Lance Taylor <iant@google.com>
6621
6622 PR gold/12695
6623 * layout.cc (Layout::symtab_section_shndx): New function.
6624 * layout.h (class Layout): Declare symtab_section_shndx.
6625 * output.cc (Output_section::write_header): Call it.
6626
f3ae1b28
ILT
66272011-06-29 Ian Lance Taylor <iant@google.com>
6628
6629 PR gold/12818
6630 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6631 symbols which are not used in a relocation.
6632
aecf301f
ILT
66332011-06-28 Ian Lance Taylor <iant@google.com>
6634
6635 PR gold/12898
6636 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6637 script create indistinguishable segments.
6638 (Layout::set_segment_offsets): Use stable_sort when sorting
6639 segments. Pass this to Compare_segments constructor.
6640 * layout.h (class Layout): Make segment_precedes non-static.
6641 (class Compare_segments): Change from struct to class. Add
6642 layout_ field. Add constructor.
6643 * script-sections.cc
6644 (Script_sections::attach_sections_using_phdrs_clause): Rename
6645 local orphan to is_orphan. Don't report failure to put empty
6646 section in segment. On attachment failure, report name of
6647 section, and attach to first PT_LOAD segment.
6648
03ef7571
ILT
66492011-06-28 Ian Lance Taylor <iant@google.com>
6650
6651 PR gold/12934
6652 * target-select.cc (Target_selector::Target_selector): Add
6653 emulation parameter. Change all callers.
6654 (select_target_by_bfd_name): Rename from select_target_by_name.
6655 Change all callers.
6656 (select_target_by_emulation): New function.
6657 (supported_emulation_names): New function.
6658 * target-select.h (class Target_selector): Add emulation_ field.
6659 Update declarations.
6660 (Target_selector::recognize_by_bfd_name): Rename from
6661 recognize_by_name. Change all callers.
6662 (Target_selector::supported_bfd_names): Rename from
6663 supported_names. Change all callers.
6664 (Target_selector::recognize_by_emulation): New function.
6665 (Target_selector::supported_emulations): New function.
6666 (Target_selector::emulation): New function.
6667 (Target_selector::do_recognize_by_bfd_name): Rename from
6668 do_recognize_by_name. Change all callers.
6669 (Target_selector::do_supported_bfd_names): Rename from
6670 do_supported_names. Change all callers.
6671 (Target_selector::do_recognize_by_emulation): New function.
6672 (Target_selector::do_supported_emulations): New function.
6673 (select_target_by_bfd_name): Change name in declaration.
6674 (select_target_by_emulation): Declare.
6675 (supported_emulation_names): Declare.
6676 * parameters.cc (parameters_force_valid_target): Try to find
6677 target based on emulation from -m option.
6678 * options.h (class General_options): Change doc string for -m.
6679 * options.cc (help): Print emulations.
6680 (General_options::parse_V): Likewise.
6681 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6682 Add emulation parameter. Change all callers.
6683
200b2bb9
ILT
66842011-06-28 Ian Lance Taylor <iant@google.com>
6685
6686 * target.h (class Target): Add osabi_ field.
6687 (Target::osabi): New function.
6688 (Target::set_osabi): New function.
6689 (Target::Target): Initialize osabi_.
6690 (Target::do_adjust_elf_header): Make pure virtual.
6691 (Sized_target::do_adjust_elf_header): Declare.
6692 * target.cc (Sized_target::do_adjust_elf_header): New function.
6693 (class Sized_target): Instantiate all versions.
6694 * freebsd.h (class Target_freebsd): Remove.
6695 (Target_selector_freebsd::do_recognize): Call set_osabi on
6696 Target.
6697 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6698 (Target_selector_freebsd::set_osabi): Remove.
6699 * i386.cc (class Target_i386): Inherit from Sized_target rather
6700 than Target_freebsd.
6701 * x86_64.cc (class Target_x86_64): Likewise.
6702
b3ce541e
ILT
67032011-06-28 Ian Lance Taylor <iant@google.com>
6704
6705 * target.h (Target::can_check_for_function_pointers): Rewrite.
6706 Make non-virtual.
6707 (Target::can_icf_inline_merge_sections): Likewise.
6708 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6709 (Target::Target_info): Add can_icf_inline_merge_sections field.
6710 (Target::do_can_check_for_function_pointers): New virtual
6711 function.
6712 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6713 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6714 from can_check_for_function_pointers, move in file.
6715 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6716 section_may_have_icf_unsafe_poineters, move in file.
6717 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6718 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6719 Rename from can_check_for_function_pointers, move in file.
6720 (Target_i386::can_icf_inline_merge_sections): Remove.
6721 (Target_i386::i386_info): Initialize
6722 can_icf_inline_merge_sections.
6723 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6724 Initialize can_icf_inline_merge_sections.
6725 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6726 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6727 Rename from can_check_for_function_pointers, move in file.
6728 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6729 (Target_x86_64::x86_64_info): Initialize
6730 can_icf_inline_merge_sections.
6731 * testsuite/testfile.cc (Target_test::test_target_info):
6732 Likewise.
6733 * icf.cc (get_section_contents): Correct formatting.
6734
6d1c4efb
ILT
67352011-06-27 Ian Lance Taylor <iant@google.com>
6736
6737 * symtab.cc (Symbol::versioned_name): New function.
6738 (Symbol_table::add_to_final_symtab): Use versioned_name when
6739 appropriate.
6740 (Symbol_table::sized_write_symbol): Likewise.
6741 * symtab.h (class Symbol): Declare versioned_name.
6742 * stringpool.h (class Stringpool_template): Add variant of add
6743 which takes a std::basic_string.
6744 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6745 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6746 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6747 (ver_test_12.o): New target.
6748 * testsuite/Makefile.in: Rebuild.
6749
57eb9b50
DK
67502011-06-27 Doug Kwan <dougkwan@google.com>
6751
6752 * arm.cc (Arm_relocate_functions::thm_jump8,
6753 Arm_relocate_functions::thm_jump11): Use a wider signed
6754 type to compute offset.
6755 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6756 arm_thm_jump8.
6757 * testsuite/Makefile.in: Regenerate.
6758 * testsuite/arm_branch_in_range.sh: Check test results of
6759 arm_thm_jump11 and arm_thm_jump8.
6760 * testsuite/arm_thm_jump11.s: New test source file.
6761 * testsuite/arm_thm_jump11.t: New linker script.
6762 * testsuite/arm_thm_jump8.s: New test source file.
6763 * testsuite/arm_thm_jump8.t: New linker script.
6764
487b39df
ILT
67652011-06-24 Ian Lance Taylor <iant@google.com>
6766
6767 * layout.cc: Include "object.h".
6768 (ctors_sections_in_init_array): New static variable.
6769 (Layout::is_ctors_in_init_array): New function.
6770 (Layout::layout): Add entry to ctors_sections_in_init_array if
6771 appropriate.
6772 * layout.h (class Layout): Declare is_ctors_in_init_array.
6773 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6774 is_ctors_reverse_view is set.
6775 (Sized_relobj_file::write_sections): Add layout parameter. Change
6776 all callers. Set is_ctors_reverse_view field of View_size.
6777 (Sized_relobj_file::reverse_words): New function.
6778 * object.h (Sized_relobj_file::View_size): Add
6779 is_ctors_reverse_view field.
6780 (class Sized_relobj_file): Update declarations.
6781 * testsuite/initpri3.c: New test.
6782 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6783 initpri3b.
6784 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6785 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6786 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6787 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6788 * testsuite/Makefile.in: Rebuild.
6789
472076e4
CC
67902011-06-24 Cary Coutant <ccoutant@google.com>
6791
6792 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6793 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6794 (debug_msg_cdebug.err): New targets.
6795 * testsuite/Makefile.in: Regenerate.
6796 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6797 Fix checks for link with shared library.
6798
a60af0db
DK
67992011-06-24 Doug Kwan <dougkwan@google.com>
6800
6801 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6802 skip empty text sections.
6803 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6804
5393d741
ILT
68052011-06-22 Ian Lance Taylor <iant@google.com>
6806
6807 PR gold/12910
6808 * options.h (class General_options): Add --ctors-in-init-array.
6809 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6810 friends as SHT_PROGBITS for merging sections.
6811 (Layout::layout): Remove special handling of .init_array and
6812 friends. Don't sort if doing relocatable link. Sort for .ctors
6813 and .dtors if ctors_in_init_array.
6814 (Layout::make_output_section): Force correct section types for
6815 .init_array and friends. Don't sort if doing relocatable link,
6816 Don't sort .ctors and .dtors if ctors_in_init_array.
6817 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6818 (Layout::output_section_name): Add relobj parameter. Change all
6819 callers. Handle .ctors. and .dtors. in code rather than table.
6820 Handle .ctors and .dtors if ctors_in_init_array.
6821 (Layout::match_file_name): New function, moved from output.cc.
6822 * layout.h (class Layout): Update declarations.
6823 * output.cc: Include "layout.h".
6824 (Input_section_sort_entry::get_priority): New function.
6825 (Input_section_sort_entry::match_file_name): Just call
6826 Layout::match_file_name.
6827 (Output_section::Input_section_sort_init_fini_compare::operator()):
6828 Handle .ctors and .dtors. Sort by explicit priority rather than
6829 by name.
6830 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6831 * testsuite/initpri2.c: New test.
6832 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6833 (check_PROGRAMS): Add initpri2.
6834 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6835 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6836 * configure, testsuite/Makefile.in: Rebuild.
6837
e1f74f98
ILT
68382011-06-19 Ian Lance Taylor <iant@google.com>
6839
6840 PR gold/12880
6841 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6842 .interp section to a PT_INTERP segment even if we have seen a
6843 --dynamic-linker option. Don't do it if we have seen a PHDRS
6844 clause in a linker script.
6845 (Layout::finalize): Don't create a .interp section if we've
6846 already create a PT_INTERP segment.
6847 (Layout::create_interp): Always call choose_output_section (revert
6848 patch of 2011-06-17). Don't create PT_INTERP segment.
6849 * script-sections.cc
6850 (Script_sections::create_note_and_tls_segments): Add a .interp
6851 section to a PT_INTERP segment even if we have seen a
6852 --dynamic-linker option.
6853
766f91bb
ILT
68542011-06-18 Ian Lance Taylor <iant@google.com>
6855
6856 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6857 merely because a non-PT_LOAD segment has a dynamic reloc.
6858
0d212c3a
ILT
68592011-06-18 Ian Lance Taylor <iant@google.com>
6860
6861 * layout.cc (Layout::finish_dynamic_section): Don't create
6862 DT_FLAGS entry if not needed.
6863
911a5072
ILT
68642011-06-18 Ian Lance Taylor <iant@google.com>
6865
6866 PR gold/12745
6867 * layout.cc (Layout::layout_eh_frame): Correct handling of
6868 writable .eh_frame section.
6869
534b4e5f
ILT
68702011-06-17 Ian Lance Taylor <iant@google.com>
6871
6872 PR gold/12893
6873 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6874 symbol is redefined with the exact same object and value.
6875
10b4f102
ILT
68762011-06-17 Ian Lance Taylor <iant@google.com>
6877
6878 PR gold/12880
6879 * layout.h (class Layout): Add interp_segment_ field.
6880 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6881 (Layout::attach_allocated_section_to_segment): If making shared
6882 library, put .interp section in PT_INTERP segment.
6883 (Layout::finalize): Also call create_interp if -dynamic-linker
6884 option was used.
6885 (Layout::create_interp): Assert that there is no PT_INTERP
6886 segment. If not using a SECTIONS clause, use make_output_section.
6887 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6888 * script-sections.cc
6889 (Script_sections::create_note_and_tls_segments): If making shared
6890 library, put .interp section in PT_INTERP segment.
6891
a29b0dad
ILT
68922011-06-17 Ian Lance Taylor <iant@google.com>
6893
e588ea8d
ILT
6894 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6895 when making a shared library.
6896
68972011-06-17 Ian Lance Taylor <iant@google.com>
6898
6899 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6900 parameter. Change all callers. Don't issue warning about PC32
6901 against locally defined symbol.
a29b0dad 6902
9d3b0698
ILT
69032011-06-16 Ian Lance Taylor <iant@google.com>
6904
6905 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6906 occurs in same object.
6907
85b0f90c
AM
69082011-06-14 Alan Modra <amodra@gmail.com>
6909
6910 * po/POTFILES.in: Regenerate.
6911
a94907d9
ILT
69122011-06-09 Ian Lance Taylor <iant@google.com>
6913
6914 * script-sections.cc
6915 (Orphan_output_section::set_section_addresses): For a relocatable
6916 link set address to 0.
6917
4fb3a1c3
CC
69182011-06-09 Cary Coutant <ccoutant@google.com>
6919
6920 PR gold/12804
6921 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6922 used with --compress-debug-sections.
6923 * gold/object.cc (Sized_relobj_file::do_layout): Report
6924 uncompressed size of compressed input sections.
6925
61220854
CC
69262011-06-08 Cary Coutant <ccoutant@google.com>
6927
6928 PR gold/12804
6929 * testsuite/two_file_test_2_v1.cc: Change initialization of
6930 v2 to keep it in .data.
6931
e6455dfb
CC
69322011-06-07 Cary Coutant <ccoutant@google.com>
6933
6934 * common.cc (Symbol_table::do_allocate_commons_list): Call
6935 gold_fallback.
6936 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6937 (Errors::fallback): New function.
6938 (gold_fallback): New function.
6939 * errors.h (Errors::fallback): New function.
6940 * gold.cc (gold_exit): Change status parameter to enum; adjust
6941 all callers.
6942 (queue_initial_tasks): Call gold_fallback.
6943 * gold.h: Include cstdlib.
6944 (Exit_status): New enum type.
6945 (gold_exit): Change status parameter to enum.
6946 (gold_fallback): New function.
6947 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6948 (Layout::create_symtab_sections): Likewise.
6949 (Layout::create_shdrs): Likewise.
6950 * main.cc (main): Adjust call to gold_exit.
6951 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6952 (Output_data_got::add_got_entry_pair): Likewise.
6953 (Output_section::add_input_section): Likewise.
6954 (Output_section::add_output_section_data): Likewise.
6955 (Output_segment::set_section_list_addresses): Likewise.
6956 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6957
fb0e076f
CC
69582011-06-07 Cary Coutant <ccoutant@google.com>
6959
6960 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6961 for incremental links.
6962 * output.cc (Output_segment::set_section_list_addresses): Remove
6963 FIXME and test for TLS or BSS.
6964
a5ee4d5d
CC
69652011-06-07 Cary Coutant <ccoutant@google.com>
6966
6967 * testsuite/Makefile.am: Add incremental_copy_test,
6968 incremental_common_test_1.
6969 * testsuite/Makefile.in: Regenerate.
6970 * testsuite/common_test_1_v1.c: New source file.
6971 * testsuite/common_test_1_v2.c: New source file.
6972 * testsuite/copy_test_v1.cc: New source file.
6973
5146f448
CC
69742011-06-07 Cary Coutant <ccoutant@google.com>
6975
6976 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6977 update, allocate common from bss section's free list.
6978 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6979 linker-defined symbols.
6980 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6981 Skip GOT and PLT entries that are no longer referenced.
6982 (Output_section_incremental_inputs::write_info_blocks): Mark
6983 linker-defined symbols.
6984 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6985 * output.cc (Output_section::allocate): New function.
6986 * output.h (Output_section::allocate): New function.
6987 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6988 linker-defined symbols.
6989 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6990 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6991 (Symbol::init_base_output_data): Likewise.
6992 (Symbol::init_base_output_segment): Likewise.
6993 (Symbol::init_base_constant): Likewise.
6994 (Sized_symbol::init_output_data): Likewise.
6995 (Sized_symbol::init_output_segment): Likewise.
6996 (Sized_symbol::init_constant): Likewise.
6997 (Symbol_table::do_define_in_output_data): Likewise.
6998 (Symbol_table::do_define_in_output_segment): Likewise.
6999 (Symbol_table::do_define_as_constant): Likewise.
7000 * symtab.h (Symbol::is_predefined): New function.
7001 (Symbol::init_base_output_data): Add is_predefined parameter.
7002 (Symbol::init_base_output_segment): Likewise.
7003 (Symbol::init_base_constant): Likewise.
7004 (Symbol::is_predefined_): New data member.
7005 (Sized_symbol::init_output_data): Add is_predefined parameter.
7006 (Sized_symbol::init_output_segment): Likewise.
7007 (Sized_symbol::init_constant): Likewise.
7008 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7009
26d3c67d
CC
70102011-06-07 Cary Coutant <ccoutant@google.com>
7011
7012 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7013 instead of emit_copy_reloc.
7014 (Copy_relocs::emit_copy_reloc): Refactor.
7015 (Copy_relocs::make_copy_reloc): New function.
7016 (Copy_relocs::add_copy_reloc): Remove.
7017 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7018 section.
7019 (Copy_relocs::make_copy_reloc): New function.
7020 (Copy_relocs::add_copy_reloc): Remove.
7021 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7022 unchanged input files.
7023 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7024 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7025 Reserve BSS space for COPY relocations.
7026 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7027 (Output_section_incremental_inputs::write_info_blocks): Record
7028 whether a symbol is copied from a shared object.
7029 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7030 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7031 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7032 (Incremental_input_entry_reader::get_output_symbol_index): Add
7033 is_copy parameter.
7034 (Incremental_binary::emit_copy_relocs): New function.
7035 (Incremental_binary::do_emit_copy_relocs): New function.
7036 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7037 new data member.
7038 (Sized_incremental_binary::add_copy_reloc): New function.
7039 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7040 (Sized_incremental_binary::Copy_reloc): New struct.
7041 (Sized_incremental_binary::Copy_relocs): New typedef.
7042 (Sized_incremental_binary::copy_relocs_): New data member.
7043 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7044 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7045 * target.h (Sized_target::emit_copy_reloc): New function.
7046 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7047
7cdb37d9
CC
70482011-06-02 Cary Coutant <ccoutant@google.com>
7049
7050 PR gold/12163
7051 * gold/archive.cc (Archive::Archive): Initialize new data member.
7052 (Archive::include_all_members): Return if archive has already been
7053 included.
7054 * gold/archive.h (Archive::include_all_members_): New data member.
7055
cc643b88
NC
70562011-06-02 Nick Clifton <nickc@redhat.com>
7057
7058 * dynobj.h: Fix spelling mistake in comment.
7059 * output.cc: Likewise.
7060
f62a3ca7 70612011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7062 Asier Llano
f62a3ca7
DK
7063
7064 PR gold/12826
cc643b88 7065 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7066 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7067 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7068 redundant arm_exidx_test.so.
7069 * testsuite/Makefile.in: Regenerate.
7070 (check_SCRIPTS): Add pr12826.sh
7071 (check_DATA): Add pr12826.stdout
7072 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7073 * testsuite/pr12826.sh: New file.
7074 * testsuite/pr12826_1.s: Ditto.
7075 * testsuite/pr12826_1.s: Ditto.
7076
8dbe1edc
ILT
70772011-05-30 Ian Lance Taylor <iant@google.com>
7078
7079 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7080 sections.
7081
c49875be
ILT
70822011-05-29 Ian Lance Taylor <iant@google.com>
7083
7084 PR gold/12804
7085 * testsuite/Makefile.am: Use different file name for two_file_test
7086 temporary file for each incremental test.
7087 * testsuite/Makefile.in: Rebuild.
7088
69d53f7a
ILT
70892011-05-29 Ian Lance Taylor <iant@google.com>
7090
7091 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7092 binary input file is empty.
7093
41d0ab5f
ILT
70942011-05-27 Ian Lance Taylor <iant@google.com>
7095
7096 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7097 (ver_test_9.so): Likewise.
7098 * testsuite/Makefile.in: Rebuild.
7099
89d8a36b
CC
71002011-05-26 Cary Coutant <ccoutant@google.com>
7101
7102 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7103 * incremental.cc (Incremental_inputs::report_input_section): Fix
7104 comment, indentation.
7105 (Incremental_inputs::report_comdat_group): New function.
7106 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7107 of data for incremental input file entry.
7108 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7109 group count, COMDAT group signatures.
7110 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7111 an unchanged input file.
7112 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7113 Initialize new data member.
7114 (Incremental_object_entry::add_comdat_group): New function.
7115 (Incremental_object_entry::get_comdat_group_count): New function.
7116 (Incremental_object_entry::get_comdat_signature_key): New function.
7117 (Incremental_object_entry::groups_): New data member.
7118 (Incremental_inputs::report_comdat_group): New function.
7119 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7120 data for incremental input file entry.
7121 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7122 (Incremental_input_entry_reader::get_input_section): Adjust size of
7123 data for incremental input file entry.
7124 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7125 (Incremental_input_entry_reader::get_comdat_group_signature): New
7126 function.
7127 * object.cc (Sized_relobj::include_section_group): Report kept
7128 COMDAT groups for incremental links.
7129
1706a06f
ILT
71302011-05-24 David Meyer <pdox@google.com>
7131
7132 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7133 with name parameter. Add found_name parameter.
7134 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7135 * dirsearch.h (class Dirsearch): Update declaration.
7136
a10ae760
ILT
71372011-05-24 Ian Lance Taylor <iant@google.com>
7138
7139 * archive.cc (Library_base::should_include_member): Pull in object
7140 from archive if it defines the entry symbol.
7141 * parameters.cc (Parameters::entry): New function.
7142 * parameters.h (class Parameters): Declare entry.
7143 * output.h (class Output_file_header): Remove entry_ field.
7144 * output.cc (Output_file_header::Output_file_header): Remove entry
7145 parameter. Change all callers.
7146 (Output_file_header::entry): Use parameters->entry.
7147 * gold.cc (queue_middle_tasks): Likewise.
7148 * plugin.cc (Plugin_hook::run): Likewise.
7149
aa92d6ed
CC
71502011-05-24 Cary Coutant <ccoutant@google.com>
7151
7152 * gold.cc (queue_initial_tasks): Pass incremental base filename
7153 to Output_file::open_base_file; don't print error message.
7154 * incremental-dump.cc (main): Adjust call to
7155 Output_file::open_for_modification.
7156 * incremental-dump.cc (main): Likewise.
7157 * incremental.cc (Incremental_inputs::report_command_line):
7158 Ignore --incremental-base option when comparing command lines.
7159 Ignore parameter when given as separate argument.
7160 * options.h (class General_options): Add --incremental-base.
7161 * output.cc (Output_file::Output_file):
7162 (Output_file::open_base_file): Add base_name and writable parameters;
7163 read base file into new file; print error message here.
7164 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7165 callers.
7166 * output.h (Output_file::open_for_modification): Rename to...
7167 (Output_file::open_base_file): ...this; add base_name and
7168 writable parameters; adjust all callers.
7169 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7170 callers.
7171 * testsuite/Makefile.am (incremental_test_4): Test
7172 --incremental-base.
7173 * testsuite/Makefile.in: Regenerate.
7174
2eedd706
CC
71752011-05-24 Cary Coutant <ccoutant@google.com>
7176
7177 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7178 incremental_test_4.
7179 * testsuite/Makefile.in: Regenerate.
7180 * testsuite/two_file_test_1_v1.cc: New test source file.
7181 * testsuite/two_file_test_1b_v1.cc: New test source file.
7182 * testsuite/two_file_test_2_v1.cc: New test source file.
7183
0f1c85a6
CC
71842011-05-24 Cary Coutant <ccoutant@google.com>
7185
7186 * dynobj.h (Dynobj::do_dynobj): New function.
7187 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7188 flag and soname for shared objects.
7189 * incremental.cc (Incremental_inputs::report_object): Make
7190 either Incremental_object_entry or Incremental_dynobj_entry; add
7191 soname to string table.
7192 (Incremental_inputs::report_input_section): Add assertion.
7193 (Output_section_incremental_inputs::set_final_data_size): Adjust
7194 type of input file entry for shared libraries; adjust size of
7195 shared library info entry.
7196 (Output_section_incremental_inputs::write_input_files): Write
7197 as_needed flag for shared libraries.
7198 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7199 of input file entry for shared libraries; write soname.
7200 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7201 soname from incremental info.
7202 * incremental.h (enum Incremental_input_flags): Add
7203 INCREMENTAL_INPUT_AS_NEEDED.
7204 (Incremental_input_entry::Incremental_input_entry): Initialize new
7205 data member.
7206 (Incremental_input_entry::set_as_needed): New function.
7207 (Incremental_input_entry::as_needed): New function.
7208 (Incremental_input_entry::do_dynobj_entry): New function.
7209 (Incremental_input_entry::as_needed_): New data member.
7210 (Incremental_object_entry::Incremental_object_entry): Don't check
7211 for shared library.
7212 (Incremental_object_entry::do_type): Likewise.
7213 (class Incremental_dynobj_entry): New class.
7214 (Incremental_input_entry_reader::as_needed): New function.
7215 (Incremental_input_entry_reader::get_soname): New function.
7216 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7217 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7218 size of shared library info entry.
58797674 7219 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7220 incremental link when adding DT_NEEDED entries.
7221 * object.h (Object::Object): Initialize new data member.
7222 (Object::dynobj): New function.
7223 (Object::set_as_needed): New function.
7224 (Object::as_needed): New function.
7225 (Object::do_dynobj): New function.
7226 (Object::as_needed_): New data member.
7227
6fa2a40b
CC
72282011-05-24 Cary Coutant <ccoutant@google.com>
7229
7230 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7231 info; adjust display of GOT entries.
7232 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7233 vector of input objects; remove file_status_.
7234 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7235 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7236 got_plt reader; call target hooks to reserve GOT entries.
7237 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7238 of input file info header and GOT info entry.
7239 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7240 relocation info.
7241 (Got_plt_view_info::got_descriptor): Remove.
7242 (Got_plt_view_info::sym_index): New data member.
7243 (Got_plt_view_info::input_index): New data member.
7244 (Local_got_offset_visitor::visit): Write input file index.
7245 (Global_got_offset_visitor::visit): Write 0 for input file index.
7246 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7247 with sym_index and input_index.
7248 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7249 incremental info GOT entry; replace got_descriptor with input_index.
7250 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7251 map from input file index to object.
7252 (Sized_relobj_incr::do_layout): Replace direct data member reference
7253 with accessor function.
7254 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7255 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7256 Adjust size of input file info header.
7257 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7258 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7259 (Incremental_input_entry_reader::get_input_section): Adjust size of
7260 input file info header.
7261 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7262 of incremental info GOT entry.
7263 (Incremental_got_plt_reader::get_got_desc): Remove.
7264 (Incremental_got_plt_reader::get_got_symndx): New function.
7265 (Incremental_got_plt_reader::get_got_input_index): New function.
7266 (Sized_incremental_binary::Sized_incremental_binary): Remove
7267 file_status_; add input_objects_.
7268 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7269 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7270 (Sized_incremental_binary::file_is_unchanged): Remove.
7271 (Sized_incremental_binary::set_input_object): New function.
7272 (Sized_incremental_binary::input_object): New function.
7273 (Sized_incremental_binary::file_status_): Remove.
7274 (Sized_incremental_binary::input_objects_): New data member.
7275 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7276 references.
7277 (Sized_relobj_incr::invalid_address): Move to base class.
7278 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7279 class.
7280 (Sized_relobj_incr::do_output_section_offset): Likewise.
7281 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7282 (Sized_relobj_incr::section_offsets_): Likewise.
7283 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7284 function.
7285 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7286 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7287 with accessor function.
7288 (Sized_relobj_file::do_layout): Likewise.
7289 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7290 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7291 (Sized_relobj_file::compute_final_local_value): Replace refs to
7292 section_offsets_ with accessor function.
7293 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7294 * object.h (Relobj::Relobj): Initialize new data members.
7295 (Relobj::add_dyn_reloc): New function.
7296 (Relobj::first_dyn_reloc): New function.
7297 (Relobj::dyn_reloc_count): New function.
7298 (Relobj::first_dyn_reloc_): New data member.
7299 (Relobj::dyn_reloc_count_): New data member.
7300 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7301 references.
7302 (Sized_relobj::Address): New typedef.
7303 (Sized_relobj::invalid_address): Move here from child class.
7304 (Sized_relobj::Sized_relobj): Initialize new data members.
7305 (Sized_relobj::sized_relobj): New function.
7306 (Sized_relobj::is_output_section_offset_invalid): Move here from
7307 child class.
7308 (Sized_relobj::get_output_section_offset): Likewise.
7309 (Sized_relobj::local_has_got_offset): Likewise.
7310 (Sized_relobj::local_got_offset): Likewise.
7311 (Sized_relobj::set_local_got_offset): Likewise.
7312 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7313 (Sized_relobj::clear_got_offsets): New function.
7314 (Sized_relobj::section_offsets): Move here from child class.
7315 (Sized_relobj::do_output_section_offset): Likewise.
7316 (Sized_relobj::do_set_section_offset): Likewise.
7317 (Sized_relobj::Local_got_offsets): Likewise.
7318 (Sized_relobj::local_got_offsets_): Likewise.
7319 (Sized_relobj::section_offsets_): Likewise.
7320 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7321 references.
7322 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7323 class.
7324 (Sized_relobj_file::sized_relobj): New function
7325 (Sized_relobj_file::local_has_got_offset): Move to base class.
7326 (Sized_relobj_file::local_got_offset): Likewise.
7327 (Sized_relobj_file::set_local_got_offset): Likewise.
7328 (Sized_relobj_file::get_output_section_offset): Likewise.
7329 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7330 (Sized_relobj_file::do_output_section_offset): Likewise.
7331 (Sized_relobj_file::do_set_section_offset): Likewise.
7332 (Sized_relobj_file::Local_got_offsets): Likewise.
7333 (Sized_relobj_file::local_got_offsets_): Likewise.
7334 (Sized_relobj_file::section_offsets_): Likewise.
7335 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7336 (all constructors).
7337 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7338 (Output_reloc::get_symbol_index): Likewise.
7339 (Output_reloc::local_section_offset): Likewise.
7340 (Output_reloc::get_address): Likewise.
7341 (Output_reloc::symbol_value): Likewise.
7342 (Output_data_got::reserve_slot): Move to class definition.
7343 (Output_data_got::reserve_local): New function.
7344 (Output_data_got::reserve_slot_for_global): Remove.
7345 (Output_data_got::reserve_global): New function.
7346 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7347 (all constructors, two instantiations).
7348 (Output_reloc::get_relobj): New function (two instantiations).
7349 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7350 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7351 (Output_data_reloc::add_global): Adjust type of relobj.
7352 (Output_data_reloc::add_global_relative): Likewise.
7353 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7354 (Output_data_reloc::add_local): Likewise.
7355 (Output_data_reloc::add_local_relative): Likewise.
7356 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7357 (Output_data_reloc::add_local_section): Likewise.
7358 (Output_data_reloc::add_output_section): Likewise.
7359 (Output_data_reloc::add_absolute): Likewise.
7360 (Output_data_reloc::add_target_specific): Likewise.
7361 (Output_data_got::reserve_slot): Move definition here.
7362 (Output_data_got::reserve_local): New function.
7363 (Output_data_got::reserve_global): New function.
7364 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7365 section_offsets_ with accessor function.
7366 (Sized_relobj_file::write_sections): Likewise.
7367 (Sized_relobj_file::do_relocate_sections): Likewise.
7368 * target.h (Sized_target::reserve_local_got_entry): New function.
7369 (Sized_target::reserve_global_got_entry): New function.
7370 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7371 (Target_x86_64::reserve_global_got_entry): New function.
7372 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7373
4829d394
CC
73742011-05-23 Cary Coutant <ccoutant@google.com>
7375
7376 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7377 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7378 bit when checking got_type.
7379 * incremental.cc (Sized_incremental_binary::setup_readers):
7380 Store symbol table and string table locations; initialize bit vector
7381 of file status flags.
7382 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7383 unchanged files.
7384 (Sized_incremental_binary::do_process_got_plt): New function.
7385 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7386 (Output_section_incremental_inputs::set_final_data_size): Record
7387 file index for each input file.
7388 (Output_section_incremental_inputs::write_got_plt): Store file index
7389 instead of input entry offset for each GOT entry.
7390 * incremental.h
7391 (Incremental_input_entry::Incremental_input_entry): Initialize new
7392 data member.
7393 (Incremental_input_entry::set_offset): Store file index.
7394 (Incremental_input_entry::get_file_index): New function.
7395 (Incremental_input_entry::file_index_): New data member.
7396 (Incremental_binary::process_got_plt): New function.
7397 (Incremental_binary::do_process_got_plt): New function.
7398 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7399 data members.
7400 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7401 (Sized_incremental_binary::set_file_is_unchanged): New function.
7402 (Sized_incremental_binary::file_is_unchanged): New function.
7403 (Sized_incremental_binary::do_process_got_plt): New function.
7404 (Sized_incremental_binary::file_status_): New data member.
7405 (Sized_incremental_binary::main_symtab_loc_): New data member.
7406 (Sized_incremental_binary::main_strtab_loc_): New data member.
7407 * output.cc (Output_data_got::Got_entry::write): Add case
7408 RESERVED_CODE.
7409 (Output_data_got::add_global): Call add_got_entry.
7410 (Output_data_got::add_global_plt): Likewise.
7411 (Output_data_got::add_global_with_rel): Likewise.
7412 (Output_data_got::add_global_with_rela): Likewise.
7413 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7414 (Output_data_got::add_global_pair_with_rela): Likewise.
7415 (Output_data_got::add_local): Call add_got_entry.
7416 (Output_data_got::add_local_plt): Likewise.
7417 (Output_data_got::add_local_with_rel): Likewise.
7418 (Output_data_got::add_local_with_rela): Likewise.
7419 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7420 (Output_data_got::add_local_pair_with_rela): Likewise.
7421 (Output_data_got::reserve_slot): New function.
7422 (Output_data_got::reserve_slot_for_global): New function.
7423 (Output_data_got::add_got_entry): New function.
7424 (Output_data_got::add_got_entry_pair): New function.
7425 (Output_section::add_output_section_data): Edit FIXME.
7426 * output.h
7427 (Output_section_data_build::Output_section_data_build): New
7428 constructor with size parameter.
7429 (Output_data_space::Output_data_space): Likewise.
7430 (Output_data_got::Output_data_got): Initialize new data member; new
7431 constructor with size parameter.
7432 (Output_data_got::add_constant): Call add_got_entry.
7433 (Output_data_got::reserve_slot): New function.
7434 (Output_data_got::reserve_slot_for_global): New function.
7435 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7436 (Output_data_got::add_got_entry): New function.
7437 (Output_data_got::add_got_entry_pair): New function.
7438 (Output_data_got::free_list_): New data member.
7439 * target.h (Sized_target::init_got_plt_for_update): New function.
7440 (Sized_target::register_global_plt_entry): New function.
7441 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7442 Initialize new data member; call init; add constructor with PLT count.
7443 (Output_data_plt_x86_64::init): New function.
7444 (Output_data_plt_x86_64::add_relocation): New function.
7445 (Output_data_plt_x86_64::reserve_slot): New function.
7446 (Output_data_plt_x86_64::free_list_): New data member.
7447 (Target_x86_64::init_got_plt_for_update): New function.
7448 (Target_x86_64::register_global_plt_entry): New function.
7449 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7450 incremental updates.
7451 (Output_data_plt_x86_64::add_relocation): New function.
7452 * testsuite/object_unittest.cc (Object_test): Set default options.
7453
ec69d6da
ILT
74542011-05-16 Ian Lance Taylor <iant@google.com>
7455
7456 * options.h (class General_options): Make -i a synonym for -r.
7457
732e31de
ILT
74582011-05-16 Ian Lance Taylor <iant@google.com>
7459
7460 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7461
403676b5
CC
74622011-05-10 Cary Coutant <ccoutant@google.com>
7463
7464 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7465 strip_all (-s).
7466
5b7b7d6e
ILT
74672011-05-06 Ian Lance Taylor <iant@google.com>
7468
7469 * layout.cc (Layout::layout): If the output section flags change,
7470 update the ordering.
7471
f0f9babf
CC
74722011-04-25 Cary Coutant <ccoutant@google.com>
7473
7474 * incremental-dump.cc (dump_incremental_inputs): Print local
7475 symbol info for each input file.
7476 * incremental.cc
7477 (Output_section_incremental_inputs::set_final_data_size): Add local
7478 symbol info to input file entries in incremental info.
7479 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7480 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7481 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7482 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7483 implementation.
7484 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7485 (Sized_incr_relobj::do_relocate): Write the local symbols.
7486 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7487 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7488 Adjust size of input file header.
7489 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7490 (Incremental_inputs_reader::get_local_symbol_count): New function.
7491 (Incremental_inputs_reader::get_input_section): Adjust size of input
7492 file header.
7493 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7494 (Sized_incr_relobj::This): New typedef.
7495 (Sized_incr_relobj::sym_size): New const data member.
7496 (Sized_incr_relobj::Local_symbol): New struct.
7497 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7498 (Sized_incr_relobj::do_local_symbol_offset): New function.
7499 (Sized_incr_relobj::local_symbol_count_): New data member.
7500 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7501 (Sized_incr_relobj::local_symbol_index_): New data member.
7502 (Sized_incr_relobj::local_symbol_offset_): New data member.
7503 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7504 (Sized_incr_relobj::local_symbols_): New data member.
7505 * object.h (Relobj::output_local_symbol_count): New function.
7506 (Relobj::local_symbol_offset): New function.
7507 (Relobj::do_output_local_symbol_count): New function.
7508 (Relobj::do_local_symbol_offset): New function.
7509 (Sized_relobj::do_output_local_symbol_count): New function.
7510 (Sized_relobj::do_local_symbol_offset): New function.
7511
d0a9ace3
ILT
75122011-04-22 Vladimir Simonov <sv@sw.ru>
7513
7514 * descriptors.cc (set_close_on_exec): New function.
7515 (Descriptors::open): Use set_close_on_exec.
7516 * output.cc (S_ISLNK): Define if not defined.
7517
94a3fc8b
CC
75182011-04-22 Cary Coutant <ccoutant@google.com>
7519
7520 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7521 global symbol map.
7522 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7523 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7524 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7525 relocations.
7526 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7527 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7528 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7529 * incremental.h
7530 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7531 function.
7532 (Incremental_binary::apply_incremental_relocs): New function.
7533 (Incremental_binary::do_apply_incremental_relocs): New function.
7534 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7535 data member.
7536 (Sized_incremental_binary::add_global_symbol): New function.
7537 (Sized_incremental_binary::global_symbol): New function.
7538 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7539 (Sized_incremental_binary::symbol_map_): New data member.
7540 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7541 * target.h (Sized_target::apply_relocation): New function.
7542 * target-reloc.h (apply_relocation): New function.
7543 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7544
c87e4302
DK
75452011-04-22 Doug Kwan <dougkwan@google.com>
7546
7547 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7548 flag of a SHT_ARM_EXIDX section.
2e702c99 7549 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7550 * testsuite/Makefile.in: Regenerate.
7551 * testsuite/arm_exidx_test.s: New file.
7552 * testsuite/arm_exidx_test.sh: Same.
7553
e7782cf6
CC
75542011-04-20 Cary Coutant <ccoutant@google.com>
7555
7556 PR gold/12689
7557 * archive.h (Incremental_archive_entry::Archive_member):
7558 Initialize arg_serial_ (second constructor).
7559
308ecdc7
ILT
75602011-04-17 Ian Lance Taylor <iant@google.com>
7561
7562 * object.cc (Relocate_info::location): Simplify location string.
7563 * errors.cc (Errors::error_at_location): Don't print program
7564 name.
7565 (Errors::warning_at_location): Likewise.
7566 (Errors::undefined_symbol): Likewise.
7567 * testsuite/debug_msg.sh: Update accordingly.
7568
bec5b579
CC
75692011-04-14 Cary Coutant <ccoutant@google.com>
7570
7571 * gold/layout.cc (Layout::symtab_section_offset): New function.
7572 * gold/layout.h (Layout::symtab_section_offset): New function.
7573 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7574
88597d34
ILT
75752011-04-12 Ian Lance Taylor <iant@google.com>
7576
7577 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7578 with MREMAP_MAYMOVE.
7579 * output.h (class Output_file): Add map_is_allocated_ field.
7580 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7581 not available, provide stubs. If mremap is not available, #define
7582 it to gold_mremap.
7583 (MREMAP_MAYMOVE): Define if not defined.
7584 (Output_file::Output_file): Initialize map_is_allocated_.
7585 (Output_file::resize): Check map_is_allocated_.
7586 (Output_file::map_anonymous): If mmap fails, use malloc.
7587 (Output_file::unmap): Don't do anything for an anonymous map.
7588 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7589 is not available, provide stubs.
7590 (File_read::View::~View): Use free rather than delete[].
7591 (File_read::make_view): Use malloc rather than new[]. If mmap
7592 fails, use malloc.
7593 (File_read::find_or_make_view): Use malloc rather than new[].
7594 * gold.h: Remove HAVE_REMAP code.
7595 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7596 exists. Rename mremap to gold_mremap. If mmap is not available
7597 don't do anything.
7598 * configure, config.in: Rebuild.
7599
11e361bc
ILT
76002011-04-11 Ian Lance Taylor <iant@google.com>
7601
7602 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7603 initialize local variable v.
7604
cdc29364
CC
76052011-04-11 Cary Coutant <ccoutant@google.com>
7606
7607 * archive.cc (Archive::include_member): Adjust call to
7608 report_object.
7609 (Add_archive_symbols::run): Track argument serial numbers.
7610 (Lib_group::include_member): Likewise.
7611 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7612 * archive.h (Incremental_archive_entry::Archive_member):
7613 Initialize arg_serial_.
7614 (Archive_member::arg_serial_): New data member.
7615 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7616 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7617 incremental link.
7618 (Sized_dynobj::do_for_all_local_got_entries): New function.
7619 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7620 function.
7621 * fileread.cc (get_mtime): New function.
7622 * fileread.h (get_mtime): New function.
7623 * gold.cc (queue_initial_tasks): Check for incremental update.
7624 (process_incremental_input): New function.
7625 (queue_middle_tasks): Don't force valid target for incremental
7626 update.
7627 * incremental-dump.cc (find_input_containing_global): Adjust
7628 size of symbol info entry.
7629 (dump_incremental_inputs): Dump argument serial number and
7630 in_system_directory flag; bias shndx by 1; print symbol names
7631 when dumping per-file symbol lists; use new symbol info readers.
7632 * incremental.cc
7633 (Output_section_incremental_inputs:update_data_size): New function.
7634 (Sized_incremental_binary::setup_readers): Setup input readers
7635 for each input file; build maps for files added from libraries
7636 and scripts.
7637 (Sized_incremental_binary::check_input_args): New function.
7638 (Sized_incremental_binary::do_check_inputs): Build map of argument
7639 serial numbers to input arguments.
7640 (Sized_incremental_binary::do_file_has_changed): Rename
7641 do_file_is_unchanged to this; compare file modification times.
7642 (Sized_incremental_binary::do_init_layout): New function.
7643 (Sized_incremental_binary::do_reserve_layout): New function.
7644 (Sized_incremental_binary::do_get_input_reader): Remove.
7645 (Sized_incremental_binary::get_symtab_view): New function.
7646 (Incremental_checker::can_incrementally_link_output_file): Remove.
7647 (Incremental_inputs::report_command_line): Exclude --debug options.
7648 (Incremental_inputs::report_archive_begin): Add parameter; track
7649 argument serial numbers; don't put input file entry for archive
7650 before archive members.
7651 (Incremental_inputs::report_archive_end): Put input file entry
7652 for archive after archive members.
7653 (Incremental_inputs::report_object): Add parameter; track argument
7654 serial numbers and in_system_directory flag.
7655 (Incremental_inputs::report_script): Add parameter; track argument
7656 serial numbers.
7657 (Output_section_incremental_inputs::set_final_data_size): Adjust
7658 size of symbol info entry; check for forwarding symbols.
7659 (Output_section_incremental_inputs::write_input_files): Write
7660 in_system_directory flag and argument serial number.
7661 (Output_section_incremental_inputs::write_info_blocks): Map section
7662 indices between incremental info and original input file; store
7663 input section index for each symbol.
7664 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7665 change operator() to visit().
7666 (class Global_got_offset_visitor): Likewise.
7667 (class Global_symbol_visitor_got_plt):
7668 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7669 classes.
7670 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7671 (Sized_incr_relobj::do_read_symbols): New function.
7672 (Sized_incr_relobj::do_layout): New function.
7673 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7674 (Sized_incr_relobj::do_add_symbols): New function.
7675 (Sized_incr_relobj::do_should_include_member): New function.
7676 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7677 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7678 (Sized_incr_relobj::do_section_size): New function.
7679 (Sized_incr_relobj::do_section_name): New function.
7680 (Sized_incr_relobj::do_section_contents): New function.
7681 (Sized_incr_relobj::do_section_flags): New function.
7682 (Sized_incr_relobj::do_section_entsize): New function.
7683 (Sized_incr_relobj::do_section_address): New function.
7684 (Sized_incr_relobj::do_section_type): New function.
7685 (Sized_incr_relobj::do_section_link): New function.
7686 (Sized_incr_relobj::do_section_info): New function.
7687 (Sized_incr_relobj::do_section_addralign): New function.
7688 (Sized_incr_relobj::do_initialize_xindex): New function.
7689 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7690 (Sized_incr_relobj::do_read_relocs): New function.
7691 (Sized_incr_relobj::do_gc_process_relocs): New function.
7692 (Sized_incr_relobj::do_scan_relocs): New function.
7693 (Sized_incr_relobj::do_count_local_symbols): New function.
7694 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7695 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7696 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7697 (Sized_incr_relobj::do_relocate): New function.
7698 (Sized_incr_relobj::do_set_section_offset): New function.
7699 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7700 (Sized_incr_dynobj::do_read_symbols): New function.
7701 (Sized_incr_dynobj::do_layout): New function.
7702 (Sized_incr_dynobj::do_add_symbols): New function.
7703 (Sized_incr_dynobj::do_should_include_member): New function.
7704 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7705 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7706 (Sized_incr_dynobj::do_section_size): New function.
7707 (Sized_incr_dynobj::do_section_name): New function.
7708 (Sized_incr_dynobj::do_section_contents): New function.
7709 (Sized_incr_dynobj::do_section_flags): New function.
7710 (Sized_incr_dynobj::do_section_entsize): New function.
7711 (Sized_incr_dynobj::do_section_address): New function.
7712 (Sized_incr_dynobj::do_section_type): New function.
7713 (Sized_incr_dynobj::do_section_link): New function.
7714 (Sized_incr_dynobj::do_section_info): New function.
7715 (Sized_incr_dynobj::do_section_addralign): New function.
7716 (Sized_incr_dynobj::do_initialize_xindex): New function.
7717 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7718 (make_sized_incremental_object): New function.
7719 (Incremental_library::copy_unused_symbols): New function.
7720 (Incremental_library::do_for_all_unused_symbols): New function.
7721 * incremental.h (enum Incremental_input_flags): New type.
7722 (class Incremental_checker): Remove.
7723 (Incremental_input_entry::Incremental_input_entry): Add argument
7724 serial number.
7725 (Incremental_input_entry::arg_serial): New function.
7726 (Incremental_input_entry::set_is_in_system_directory): New function.
7727 (Incremental_input_entry::is_in_system_directory): New function.
7728 (Incremental_input_entry::arg_serial_): New data member.
7729 (Incremental_input_entry::is_in_system_directory_): New data member.
7730 (class Script_info): Move here from script.h.
7731 (Script_info::Script_info): Add filename parameter.
7732 (Script_info::filename): New function.
7733 (Script_info::filename_): New data member.
7734 (Incremental_script_entry::Incremental_script_entry): Add argument
7735 serial number.
7736 (Incremental_object_entry::Incremental_object_entry): Likewise.
7737 (Incremental_object_entry::add_input_section): Build list of input
7738 sections with map to original shndx.
7739 (Incremental_object_entry::get_input_section_index): New function.
7740 (Incremental_object_entry::shndx_): New data member.
7741 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7742 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7743 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7744 serial number.
7745 (Incremental_inputs::report_archive_begin): Likewise.
7746 (Incremental_inputs::report_object): Likewise.
7747 (Incremental_inputs::report_script): Likewise.
7748 (class Incremental_global_symbol_reader): New class.
7749 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7750 and store flags and input file type.
7751 (Incremental_input_entry_reader::arg_serial): New function.
7752 (Incremental_input_entry_reader::type): Extract type from flags.
7753 (Incremental_input_entry_reader::is_in_system_directory): New function.
7754 (Incremental_input_entry_reader::get_input_section_count): Call
7755 accessor function for type.
7756 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7757 function for type; adjust size of global symbol entry.
7758 (Incremental_input_entry_reader::get_global_symbol_count): Call
7759 accessor function for type.
7760 (Incremental_input_entry_reader::get_object_count): Likewise.
7761 (Incremental_input_entry_reader::get_object_offset): Likewise.
7762 (Incremental_input_entry_reader::get_member_count): Likewise.
7763 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7764 (Incremental_input_entry_reader::get_member_offset): Likewise.
7765 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7766 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7767 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7768 (Incremental_input_entry_reader::get_global_symbol_reader): New
7769 function.
7770 (Incremental_input_entry_reader::get_output_symbol_index): New
7771 function.
7772 (Incremental_input_entry_reader::type_): Remove.
7773 (Incremental_input_entry_reader::flags_): New data member.
7774 (Incremental_inputs_reader::input_file_offset): New function.
7775 (Incremental_inputs_reader::input_file_index): New function.
7776 (Incremental_inputs_reader::input_file): Call input_file_offset.
7777 (Incremental_inputs_reader::input_file_at_offset): New function.
7778 (Incremental_relocs_reader::get_r_type): Reformat.
7779 (Incremental_relocs_reader::get_r_shndx): Reformat.
7780 (Incremental_relocs_reader::get_r_offset): Reformat.
7781 (Incremental_relocs_reader::data): New function.
7782 (Incremental_binary::Incremental_binary): Initialize new data members.
7783 (Incremental_binary::check_inputs): Add cmdline parameter.
7784 (Incremental_binary::file_is_unchanged): Remove.
7785 (Input_reader::arg_serial): New function.
7786 (Input_reader::get_unused_symbol_count): New function.
7787 (Input_reader::get_unused_symbol): New function.
7788 (Input_reader::do_arg_serial): New function.
7789 (Input_reader::do_get_unused_symbol_count): New function.
7790 (Input_reader::do_get_unused_symbol): New function.
7791 (Incremental_binary::input_file_count): New function.
7792 (Incremental_binary::get_input_reader): Change signature to use
7793 index instead of filename.
7794 (Incremental_binary::file_has_changed): New function.
7795 (Incremental_binary::get_input_argument): New function.
7796 (Incremental_binary::get_library): New function.
7797 (Incremental_binary::get_script_info): New function.
7798 (Incremental_binary::init_layout): New function.
7799 (Incremental_binary::reserve_layout): New function.
7800 (Incremental_binary::output_file): New function.
7801 (Incremental_binary::do_check_inputs): New function.
7802 (Incremental_binary::do_file_is_unchanged): Remove.
7803 (Incremental_binary::do_file_has_changed): New function.
7804 (Incremental_binary::do_init_layout): New function.
7805 (Incremental_binary::do_reserve_layout): New function.
7806 (Incremental_binary::do_input_file_count): New function.
7807 (Incremental_binary::do_get_input_reader): Change signature.
7808 (Incremental_binary::input_args_map_): New data member.
7809 (Incremental_binary::library_map_): New data member.
7810 (Incremental_binary::script_map_): New data member.
7811 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7812 new data members.
7813 (Sized_incremental_binary::output_section): New function.
7814 (Sized_incremental_binary::inputs_reader): Add const.
7815 (Sized_incremental_binary::symtab_reader): Add const.
7816 (Sized_incremental_binary::relocs_reader): Add const.
7817 (Sized_incremental_binary::got_plt_reader): Add const.
7818 (Sized_incremental_binary::get_symtab_view): New function.
7819 (Sized_incremental_binary::Inputs_reader): New typedef.
7820 (Sized_incremental_binary::Input_entry_reader): New typedef.
7821 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7822 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7823 (Sized_incremental_binary::do_file_has_changed): New function.
7824 (Sized_incremental_binary::do_init_layout): New function.
7825 (Sized_incremental_binary::do_reserve_layout): New function.
7826 (Sized_input_reader::Inputs_reader): Remove.
7827 (Sized_input_reader::Input_entry_reader): Remove.
7828 (Sized_input_reader::do_arg_serial): New function.
7829 (Sized_input_reader::do_get_unused_symbol_count): New function.
7830 (Sized_input_reader::do_get_unused_symbol): New function.
7831 (Sized_incremental_binary::do_input_file_count): New function.
7832 (Sized_incremental_binary::do_get_input_reader): Change signature;
7833 use index instead of filename.
7834 (Sized_incremental_binary::section_map_): New data member.
7835 (Sized_incremental_binary::input_entry_readers_): New data member.
7836 (class Sized_incr_relobj): New class.
7837 (class Sized_incr_dynobj): New class.
7838 (make_sized_incremental_object): New function.
7839 (class Incremental_library): New class.
7840 * layout.cc (Free_list::num_lists): New static data member.
7841 (Free_list::num_nodes): New static data member.
7842 (Free_list::num_removes): New static data member.
7843 (Free_list::num_remove_visits): New static data member.
7844 (Free_list::num_allocates): New static data member.
7845 (Free_list::num_allocate_visits): New static data member.
7846 (Free_list::init): New function.
7847 (Free_list::remove): New function.
7848 (Free_list::allocate): New function.
7849 (Free_list::dump): New function.
7850 (Free_list::print_stats): New function.
7851 (Layout_task_runner::run): Resize output file for incremental updates.
7852 (Layout::Layout): Initialize new data members.
7853 (Layout::set_incremental_base): New function.
7854 (Layout::init_fixed_output_section): New function.
7855 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7856 incremental updates.
7857 (Layout::create_gold_note): Do not create gold note section for
7858 incremental updates.
7859 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7860 for incremental updates.
7861 (Layout::set_section_offsets): For incremental updates, allocate space
7862 from free list.
7863 (Layout::create_symtab_sections): Layout with offsets relative to
7864 start of section; for incremental updates, allocate space from free
7865 list.
7866 (Layout::create_shdrs): For incremental updates, allocate space from
7867 free list.
7868 (Layout::finish_dynamic_section): For incremental updates, do not
7869 check --as-needed (fixed in subsequent patch).
7870 * layout.h (class Free_list): New class.
7871 (Layout::set_incremental_base): New function.
7872 (Layout::incremental_base): New function.
7873 (Layout::init_fixed_output_section): New function.
7874 (Layout::allocate): New function.
7875 (Layout::incremental_base_): New data member.
7876 (Layout::free_list_): New data member.
7877 * main.cc (main): Print Free_list statistics.
7878 * object.cc (Relobj::finalize_incremental_relocs): Add
7879 clear_counts parameter; clear counts only when clear_counts is set.
7880 (Sized_relobj::Sized_relobj): Initialize new base class.
7881 (Sized_relobj::do_layout): Don't report special sections.
7882 (Sized_relobj::do_for_all_local_got_entries): New function.
7883 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7884 symtab_off to all symbol table offsets.
7885 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7886 * object.h (class Got_offset_list): Move to top of file.
7887 (Object::Object): Allow case where input_file == NULL.
7888 (Object::~Object): Likewise.
7889 (Object::input_file): Assert that input_file != NULL.
7890 (Object::lock): Allow case where input_file == NULL.
7891 (Object::unlock): Likewise.
7892 (Object::is_locked): Likewise.
7893 (Object::token): Likewise.
7894 (Object::release): Likewise.
7895 (Object::is_incremental): New function.
7896 (Object::get_mtime): New function.
7897 (Object::for_all_local_got_entries): New function.
7898 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7899 (Object::set_is_in_system_directory): New function.
7900 (Object::is_in_system_directory): New function.
7901 (Object::do_is_incremental): New function.
7902 (Object::do_get_mtime): New function.
7903 (Object::do_for_all_local_got_entries): New function.
7904 (Object::is_in_system_directory_): New data member.
7905 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7906 (class Sized_relobj_base): New class.
7907 (class Sized_relobj): Derive from Sized_relobj_base.
7908 (class Sized_relobj::Symbols): Redeclare from base class.
7909 (class Sized_relobj::local_got_offset_list): Remove.
7910 (class Sized_relobj::Output_sections): Redeclare from base class.
7911 (class Sized_relobj::do_for_all_local_got_entries): New function.
7912 (class Sized_relobj::write_local_symbols): Add offset parameter.
7913 (class Sized_relobj::local_symbol_offset_): Update comment.
7914 (class Sized_relobj::local_dynsym_offset_): Update comment.
7915 * options.cc (Input_arguments::add_file): Remove const.
7916 * options.h (Input_file_argument::Input_file_argument):
7917 Initialize arg_serial_ (all constructors).
7918 (Input_file_argument::set_arg_serial): New function.
7919 (Input_file_argument::arg_serial): New function.
7920 (Input_file_argument::arg_serial_): New data member.
7921 (Input_arguments::Input_arguments): Initialize file_count_.
7922 (Input_arguments::add_file): Remove const.
7923 (Input_arguments::number_of_input_files): New function.
7924 (Input_arguments::file_count_): New data member.
7925 (Command_line::number_of_input_files): Call
7926 Input_arguments::number_of_input_files.
7927 * output.cc (Output_segment_headers::Output_segment_headers):
7928 Set current size.
7929 (Output_section::Input_section::current_data_size): New function.
7930 (Output_section::Output_section): Initialize new data members.
7931 (Output_section::add_input_section): Don't do merge sections for
7932 an incremental link; allocate space from free list for an
7933 incremental update.
7934 (Output_section::add_output_section_data): Allocate space from
7935 free list for an incremental update.
7936 (Output_section::update_data_size): New function.
7937 (Output_section::set_fixed_layout): New function.
7938 (Output_section::reserve): New function.
7939 (Output_segment::set_section_addresses): Remove const.
7940 (Output_segment::set_section_list_addresses): Remove const; allocate
7941 space from free list for an incremental update.
7942 (Output_segment::set_offset): Adjust size of RELRO segment for an
7943 incremental update.
7944 * output.h (Output_data::current_data_size): Move here from
7945 child classes.
7946 (Output_data::pre_finalize_data_size): New function.
7947 (Output_data::update_data_size): New function.
7948 (Output_section_headers::update_data_size): new function.
7949 (Output_section_data_build::current_data_size): Move to Output_data.
7950 (Output_data_strtab::update_data_size): New function.
7951 (Output_section::current_data_size): Move to Output_data.
7952 (Output_section::set_fixed_layout): New function.
7953 (Output_section::has_fixed_layout): New function.
7954 (Output_section::reserve): New function.
7955 (Output_section::update_data_size): New function.
7956 (Output_section::has_fixed_layout_): New data member.
7957 (Output_section::free_list_): New data member.
7958 (Output_segment::set_section_addresses): Remove const.
7959 (Output_segment::set_section_list_addresses): Remove const.
7960 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7961 New function.
7962 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7963 New function.
7964 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7965 parameter when calling Add_symbols constructor; store argument
7966 serial number for members of a lib group.
7967 (Add_symbols::locks): Allow case where token == NULL.
7968 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7969 (Read_member::~Read_member): New function.
7970 (Read_member::is_runnable): New function.
7971 (Read_member::locks): New function.
7972 (Read_member::run): New function.
7973 (Check_script::~Check_script): New function.
7974 (Check_script::is_runnable): New function.
7975 (Check_script::locks): New function.
7976 (Check_script::run): New function.
7977 (Check_library::~Check_library): New function.
7978 (Check_library::is_runnable): New function.
7979 (Check_library::locks): New function.
7980 (Check_library::run): New function.
7981 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7982 (Add_symbols::library_): New data member.
7983 (class Read_member): New class.
7984 (class Check_script): New class.
7985 (class Check_library): New class.
7986 * reloc.cc (Read_relocs::is_runnable): Allow case where
7987 token == NULL.
7988 (Read_relocs::locks): Likewise.
7989 (Scan_relocs::locks): Likewise.
7990 (Relocate_task::locks): Likewise.
7991 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7992 to clear counters.
7993 (Sized_relobj::incremental_relocs_scan): Fix comment.
7994 (Sized_relobj::do_relocate): Pass output file offset to
7995 write_local_symbols.
7996 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7997 from class declaration.
7998 * script.cc (read_input_script): Allocate Script_info; pass
7999 argument serial number to report_script.
8000 * script.h (class Script_info): Move to incremental.h.
8001 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8002 * symtab.h (Symbol_table::add_from_incrobj): New function.
8003 (Symbol_table::set_file_offset): New function.
8004
b961d0d7
CC
80052011-04-05 Cary Coutant <ccoutant@google.com>
8006
8007 * incremental-dump.cc (dump_incremental_inputs): Change signature
8008 to take a Sized_incremental_binary; change caller. Use readers
8009 in Sized_incremental_binary.
8010 * incremental.cc
8011 (Sized_incremental_binary::find_incremental_inputs_sections):
8012 Rename do_find_incremental_inputs_sections to this.
8013 (Sized_incremental_binary::setup_readers): New function.
8014 (Sized_incremental_binary::do_check_inputs): Check
8015 has_incremental_info_ flag; move setup code to setup_readers;
8016 use input readers.
8017 (Sized_incremental_binary::do_file_is_unchanged): New function.
8018 (Sized_incremental_binary::do_get_input_reader): New function.
8019 * incremental.h (class Incremental_binary): Move to end of file.
8020 (Incremental_binary::file_is_unchanged): New function.
8021 (Incremental_binary::do_file_is_unchanged): New function.
8022 (Incremental_binary::Input_reader): New class.
8023 (Incremental_binary::get_input_reader): New function.
8024 (class Sized_incremental_binary): Move to end of file.
8025 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8026 input section reader classes.
8027 (Sized_incremental_binary::has_incremental_info): New function.
8028 (Sized_incremental_binary::inputs_reader): New function.
8029 (Sized_incremental_binary::symtab_reader): New function.
8030 (Sized_incremental_binary::relocs_reader): New function.
8031 (Sized_incremental_binary::got_plt_reader): New function.
8032 (Sized_incremental_binary::do_file_is_unchanged): New function.
8033 (Sized_incremental_binary::Sized_input_reader): New class.
8034 (Sized_incremental_binary::get_input_reader): New function.
8035 (Sized_incremental_binary::find_incremental_inputs_sections):
8036 Rename do_find_incremental_inputs_sections to this.
8037 (Sized_incremental_binary::setup_readers): New function.
8038 (Sized_incremental_binary::has_incremental_info_): New data member.
8039 (Sized_incremental_binary::inputs_reader_): New data member.
8040 (Sized_incremental_binary::symtab_reader_): New data member.
8041 (Sized_incremental_binary::relocs_reader_): New data member.
8042 (Sized_incremental_binary::got_plt_reader_): New data member.
8043 (Sized_incremental_binary::current_input_file_): New data member.
8044
a869183f
PP
80452011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8046
8047 PR gold/12640
8048 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8049 violation.
8050
80512011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8052
8053 * archive.cc (Archive::include_member): Adjust call to report_object.
8054 (Add_archive_symbols::run): Add script_info to call to
8055 report_archive_begin.
8056 (Lib_group::include_member): Adjust call to report_object.
8057 (Add_lib_group_symbols::run): Adjust call to report_object.
8058 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8059 blocks. Add object count for script input files.
8060 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8061 script_info parameter; change all callers.
8062 (Incremental_inputs::report_object): Add script_info parameter;
8063 change all callers.
8064 (Incremental_inputs::report_script): Store backpointer to
8065 incremental info entry.
8066 (Output_section_incremental_inputs::set_final_data_size): Record
8067 additional information for scripts.
8068 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8069 * incremental.h (Incremental_script_entry::add_object): New function.
8070 (Incremental_script_entry::get_object_count): New function.
8071 (Incremental_script_entry::get_object): New function.
8072 (Incremental_script_entry::objects_): New data member; adjust
8073 constructor.
8074 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8075 (Incremental_inputs::report_object): Add script_info parameter.
8076 (Incremental_inputs_reader::get_object_count): New function.
8077 (Incremental_inputs_reader::get_object_offset): New function.
8078 * options.cc (Input_arguments::add_file): Return reference to
8079 new input argument.
8080 * options.h (Input_argument::set_script_info): New function.
8081 (Input_argument::script_info): New function.
8082 (Input_argument::script_info_): New data member; adjust all
8083 constructors.
8084 (Input_file_group::add_file): Return reference to new input argument.
8085 (Input_file_lib::add_file): Likewise.
8086 (Input_arguments::add_file): Likewise.
8087 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8088 * script.cc (Parser_closure::Parser_closure): Add script_info
8089 parameter; adjust all callers.
8090 (Parser_closure::script_info): New function.
8091 (Parser_closure::script_info_): New data member.
8092 (read_input_script): Report scripts earlier to incremental info.
8093 (script_add_file): Set script_info in Input_argument.
8094 (script_add_library): Likewise.
8095 * script.h (Script_options::Script_info): Rewrite class.
8096
a869183f 80972011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8098
8099 * archive.cc (Library_base::should_include_member): Move
8100 method here from class Archive.
8101 (Archive::Archive): Initialize base class.
8102 (Archive::should_include_member): Move to base class.
8103 (Archive::do_for_all_unused_symbols): New function.
8104 (Add_archive_symbols::run): Remove redundant access to
8105 incremental_inputs.
8106 (Lib_group::Lib_group): Initialize base class.
8107 (Lib_group::do_filename): New function.
8108 (Lib_group::include_member): Pass pointer to Lib_group to
8109 report_object.
8110 (Lib_group::do_for_all_unused_symbols): New function.
8111 (Add_lib_group_symbols::run): Report archive information for
8112 incremental links.
8113 * archive.h (class Library_base): New base class.
8114 (class Archive): Derive from Library_base.
8115 (Archive::filename): Move to base class.
8116 (Archive::set_incremental_info): Likewise.
8117 (Archive::incremental_info): Likewise.
8118 (Archive::Should_include): Likewise.
8119 (Archive::should_include_member): Likewise.
8120 (Archive::Armap_entry): Remove.
8121 (Archive::Unused_symbol_iterator): Remove.
8122 (Archive::unused_symbols_begin): Remove.
8123 (Archive::unused_symbols_end): Remove.
8124 (Archive::do_filename): New function.
8125 (Archive::do_get_mtime): New function.
8126 (Archive::do_for_all_unused_symbols): New function.
8127 (Archive::task_): Move to base class.
8128 (Archive::incremental_info_): Likewise.
8129 (class Lib_group): Derive from Library_base.
8130 (Lib_group::do_filename): New function.
8131 (Lib_group::do_get_mtime): New function.
8132 (Lib_group::do_for_all_unused_symbols): New function.
8133 (Lib_group::task_): Move to base class.
8134 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8135 function.
8136 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8137 function.
8138 * incremental.cc (Incremental_inputs::report_archive_begin):
8139 Use Library_base; call library's get_mtime; add incremental inputs
8140 entry before members.
8141 (class Unused_symbol_visitor): New class.
8142 (Incremental_inputs::report_archive_end): Use Library_base; use
8143 visitor class to record unused symbols; don't add incremental inputs
8144 entry after members.
8145 (Incremental_inputs::report_object): Use Library_base.
8146 * incremental.h
8147 (Incremental_archive_entry::Incremental_archive_entry): Remove
8148 unused Archive parameter.
8149 (Incremental_inputs::report_archive_begin): Use Library_base.
8150 (Incremental_inputs::report_archive_end): Likewise.
8151 (Incremental_inputs::report_object): Likewise.
8152 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8153 function.
8154 * object.h (Object::for_all_global_symbols): New function.
8155 (Object::do_for_all_global_symbols): New function.
8156 (Sized_relobj::do_for_all_global_symbols): New function.
8157 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8158 function.
8159 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8160 function.
8161
61ab3e40
ILT
81622011-03-27 Ian Lance Taylor <iant@google.com>
8163
8164 * archive.cc (Archive::interpret_header): Return -1 if something
8165 goes wrong. Change callers accordingly.
8166
30e1f9e6
CC
81672011-03-25 Cary Coutant <ccoutant@google.com>
8168
8169 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8170 * testsuite/Makefile.in: Regenerate.
8171
9370ce59 81722011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8173
8174 * plugin.cc (get_view): New.
8175 (Plugin::load): Pass get_view to the plugin.
8176 (Plugin_manager::get_view): New.
8177
9312bb0a
ILT
81782011-03-21 Ian Lance Taylor <iant@google.com>
8179
8180 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8181 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8182
7e12ba9e
ST
81832011-03-21 Sriraman Tallam <tmsriram@google.com>
8184
8185 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8186 Change == to -eq.
8187 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8188 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8189 Change == to -eq.
8190 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8191 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8192
fd7a005d
ILT
81932011-03-14 Ian Lance Taylor <iant@google.com>
8194
8195 * script-sections.cc (Sort_output_sections::script_compare):
8196 Rename from is_before, change return type.
8197 (Sort_output_sections::operator()): Adjust accordingly.
8198
ed16fd1b
ILT
81992011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8200
8201 PR gold/12572
8202 * testsuite/odr_violation2.cc: Add comment to make all error line
8203 numbers double digits.
8204 * testsuite/debug_msg.sh: Adjust expected errors.
8205
71ff8986
ILT
82062011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8207
8208 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8209 but mark earlier ones as non-canonical
8210 (offset_to_iterator): Update search target and example
8211 (do_addr2line): Return extra lines in a vector*
8212 (format_file_lineno): Extract from do_addr2line
8213 (one_addr2line): Add vector* out-param
8214 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8215 when a lineno entry appeared last for its instruction
8216 (Dwarf_line_info): Add vector* out-param
8217 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8218 * symtab.cc (Odr_violation_compare): Include the lineno in the
8219 comparison again.
8220 (linenos_from_loc): New. Combine the canonical line for an
8221 address with its other lines.
8222 (True_if_intersect): New. Helper functor to make
8223 std::set_intersection a query.
8224 (detect_odr_violations): Compare sets of lines instead of just
8225 one line for each function. This became less deterministic, but
8226 has fewer false positives.
8227 * symtab.h: Declarations.
8228 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8229 mix an optimized and non-optimized object in the same binary
8230 (odr_violation2.so): Same.
8231 * testsuite/Makefile.in: Regenerate from Makefile.am.
8232 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8233 * testsuite/debug_msg.sh: Update line numbers and add
8234 assertions.
8235 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8236 non-optimized context.
8237 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8238 isn't inlined, and use OdrDerived in an optimized context.
8239 * testsuite/odr_header1.h: Defines OdrDerived, where
8240 optimization will change the
8241 first-instruction-in-the-destructor's file and line number.
8242 * testsuite/odr_header2.h: Defines OdrBase.
8243
a19fefdc
ILT
82442011-03-09 Ian Lance Taylor <iant@google.com>
8245
8246 * fileread.cc (File_read::clear_views): Don't delete the whole
8247 file view.
8248
ecb351e9
ILT
82492011-03-08 Ian Lance Taylor <iant@google.com>
8250
8251 PR gold/12525
8252 * fileread.cc: #include <climits>.
8253 (GOLD_IOV_MAX): Define.
8254 (File_read::read_multiple): Limit number of entries by iov_max.
8255 * fileread.h (class File_read): Always set max_readv_entries to
8256 128.
8257
b821d13c
ILT
82582011-03-07 Ian Lance Taylor <iant@google.com>
8259
8260 PR gold/12525
8261 * options.h (class General_options): Add -dy and -dn.
8262
89243142
CC
82632011-03-02 Cary Coutant <ccoutant@google.com>
8264
8265 * testsuite/script_test_9.t: Add TLS segment.
8266
d0773f31
ILT
82672011-03-02 Simon Baldwin <simonb@google.com>
8268
8269 * configure.ac: Add check for gnu_indirect_function support in
8270 the toolchain building binutils.
8271 * configure: Rebuild.
8272
9370ce59 82732011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8274
8275 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8276 plugin only symbols.
8277 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8278 in plugin files as not needed in the symbol table.
8279
4cf7a849
ST
82802011-02-11 Sriraman Tallam <tmsriram@google.com>
8281
8282 * output.cc (Output_section::add_input_section): Delay fill
8283 generation for section ordering.
8284
b578bd7d
ILT
82852011-02-09 Ian Lance Taylor <iant@google.com>
8286
8287 PR gold/12316
8288 * object.h (class Sized_relobj): Remove clear_local_symbols.
8289 * reloc.cc (Sized_relobj::do_relocate): Don't call
8290 clear_local_symbols.
8291
9370ce59 82922011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8293
8294 * plugin.cc (is_visible_from_outside): Return true for symbols
8295 in the -u option.
8296
55382fb7
ILT
82972011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8298
8299 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8300 filename.
8301
4e271fff
ST
83022011-02-02 Sriraman Tallam <tmsriram@google.com>
8303
8304 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8305 to std::string.
4e271fff 8306 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8307 section_name to be std::string.
4e271fff
ST
8308 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8309
d433c3ac
ILT
83102011-01-25 Ian Lance Taylor <iant@google.com>
8311
8312 * script.cc (script_add_extern): Rewrite to use
8313 add_symbol_reference.
8314
880473a6
DK
83152011-01-25 Doug Kwan <dougkwan@google.com>
8316
d433c3ac 8317 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8318
f30f86fa
ILT
83192011-01-24 Ian Lance Taylor <iant@google.com>
8320
8321 * options.h (class General_options): Accept
8322 --no-detect-odr-violations.
8323
8e51a0b9
ILT
83242011-01-24 Ian Lance Taylor <iant@google.com>
8325
8326 * version.cc (version_string): Bump to 1.11.
8327
0f3b89d8
ILT
83282011-01-24 Ian Lance Taylor <iant@google.com>
8329
8330 * plugin.cc (class Plugin_rescan): Define new class.
8331 (Plugin_manager::claim_file): Set any_claimed_.
8332 (Plugin_manager::save_archive): New function.
8333 (Plugin_manager::save_input_group): New function.
8334 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8335 necessary.
8336 (Plugin_manager::new_undefined_symbol): New function.
8337 (Plugin_manager::rescan): New function.
8338 (Plugin_manager::rescannable_defines): New function.
8339 (Plugin_manager::add_input_file): Set any_added_.
8340 * plugin.h (class Plugin_manager): define new fields rescannable_,
8341 undefined_symbols_, any_claimed_, and any_added_. Declare
8342 Plugin_rescan as friend. Declare new functions.
8343 (Plugin_manager::Rescannable): Define type.
8344 (Plugin_manager::Rescannable_list): Define type.
8345 (Plugin_manager::Undefined_symbol_list): Define type.
8346 (Plugin_manager::Plugin_manager): Initialize new fields.
8347 * archive.cc (Archive::defines_symbol): New function.
8348 (Add_archive_symbols::run): Pass archive to plugins if any.
8349 * archive.h (class Archive): Declare defines_symbol.
8350 * readsyms.cc (Input_group::~Input_group): New function.
8351 (Finish_group::run): Pass input_group to plugins if any.
8352 * readsyms.h (class Input_group): Declare destructor.
8353 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8354 any.
8355
3bb951e5
ILT
83562011-01-10 Ian Lance Taylor <iant@google.com>
8357
8358 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8359 section as relro.
8360 (Layout::set_segment_offsets): Reset increase_relro before calling
8361 set_section_addresses a second time.
8362
0aa45fac
CC
83632011-01-04 Cary Coutant <ccoutant@google.com>
8364
8365 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8366 sections before NOBITS sections.
8367
0db46eb4
L
83682011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8369
8370 * version.cc (print_version): Update copyright to 2011.
8371
829c9745
CC
83722010-12-23 Cary Coutant <ccoutant@google.com>
8373
8374 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8375 of OS to this->add. Add OD parameter to second form of the function.
8376
7500420b
ILT
83772010-12-20 Ian Lance Taylor <iant@google.com>
8378
8379 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8380 second of two consecutive entries with same offset.
8381
f8e9a930
RW
83822010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8383
8384 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8385 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8386 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8387 to avoid unneeded links against $(LDADD).
8388 * testsuite/Makefile.in: Regenerate.
8389
2fbb4320
ILT
83902010-12-15 Ian Lance Taylor <iant@google.com>
8391
8392 PR gold/12324
8393 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8394 for R_X86_64_32 and R_X86_64_PC32.
8395 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8396 ver_matching_def_pic.o.
8397 (ver_matching_def_pic.o): New target.
8398
fedb228d
RW
83992010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8400
8401 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8402 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8403 Move definition before File_read::View member definitions.
8404 (File_read::View::~View): Initialize and hold lock before
8405 updating current_mapped_bytes.
8406
9b547ce6
RW
84072010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8408
8409 * dwarf_reader.cc: Remove outdated comment.
8410 * gold-threads.cc: Fix typo in error message.
8411 * archive.cc: Fix typos in comments.
8412 * archive.h: Likewise.
8413 * arm-reloc-property.cc: Likewise.
8414 * arm-reloc-property.h: Likewise.
8415 * arm-reloc.def: Likewise.
8416 * arm.cc: Likewise.
8417 * attributes.h: Likewise.
8418 * cref.cc: Likewise.
8419 * ehframe.cc: Likewise.
8420 * fileread.h: Likewise.
8421 * gold.h: Likewise.
8422 * i386.cc: Likewise.
8423 * icf.cc: Likewise.
8424 * incremental.h: Likewise.
8425 * int_encoding.cc: Likewise.
8426 * layout.h: Likewise.
8427 * main.cc: Likewise.
8428 * merge.h: Likewise.
8429 * object.cc: Likewise.
8430 * object.h: Likewise.
8431 * options.cc: Likewise.
8432 * readsyms.cc: Likewise.
8433 * reduced_debug_output.cc: Likewise.
8434 * reloc.cc: Likewise.
8435 * script-sections.cc: Likewise.
8436 * sparc.cc: Likewise.
8437 * symtab.h: Likewise.
8438 * target-reloc.h: Likewise.
8439 * target.cc: Likewise.
8440 * target.h: Likewise.
8441 * timer.cc: Likewise.
8442 * timer.h: Likewise.
8443 * x86_64.cc: Likewise.
8444
83e17bd5
CC
84452010-12-09 Cary Coutant <ccoutant@google.com>
8446
8447 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8448 stack.
8449 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8450 parameter; change all callers.
8451 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8452 * options.h (warn_execstack): New option.
8453
017257f8
DK
84542010-12-07 Doug Kwan <dougkwan@google.com>
8455
8456 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8457 like function call relocations.
8458
c20cbc06
ILT
84592010-12-07 Ian Lance Taylor <iant@google.com>
8460
8461 * archive.cc (Archive::get_elf_object_for_member): Permit
8462 punconfigured to be NULL.
8463 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8464 (Archive::include_member): Pass NULL to get_elf_object_for_member
8465 if we searched for the archive and this is the first included
8466 object.
8467
4dbfafcc
ILT
84682010-12-01 Ian Lance Taylor <iant@google.com>
8469
8470 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8471 track_relocs_type_ field.
8472 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8473 Set track_relocs_type_.
8474 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8475 contents when using RELA relocs.
8476 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8477 reloc_map_.
8478 * reloc.cc (Track_relocs::next_addend): New function.
8479 * reloc.h (class Track_relocs): Declare next_addend.
8480
e5e19edd
ILT
84812010-12-01 Ian Lance Taylor <iant@google.com>
8482
8483 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8484 virtual destructor.
8485
9a5ce24c
ILT
84862010-12-01 Ian Lance Taylor <iant@google.com>
8487
8488 * README: Update compilers known to work and fail.
8489
c7791212
NC
84902010-11-23 Matthias Klose <doko@ubuntu.com>
8491
8492 * configure.in: For --enable-gold, handle value `default' instead of
8493 `both*'. Always install ld as ld.bfd, install as ld if gold is
8494 not the default.
8495 * configure: Regenerate.
8496
0ad220c9
DK
84972010-11-18 Doug Kwan <dougkwan@google.com>
8498
8499 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8500 and right_alignment to be zero. Store result alignment only if it is
8501 greater than existing alignment.
8502
ab8056e0
CC
85032010-11-16 Cary Coutant <ccoutant@google.com>
8504
8505 PR gold/12220
8506 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8507 Check for ".zdebug_line".
8508
fd064a5b
CC
85092010-11-16 Doug Kwan <dougkwan@google.com>
8510 Cary Coutant <ccoutant@google.com>
8511
8512 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8513 by reference; adjust all callers.
8514 * output.cc (Output_segment::set_section_addresses): Adjust references
8515 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8516 list is empty.
8517 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8518 end at page boundary.
8519
6fc6ea19
CC
85202010-11-16 Cary Coutant <ccoutant@google.com>
8521
8522 PR gold/12220
8523 * layout.cc (Layout::choose_output_section): Transform names of
8524 compressed sections even when using a script with a SECTIONS clause.
8525 (Layout::output_section_name): Remove code to transform
8526 compressed debug section names.
8527 * output.cc (Output_section::add_input_section): Use uncompressed
8528 section size when tracking input sections.
8529
95a2c8d6
RS
85302010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8531
8532 * symtab.h (Symbol::NON_PIC_REF): Remove.
8533 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8534 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8535 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8536 (Symbol::use_plt_offset): Take a flags argument and pass it
8537 directly to needs_dynamic_reloc. Restrict check for undefined
8538 weak symbols to function calls.
8539 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8540 (Target_arm::Scan::global): Use it.
8541 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8542 (Target_arm::Relocate::relocate): Likewise.
8543 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8544 parameter with an r_type parameter. Use get_reference_flags
8545 to get the flags.
8546 (Target_arm::Relocate::relocate): Update accordingly.
8547 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8548 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8549 (Target_i386::Scan::global): Likewise.
8550 (Target_i386::Relocate::relocate): Likewise.
8551 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8552 parameter with an r_type parameter. Use get_reference_flags
8553 to get the flags.
8554 (Target_i386::Relocate::relocate): Update accordingly.
8555 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8556 (Target_powerpc::Scan::global): Use it.
8557 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8558 (Target_powerpc::Relocate::relocate): Likewise.
8559 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8560 (Target_sparc::Scan::global): Use it.
8561 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8562 (Target_sparc::Relocate::relocate): Likewise.
8563 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8564 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8565 (Target_x86_64::Scan::global): Likewise.
8566 (Target_x86_64::Relocate::relocate): Likewise.
8567
f625ae50
DK
85682010-11-08 Doug Kwan <dougkwan@google.com>
8569 Cary Coutant <ccoutant@google.com>
8570
8571 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8572 (Arm_exidx_merge_section::section_contents_): New data member.
8573 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8574 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8575 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8576 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8577 in parameters instead of calling Object::section_contents without
8578 locking.
8579 (Arm_output_section::group_section): New parameter TASK. Pass it
8580 to callees that need locking objects.
8581 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8582 to lock EXIDX input sections. Fix a formatting issue. Call
8583 Arm_exidx_merged_section::build_contents to create merged section
8584 contents.
8585 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8586 to lock object of stub table owner.
8587 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8588 TEXT_SIZE to initialize data member TEXT_SIZE_.
8589 (Arm_exidx_input_section::addralign): Fix typo in comment.
8590 (Arm_exidx_input_section::text_size): New method.
8591 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8592 that require locking objects. Lock objects before scanning for stubs
8593 and updating local symbols.
8594 (Arm_input_section<big_endian>::init): Copy contents of original
8595 input section.
2e702c99 8596 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8597 original input section instead of calling Object::section_contents
8598 without locking.
8599 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8600 size without calling Object::section_size().
8601 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8602 for size. Allocate a buffer for merged EXIDX entries.
8603 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8604 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8605 building code to Arm_exidx_merged_section::build_contetns. Write
8606 out contetns in buffer instead of building it on the fly.
8607 (Arm_relobj::make_exidx_input_section): Also pass text section size
8608 to Arm_exidx_input_section constructor.
8609 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8610 (Arm_dynobj::do_read_symbols): Fix memory leak.
8611 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8612 * target.h: (class Task): Add forward declaration.
8613 (Target::relax): Add new parameter TASK and pass it to
8614 Target::do_relax().
8615 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8616
5f9bcf58
CC
86172010-11-05 Cary Coutant <ccoutant@google.com>
8618
8619 PR gold/10708
8620 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8621 object when reading from the file.
8622 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8623 second layout pass.
8624 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8625 when reading section contents.
8626 (get_section_contents): Likewise.
8627 (icf::find_identical_sections): Likewise.
8628 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8629 object when reading from the file.
8630 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8631 the object when doing deferred section layout.
8632
e597fa08
NC
86332010-11-03 Nick Clifton <nickc@redhat.com>
8634
8635 PR gold/12001
8636 * script.h (class Symbol_assignment: name): New member. Returns
8637 the name of the symbol.
8638 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8639 Returns true if the given symbol name is on the list of
8640 assignments wating to be processed.
8641 * archive.cc (should_incldue_member): If the symbol is undefined,
8642 check to see if it is on the list of symbols pending assignment.
8643
3f9a3278
ILT
86442010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8645
8646 * script-sections.cc (Script_sections::find_memory_region): Check
8647 for a NULL output section pointer.
8648
d06fb4d1
DK
86492010-10-29 Doug Kwan <dougkwan@google.com>
8650
8651 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8652 Output_section::add_relaxed_input_section.
8653 * output.cc (Output_section::add_relaxed_input_section): Add new
8654 arguments LAYOUT and NAME. Set section order index.
8655 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8656 Copy section order index.
8657 * output.h (Output_section::add_relaxed_input_section): Add new
8658 arguments LAYOUT and NAME.
8659
90e24de5
ILT
86602010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8661
8662 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8663 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8664 * testsuite/Makefile.in: Regenerate.
8665
c9484ea5
DK
86662010-10-20 Doug Kwan <dougkwan@google.com>
8667
8668 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8669 without SHF_LINK_ORDER flags.
8670 * layout.cc (Layout::choose_output_section): Do not filter
8671 SHF_LINK_ORDER flag in a relocatable link.
8672
5bc2f5be
CC
86732010-10-17 Cary Coutant <ccoutant@google.com>
8674
8675 * output.h (Output_segment::set_section_addresses): Change function
8676 signature. Update all callers.
8677 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8678 sections.
8679 (Output_segment::set_section_addresses): Align after last TLS
8680 section. Add padding before last relro section instead of after.
8681
0c91cf04
DK
86822010-10-17 Doug Kwan <dougkwan@google.com>
8683
8684 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8685 GOT output section to be writable.
8686
8c21d9d3
CC
86872010-10-14 Cary Coutant <ccoutant@google.com>
8688
8689 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8690 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8691 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8692 mode.
8693 * incremental.cc (report_command_line): Ignore all forms of
8694 --incremental.
8695 * layout.cc (Layout::Layout): Check parameters for incremental link
8696 mode.
8697 * options.cc (General_options::parse_incremental): New function.
8698 (General_options::parse_no_incremental): New function.
8699 (General_options::parse_incremental_full): New function.
8700 (General_options::parse_incremental_update): New function.
8701 (General_options::incremental_mode_): New data member.
8702 (General_options::finalize): Check incremental_mode_.
8703 * options.h (General_options): Update help text for --incremental.
8704 Add --no-incremental, --incremental-full, --incremental-update.
8705 (General_options::Incremental_mode): New enum type.
8706 (General_options::incremental_mode): New function.
8707 (General_options::incremental_mode_): New data member.
8708 * parameters.cc (Parameters::incremental_mode_): New data member.
8709 (Parameters::set_options): Set incremental_mode_.
8710 (Parameters::set_incremental_full): New function.
8711 (Parameters::incremental): New function.
8712 (Parameters::incremental_update): New function.
8713 (set_parameters_incremental_full): New function.
8714 * parameters.h (Parameters::set_incremental_full): New function.
8715 (Parameters::incremental): New function.
8716 (Parameters::incremental_update): New function.
8717 (Parameters::incremental_mode_): New data member.
8718 (set_parameters_incremental_full): New function.
8719 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8720 incremental link mode.
8721 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8722 (Sized_relobj::do_relocate_sections): Likewise.
8723 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8724 option.
8725 * testsuite/Makefile.in: Regenerate.
8726 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8727
bb32aa18 87282010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8729
8730 * script-sections.h (class Script_sections): Make
8731 Sections_elements typedef public.
8732 * script-sections.cc (class Sort_output_sections): Add elements_
8733 field. Add constructor which sets it; change all callers.
8734 (Sort_output_sections::is_before): New function.
8735 (Sort_output_sections::operator()): Call is_before.
8736 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8737 conditional.
8738 * testsuite/script_test_10.sh: New test. Test script section
8739 order.
8740 * testsuite/script_test_10.t: Likewise.
8741 * testsuite/script_test_10.s: Likewise.
8742 * testsuite/Makefile.am: Wrap the cross linker tests and the
8743 common tests into NATIVE_OR_CROSS_LINKER.
8744 (check_SCRIPTS): Add script_test_10.sh.
8745 (check_DATA): Add script_test_10.stdout.
8746 (script_test_10.o, script_test_10): New targets.
8747 (script_test_10.stdout): New target.
8748 * configure, testsuite/Makefile.in: Regenerate.
8749
3cef7179
ILT
87502010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8751
8752 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8753 error for the deprecated relocations.
8754 (Target_arm::Scan::global): Likewise.
8755 (Target_arm::Relocate::relocate): Likewise.
8756
7411e9a8
RS
87572010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8758
8759 * fileread.cc (Input_file::find_file): Initialize *found_name
8760 and *namep when using the fallback search for case 4.
8761
6a9da32a
CC
87622010-10-11 Cary Coutant <ccoutant@google.com>
8763
8764 * options.h (class General_options): Redefine -z lazy as an alias for
8765 the negation of -z now.
8766
ac897c20
ILT
87672010-10-11 Ian Lance Taylor <iant@google.com>
8768
8769 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8770 binding.
8771
ea5cae92
NC
87722010-10-06 Nick Clifton <nickc@redhat.com>
8773
8774 * script-sections.cc(class Memory_region): Remove
8775 current_lma_offset_ field. Rename current_vma_offset_ to
8776 current_offset_. Add last_section_ field.
8777 (Memory_region::get_current_vma_address): Rename to
8778 get_current_address.
8779 (Memory_region::get_current_lma_address): Delete.
8780 (Memory_region::increment_vma_offset): Rename to
8781 increment_offset.
8782 (Memory_region::increment_lma_offset): Delete.
8783 (Memory_region::attributes_compatible): New method. Returns
8784 true if the provided section is compatible with the region.
8785 (Memory_region::get_last_section): New method. Returns the last
8786 section to use the region.
8787 (Memory_region::set_last_section): New method. Stores the last
8788 section to use the region.
8789 (Script_sections::block_in_region): New method. Returns true if
8790 a block of memory is contained within a region.
8791 (Script_sections::find_memory_region): New method. Locates a
8792 memory region to be used to set a VMA or LMA address.
8793 (Output_section_definition::set_section_addresses): Add code to
8794 check for addresses set by memory regions.
8795 (Output_segment::set_section_addresses): Remove memory region
8796 walking code.
8797 (Script_sections::create_segment): Add a warning if a header
8798 segment is created outside of any region.
8799 * script-sections.h (class Script_sections): Add prototypes for
8800 find_memory_region and block_in_region methods.
8801 * testsuite/memory_test.s: Use .long instead of .word.
8802 * testsuite/memory_test.t: Add some more output sections.
8803 * testsuite/memory_test.sh: Update expected output.
8804
a9bfd952
DK
88052010-10-02 Doug Kwan <dougkwan@google.com>
8806
8807 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8808 defintion to symtab.h
8809 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8810 declaration to defintion.
8811
bacff3ab
NC
88122010-10-01 Nick Clifton <nickc@redhat.com>
8813
8814 * expression.cc (eval): Replace dummy argument with NULL.
8815 (eval_maybe_dot): Check for a NULL result section pointer.
8816 (Symbol_expression::value): Likewise.
8817 (Dot_expression::value): Likewise.
8818 (BINARY_EXPRESSION): Likewise.
8819 (Max_expression::value): Likewise.
8820 (Min_expression::value): Likewise.
8821 (Absolute_expression::value): Likewise.
8822 (Addr_expression::value_from_output_section): Likewise.
8823 (Loaddddr_expression::value_from_output_section): Likewise.
8824 (Segment_start_expression::value): Likewise.
8825 * script-sections.cc
8826 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8827 argument with NULL.
8828 (Sections_elememt_dot_assignment::set_section_addresses):
8829 Likewise.
8830 (Output_data_expression::do_write_to_buffer): Likewise.
8831 (Output_section_definition::finalize_symbols): Likewise.
8832 (Output_section_definition::set_section_addresses): Likewise.
8833
f81bc8b5
DK
88342010-09-30 Doug Kwan <dougkwan@google.com>
8835
8836 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8837
c95e9f27
ST
88382010-09-28 Sriraman Tallam <tmsriram@google.com>
8839
8840 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8841 function.
c95e9f27
ST
8842 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8843 virtual function.
8844 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8845 virtual function.
8846 * icf.cc (get_section_contents): Inline merge sections only when
8847 target allows it.
8848
3cac54d2
RW
88492010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8850
8851 * configure: Regenerate.
8852
2904037a
ILT
88532010-09-17 Ian Lance Taylor <iant@google.com>
8854
8855 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8856 * testsuite/Makefile.am (memory_test.o): New target.
8857 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8858 memory_test.t.
8859 * testsuite/Makefile.in: Rebuild.
2904037a 8860
bca7fb63
DK
88612010-09-17 Doug Kwan <dougkwan@google.com>
8862
8863 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8864 defintion if relocation uses GOT entries of the symbol.
8865 * testsuite/icf_safe_test.sh: Fix test.
8866 * testsuite/icf_safe_so_test.sh: Fix test.
8867
4ef28648
CC
88682010-09-16 Cary Coutant <ccoutant@google.com>
8869
8870 * script_sections.cc (class Memory_region): Remove "NULL" from
8871 vector initializations.
8872
793990de
CC
88732010-09-15 Cary Coutant <ccoutant@google.com>
8874
8875 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8876 Resolve forwarding symbols.
8877
81e015e2
DK
88782010-09-15 Doug Kwan <dougkwan@google.com>
8879
8880 * gold/testsuite/script_test_3.t: Add ARM special sections.
8881 * gold/testsuite/script_test_4.t: Same.
8882 * gold/testsuite/script_test_5.t: Same.
8883 * gold/testsuite/script_test_6.t: Same.
8884 * gold/testsuite/script_test_7.t: Same.
8885 * gold/testsuite/script_test_7.t: Same.
8886 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8887
36171d64
CC
88882010-09-14 Cary Coutant <ccoutant@google.com>
8889
8890 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8891 (Target_x86_64::Relocate::relocate_tls): Replace check for
8892 saw_tls_block_reloc_ with test for executable section.
8893
d89051bd
CC
88942010-09-12 Cary Coutant <ccoutant@google.com>
8895
8896 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8897 position-independent executables to shared libraries need dynamic
8898 relocations.
8899 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8900 position-independent executables.
8901 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8902 * testsuite/Makefile.in: Regenerate.
8903
fca41f0f
NC
89042010-09-10 Nick Clifton <nickc@redhat.com>
8905
8906 PR gold/11997
8907 * testsuite/memory_test.t: Discard any sections that are not
8908 needed.
8909
6695e4b3
L
89102010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8911
8912 PR gold/11996
8913 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8914 "This::" to work around a bug in gcc 4.2.
8915
8916 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8917
0f72bf6f
RÁE
89182010-09-09 Rafael Espindola <espindola@google.com>
8919
8920 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8921 sections with different PF_X flags in the same segment.
8922 (Layout::find_first_load_seg): Search all segments to find the first
8923 one.
8924 * options.h (rosegment): New.
8925
89262010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8927
05a79166 8928 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8929
aa98ff75
DK
89302010-09-08 Doug Kwan <dougkwan@google.com>
8931
8932 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8933 (Arm_relobj::do_relocate_sections): Add new parameter for output
8934 file to match the parent.
8935 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8936 of local symbols instead of input values. Update code to track
8937 changes in gold::relocate_section.
8938 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8939 (Sized_relobj::compute_final_local_value_internal): New methods.
8940 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8941 body into private version of Sized_relobj::compute_final_local_value.
8942 Call the inline method.
8943 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8944 merged symbol value if there is one.
8945 (Symbol_value::has_output_value): New method defintiion.
8946 (Sized_relobj::Compute_final_local_value_status): New enum type.
8947 (Sized_relobj::compute_final_local_value): New methods.
8948 (Sized_relobj::compute_final_local_value_internal): New methods.
8949 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8950 and arm_cortex_a8.sh.
8951 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8952 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8953 New tests.
8954 * Makefile.in: Regenerate.
8955 * testsuite/arm_bl_out_of_range.s: Update test.
8956 * testsuite/thumb_bl_out_of_range.s: Ditto.
8957 * testsuite/thumb_blx_out_of_range.s: Ditto.
8958 * testsuite/arm_branch_out_of_range.sh: New file.
8959 * testsuite/arm_cortex_a8.sh: Ditto.
8960 * testsuite/arm_cortex_a8_b.s: Ditto.
8961 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8962 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8963 * testsuite/arm_cortex_a8_bl.s: Ditto.
8964 * testsuite/arm_cortex_a8_blx.s: Ditto.
8965 * testsuite/arm_cortex_a8_local.s: Ditto.
8966 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8967 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8968
05a79166
L
89692010-09-08 Rafael Espindola <espindola@google.com>
8970
8971 * Makefile.am (memory_test.stdout): Run readelf with -W.
8972 * Makefile.in: Regenerate.
8973 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8974 64 bit output.
8975
33dbc701
RÁE
89762010-09-08 Rafael Espindola <espindola@google.com>
8977
8978 * script-sections.cc (Script_sections::add_memory_region): Convert
8979 field precision to int.
8980 * script.cc (script_set_section_region, script_set_section_region):
8981 Convert field precision to int.
8982
731ca54a
RÁE
89832010-09-08 Rafael Espindola <espindola@google.com>
8984
8985 * arm.cc (do_finalize_sections): Create the __exidx_start and
8986 __exdix_end symbols even when the section is missing.
8987
7f8cd844
NC
89882010-09-08 Nick Clifton <nickc@redhat.com>
8989
8990 * README: Remove claim that MEMORY is not supported.
8991 * expression.cc (script_exp_function_origin)
8992 (script_exp_function_length): Move from here to ...
8993 * script.cc: ... here.
8994 (script_set_section_region, script_add_memory)
8995 (script_parse_memory_attr, script_include_directive): New
8996 functions.
8997 * script-sections.cc
8998 (class Memory_region): New class.
8999 (class Output_section_definition): Add set_memory_region,
9000 set_section_vma, set_section_lma and get_section_name methods.
9001 (class Script_Sections): Add add_memory_region,
9002 find_memory_region, find_memory_region_origin,
9003 find_memory_region_length and set_memory_region methods.
9004 Have set_section_addresses method walk the list of set memory
9005 regions.
9006 Extend the print methos to display memory regions.
9007 * script-sections.h: Add prototypes for new methods.
9008 Add enum for MEMORY region attributes.
9009 * yyscript.y: Add support for parsing MEMORY regions.
9010 * script-c.h: Add prototypes for new functions.
9011 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9012 * testsuite/Makefile.in: Regenerate.
9013 * testsuite/memory_test.sh: New script.
9014 * testsuite/memory_test.s: New assembler source file.
9015 * testsuite/memory_test.t: New linker script.
9016
a4649286
DK
90172010-08-27 Doug Kwan <dougkwan@google.com>
9018
9019 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9020 reference override an existing dynamic weak reference.
9021 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9022 * testsuite/Makefile.in: Regenerate.
9023 * testsuite/dyn_weak_ref.sh: New file.
9024 * testsuite/dyn_weak_ref_1.c: Ditto.
9025 * testsuite/dyn_weak_ref_2.c: Ditto.
9026
b56648ad
ILT
90272010-08-27 Ian Lance Taylor <iant@google.com>
9028
9029 * incremental.h (class Incremental_input_entry): Add virtual
9030 destructor.
9031
809313cb
ILT
90322010-08-27 Ian Lance Taylor <iant@google.com>
9033
9034 * testsuite/start_lib_test_3.c: Mark t3 as used.
9035
11e32464
NC
90362010-08-27 Nick Clifton <nickc@redhat.com>
9037
9038 * options.cc (version_script): Fix small typo in previous
9039 whitespace tidyup.
9040
ca09d69a
NC
90412010-08-25 Nick Clifton <nickc@redhat.com>
9042
9043 * archive.cc: Formatting fixes: Remove whitespace between
9044 typename and following asterisk. Remove whitespace between
9045 function name and opening parenthesis.
9046 * archive.h: Likewise.
9047 * arm.cc: Likewise.
9048 * attributes.cc: Likewise.
9049 * attributes.h: Likewise.
9050 * common.cc: Likewise.
9051 * copy-relocs.cc: Likewise.
9052 * dirsearch.h: Likewise.
9053 * dynobj.cc: Likewise.
9054 * ehframe.cc: Likewise.
9055 * ehframe.h: Likewise.
9056 * expression.cc: Likewise.
9057 * fileread.cc: Likewise.
9058 * fileread.h: Likewise.
9059 * gc.h: Likewise.
9060 * gold-threads.cc: Likewise.
9061 * gold.cc: Likewise.
9062 * i386.cc: Likewise.
9063 * icf.h: Likewise.
9064 * incremental-dump.cc: Likewise.
9065 * incremental.cc: Likewise.
9066 * layout.cc: Likewise.
9067 * layout.h: Likewise.
9068 * main.cc: Likewise.
9069 * merge.cc: Likewise.
9070 * merge.h: Likewise.
9071 * object.cc: Likewise.
9072 * object.h: Likewise.
9073 * options.cc: Likewise.
9074 * options.h: Likewise.
9075 * output.cc: Likewise.
9076 * output.h: Likewise.
9077 * plugin.cc: Likewise.
9078 * plugin.h: Likewise.
9079 * powerpc.cc: Likewise.
9080 * reloc.cc: Likewise.
9081 * script-c.h: Likewise.
9082 * script-sections.cc: Likewise.
9083 * script.cc: Likewise.
9084 * stringpool.cc: Likewise.
9085 * symtab.cc: Likewise.
9086 * symtab.h: Likewise.
9087 * target.cc: Likewise.
9088 * timer.cc: Likewise.
9089 * timer.h: Likewise.
9090 * version.cc: Likewise.
9091 * x86_64.cc: Likewise.
9092
b8fa8750
NC
90932010-08-24 Nick Clifton <nickc@redhat.com>
9094
9095 PR 11899
9096 * layout.cc (segment_precedes): Sort segments by their physical
9097 addresses, if they have been set.
9098
9919d93b
CC
90992010-08-23 Cary Coutant <ccoutant@google.com>
9100
9101 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9102 symbols data.
9103 (Lib_group::include_member): Unlock object after deleting its
9104 symbols data.
9105 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9106 the bug fixed here.
9107
97b4be1c
CC
91082010-08-19 Neil Vachharajani <nvachhar@google.com>
9109 Cary Coutant <ccoutant@google.com>
9110
9111 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9112 constructor, and set_blocker.
9113 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9114 readsyms_blocker_.
9115 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9116 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9117 * testsuite/Makefile.am (start_lib_test): New test case.
9118 * testsuite/Makefile.in: Regenerate.
9119 * testsuite/start_lib_test_main.c: New file.
9120 * testsuite/start_lib_test_1.c: New file.
9121 * testsuite/start_lib_test_2.c: New file.
9122 * testsuite/start_lib_test_3.c: New file.
9123
dd0b1884
ILT
91242010-08-19 Ian Lance Taylor <iant@google.com>
9125
9126 * Makefile.in: Rebuild with automake 1.11.1.
9127 * aclocal.m4: Likewise.
9128 * testsuite/Makefile.in: Likewise.
9129
7223e9ca
ILT
91302010-08-19 Ian Lance Taylor <iant@google.com>
9131
9132 PR 10893
9133 * i386.cc (class Output_data_plt_i386): Update declarations.
9134 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9135 local_ifuncs_ fields.
9136 (Target_i386::do_plt_section_for_global): New function.
9137 (Target_i386::do_plt_section_for_local): New function.
9138 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9139 parameter; change all callers. Initialize global_ifuncs_ and
9140 local_ifuncs_. If doing a static link define __rel_iplt_start and
9141 __rel_iplt_end.
9142 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9143 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9144 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9145 symbols.
9146 (Target_i386::make_plt_section): New function, broken out of
9147 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9148 (Target_i386::make_plt_entry): Call make_plt_section.
9149 (Target_i386::make_local_ifunc_plt_entry): New function.
9150 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9151 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9152 R_386_IRELATIVE to switch.
9153 (Target_i386::Scan::global): Likewise.
9154 (Target_i386::Relocate::relocate): Likewise.
9155 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9156 switch.
9157 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9158 (Target_x86_64::do_plt_section_for_global): New function.
9159 (Target_x86_64::do_plt_section_for_local): New function.
9160 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9161 parameter; change all callers. If doing a static link define
9162 __rela_iplt_start and __rela_iplt_end.
9163 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9164 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9165 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9166 to point to .plt.
9167 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9168 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9169 switch.
9170 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9171 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9172 R_X86_64_IRELATIVE to switch.
9173 (Target_x86_64::Scan::global): Likewise.
9174 (Target_x86_64::Relocate::relocate): Likewise.
9175 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9176 switch.
9177 * target.h (class Target): Add plt_section_for_global and
9178 plt_section_for_local functions. Add do_plt_section_for_global
9179 and do_plt_section_for_local virtual functions.
9180 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9181 clarifying comments.
9182 (Symbol::use_plt_offset): Handle IFUNC symbol.
9183 * object.cc (Sized_relobj::Sized_relobj): Initialize
9184 local_plt_offsets_.
9185 (Sized_relobj::local_has_plt_offset): New function.
9186 (Sized_relobj::local_plt_offset): New function.
9187 (Sized_relobj::set_local_plt_offset): New function.
9188 (Sized_relobj::do_count): Handle IFUNC symbol.
9189 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9190 a bit away from input_shndx_ field. Add set_is_func_symbol and
9191 is_ifunc_symbol functions.
9192 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9193 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9194 local_plt_offsets_ field.
9195 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9196 * output.h (class Output_section_data): Add non-const
9197 output_section function.
9198 (class Output_data_got): Update declarations.
9199 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9200 Add use_plt_offset parameter to global and local constructors.
9201 Change all callers. Change local_sym_index_ field to 31 bits.
9202 Change GSYM_CODE and CONSTANT_CODE accordingly.
9203 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9204 doing a static link don't set sh_link field.
9205 (Output_data_got::Got_entry::write): Use PLT offset if
9206 appropriate.
9207 (Output_data_got::add_global_plt): New function.
9208 (Output_data_got::add_local_plt): New function.
9209 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9210 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9211 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9212 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9213 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9214 IFUNC conditional.
9215 * testsuite/ifunc-sel.h: New file.
9216 * testsuite/ifuncmain1.c: New file.
9217 * testsuite/ifuncmain1vis.c: New file.
9218 * testsuite/ifuncmod1.c: New file.
9219 * testsuite/ifuncdep2.c: New file.
9220 * testsuite/ifuncmain2.c: New file.
9221 * testsuite/ifuncmain3.c: New file.
9222 * testsuite/ifuncmod3.c: New file.
9223 * testsuite/ifuncmain4.c: New file.
9224 * testsuite/ifuncmain5.c: New file.
9225 * testsuite/ifuncmod5.c: New file.
9226 * testsuite/ifuncmain6pie.c: New file.
9227 * testsuite/ifuncmod6.c: New file.
9228 * testsuite/ifuncmain7.c: New file.
9229 * configure, testsuite/Makefile.in: Rebuild.
9230
56f75c03
ILT
92312010-08-18 Ian Lance Taylor <iant@google.com>
9232
9233 * incremental.cc
9234 (Output_section_incremental_inputs::write_input_files): Add cast
9235 to avoid signed/unsigned comparison warning.
9236 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9237
55455f89
CC
92382010-08-12 Cary Coutant <ccoutant@google.com>
9239
9240 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9241
e2054bcb
ILT
92422010-08-13 Ian Lance Taylor <iant@google.com>
9243
9244 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9245
74f67560
DK
92462010-08-12 Cary Coutant <ccoutant@google.com>
9247 Doug Kwan <dougkwan@google.com>
9248
9249 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9250 defintion overrides non-weak undef, remember that the original undef
9251 is not weak.
9252 * symtab.cc (Symbol_table::sized_write_global): For undef without
9253 an original weak binding, set binding to global in output.
9254 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9255 * testsuite/Makefile.in: Regenerate.
9256 * testsuite/strong_ref_weak_def.sh: New file.
9257 * testsuite/strong_ref_weak_def_1.c: Ditto.
9258 * testsuite/strong_ref_weak_def_2.c: Ditto.
9259
d1238d12
CC
92602010-08-12 Cary Coutant <ccoutant@google.com>
9261
9262 * testsuite/incremental_test.sh: Rewrite.
9263 * testsuite/incremental_test_1.c: Rewrite.
9264 * testsuite/incremental_test_2.c: Rewrite.
9265
0e70b911
CC
92662010-08-12 Cary Coutant <ccoutant@google.com>
9267
9268 * arm.cc (Target_arm::got_size): Add const.
9269 (Target_arm::got_entry_count): New function.
9270 (Target_arm::plt_entry_count): New function.
9271 (Target_arm::first_plt_entry_offset): New function.
9272 (Target_arm::plt_entry_size): New function.
9273 (Output_data_plt_arm::entry_count): New function.
9274 (Output_data_plt_arm::first_plt_entry_offset): New function.
9275 (Output_data_plt_arm::get_plt_entry_size): New function.
9276 * i386.cc (Target_i386::got_size): Add const.
9277 (Target_i386::got_entry_count): New function.
9278 (Target_i386::plt_entry_count): New function.
9279 (Target_i386::first_plt_entry_offset): New function.
9280 (Target_i386::plt_entry_size): New function.
9281 (Output_data_plt_i386::entry_count): New function.
9282 (Output_data_plt_i386::first_plt_entry_offset): New function.
9283 (Output_data_plt_i386::get_plt_entry_size): New function.
9284 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9285 find_incremental_inputs_sections. Dump incremental_got_plt section.
9286 * incremental.cc: Include target.h.
9287 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9288 parameter. Adjust all callers. Find incremental_got_plt section.
9289 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9290 section.
9291 (Output_section_incremental_inputs::set_final_data_size): Calculate
9292 size of incremental_got_plt section.
9293 (Output_section_incremental_inputs::do_write): Write the
9294 incremental_got_plt section.
9295 (Got_plt_view_info): New struct.
9296 (Local_got_offset_visitor): New class.
9297 (Global_got_offset_visitor): New class.
9298 (Global_symbol_visitor_got_plt): New class.
9299 (Output_section_incremental_inputs::write_got_plt): New function.
9300 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9301 Add parameter. Adjust all callers.
9302 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9303 (Incremental_inputs::got_plt_section): New function.
9304 (Incremental_inputs::got_plt_section_): New data member.
9305 (Incremental_got_plt_reader): New class.
9306 * layout.cc (Layout::create_incremental_info_sections): Add the
9307 incremental_got_plt section.
9308 * object.h (Got_offset_list::get_list): New function.
9309 (Got offset_list::for_all_got_offsets): New function.
9310 (Sized_relobj::local_got_offset_list): New function.
9311 * powerpc.cc (Target_powerpc::got_size): Add const.
9312 (Target_powerpc::got_entry_count): New function.
9313 (Target_powerpc::plt_entry_count): New function.
9314 (Target_powerpc::first_plt_entry_offset): New function.
9315 (Target_powerpc::plt_entry_size): New function.
9316 (Output_data_plt_powerpc::entry_count): New function.
9317 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9318 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9319 * sparc.cc (Target_sparc::got_size): Add const.
9320 (Target_sparc::got_entry_count): New function.
9321 (Target_sparc::plt_entry_count): New function.
9322 (Target_sparc::first_plt_entry_offset): New function.
9323 (Target_sparc::plt_entry_size): New function.
9324 (Output_data_plt_sparc::entry_count): New function.
9325 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9326 (Output_data_plt_sparc::get_plt_entry_size): New function.
9327 * symtab.h (Symbol::got_offset_list): New function.
9328 (Symbol_table::for_all_symbols): New function.
9329 * target.h (Sized_target::got_entry_count): New function.
9330 (Sized_target::plt_entry_count): New function.
9331 (Sized_target::plt_entry_size): New function.
9332 * x86_64.cc (Target_x86_64::got_size): Add const.
9333 (Target_x86_64::got_entry_count): New function.
9334 (Target_x86_64::plt_entry_count): New function.
9335 (Target_x86_64::first_plt_entry_offset): New function.
9336 (Target_x86_64::plt_entry_size): New function.
9337 (Output_data_plt_x86_64::entry_count): New function.
9338 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9339 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9340
09ec0418
CC
93412010-08-12 Cary Coutant <ccoutant@google.com>
9342
9343 * archive.cc: Include incremental.h.
9344 (Archive::Archive): Initialize incremental_info_.
9345 (Archive::include_member): Record archive members in incremental info.
9346 (Add_archive_symbols::run): Record begin and end of an archive in
9347 incremental info.
9348 (Lib_group::include_member): Record objects in incremental info.
9349 * archive.h (Incremental_archive_entry): Forward declaration.
9350 (Archive::set_incremental_info): New member function.
9351 (Archive::incremental_info): New member function.
9352 (Archive::Unused_symbol_iterator): New class.
9353 (Archive::unused_symbols_begin): New member function.
9354 (Archive::unused_symbols_end): New member function.
9355 (Archive::incremental_info_): New data member.
9356 * incremental-dump.cc (find_input_containing_global): New function.
9357 (dump_incremental_inputs): Dump new incremental info sections.
9358 * incremental.cc: Include symtab.h.
9359 (Output_section_incremental_inputs): New class.
9360 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9361 new incremental info sections.
9362 (Sized_incremental_binary::do_check_inputs): Likewise.
9363 (Incremental_inputs::report_archive): Remove.
9364 (Incremental_inputs::report_archive_begin): New function.
9365 (Incremental_inputs::report_archive_end): New function.
9366 (Incremental_inputs::report_object): New function.
9367 (Incremental_inputs::finalize_inputs): Remove.
9368 (Incremental_inputs::report_input_section): New function.
9369 (Incremental_inputs::report_script): Rewrite.
9370 (Incremental_inputs::finalize): Do nothing but finalize string table.
9371 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9372 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9373 (Incremental_inputs::create_data_sections): New function.
9374 (Incremental_inputs::relocs_entsize): New function.
9375 (Output_section_incremental_inputs::set_final_data_size): New function.
9376 (Output_section_incremental_inputs::do_write): New function.
9377 (Output_section_incremental_inputs::write_header): New function.
9378 (Output_section_incremental_inputs::write_input_files): New function.
9379 (Output_section_incremental_inputs::write_info_blocks): New function.
9380 (Output_section_incremental_inputs::write_symtab): New function.
9381 * incremental.h (Incremental_script_entry): Forward declaration.
9382 (Incremental_object_entry): Forward declaration.
9383 (Incremental_archive_entry): Forward declaration.
9384 (Incremental_inputs): Forward declaration.
9385 (Incremental_inputs_header_data): Remove.
9386 (Incremental_inputs_header): Remove.
9387 (Incremental_inputs_header_write): Remove.
9388 (Incremental_inputs_entry_data): Remove.
9389 (Incremental_inputs_entry): Remove.
9390 (Incremental_inputs_entry_write): Remove.
9391 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9392 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9393 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9394 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9395 Likewise.
9396 (Incremental_input_entry): New class.
9397 (Incremental_script_entry): New class.
9398 (Incremental_object_entry): New class.
9399 (Incremental_archive_entry): New class.
9400 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9401 (Incremental_inputs::report_inputs): Remove.
9402 (Incremental_inputs::report_archive): Remove.
9403 (Incremental_inputs::report_archive_begin): New function.
9404 (Incremental_inputs::report_archive_end): New function.
9405 (Incremental_inputs::report_object): Change prototype.
9406 (Incremental_inputs::report_input_section): New function.
9407 (Incremental_inputs::report_script): Change prototype.
9408 (Incremental_inputs::get_reloc_count): New function.
9409 (Incremental_inputs::set_reloc_count): New function.
9410 (Incremental_inputs::create_data_sections): New function.
9411 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9412 (Incremental_inputs::inputs_section): New function.
9413 (Incremental_inputs::symtab_section): New function.
9414 (Incremental_inputs::relocs_section): New function.
9415 (Incremental_inputs::get_stringpool): Add const.
9416 (Incremental_inputs::command_line): Add const.
9417 (Incremental_inputs::inputs): Remove.
9418 (Incremental_inputs::command_line_key): New function.
9419 (Incremental_inputs::input_file_count): New function.
9420 (Incremental_inputs::input_files): New function.
9421 (Incremental_inputs::relocs_entsize): New function.
9422 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9423 (Incremental_inputs::finalize_inputs): Remove.
9424 (Incremental_inputs::Input_info): Remove.
9425 (Incremental_inputs::lock_): Remove.
9426 (Incremental_inputs::inputs_): Change type.
9427 (Incremental_inputs::inputs_map_): Remove.
9428 (Incremental_inputs::current_object_entry_): New data member.
9429 (Incremental_inputs::inputs_section_): New data member.
9430 (Incremental_inputs::symtab_section_): New data member.
9431 (Incremental_inputs::relocs_section_): New data member.
9432 (Incremental_inputs::reloc_count_): New data member.
9433 (Incremental_inputs_reader): New class.
9434 (Incremental_symtab_reader): New class.
9435 (Incremental_relocs_reader): New class.
9436 * layout.cc (Layout::finalize): Move finalization of incremental info
9437 and creation of incremental info sections to follow finalization of
9438 symbol table. Set offsets for postprocessing sections.
9439 (Layout::create_incremental_info_sections): Call
9440 Incremental_inputs::create_data_sections. Add incremental symtab
9441 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9442 sections to layout after input sections.
9443 * layout.h (struct Timespec): Forward declaration.
9444 (Layout::incremental_inputs): Add const.
9445 (Layout::create_incremental_info_sections): Add parameter.
9446 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9447 * object.cc: Include incremental.h.
9448 (Relobj::finalize_incremental_relocs): New function.
9449 (Sized_relobj::do_layout): Record input sections in incremental info.
9450 * object.h (Object::output_section): New function.
9451 (Object::output_section_offset): Moved from Relobj.
9452 (Object::get_incremental_reloc_base): New function.
9453 (Object::get_incremental_reloc_count): New function.
9454 (Object::do_output_section): New function.
9455 (Object::do_output_section_offset): Moved from Relobj.
9456 (Object::do_get_incremental_reloc_base): New function.
9457 (Object::do_get_incremental_reloc_count): New function.
9458 (Object::Object): Initialize new data members.
9459 (Relobj::output_section): Renamed do_output_section and moved to
9460 protected.
9461 (Relobj::output_section_offset): Moved to Object.
9462 (Relobj::do_get_incremental_reloc_base): New function.
9463 (Relobj::do_get_incremental_reloc_count): New function.
9464 (Relobj::allocate_incremental_reloc_counts): New function.
9465 (Relobj::count_incremental_reloc): New function.
9466 (Relobj::finalize_incremental_relocs): New function.
9467 (Relobj::next_incremental_reloc_index): New function.
9468 (Relobj::reloc_counts_): New data member.
9469 (Relobj::reloc_bases_): New data member.
9470 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9471 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9472 (Sized_relobj::incremental_relocs_scan): New function.
9473 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9474 (Sized_relobj::incremental_relocs_write): New function.
9475 (Sized_relobj::incremental_relocs_write_reltype): New function.
9476 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9477 incremental link.
9478 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9479 archives and object files elsewhere.
9480 (Add_symbols::run): Report object files here.
9481 (Finish_group::run): Report end of archive at end of group.
9482 * reloc.cc: Include layout.h, incremental.h.
9483 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9484 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9485 (Sized_relobj::incremental_relocs_scan): New function.
9486 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9487 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9488 (Sized_relobj::incremental_relocs_write): New function.
9489 (Sized_relobj::incremental_relocs_write_reltype): New function.
9490 * script.cc (read_input_script): Rewrite test for incremental link.
9491 Change call to Incremental_inputs::report_script.
9492 * symtab.h (Symbol_table::first_global_index): New function.
9493 (Symbol_table::output_count): New function.
9494
ce0d1972
DK
94952010-08-12 Doug Kwan <dougkwan@google.com>
9496
9497 * arm.cc (Target_arm::merge_object_attributes): Check command line
9498 options --no-wchar-size-warning and --no-enum-size-warning.
9499 * options.h (General_options): Add ld-compatible options
9500 --no-enum-size-warning and --no-wchar-size-warning.
9501
6e5710ce
ILT
95022010-08-04 Ian Lance Taylor <iant@google.com>
9503
9504 * x86_64.cc (Target_x86_64::Scan::local): Use
9505 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9506 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9507 (Target_x86_64::Scan::global): Likewise.
9508 (Target_x86_64::Relocate::relocate): Likewise.
9509 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9510 Likewise.
9511
fef830db
CC
95122010-08-03 Cary Coutant <ccoutant@google.com>
9513
9514 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9515 to reserve space in merged_strings vector. Keep total input size
9516 for stats.
9517 (Output_merge_string::do_print_merge_stats): Print total input size.
9518 * merge.h (Output_merge_string): Add input_size_ field.
9519 * stringpool.cc (Stringpool_template::string_length): Move
9520 implementations out of Stringpool_template class and place in
9521 stringpool.h.
9522 * stringpool.h (string_length): Move out of Stringpool_template.
9523
1e3811b0
ILT
95242010-08-03 Ian Lance Taylor <iant@google.com>
9525
9526 PR 11712
9527 * layout.cc (relaxation_loop_body): If address of load segment is
9528 set, adjust address to include headers if possible.
9529
7af0c620
ILT
95302010-08-03 Ian Lance Taylor <iant@google.com>
9531
9532 * version.cc (version_string): Bump to 1.10.
9533
22f0da72
ILT
95342010-08-03 Ian Lance Taylor <iant@google.com>
9535
9536 PR 11805
9537 * layout.h (enum Output_section_order): Define.
9538 (class Layout): Update declarations.
9539 * layout.cc (Layout::get_output_section): Add order parameter.
9540 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9541 is_first_non_relro parameters. Change all callers.
9542 (Layout::choose_output_section): Likewise.
9543 (Layout::add_output_section_data): Likewise.
9544 (Layout::make_output_section): Likewise. Set order.
9545 (Layout::default_section_order): New function.
9546 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9547 * output.cc (Output_section::Output_section): Initialize order_.
9548 Don't initialize deleted fields.
9549 (Output_segment::Output_segment): Don't initialize deleted
9550 fields.
9551 (Output_segment::add_output_section_to_load): New function
9552 replacing add_output_section. Change all callers to call this or
9553 add_output_section_to_nonload.
9554 (Output_segment::add_output_section_to_nonload): New function.
9555 (Output_segment::remove_output_section): Rewrite.
9556 (Output_segment::add_initial_output_data): Likewise.
9557 (Output_segment::has_any_data_sections): Likewise.
9558 (Output_segment::is_first_section_relro): Likewise.
9559 (Output_segment::maximum_alignment): Likewise.
9560 (Output_segment::has_dynamic_reloc): New function replacing
9561 dynamic_reloc_count. Change all callers.
9562 (Output_segment::has_dynamic_reloc_list): New function replacing
9563 dynamic_reloc_count_list. Change all callers.
9564 (Output_segment::set_section_addresses): Rewrite.
9565 (Output_segment::set_offset): Rewrite.
9566 (Output_segment::find_first_and_last_list): Remove.
9567 (Output_segment::set_tls_offsets): Rewrite.
9568 (Output_segment::first_section_load_address): Likewise.
9569 (Output_segment::output_section_count): Likewise.
9570 (Output_segment::section_with_lowest_load_address): Likewise.
9571 (Output_segment::write_section_headers): Likewise.
9572 (Output_segment::print_sections_to_map): Likewise.
9573 * output.h (class Output_data): Remove dynamic_reloc_count_
9574 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9575 (Output_data::add_dynamic_reloc): Rewrite.
9576 (Output_data::has_dynamic_reloc): New function.
9577 (Output_data::dynamic_reloc_count): Remove.
9578 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9579 is_last_relro_, is_first_non_relro_, is_interp_,
9580 is_dynamic_linker_section_ fields. Add order and set_order
9581 functions. Remove is_relro_local, set_is_relro_local,
9582 is_last_relro, set_is_last_relro, is_first_non_relro,
9583 set_is_first_non_relro functions, is_interp, set_is_interp,
9584 is_dynamic_linker_section, and set_is_dynamic_linker_section
9585 functions.
9586 (class Output_segment): Change Output_data_list from std::list to
9587 std:;vector. Add output_lists_ field. Remove output_data_ and
9588 output_bss_ fields. Update declarations.
9589
3ff2ccb0
ILT
95902010-08-02 Ian Lance Taylor <iant@google.com>
9591
9592 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9593 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9594 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9595
88a4108b
ILT
95962010-08-02 Ian Lance Taylor <iant@google.com>
9597
9598 PR 11855
9599 * script.cc (Script_options::Script_options): Initialize
9600 symbol_definitions_ and symbol_references_.
9601 (Script_options::add_symbol_assignment): Update
9602 symbol_definitions_ and symbol_references_.
9603 (Script_options::add_symbol_reference): New function.
9604 (script_symbol): New function.
9605 * script.h (class Script_options): Add symbol_definitions_ and
9606 symbol_references_ fields.
9607 (Script_options::referenced_const_iterator): New type.
9608 (Script_options::referenced_begin): New function.
9609 (Script_options::referenced_end): New function.
9610 (Script_options::is_referenced): New function.
9611 (Script_options::any_unreferenced): New function.
9612 * script-c.h (script_symbol): Declare.
9613 * yyscript.y (exp): Call script_symbol.
9614 * symtab.cc: Include "script.h".
9615 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9616 Change all callers. Check symbols referenced by scripts.
9617 (Symbol_table::add_undefined_symbols_from_command_line): Add
9618 layout parameter. Change all callers.
9619 (Symbol_table::do_add_undefined_symbols_from_command_line):
9620 Likewise. Break out loop body. Check symbols referenced by
9621 scripts.
9622 (Symbol_table::add_undefined_symbol_from_command_line): New
9623 function broken out of
9624 do_add_undefined_symbols_from_command_line.
9625 * symtab.h (class Symbol_table): Update declarations.
9626 * archive.cc: Include "layout.h".
9627 (Archive::should_include_member): Add layout parameter. Change
9628 all callers. Check for symbol mentioned in expression.
9629 * archive.h (class Archive): Update declaration.
9630 * object.cc (Sized_relobj::do_should_include_member): Add layout
9631 parameter.
9632 * object.h (Object::should_include_member): Add layout parameter.
9633 Change all callers.
9634 (Object::do_should_include_member): Add layout parameter.
9635 (class Sized_relobj): Update declaration.
9636 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9637 parameter.
9638 * dynobj.h (class Sized_dynobj): Update declaration.
9639 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9640 layout parameter.
9641 * plugin.h (class Sized_pluginobj): Update declaration.
9642
5f1ab67a
ILT
96432010-08-02 Ian Lance Taylor <iant@google.com>
9644
9645 PR 11866
9646 * output.cc (Output_segment::set_offset): Search for the first and
9647 last sections rather than assuming that the list is in order.
9648 (Output_segment::find_first_and_last_list): New function.
9649 * output.h (class Output_segment): Update declarations.
9650 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9651 (relro_strip_test_SOURCES): New variable.
9652 (relro_strip_test_DEPENDENCIES): New variable.
9653 (relro_strip_test_LDFLAGS): New variable.
9654 (relro_strip_test_LDADD): New variable.
9655 (relro_strip_test.so): New target.
9656
a8df5856
ILT
96572010-08-02 Ian Lance Taylor <iant@google.com>
9658
9659 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9660 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9661 (Target_i386::got_tlsdesc_section): New function.
9662 (Target_i386::got_section): Create space for GOT entries for
9663 TLSDESC relocations.
9664 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9665 R_386_TLS_GOTDESC.
9666 (Target_i386::Scan::global): Likewise.
9667 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9668 using TLSDESC GOT.
9669 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9670 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9671 (Target_x86_64::got_tlsdesc_section): New function.
9672 (Target_x86_64::got_section): Create space for GOT entries for
9673 TLSDESC relocations.
9674 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9675 R_386_TLS_GOTDESC.
9676 (Target_x86_64::Scan::global): Likewise.
9677 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9678 using TLSDESC GOT.
9679
0c10a0a6
ILT
96802010-08-02 Ian Lance Taylor <iant@google.com>
9681
9682 * testsuite/final_layout.sh: Use dc to convert from hex to
9683 decimal.
9684
41cbeecc
ST
96852010-07-29 Sriraman Tallam <tmsriram@google.com>
9686
9687 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9688 paramter to the call to gold::gc_process_relocs.
9689 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9690 paramter to the call to gold::gc_process_relocs.
9691 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9692 parameter to the call to gold::gc_process_relocs.
9693 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9694 template parameter to the call to gold::gc_process_relocs.
9695 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9696 paramter to the call to gold::gc_process_relocs.
9697 * gc.h (get_embedded_addend_size): New function.
9698 (gc_process_relocs): Save the size of the reloc for use by ICF.
9699 * icf.cc (get_section_contents): Get the addend from the text section
9700 for SHT_REL relocation sections.
9701 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9702 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9703 * int_encoding.h (read_from_pointer): New overloaded function.
9704 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9705 * testsuite/icf_sht_rel_addend_test.sh: New file.
9706 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9707 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9708
6ea55b82
RW
97092010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9710
9711 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9712 * Makefile.in: Regenerate.
9713 * testsuite/Makefile.in: Regenerate.
9714
9691462b
ILT
97152010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9716
9717 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9718 * gold/testsuite/debug_msg.cc: Likewise.
9719 * gold/testsuite/odr_violation1.cc
9720 * gold/testsuite/odr_violation2.cc
9721
76897331
CC
97222010-07-21 Cary Coutant <ccoutant@google.com>
9723
9724 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9725 string, and length fields.
9726 (Output_merge_string::Merged_strings_list): New type.
9727 (Output_merge_string::Merged_strings_lists): New typedef.
9728 (Output_merge_string): Replace merged_strings_ with
9729 merged_strings_lists_.
9730 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9731 Merged_strings_list per input object and section. Don't store pointer
9732 to the string. Don't store length with each merged string entry.
9733 (Output_merge_string::finalize_merged_data): Loop over list of merged
9734 strings lists. Recompute length of each merged string.
9735
78384e8f
CC
97362010-07-15 Cary Coutant <ccoutant@google.com>
9737
9738 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9739 here.
9740
783659f9
ILT
97412010-07-14 Ian Lance Taylor <iant@google.com>
9742
9743 * descriptors.cc (Descriptors::open): Report correct name in error
9744 message.
9745
131687b4
DK
97462010-07-13 Doug Kwan <dougkwan@google.com>
9747
9748 * arm.cc (Arm_input_section::Arm_input_section): For a
9749 SHT_ARM_EXIDX section, always keeps the input sections.
9750 (Arm_input_section::set_exidx_section_link): New method.
9751 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9752 has_errors_ to false.
9753 (Arm_exidx_input_section::has_errors,
9754 Arm_exidx_input_section::set_has_errors): New methods.
9755 (Arm_exidx_input_section::has_errors_): New data member.
9756 (Arm_relobj::get_exidx_shndx_list): New method.
9757 (Arm_output_section::append_text_sections_to_list): Do not skip
9758 section without SHF_EXECINSTR.
9759 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9760 errors.
2e702c99 9761 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9762 section header. Make error messages more verbose. Check for
9763 a non-executable section linked to an EXIDX section.
9764 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9765 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9766 check that there is no deferred EXIDX section if we exit early.
9767 Instead of not making an EXIDX section in case of an error, make one
9768 and set the has_errors flag of it.
9769 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9770 in a relocatable link.
9771 (Target_arm::do_relax): Look for the EXIDX output section instead of
9772 assuming that it is called .ARM.exidx.
2e702c99 9773 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9774 section list. Do not check for SHF_EXECINSTR section flags but
9775 skip any input section with errors.
9776 * output.cc (Output_section::Output_section): Initialize
9777 always_keeps_input_sections_ to false.
9778 (Output_section::add_input_section): Check for
9779 always_keeps_input_sections_.
9780 * output.h (Output_section::always_keeps_input_sections,
9781 Output_section::set_always_keeps_input_sections): New methods.
9782 (Output_section::always_keeps_input_sections): New data member.
9783
69517287
RÁE
97842010-07-13 Rafael Espindola <espindola@google.com>
9785
9786 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9787 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9788
82742395
ILT
97892010-07-13 Philip Herron <herron.philip@googlemail.com>
9790 Ian Lance Taylor <iant@google.com>
9791
9792 * output.h (Output_section_lookup_maps::add_merge_section):
9793 Correct check of whether value was inserted.
9794 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9795 (Output_section_lookup_maps::add_relaxed_input_section):
9796 Likewise.
9797 * arm.cc (Target_arm::got_section): Remove used local os.
9798 * i386.cc (Target_i386::got_section): Likewise.
9799 * x86_64.cc (Target_x86_64::got_section): Likewise.
9800 * sparc.cc (Target_sparc::got_section): Likewise.
9801 (Target_sparc::relocate): Remove unused local have_got_offset.
9802 * powerpc.cc (Target_powerpc::relocate): Likewise.
9803
f2d707b5
ILT
98042010-07-13 Ian Lance Taylor <iant@google.com>
9805
241531d6
ILT
9806 * compressed_output.cc (zlib_decompress): Fix signature in
9807 !HAVE_ZLIB_H case.
9808
f2d707b5
ILT
9809 * archive.cc (Archive::include_member): Unlock an external member
9810 of a thin archive. Don't bother to delete an object we know is
9811 NULL.
9812
a2e47362
CC
98132010-07-12 Cary Coutant <ccoutant@google.com>
9814
9815 * compressed_output.cc (zlib_decompress): New function.
9816 (get_uncompressed_size): New function.
9817 (decompress_input_section): New function.
9818 * compressed_output.h (get_uncompressed_size): New function.
9819 (decompress_input_section): New function.
9820 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9821 Handle compressed debug sections.
9822 * layout.cc (is_compressed_debug_section): New function.
9823 (Layout::output_section_name): Map compressed section names to
9824 canonical names.
9825 * layout.h (is_compressed_debug_section): New function.
9826 (is_debug_info_section): Recognize compressed debug sections.
9827 * merge.cc: Include compressed_output.h.
9828 (Output_merge_data::do_add_input_section): Handle compressed
9829 debug sections.
9830 (Output_merge_string::do_add_input_section): Handle compressed
9831 debug sections.
9832 * object.cc: Include compressed_output.h.
9833 (Sized_relobj::Sized_relobj): Initialize new data members.
9834 (build_compressed_section_map): New function.
9835 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9836 * object.h (Object::section_is_compressed): New method.
9837 (Object::do_section_is_compressed): New method.
9838 (Sized_relobj::Compressed_section_map): New type.
9839 (Sized_relobj::do_section_is_compressed): New method.
9840 (Sized_relobj::compressed_sections_): New data member.
9841 * output.cc (Output_section::add_input_section): Handle compressed
9842 debug sections.
9843 * reloc.cc: Include compressed_output.h.
9844 (Sized_relobj::write_sections): Handle compressed debug sections.
9845
ce279a62
CC
98462010-07-08 Cary Coutant <ccoutant@google.com>
9847
9848 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9849 weak when resolving to a dynamic def.
9850 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9851 for weak undef/dynamic def cases. Adjust callers.
9852 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9853 undef_binding_weak_.
9854 (Symbol_table::sized_write_globals): Adjust symbol binding.
9855 (Symbol_table::sized_write_symbol): Add binding parameter.
9856 * symtab.h (Symbol::set_undef_binding): New method.
9857 (Symbol::is_undef_binding_weak): New method.
9858 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9859 (Symbol_table::should_override): Add new parameter.
9860 (Symbol_table::sized_write_symbol): Add new parameter.
9861
9862 * testsuite/weak_undef_file1.cc: Add new test case.
9863 * testsuite/weak_undef_file2.cc: Fix header comment.
9864 * testsuite/weak_undef_test.cc: Add new test case.
9865
b2286c10
DK
98662010-06-29 Doug Kwan <dougkwan@google.com>
9867
9868 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9869 Initialize USE_SYMBOL_.
9870 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9871 definition.
9872 (Arm_reloc_property::uses_symbol_): New data member declaration.
9873 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9874 uses symbol value and symbol is undefined but not weakly undefined.
9875
4802450a
RÁE
98762010-06-28 Rafael Espindola <espindola@google.com>
9877
9878 * plugin.cc (Plugin::load): Use dlerror.
9879
e5ca47ba
ILT
98802010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9881
9882 * symtab.cc (detect_odr_violations): When reporting an ODR
9883 violation, report an object where the symbol is defined.
9884
8a75a161
DK
98852010-06-25 Doug Kwan <dougkwan@google.com>
9886
9887 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9888 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9889 definition.
9890 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9891 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9892 target hook to detect function points.
9893 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9894 * icf.h (Icf::check_section_for_function_pointers): Change type of
9895 parameter SECTION_NAME to const reference to std::string. Use
9896 target hook to determine if section may have unsafe pointers.
9897 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9898 method definition.
9899
42218b9f
RÁE
99002010-06-21 Rafael Espindola <espindola@google.com>
9901
9902 * fileread.cc (Input_file::find_fie): New
9903 (Input_file::open): Use Input_file::find_fie.
9904 * fileread.h (Input_file::find_fie): New
9905 * plugin.cc (set_extra_library_path): New.
9906 (Plugin::load): Add set_extra_library_path to the transfer vector.
9907 (Plugin_manager::set_extra_library_path): New.
9908 (Plugin_manager::add_input_file): Use the extra search path if set.
9909 (set_extra_library_path(): New.
9910 * plugin.h (Plugin_manager): Add set_extra_library_path and
9911 extra_search_path_.
9912
a0506cca
CC
99132010-06-19 Cary Coutant <ccoutant@google.com>
9914
9915 * layout.cc (gdb_sections): Add .debug_types.
9916 (lines_only_debug_sections): Likewise.
9917
6508b958
RÁE
99182010-06-18 Rafael Espindola <espindola@google.com>
9919
9920 * plugin.cc (add_input_file,add_input_library)
9921 (Plugin_manager::add_input_file): Make filename arguments const.
9922 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9923 const.
9924
3e235302
DK
99252010-06-16 Doug Kwan <dougkwan@google.com>
9926
9927 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9928 .ARM.attributes section if we have not merged any input
9929 attributes sections.
9930
106e8a6c
DK
99312010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9932
9933 * arm.cc: Allow combining objects with no EABI version
9934 information.
9935
91ff43fe
RÁE
99362010-06-15 Rafael Espindola <espindola@google.com>
9937
9938 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9939
68ed838c
ILT
99402010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9941
9942 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9943 (struct iovec): Correct !HAVE_READV definition.
9944
f3a2388f
CC
99452010-06-10 Cary Coutant <ccoutant@google.com>
9946
9947 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9948 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9949 reloc sections.
9950 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9951
9952 PR 11683
9953 * symtab.h (Symbol::is_placeholder): New member function.
9954 * target-reloc.h (relocate_section): Check for placeholder symbols.
9955
9956 * testsuite/Makefile.am (plugin_test_8): New test.
9957 (plugin_test_9): New test.
9958 * testsuite/Makefile.in: Regenerate.
9959
e1df38aa
NC
99602010-06-09 Nick Clifton <nickc@redhat.com>
9961
9962 * yyscript.y (input_list_element): Allow strings prefixed with
9963 the '-' character. Treat these as libraries.
9964 * script.cc (script_add_library): New function. Adds a library
9965 specified by "-l<name>" found in an input script.
9966 * script-c.h: Add prototype for script_add_library.
9967
25bbe950
DK
99682010-06-07 Doug Kwan <dougkwan@google.com>
9969
9970 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9971 Restrict stub-group size to be within long conditional branch
9972 range when working around cortex-A8 erratum.
9973
0f32ea4c
ILT
99742010-06-07 Damien Diederen <dd@crosstwine.com>
9975
9976 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9977 #ifdef typo.
9978
8fe2a369
ST
99792010-06-03 Sriraman Tallam <tmsriram@google.com>
9980
9981 PR gold/11658
9982 * output.cc
9983 (Output_section::Input_section_sort_entry::compare_section_ordering):
9984 Change to return non-zero correctly.
9985 (Output_section::Input_section_sort_section_order_index_compare
9986 ::operator()): Change to fix ambiguity in comparisons.
9987
6e9ba2ca
ST
99882010-06-01 Sriraman Tallam <tmsriram@google.com>
9989
9990 * gold.h (is_wildcard_string): New function.
9991 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9992 (Layout::layout_eh_frame): Ditto.
9993 (Layout::find_section_order_index): New method.
9994 (Layout::read_layout_from_file): New method.
9995 * layout.h (Layout::find_section_order_index): New method.
9996 (Layout::read_layout_from_file): New method.
9997 (Layout::input_section_position_): New private member.
9998 (Layout::input_section_glob_): New private member.
9999 * main.cc (main): Call read_layout_from_file here.
10000 * options.h (--section-ordering-file): New option.
10001 * output.cc (Output_section::input_section_order_specified_): New
10002 member.
10003 (Output_section::Output_section): Initialize new member.
10004 (Output_section::add_input_section): Add new parameter.
10005 Keep input sections when --section-ordering-file is used.
10006 (Output_section::set_final_data_size): Sort input sections when
10007 section ordering file is specified.
10008 (Output_section::Input_section_sort_entry): Add new parameter.
10009 Check sorting type.
10010 (Output_section::Input_section_sort_entry::compare_section_ordering):
10011 New method.
10012 (Output_section::Input_section_sort_compare::operator()): Change to
10013 consider section_order_index.
10014 (Output_section::Input_section_sort_init_fini_compare::operator()):
10015 Change to consider section_order_index.
10016 (Output_section::Input_section_sort_section_order_index_compare
10017 ::operator()): New method.
10018 (Output_section::sort_attached_input_sections): Change to sort
10019 according to section order when specified.
e1df38aa
NC
10020 (Output_section::add_input_section<32, true>): Add new parameter.
10021 (Output_section::add_input_section<64, true>): Add new parameter.
10022 (Output_section::add_input_section<32, false>): Add new parameter.
10023 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
10024 * output.h (Output_section::add_input_section): Add new parameter.
10025 (Output_section::input_section_order_specified): New
10026 method.
10027 (Output_section::set_input_section_order_specified): New method.
10028 (Input_section::Input_section): Initialize section_order_index_.
10029 (Input_section::section_order_index): New method.
10030 (Input_section::set_section_order_index): New method.
10031 (Input_section::section_order_index_): New member.
10032 (Input_section::Input_section_sort_section_order_index_compare): New
10033 struct.
10034 (Output_section::input_section_order_specified_): New member.
10035 * script-sections.cc (is_wildcard_string): Delete and move modified
10036 method to gold.h.
10037 (Output_section_element_input::Output_section_element_input): Modify
10038 call to is_wildcard_string.
10039 (Output_section_element_input::Input_section_pattern
10040 ::Input_section_pattern): Ditto.
10041 (Output_section_element_input::Output_section_element_input): Ditto.
10042 * testsuite/Makefile.am (final_layout): New test case.
10043 * testsuite/Makefile.in: Regenerate.
10044 * testsuite/final_layout.cc: New file.
10045 * testsuite/final_layout.sh: New file.
10046
3537c84b
RÁE
100472010-06-01 Rafael Espindola <espindola@google.com>
10048
10049 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10050
105b6afd
RÁE
100512010-06-01 Rafael Espindola <espindola@google.com>
10052
10053 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10054 visibility of symbols.
10055
29e11421
DK
100562010-05-27 Doug Kwan <dougkwan@google.com>
10057
10058 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10059 from start of output section instead of address for a local symbol
10060 in a merged or relaxed section when doing a relocatable link.
10061
5e0f337e
RÁE
100622010-05-26 Rafael Espindola <espindola@google.com>
10063
703d02da 10064 PR 11604
5e0f337e
RÁE
10065 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10066 adding sections the garbage collector removed.
10067 * gold/testsuite/Makefile.am: Add test.
10068 * gold/testsuite/Makefile.in: Regenerate.
10069 * gold/testsuite/plugin_test_7.sh: New.
10070 * gold/testsuite/plugin_test_7_1.c: New.
10071 * gold/testsuite/plugin_test_7_2.c: New.
10072
f4187277
RÁE
100732010-05-26 Rafael Espindola <espindola@google.com>
10074
10075 * script-sections.cc (Output_section_definition::set_section_addresses):
10076 Check for --section-start.
10077
5c388529
DK
100782010-05-26 Doug Kwan <dougkwan@google.com>
10079
10080 * arm.cc (Arm_scan_relocatable_relocs): New class.
10081 (Target_arm::relocate_special_relocatable): New method.
10082 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10083 (Arm_relocate_functions::thumb_branch_common): Same.
10084 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10085 instead of Default_scan_relocatable_relocs.
10086 * target-reloc.h (relocate_for_relocatable): Let target handle
10087 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10088 * target.h (Sized_target::relocate_special_relocatable): New method.
10089
bca1c3ae
ILT
100902010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10091
10092 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10093
0439c796
DK
100942010-05-23 Doug Kwan <dougkwan@google.com>
10095
10096 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10097 instead of a cast.
10098 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10099 with a direct branch, not a conditional branch, to a stub.
10100 * merge.cc (Output_merge_base::record_input_section): New method
10101 defintion.
10102 (Output_merge_data::do_add_input_section): Record input section if
10103 keeps-input-sections flag is set.
10104 (Output_merge_string::do_add_input_section): Ditto.
10105 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10106 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10107 INPUT_SECTIONS_.
10108 (Output_merge_base::keeps_input_sections,
10109 Output_merge_base::set_keeps_input_sections,
10110 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10111 method definitions.
10112 (Output_merge_base::Input_sections): New type declaration.
10113 (Output_merge_base::input_sections_begin,
10114 Output_merge_base::input_sections_end,
10115 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10116 (Output_merge_base::bool keeps_input_sections_,
10117 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10118 Output_merge_base::input_sections_): New data members.
10119 (Output_merge_data::do_set_keeps_input_sections): New method
10120 defintion.
10121 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10122 * output.cc (Output_section::Input_section::relobj): Move method
10123 defintion from class declaration to here and handle merge sections.
10124 (Output_section::Input_section::shndx): Ditto.
10125 (Output_section::Output_section): Remove initializations of removed
10126 data members and initialize new data member LOOKUP_MAPS_.
10127 (Output_section::add_input_section): Set keeps-input-sections flag
10128 for a newly created merge output section as appropriate. Adjust code
10129 to use Output_section_lookup_maps class.
10130 (Output_section::add_relaxed_input_section): Adjst code for lookup
10131 maps code refactoring.
2e702c99 10132 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10133 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10134 class. If adding input section to a newly created merge output
10135 section fails, remove the new merge section.
10136 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10137 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10138 (Output_section::find_merge_section): Ditto.
0439c796 10139 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10140 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10141 Output_section_lookup_maps class.
10142 (Output_section::get_input_sections): Export merge sections. Adjust
10143 code to use Output_section_lookup_maps class.
10144 (Output_section:::add_script_input_section): Adjust code to use
10145 Output_section_lookup_maps class. Update lookup maps for merge
10146 sections also.
10147 (Output_section::discard_states): Use Output_section_lookup_maps.
10148 (Output_section::restore_states): Same.
10149 * output.h (Merge_section_properties): Move class defintion out of
10150 Output_section.
10151 (Output_section_lookup_maps): New class.
10152 (Output_section::Input_section::is_merge_section): New method
10153 defintion.
10154 (Output_section::Input_section::relobj): Move defintion out of class
10155 defintion. Declare method only.
10156 (Output_section::Input_section::shndx): Ditto.
10157 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10158 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10159 (Output_section::Merge_section_by_properties_map,
10160 Output_section::Output_section_data_by_input_section_map,
10161 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10162 Remove types.
2e702c99 10163 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10164 KEEPS_INPUT_SECTIONS.
10165 (Output_section::build_lookup_maps): New method declaration.
10166 (Output_section::merge_section_map_,
10167 Output_section::merge_section_by_properties_map_,
10168 Output_section::relaxed_input_section_map_,
10169 Output_section::is_relaxed_input_section_map_valid_): Remove data
10170 members.
10171 (Output_section::lookup_maps_): New data member.
10172
76295588
L
101732010-05-21 Doug Kwan <dougkwan@google.com>
10174
10175 PR gold/11619
10176 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10177 avoid a compilation error.
10178
d103a984
RÁE
101792010-05-19 Rafael Espindola <espindola@google.com>
10180
10181 * script-sections.cc (Output_section_definition::allocate_to_segment):
10182 Update the phdrs_list even when the output section is NULL.
10183 * testsuite/Makefile.am: Add test.
10184 * testsuite/Makefile.in: Regenerate.
10185 * testsuite/script_test_9.cc: New.
10186 * testsuite/script_test_9.sh: New.
10187 * testsuite/script_test_9.t: New.
10188
6625d24e
DK
101892010-05-19 Doug Kwan <dougkwan@google.com>
10190
10191 * arm.cc (Arm_input_section::original_size): New method.
10192 (Arm_input_section::do_addralign): Add a cast.
10193 (Arm_input_section::do_output_offset): Remove static cast.
10194 (Arm_input_section::original_addralign,
10195 Arm_input_section::original_size_): Change type to uint32_t.
10196 (Arm_input_section::init): Add safe casts for section alignment
10197 and size.
10198 (Arm_input_section::set_final_data_size): Do not set address and
10199 offset of stub table.
10200 (Arm_output_section::fix_exidx_coverage): Change use of of
10201 Output_section::Simple_input_section to that of
10202 Output_section::Input_section.
10203 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10204 except for the first pass.
10205 * output.cc (Output_section::get_input_sections): Change type of
10206 input_sections to std::list<Input_section>.
10207 (Output_section::add_script_input_section): Rename from
10208 Output_section::add_simple_input_section. Change type of SIS
10209 parameter from Simple_input_section to Input_section.
10210 * output.h (Output_section::Simple_input_section): Remove class.
10211 (Output_section::Input_section): Change class visibility to public.
10212 (Output_section::Input_section::addralign): Use stored alignments
10213 for special input sections if set.
10214 (Output_section::Input_section::set_addralign): New method.
10215 (Output_section::get_input_sections): Change parameter type from
10216 list of Simple_input_section to list of Input_section.
10217 (Output_section::add_script_input_section): Rename from
10218 Output_section::add_simple_input_section. Change first parameter's
10219 type from Simple_input_section to Input_section and remove the
10220 second and third parameters.
10221 * script-sections.cc (Input_section::Input_section_list): Change
10222 type to list of Output_section::Input_section/
10223 (Input_section_info::Input_section_info): Change parameter type of
10224 INPUT_SECTION to Output_section::Input_section.
10225 (Input_section_info::input_section): Change return type.
10226 (Input_section_info::input_section_): Change type to
10227 Output_section::Input_section.
10228 (Output_section_element_input::set_section_addresses): Adjust code
10229 to use Output_section::Input_section instead of
10230 Output_section::Simple_input_section. Adjust code for renaming
10231 of Output_section::add_simple_input_section.
10232 (Orphan_output_section::set_section_addresses): Ditto.
10233
e1e82ea4
RW
102342010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10235
10236 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10237 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10238
91e75c8a
RÁE
102392010-05-18 Rafael Espindola <espindola@google.com>
10240
10241 * options.cc (General_options::finalize): Handle -nostdlib.
10242 * options.h (nostdlib): New option.
10243 * script.cc (script_add_search_dir): Handle -nostdlib.
10244
da59ad79
DK
102452010-05-12 Doug Kwan <dougkwan@google.com>
10246
10247 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10248 attributes section only if there no attributes section after merging.
10249 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10250 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10251 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10252 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10253 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10254 and arm_attr_merge_7.stdout.
10255 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10256 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10257 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10258 arm_attr_merge_7b.o): New rules.
10259 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10260 arm_attr_merge_7
10261 * testsuite/Makefile.in: Regenerate.
10262 * testsuite/arm_attr_merge.sh: New file.
10263 * testsuite/arm_attr_merge_[67][ab].s: Same.
10264
3e01a7fd
NC
102652010-05-05 Nick Clifton <nickc@redhat.com>
10266
10267 * po/es.po: Updated Spanish translation.
10268
7ad2014a
L
102692010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10270
10271 * Makefile.am (install-exec-local): Properly install gold as
10272 default cross linker.
10273 * Makefile.in: Regenerated.
10274
4fda8867
NC
102752010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10276 Nick Clifton <nickc@redhat.com>
10277
10278 * configure.ac (install_as_default): Define and set to false
10279 unless --enable-gold or --enable-gold=both/gold has been
10280 specified.
10281 * configure: Regenerate.
10282
10283 * Makefile.am (install-exec-local): Install the executable as
10284 'ld.gold'. If install_as_default is true then also install it as
10285 'ld'.
10286 * Makefile.in: Regenerated.
10287
bd288ea2
ILT
102882010-04-24 Ian Lance Taylor <iant@google.com>
10289
10290 * layout.cc (Layout::layout_reloc): In relocatable link don't
10291 combine reloc sections for grouped sections.
10292
ef38fd8a
ST
102932010-04-23 Sriraman Tallam <tmsriram@google.com>
10294
10295 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10296 sections that are not ordinary to icf.
10297 * icf.cc (get_section_contents): Handle relocation pointing to section
10298 with no object or shndx information.
10299 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10300 * testsuite/Makefile.in: Regenerate.
10301 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10302 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10303
f6973bdc
ILT
103042010-04-22 Ian Lance Taylor <iant@google.com>
10305
10306 * expression.cc (Expression::Expression_eval_info): Add
10307 result_alignment_pointer field.
10308 (Expression::eval_with_dot): Add result_alignment_pointer
10309 parameter. Change all callers.
10310 (Expression::eval_maybe_dot): Likewise.
10311 (class Binary_expression): Add alignment_pointer parameter to
10312 left_value and right_value. Change all callers.
10313 (BINARY_EXPRESSION): Set result alignment.
10314 (class Trinary_expression): Add alignment_pointer parameter to
10315 arg2_value and arg3_value. Change all callers.
10316 (Trinary_cond::value): Set result alignment.
10317 (Max_expression::value, Min_expression::value): Likewise.
10318 (Align_expression::value): Likewise.
10319 * script-sections.cc (class Sections_element): Add dot_alignment
10320 parameter to set_section_addresses virtual function. Update
10321 instantiations.
10322 (class Output_section_element): Likewise.
10323 (Script_sections::create_segments): Add dot_alignment parameter.
10324 Change all callers.
10325 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10326 (Script_sections::set_phdrs_clause_addresses): Likewise.
10327 * script-sections.h: Update declarations.
10328 * script.h: Update declarations.
10329 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10330 min_p_align.
10331 * testsuite/script_test_3.t: Set large alignment.
10332 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10333 segment has expected alignment.
10334
9c9c98a5
NC
103352010-04-22 Nick Clifton <nickc@redhat.com>
10336
10337 * po/gold.pot: Updated by the Translation project.
10338 * po/vi.po: Updated Vietnamese translation.
10339
2253bfba
L
103402010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10341
10342 * testsuite/Makefile.am (check_PROGRAMS): Add
10343 icf_virtual_function_folding_test.
10344 * testsuite/Makefile.in: Regenerated.
10345
85fdf906
AH
103462010-04-15 Andrew Haley <aph@redhat.com>
10347
10348 * options.h (merge_exidx_entries): New option.
10349 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10350 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10351 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10352 (Target_arm::merge_exidx_entries): New function.
10353 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10354 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10355 to Arm_exidx_fixup constructor.
10356 Add new arg, merge_exidx_entries.
10357 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10358 Arm_output_section::fix_exidx_coverage.
10359
ce97fa81
ST
103602010-04-18 Sriraman Tallam <tmsriram@google.com>
10361
10362 * icf.cc (get_section_contents): Check for preemptible functions.
10363 Ignore addend when appropriate.
10364 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10365 section folded.
10366 (add_from_relobj): Check for section folded.
10367 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10368 * symtab.h (should_add_dynsym_entry): Add new parameter.
10369 * target-reloc.h (scan_relocs): Check for section folded.
10370 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10371 Check reloc types for function pointers in shared objects.
10372 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10373 case.
10374 (icf_preemptible_functions_test): New test case.
10375 (icf_string_merge_test): New test case.
10376 * testsuite.Makefile.in: Regenerate.
10377 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10378 bar_glob. Refactor code.
10379 * testsuite/icf_preemptible_functions_test.cc: New file.
10380 * testsuite/icf_preemptible_functions_test.sh: New file.
10381 * testsuite/icf_string_merge_test.cc: New file.
10382 * testsuite/icf_string_merge_test.sh: New file.
10383 * testsuite/icf_virtual_function_folding_test.cc: New file.
10384 * testsuite/icf_virtual_function_folding_test.sh: New file.
10385
04ceb17c
DK
103862010-04-14 Doug Kwan <dougkwan@google.com>
10387
10388 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10389 for local symbol recounting if we remove a section due to ICF.
10390 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10391 there are no regular objects in input.
10392
153e7da4
DK
103932010-04-13 Doug Kwan <dougkwan@google.com>
10394
10395 * arm.cc (Arm_input_section::set_final_data_size): Compute
10396 accurate final data size instead of using current data size.
10397
4dbd9faf
DK
103982010-04-09 Doug Kwan <dougkwan@google.com>
10399
10400 * layout.cc (Layout::choose_output_section): Handle script section
10401 types.
10402 (Layout::make_output_section_for_script): Add section type parameter.
10403 Handle script section types.
10404 * layout.h (Layout::make_output_section_for_script): Add section
10405 type parameter.
10406 * output.cc (Output_section::Output_section): Initialize data member
10407 is_noload_.
10408 (Output_section::do_reset_address_and_file_offset): Do not set address
10409 to 0 if section is a NOLOAD section.
10410 * output.h (Output_section::is_noload): New method.
10411 (Output_section::set_is_noload): Ditto.
10412 (Output_section::is_noload_): New data member.
10413 * script-c.h (Script_section_type): New enum type.
10414 (struct Parser_output_section_header): Add new file section_type.
10415 * script-sections.cc (Sections_element::output_section_name): Add
10416 parameter for returning script section type.
10417 (Output_section_definition::output_section_name): Ditto.
10418 (Output_section_definition::section_type)P; New method.
10419 (Output_section_definiton::script_section_type_name): Ditto.
10420 (Output_section_definition::script_section_type_): New data member.
10421 (Output_section_definition::Output_section_definition): Initialize
10422 data member Output_section_definition::script_section_type_.
10423 (Output_section_definition::create_sections): Pass script section type
10424 to Layout::make_output_section_for_script.
10425 (Output_section_definition::output_section_name): Return script
10426 section type to caller.
10427 (Output_section_definition::set_section_address): Do not advance
10428 dot value and load address if section type is NOLOAD. Set address
10429 of NOLOAD sections regardless of section flags.
10430 (Output_section_definition::print): Print section type if it is
10431 not SCRIPT_SECTION_TYPE_NONE.
10432 (Output_section_definition::section_type): New method.
10433 (Output_section_definition::script_section_type_name): Ditto.
10434 (Script_sections::output_section_name): Add new parameter
10435 PSECTION_TYPE for returning script section type. Pass it to
10436 section elements. Handle discard sections.
10437 (Sort_output_sections::operator()): Handle NOLOAD sections.
10438 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10439 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10440 returning script section type.
10441 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10442 INFO and NOLOAD.
10443 * yyscript.y (union): Add new field SECTION_TYPE.
10444 (COPY, DSECT, INFO, NOLOAD): New tokens.
10445 (opt_address_and_section_type): Change type to output_section_header.
10446 (section_type): New non-terminal
10447 (section_header): Handle section type.
2253bfba 10448 (opt_address_and_section_type): Return section type value.
4dbd9faf 10449
721ea635
L
104502010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10451
10452 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10453 * testsuite/plugin_common_test_2.c (foo): Likewise.
10454
6bf924b0
DK
104552010-04-08 Doug Kwan <dougkwan@google.com>
10456
10457 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10458 Output_merge_data.
10459 * output.cc (Output_section::add_merge_input_section): Simplify
10460 code and return status of Output_merge_base::add_input_section.
e1df38aa 10461 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10462 returns true.
10463
24af6f92
DK
104642010-04-07 Doug Kwan <dougkwan@google.com>
10465
10466 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10467 if section is marked as containing instructions but has no mapping
10468 symbols.
10469 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10470 correct section index.
10471 (Arm_relobj::find_linked_text_section): Ditto.
10472
00698fc5
CC
104732010-04-07 Cary Coutant <ccoutant@google.com>
10474
10475 * archive.cc (include_member): Destroy Read_symbols_data object before
10476 releasing file.
10477 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10478 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10479 (Read_symbols_data::~Read_symbols_data) New destructor.
10480 (Section_relocs::Section_relocs) New constructor.
10481 (Section_relocs::~Section_relocs) New destructor.
10482 (Read_relocs_data::Read_relocs_data) New constructor.
10483 (Read_relocs_data::~Read_relocs_data) New destructor.
10484 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10485 pointers to NULL after deleting.
10486
7296d933
DK
104872010-04-07 Doug Kwan <dougkwan@google.com>
10488
10489 * arm.cc: Replace "endianity" with "endianness" in comments.
10490 (Arm_exidx_cantunwind): Ditto.
10491 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10492 (Arm_relobj::merge_flags_and_attributes): New method.
10493 (Arm_relobj::merge_flags_and_attributes_): New data member.
10494 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10495 (Arm_relobj::scan_sections_for_stubs): Ditto.
10496 (Arm_relobj::do_read_symbols): Check to see if we really want to
10497 merge processor-specific flags and attributes. Exit early if
10498 an object is empty except for section names and the undefined symbol.
10499 (Target_arm::do_finalize_sections): Move check for ELF format to
10500 Arm_relobj::do_read_symbols. Merge processor specific flags and
10501 attributes from a regular object only when we have determined that
10502 it is aapropriate. Do not create an .ARM.attributes section in
10503 output if there is no regular input object.
10504 (Target_arm::merge_processor_specific_flags): Check
10505 --warn-mismatch before printing any error.
10506 (Target_arm::merge_object_attributes): Ditto.
10507 * gold.cc (queue_middle_tasks): Handle the case in which there is
10508 no regular object in input.
10509 * options.cc (General_options::parse_EB): New method.
10510 (General_options::parse_EL): Same.
10511 (General_options::General_options): Initialize endianness_.
10512 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10513 New options.
10514 (General_options::Endianness): New enum.
10515 (General_options::endianness): New method.
10516 (General_options::endianness_): New data member.
10517 * parameters.cc (Parameters::set_options): Check target endianness.
10518 (Parameters::set_target_once): Ditto.
10519 (Parameters::check_target_endianness): New method.
10520 (parameters_force_valid_target): If either -EL or -EB is specified,
10521 use it to define endianness of default target.
10522 * parameters.h (Parameters::check_target_endianness): New method
10523 declaration.
10524 * target.h (class Target): Change "endianity" to "endianness"
10525 in comments.
10526
efc8d4f2
RW
105272010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10528
10529 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10530 * configure: Regenerate.
10531 * Makefile.in: Regenerate.
10532 * testsuite/Makefile.in: Regenerate.
10533
be234d88
CC
105342010-04-06 Cary Coutant <ccoutant@google.com>
10535
10536 gcc PR lto/42757
10537 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10538 prevailing definitions of common symbols.
10539 * testsuite/plugin_test_6.sh: New test case.
10540 * testsuite/plugin_common_test_1.c: New test case.
10541 * testsuite/plugin_common_test_2.c: New test case.
10542 * testsuite/Makefile.am (plugin_test_6): New test case.
10543 * testsuite/Makefile.in: Regenerate.
10544
bd32c6bd
NC
105452010-04-06 Nick Clifton <nickc@redhat.com>
10546
10547 * po/vi.po: New Vietnamese translation.
10548
323c532f
DK
105492010-03-30 Doug Kwan <dougkwan@google.com>
10550
10551 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10552
4fcd97eb
DK
105532010-03-25 Doug Kwan <dougkwan@google.com>
10554
10555 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10556 to avoid a conversion warning on a 32-bit host.
10557
4ebf39db
ILT
105582010-03-24 Ian Lance Taylor <iant@google.com>
10559
10560 * testsuite/script_test_3.t: Add a TLS segment.
10561 * testsuite/Makefile.am (check_PROGRAMS): Add
10562 tls_phdrs_script_test.
10563 (tls_phdrs_script_test_SOURCES): Define.
10564 (tls_phdrs_script_test_DEPENDENCIES): Define.
10565 (tls_phdrs_script_test_LDFLAGS): Define.
10566 (tls_phdrs_script_test_LDADD): Define.
10567 * testsuite/Makefile.in: Rebuild.
10568
4a599bdd
CC
105692010-03-23 Cary Coutant <ccoutant@google.com>
10570
10571 * fileread.cc (find_or_make_view): Fix comment.
10572
6c93b22c
ILT
105732010-03-23 Ian Lance Taylor <iant@google.com>
10574
10575 * script-sections.cc (class Orphan_section_placement): Define
10576 PLACE_TLS and PLACE_TLS_BSS.
10577 (Orphan_section_placement::Orphan_section_placement): Initialize
10578 new places.
10579 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10580 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10581 (tls_script_test_SOURCES): Define.
10582 (tls_script_test_DEPENDENCIES): Define.
10583 (tls_script_test_LDFLAGS): Define.
10584 (tls_script_test_LDADD): Define.
10585 * testsuite/Makefile.in: Rebuild.
10586
a2c7281b
DK
105872010-03-22 Doug Kwan <dougkwan@google.com>
10588
10589 * arm.cc (Arm_relocate_functions::abs8,
10590 Arm_relocate_functions::abs16): Use correct check for overflow
10591 specified in the ARM ELF specs.
10592 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10593 target of a BLX instruction specially.
10594 (Reloc_stub::stub_type_for_reloc): Ditto.
10595 (Relocate::relocate): Use symbolic names instead of numeric relocation
10596 codes to report error.
10597 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10598 workaround.
10599 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10600 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10601 thumb2_blx_out_of_range.stdout
10602 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10603 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10604 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10605 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10606 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10607 thumb2_blx_in_range, thumb2_blx_in_range.o,
10608 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10609 thumb2_blx_out_of_range.o): New rules.
2e702c99 10610 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10611 thumb2_blx_in_range and thumb2_blx_out_of_range.
10612 * testsuite/Makefile.in: Regenerate.
10613 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10614 * testsuite/thumb_blx_in_range.s: New file.
10615 * testsuite/thumb_blx_out_of_range.s: New file.
10616
b0193076
RÁE
106172010-03-22 Rafael Espindola <espindola@google.com>
10618
10619 * archive.cc (Should_include): Move to archive.h.
10620 (should_include_member): Make it a member of Archive.
10621 (Lib_group): New.
10622 (Add_lib_group_symbols): New.
10623 * archive.h: Include options.h.
10624 (Archive_member): Moved from Archive.
10625 (Should_include): Moved from archive.cc.
10626 (Lib_group): New.
10627 (Add_lib_group_symbols): New.
10628 * dynobj.cc (do_should_include_member): New.
10629 * dynobj.h (do_should_include_member): New.
10630 * gold.cc (queue_initial_tasks): Update call to queue.
10631 * main.cc (main): Print lib group stats.
10632 * object.cc (do_should_include_member): New.
10633 * object.h: Include archive.h.
10634 (Object::should_include_member): New.
10635 (Object::do_should_include_member): New.
10636 (Sized_relobj::do_should_include_member): New.
10637 * options.cc (General_options::parse_start_lib): New.
10638 (General_options::parse_end_lib): New.
10639 (Input_arguments::add_file): Handle lib groups.
10640 (Input_arguments::start_group): Check we are not in a lib.
10641 (Input_arguments::start_lib): New.
10642 (Input_arguments::end_lib): New.
10643 * options.h (General_options): Add start_lib and end_lib.
10644 (Input_argument::lib_): New.
10645 (Input_argument::lib): New.
10646 (Input_argument::is_lib): New.
10647 (Input_file_lib): New.
10648 (Input_arguments::in_lib_): New.
10649 (Input_arguments::in_lib): New.
10650 (Input_arguments::start_lib): New.
10651 (Input_arguments::end_lib_): New.
10652 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10653 in unused members as preempted.
10654 (Sized_pluginobj::do_should_include_member): New.
10655 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10656 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10657 return the blocker.
10658 (Read_symbols::do_whole_lib_group): New.
10659 (Read_symbols::do_lib_group): New.
10660 (Read_symbols::do_read_symbols): Handle lib groups.
10661 (Read_symbols::get_name): Handle lib groups.
10662 * readsyms.h (Read_symbols): Add an archive member pointer.
10663 (Read_symbols::do_whole_lib_group): New.
10664 (Read_symbols::do_lib_group): New.
10665 (Read_symbols::member_): New.
10666 * script.cc (read_input_script): Update call to queue_soon.
10667
d099120c
DK
106682010-03-19 Doug Kwan <dougkwan@google.com>
10669
10670 * arm.cc (Stub_table::Stub_table): Initialize new data members
10671 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10672 (Stub_table::add_reloc_stub): Assign stub offset and update
10673 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10674 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10675 New data members.
2e702c99 10676 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10677 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10678 instead of going over all reloc stubs.
2e702c99 10679 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10680 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10681 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10682 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10683 Stringpool_template::offset_.
10684 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10685 Stringpool_template::offset_ to zero.
10686
1aa37384
DK
106872010-03-15 Doug Kwan <dougkwan@google.com>
10688
10689 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10690 offset_.
10691 (Stringpool_template::new_key_offset): New method.
10692 (Stringpool_template::add_string): Assign offsets when adding new
10693 strings.
10694 (Stringpool_template::set_string_offsets): Do not set string offsets
10695 when not optimizing.
10696 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10697 member size_.
2e702c99
RM
10698 (Chunked_vector::clear): Clear size_.
10699 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10700 (Chunked_vector::size): Return size_.
10701 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10702 (Chunked_vector::size_): New data member.
1aa37384
DK
10703 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10704 (Stringpool_template::new_key_offset): New method declaration.
10705 (Stringpool_template::offset_): New data member.
10706
b672b057
RÁE
107072010-03-15 Rafael Espindola <espindola@google.com>
10708
10709 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10710 Add_symbols' constructor.
10711 * readsyms.h (Add_symbols): Remove the input_group member.
10712
b6848d3c
ILT
107132010-03-10 Ian Lance Taylor <iant@google.com>
10714
10715 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10716 target to ask whether a reference to a symbol requires a stack
10717 split.
10718 * target.h (Target::is_call_to_non_split): New function.
10719 (Target::do_is_call_to_non_split): Declare virtual function.
10720 * target.cc: Include "symtab.h".
10721 (Target::do_is_call_to_non_split): New function.
10722 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10723
a2a5469e
CC
107242010-03-10 Cary Coutant <ccoutant@google.com>
10725
10726 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10727 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10728 (File_read::open[2]): Add whole_file_view_ to list of views.
10729 (File_read::make_view): Remove test of whole_file_view_.
10730 (File_read::find_or_make_view): Create whole_file_view_ if
10731 necessary.
10732 (File_read::clear_views): Replace bool parameter with enum;
10733 adjust all callers. Don't delete views with permanent data;
10734 do delete cached views and views from archives if
10735 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10736 if clearing the corresponding view.
10737 * fileread.h (File_read::Clear_views_mode): New enum.
10738 (File_read::View::is_permanent_view): New method.
10739 (File_read::clear_views): Replace bool parameter
10740 with enum; adjust all callers.
10741 * options.h (General_options): Change keep_files_mapped option;
10742 add map_whole_files.
10743 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10744 releasing the file.
10745 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10746 the file.
10747
8861f32b
DM
107482010-03-10 David S. Miller <davem@davemloft.net>
10749
10750 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10751
d62d0f5f
ST
107522010-03-09 Sriraman Tallam <tmsriram@google.com>
10753
10754 * icf.cc (get_section_contents): Add '@' marker after processing the
10755 merge reloc.
10756
9177756d
DK
107572010-03-08 Doug Kwan <dougkwan@google.com>
10758
10759 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10760 due to a conversion warning.
10761 (Arm_relobj::update_output_local_symbol_count): Check for local
10762 symbol with unset output index.
10763
9e9e071b
ILT
107642010-03-05 Ian Lance Taylor <iant@google.com>
10765
10766 * options.h (class General_options): Add --spare-dynamic-tags.
10767 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10768 --spare-dynamic-tags.
10769
a81ee015
ILT
107702010-03-05 Ian Lance Taylor <iant@google.com>
10771
10772 * incremental.cc: Include "libiberty.h".
10773
44ec90b9
RO
107742010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10775
10776 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10777 function, is_info_ member.
10778 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10779 (Versions::Versions): Update caller.
10780 (Versions::define_base_version): Likewise.
10781 (Versions::add_def): Likewise.
10782
0897ed3b
ST
107832010-03-03 Sriraman Tallam <tmsriram@google.com>
10784
10785 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10786 (Scan::possible_function_pointer_reloc): New function.
10787 (Scan::local_reloc_may_be_function_pointer): Change to call
10788 possible_function_pointer_reloc.
10789 (Scan::global_reloc_may_be_function_pointer): Ditto.
10790 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10791 relocations in ".data.rel.ro._ZTV" section.
10792 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10793 * testsuite/icf_safe_so_test.cc: Ditto.
10794 * testsuite/icf_safe_test.cc: Ditto.
10795 * testsuite/icf_safe_test.sh: Ditto.
10796
d3bbad62
ILT
107972010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10798 Ian Lance Taylor <iant@google.com>
10799
10800 * target-reloc.h (relocate_section): Check the symbol table index
10801 for -1U before setting the local symbol index.
10802 (scan_relocatable_relocs): If copying the relocation, record that
10803 the local symbol is required.
10804 * object.h (Symbol_value::is_output_symtab_index_set): New
10805 function.
10806 (Symbol_value::may_be_discarded_from_output_symtab): New
10807 function.
10808 (Symbol_value::has_output_symtab_entry): New function.
10809 (Symbol_value::needs_output_symtab_entry): Remove.
10810 (Symbol_value::output_symtab_index): Make sure the symbol index is
10811 set.
10812 (Symbol_value::set_output_symtab_index): Make sure the symbol
10813 index is not set. Make sure the new index is valid.
10814 (Symbol_value::set_must_have_output_symtab_entry): New function.
10815 (Symbol_value::has_output_dynsym_entry): New function.
10816 (Symbol_value::set_output_dynsym_index): Make sure the new index
10817 is valid.
10818 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10819 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10820 local symbol if permitted.
10821 (Sized_relobj::do_finalize_local_symbols): Call
10822 is_output_symtab_index_set rather than needs_output_symtab_entry.
10823 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10824 rather than needs_output_symtab_entry. Call
10825 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10826 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10827 is_output_symtab_index_set rather than needs_output_symtab_entry.
10828 * testsuite/discard_locals_relocatable_test.c: New file.
10829 * testsuite/discard_locals_test.sh: Test -r.
10830 * testsuite/Makefile.am (check_DATA): Add
10831 discard_locals_relocatable_test1.syms,
10832 discard_local_relocatable_test2.syms.
10833 (MOSTLYCLEANFILES): Likewise. Also add
10834 discard_locals_relocatable_test1.lout and
10835 discard_locals_relocatable_test2.out.
10836 (discard_locals_relocatable_test1.syms): New target.
10837 (discard_locals_relocatable_test.o): New target.
10838 (discard_locals_relocatable_test1.out): New target.
10839 (discard_locals_relocatable_test2.syms): New target.
10840 (discard_locals_relocatable_test2.out): New target.
10841 (various): Add missing ../ld-new dependencies.
10842 * testsuite/Makefile.in: Rebuild.
10843
7e8ccf26
NC
108442010-03-03 Nick Clifton <nickc@redhat.com>
10845
10846 * po/fi.po: New Finnish translation.
10847
2a0ff005
DK
108482010-03-01 Doug Kwan <dougkwan@google.com>
10849
10850 * layout.cc (Layout::Layout): Force section types of .init_array*,
10851 .preinit_array* and .fini_array* sections.
10852 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10853 Fix check of return value of std::string::find.().
10854 (Output_section::Input_section_sort_compare::operator()): Remove
10855 comment about .init_array.
10856 (Output_section::Input_section_sort_init_fini_compare::operator()):
10857 New method.
10858 (Output_section::sort_attached_input_sections): Handle .init_array
10859 and .fini_array specially.
10860 * output.h (Output_section::Inut_section_sort_compare): Update
10861 comment.
10862 (Output_section::Input_section_sort_init_fini_compare): New struct.
10863
c3e4ae29
DK
108642010-02-26 Doug Kwan <dougkwan@google.com>
10865
10866 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10867 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10868 * testsuite/debug_msg.sh: Avoid matching source line number for
10869 use of global variable undef_int.
10870
2fd9ae7a
DK
108712010-02-26 Doug Kwan <dougkwan@google.com>
10872
10873 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10874 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10875 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10876 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10877 * options.cc (General_options::General_options): Initialize member
10878 fix_v4bx_.
10879 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10880 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10881 and rm_no_fix_v4bx.stdout
10882 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10883 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10884 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10885 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10886 and arm_no_fix_v4bx.
10887 * Makefile.in: Regenerate.
10888 * testsuite/arm_fix_v4bx.s: New file.
10889 * testsuite/arm_fix_v4bx.sh: Ditto.
10890
67ec7d0b
DK
108912010-02-24 Doug Kwan <dougkwan@google.com>
10892
10893 * arm.cc (Target_arm::got_section): Make the .got section the first
10894 non RELRO section in the data segment.
10895 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10896 suffixes of section names.
10897
10165461
DK
108982010-02-24 Doug Kwan <dougkwan@google.com>
10899
10900 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10901 flags and attributes merging if an input file is a binary file.
10902 * fileread.cc (Input_file::open): Record format of original file.
10903 * fileread.h (Input_file::Format): New enum type.
2e702c99 10904 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10905 (Input_file::format): New method definition.
10906 (Input_file::format_):: New data member.
10907
4a54abbb
DK
109082010-02-24 Doug Kwan <dougkwan@google.com>
10909
10910 * arm.cc (Arm_output_data_got): New class.
10911 (ARM_TCB_SIZE): New constant
10912 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10913 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10914 If user uses a script with a SECTIONS clause, issue only a warning
10915 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10916 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10917 garbage collection.
10918 (Target_arm::got_mode_index_entry): Handle static linking.
10919 (Target_arm::Scan::local): Ditto.
10920 (Target_arm::Scan::global): Ditto.
10921 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10922 all incorrectly implemented relocations.
e1df38aa 10923 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10924 Arm_output_section::fix_exidx_coverage.
10925 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10926 from ".ARM.exidx." and ".ARM.extab.".
10927
ca419a6f
ILT
109282010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10929
10930 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10931 section if it does not already exist.
10932 * attributes.cc (Attributes_section_data::Attributes_section_data):
10933 Don't crash if size is zero.
10934
135b9c78
ILT
109352010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10936 Ian Lance Taylor <iant@google.com>
10937
10938 * gold.cc (queue_middle_tasks): If no input files were opened,
10939 exit.
10940 * workqueue.h (Task_function::Task_function): Assert that there is
10941 a blocker.
10942
bb0bfe4f
DK
109432010-02-22 Doug Kwan <dougkwan@google.com>
10944
10945 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10946 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10947 types to avoid warnings due to different uint64_t implementations
10948 on different hosts.
10949
2a2b6d42
DK
109502010-02-21 Doug Kwan <dougkwan@google.com>
10951
10952 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10953 handling of the maximum backward branch offset.
2e702c99 10954 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10955 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10956 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10957 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10958 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10959 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10960 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10961 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10962 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10963 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10964 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10965 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10966 thumb2_bl_out_of_range.o): New rules.
10967 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10968 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10969 thumb2_bl_out_of_range
10970 * testsuite/Makefile.in: Regenerate.
10971 * testsuite/arm_bl_in_range.s: New file.
10972 * testsuite/arm_bl_out_of_range.s: Ditto.
10973 * testsuite/arm_branch_in_range.sh: Ditto.
10974 * testsuite/arm_branch_range.t: Ditto.
10975 * testsuite/thumb2_branch_range.t: Ditto.
10976 * testsuite/thumb_bl_in_range.s: Ditto.
10977 * testsuite/thumb_bl_out_of_range.s: Ditto.
10978 * testsuite/thumb_branch_range.t: Ditto.
10979
b487ad64
ST
109802010-02-20 Sriraman Tallam <tmsriram@google.com>
10981
10982 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10983 Add reloc offset information.
10984 * icf.cc (get_section_contents): Change iterators to point to the new
10985 vectors. Add reloc offset information to the contents.
10986 * icf.h (Icf::Sections_reachable_info): New typedef.
10987 (Icf::Sections_reachable_list): New typedef.
10988 (Icf::Offset_info): New typedef.
10989 (Icf::Reloc_info): New struct typedef.
10990 (Icf::Reloc_info_list): New typedef.
10991 (Icf::symbol_reloc_list): Delete method.
10992 (Icf::addend_reloc_list): Delete method.
10993 (Icf::section_reloc_list): Delete method.
10994 (Icf::reloc_info_list): New method.
10995 (Icf::reloc_info_list_): New member.
10996
f96accdf
DK
109972010-02-19 Doug Kwan <dougkwan@google.com>
10998
10999 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11000 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11001 * arm.cc (Arm_relocation_functions): New forward declaration.
11002 (Target_arm::Target_arm): Initialize new data members
11003 got_mod_index_offset_ and tls_base_symbol_defined_.
11004 (Target_arm::Relocate::relocate_tls): New method.
11005 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11006 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11007 New methods.
2e702c99 11008 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
11009 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11010 (Target_arm::got_mod_index_offset_,
11011 Target_arm::tls_base_symbol_defined_): New data members.
11012 (Target_arm::Scan::local, Target::Scan::global,
11013 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11014 relocations.
11015
c8761b9a
DK
110162010-02-18 Doug Kwan <dougkwan@google.com>
11017
11018 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11019 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11020 text section as a parameter becuase some broken tools may not set
11021 the link in section header.
11022 (Target_arm::has_got_section): New method.
11023 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11024 without any mapping symbol as data only. Remove warning.
11025 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11026 link in its section header, try to discover the link by inspecting the
11027 REL31 relocation at the beginning of the section.
11028 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11029 in error message.
11030 (Target_arm::Scan::global): Treat any reference to the symbol
11031 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11032
21bb3914
ST
110332010-02-12 Sriraman Tallam <tmsriram@google.com>
11034
11035 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11036 (Scan::global_reloc_may_be_function_pointer): New function.
11037 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11038 (Scan::global_reloc_may_be_function_pointer): New function.
11039 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11040 (Scan::global_reloc_may_be_function_pointer): New function.
11041 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11042 (Scan::global_reloc_may_be_function_pointer): New function.
11043 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11044 (Scan::global_reloc_may_be_function_pointer): New function.
11045 (Scan::possible_function_pointer_reloc): New function.
11046 (Target_x86_64::can_check_for_function_pointers): New function.
11047 * gc.h (gc_process_relocs): Scan relocation types to determine if
11048 function pointers were taken for targets that support it.
11049 * icf.cc (Icf::find_identical_sections): Include functions for
11050 folding in safe ICF whose pointer is not taken.
11051 * icf.h (Secn_fptr_taken_set): New typedef.
11052 (fptr_section_id_): New member.
11053 (section_has_function_pointers): New function.
11054 (set_section_has_function_pointers): New function.
11055 (check_section_for_function_pointers): New function.
11056 * options.h: Fix comment for safe ICF option.
11057 * target.h (can_check_for_function_pointers): New function.
11058 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11059 Modify icf_safe_test for X86-64.
11060 * testsuite/Makefile.in: Regenerate.
11061 * testsuite/icf_safe_so_test.cc: New file.
11062 * testsuite/icf_safe_so_test.sh: New file.
11063 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11064 (main): Change to take pointer to function kept_func_3.
11065 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11066 folding is done correctly for X86-64.
11067
0da6fa6c
DM
110682010-02-12 David S. Miller <davem@davemloft.net>
11069
11070 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11071 is_symbolless parameter.
11072 (Output_reloc<SHT_REL>::is_symbolless): New.
11073 (Output_reloc<SHT_REL>::is_symbolless_): New.
11074 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11075 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11076 (Output_reloc<SHT_RELA>::is_symbolless): New.
11077 (Output_data_reloc::add_global): Handle is_symbolless.
11078 (Output_data_reloc::add_global_relative): Likewise.
11079 (Output_data_reloc::add_local): Likewise.
11080 (Output_data_reloc::add_local_relative): Likewise.
11081 (Output_data_reloc::add_symbolless_global_addend): New.
11082 (Output_data_reloc::add_symbolless_local_addend): New.
11083 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11084 is_symbolless.
11085 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11086 instead of ->is_relative_
11087 (Output_reloc::write): Likewise.
11088 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11089 (Output_reloc::write_rel): Simplify.
11090
11091 * sparc.cc (Target_sparc::Scan::local): Use
11092 ->add_symbolless_local_addend as needed.
11093 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11094 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11095 based upon relocation offset.
11096
e4782e83
DK
110972010-02-11 Doug Kwan <dougkwan@google.com>
11098
11099 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11100 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11101 beginning of function.
11102 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11103 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11104 parameter is_32bit in calls to should_apply_static_reloc.
11105 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11106 (check_DATA): Add arm_abs_global.stdout.
11107 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11108 arm_abs_global.stdout): New rules.
11109 (MOSTLLYCLEANFILES): Add arm_abs_global
11110 * Makefile.in: Regenerate.
11111 * testsuite/arm_abs_global.s: New file.
11112 * testsuite/arm_abs_global.sh: Ditto.
11113 * testsuite/arm_abs_lib.s: Ditto.
11114
93ceb764
ILT
111152010-02-11 Ian Lance Taylor <iant@google.com>
11116
11117 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11118 Read_relocs task.
11119 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11120 Allocate_commons_task first.
11121 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11122 task, rather than symtab_lock_.
11123 (Gc_process_relocs::~Gc_process_relocs): New function.
11124 (Gc_process_relocs::is_runnable): Check this_blocker_.
11125 (Gc_process_relocs::locks): Use next_blocker_ rather than
11126 blocker_.
11127 (Scan_relocs::~Scan_relocs): New function.
11128 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11129 symtab_lock_.
11130 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11131 next_blocker_.
11132 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11133 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11134 constructor accordingly.
11135 (class Gc_process_relocs): Likewise.
11136 (class Scan_relocs): Likewise.
11137 * common.h (class Allocate_commons_task): Remove symtab_lock_
11138 field, and corresponding constructor parameter.
11139 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11140 symtab_lock_.
11141 (Allocate_commons_task::locks): Likewise.
11142
114dfbe1
ILT
111432010-02-11 Ian Lance Taylor <iant@google.com>
11144
11145 * gold-threads.h (class Once): Define.
11146 (class Initialize_lock): Rewrite as child of Once.
11147 * gold-threads.cc (class Once_initialize): Define.
11148 (once_pointer_control): New static variable.
11149 (once_pointer, once_arg): New static variables.
11150 (c_run_once): New static function.
11151 (Once::Once, Once::run_once, Once::internal_run): New functions.
11152 (class Initialize_lock_once): Remove.
11153 (initialize_lock_control): Remove.
11154 (initialize_lock_pointer): Remove.
11155 (initialize_lock_once): Remove.
11156 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11157 (Initialize_lock::initialize): Rewrite.
11158 (Initialize_lock::do_run_once): New function.
11159 * archive.cc (Archive::interpret_header): Only clear name if it is
11160 not already empty.
11161 * fileread.cc: Include "gold-threads.h"
11162 (file_counts_lock): New static variable.
11163 (file_counts_initialize_lock): Likewise.
11164 (File_read::release): Only increment counts when using --stats.
11165 Use a lock around the increment.
11166 * parameters.cc (class Set_parameters_target_once): Define.
11167 (set_parameters_target_once): New static variable.
11168 (Parameters::Parameters): Move here from parameters.h.
11169 (Parameters::set_target): Rewrite.
11170 (Parameters::set_target_once): New function.
11171 (Parameters::clear_target): Move here and rewrite.
11172 * parameters.h (class Parameters): Update declarations. Add
11173 set_parameters_target_once_ field.
11174 (Parameters::Parameters): Move to parameters.cc.
11175 (Parameters::clear_target): Likewise.
11176 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11177 task.
11178 (Start_group::~Start_group): New function.
11179 (Start_group::is_runnable): New function.
11180 (Start_group::locks, Start_group::run): New functions.
11181 (Finish_group::run): Change saw_undefined to size_t.
11182 * readsyms.h (class Start_group): Define.
11183 (class Finish_group): Change saw_undefined_ field to size_t.
11184 (Finish_group::Finish_group): Remove saw_undefined and
11185 this_blocker parameters. Change all callers.
11186 (Finish_group::set_saw_undefined): New function.
11187 (Finish_group::set_blocker): New function.
11188 * symtab.h (class Symbol_table): Change saw_undefined to return
11189 size_t. Change saw_undefined_ field to size_t.
11190 * target-select.cc (Set_target_once::do_run_once): New function.
11191 (Target_selector::Target_selector): Initialize set_target_once_
11192 field. Don't initialize lock_ and initialize_lock_ fields.
11193 (Target_selector::instantiate_target): Rewrite.
11194 (Target_selector::set_target): New function.
11195 * target-select.h (class Set_target_once): Define.
11196 (class Target_selector): Update declarations. Make
11197 Set_target_once a friend. Remove lock_ and initialize_lock_
11198 fields. Add set_target_once_ field.
11199
fa17a3f4
ILT
112002010-02-10 Ian Lance Taylor <iant@google.com>
11201
11202 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11203 queueing any tasks.
11204 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11205 (queue_middle_tasks): Add all blockers before queueing any tasks.
11206 (queue_final_tasks): Likewise.
11207 * token.h (Task_token::add_blockers): New function.
11208 * object.h (Input_objects::number_of_relobjs): New function.
11209
c7177d31
ILT
112102010-02-10 Ian Lance Taylor <iant@google.com>
11211
5de0e392
ILT
11212 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11213 shared, not if not position independent.
11214 * x86_64.cc (Relocate::relocate_tls): Likewise.
11215 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11216 (tls_pie_pic_test): New target.
11217 * testsuite/Makefile.in: Rebuild.
11218
c7177d31
ILT
11219 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11220 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11221 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11222 * testsuite/Makefile.in: Rebuild.
11223
684b268a
DM
112242010-02-09 David S. Miller <davem@davemloft.net>
11225
11226 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11227 R_SPARC_RELATIVE using ->add_local_relative().
11228 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11229
612a8d3d
DM
11230 * output.h (Output_data_dynamic::add_section_size): New method
11231 that takes two Output_data objects.
11232 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11233 entry param. Handle it in initializers.
11234 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11235 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11236 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11237 arg.
11238 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11239 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11240 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11241 for dynrel_includes_plt.
11242 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11243 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11244 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11245 before .rela.plt
11246 (Target_sparc::do_finalize_sections): Update to pass true for
11247 dynrel_includes_plt.
11248 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11249 output before .rela.plt
11250 (Target_powerpc::do_finalize_sections): Update to pass true for
11251 dynrel_includes_plt when 32-bit.
11252
cb1be87e
DK
112532010-02-08 Doug Kwan <dougkwan@google.com>
11254
11255 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11256 method.
11257 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11258 Arm_relobj::scan_section_for_cortex_a8_stubs,
11259 Arm_relobj::do_relocation_section): Instead of calling
11260 Output_section::output_address, use faster
11261 Arm_relobj::simple_input_section_output_address.
11262
705b5121
DM
112632010-02-08 David S. Miller <davem@davemloft.net>
11264
11265 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11266 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11267 relocation helper function.
11268
024c4466
DM
11269 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11270 just like R_SPARC_GOT{10,13,22}.
11271 (Target_sparc::Scan::local): Likewise.
11272 (Target_sparc::Relocate:relocate): Likewise.
11273
9109c078
ILT
112742010-02-06 Ian Lance Taylor <iant@google.com>
11275
11276 * configure.ac: Rewrite targetobjs duplicate removal code to use
11277 only shell constructs.
11278 * configure: Rebuild.
11279
cf846138
DK
112802010-02-05 Doug Kwan <dougkwan@google.com>
11281
11282 PR 11247
11283 * arm.cc (Arm_relobj::section_is_scannable): New method.
11284 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11285 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11286
6cfaf60b
DK
112872010-02-04 Doug Kwan <dougkwan@google.com>
11288
11289 PR 11247
11290 * arm-reloc-property.cc (cstdio): Include.
11291 * configure.ac (targetobjs): Remove duplicates.
11292 * configure: Regenerate.
11293 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11294 big and little endian version for a given address size.
11295
5c57f1be
DK
112962010-02-03 Doug Kwan <dougkwan@google.com>
11297
11298 * arm-reloc-property.cc
11299 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11300 definition.
11301 * arm-reloc-property.h
11302 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11303 New method definition.
11304 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11305 declaration.
11306 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11307 overflow to N.
11308 (GOT_PREL): Change implemented to Y.
11309 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11310 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11311 (Arm_relocate_functions::movw_abs_nc): Remove method.
11312 (Arm_relocate_functions::movt_abs): Ditto.
11313 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11314 (Arm_relocate_functions::thm_movt_abs): Ditto.
11315 (Arm_relocate_functions::movw_rel_nc): Ditto.
11316 (Arm_relocate_functions::movw_rel): Ditto.
11317 (Arm_relocate_functions::movt_rel): Ditto.
11318 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11319 (Arm_relocate_functions:thm_movw_rel): Ditto.
11320 (Arm_relocate_functions:thm_movt_rel): Ditto.
11321 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11322 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11323 New method definitions.
11324 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11325 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11326 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11327 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11328 (Target_arm::Relocate::relocate): Check for non-static or
11329 unimplemented relocation code and exit early. Change calls to
11330 Target_arm::reloc_uses_thumb_bit and
11331 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11332 instead. Refactor code to handle similar relocations to increase
11333 code sharing. Remove check for unsupported relocation code in switch
11334 statement.
11335 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11336 relocation property table to find out size. Change error message to
11337 print out the name of a relocation code instead of the numeric value.
11338 (Target_arm::scan_reloc_for_stub): Use relocation property table
11339 instead of calling Target_arm::reloc_uses_thumb_bit().
11340
218c5831
DK
113412010-02-02 Doug Kwan <dougkwan@google.com>
11342
11343 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11344 types of relaxed input section.
11345
0d31c79d
DK
113462010-02-02 Doug Kwan <dougkwan@google.com>
11347
11348 * Makefile.am (HFILES): Add arm-reloc-property.h.
11349 (DEFFILES): New.
2e702c99
RM
11350 (TARGETSOURCES): Add arm-reloc-property.cc
11351 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11352 (libgold_a_SOURCES): $(DEFFILES)
11353 * Makefile.in: Regenerate.
11354 * arm-reloc-property.cc: New file.
11355 * arm-reloc-property.h: New file.
11356 * arm-reloc.def: New file.
11357 * arm.cc: Update comments.
11358 (arm-reloc-property.h): New included header.
11359 (arm_reloc_property_table): New global variable.
11360 (Target_arm::do_select_as_default_target): New method definition.
11361 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11362 arm-reloc-property to targ_extra_obj.
11363 * parameters.cc (set_parameters_target): Call
11364 Target::select_as_default_target().
11365 * target.h (Target::select_as_default_target): New method definition.
11366 (Target::do_select_as_default_target): Same.
11367
546c7457
DK
113682010-02-01 Doug Kwan <dougkwan@google.com>
11369
11370 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11371 first_output_text_section_.
11372 (Arm_exidx_fixup::first_output_text_section): New method definition.
11373 (Arm_exidx_fixup::first_output_text_section_): New data member.
11374 (Arm_exidx_fixup::process_exidx_section): Record the first text
11375 output section seen.
11376 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11377 and entsize in output section header.
11378
11b861d5
DK
113792010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11380
11381 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11382 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11383 (Arm_relocate_functions::thm_alu11): New Method.
11384 (Arm_relocate_functions::thm_pc8): New Method.
11385 (Arm_relocate_functions::thm_pc12): New Method.
11386 (Target_arm::Scan::local): Handle the relocations.
11387 (Target_arm::Scan::global): Likewise.
11388 (Target_arm::Relocate::relocate): Likewise.
11389 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11390
c9a2c125
DK
113912010-01-29 Doug Kwan <dougkwan@google.com>
11392
11393 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11394 of relocation types as ld.
11395
1521477a
DK
113962010-01-29 Doug Kwan <dougkwan@google.com>
11397
11398 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11399 to public.
11400 (Arm_relocate_functions::thumb_branch_common): Ditto.
11401 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11402 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11403 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11404 Arm_relocate_functions::jump24): Remove.
11405 (Target_arm::Relocate::relocate): Adjust code to call
11406 Arm_relocation_functions::arm_branch_common and
11407 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11408 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11409
e7eca48c
DK
114102010-01-29 Doug Kwan <dougkwan@google.com>
11411
11412 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11413 output_local_symbol_count_needs_update_.
11414 (Arm_relobj::output_local_symbol_count_needs_update,
11415 Arm_relobj::set_output_local_symbol_count_needs_update,
11416 Arm_relobj::update_output_local_symbol_count): New methods.
11417 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11418 member.
11419 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11420 of pointed function as in a R_ARM_PREL31 relocation.
11421 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11422 for output local symbol count updating.
11423 (Target_arm::do_relax): Update output local symbol counts in objects
11424 if necessary.
11425 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11426
02961d7e
ILT
114272010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11428
11429 * arm.cc: Added support for the ARM relocations:
11430 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11431 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11432 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11433 movw_prel_nc).
11434 (Arm_relocate_functions::movw_rel): New method.
11435 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11436 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11437 thm_movw_prel_nc).
11438 (Arm_relocate_functions::thm_movw_rel): New method.
11439 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11440 thm_movt_prel).
11441 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11442 relocations.
11443 (Target_arm::Scan::global): Likewise.
11444 (Target_arm::Relocate::relocate): Likewise.
11445 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11446 Likewise.
11447
b10d2873
ILT
114482010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11449
11450 * arm.cc: Added support for ARM group relocations.
11451 (Target_arm::reloc_needs_sym_origin): New method.
11452 (Arm_relocate_functions::calc_grp_kn): New method.
11453 (Arm_relocate_functions::calc_grp_residual): New method.
11454 (Arm_relocate_functions::calc_grp_gn): New method.
11455 (Arm_relocate_functions::arm_grp_alu): New Method.
11456 (Arm_relocate_functions::arm_grp_ldr): New Method.
11457 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11458 (Arm_relocate_functions::arm_grp_ldc): New Method.
11459 (Target_arm::Scan::local): Handle the ARM group relocations.
11460 (Target_arm::Scan::global): Likewise.
11461 (Target_arm::Relocate::relocate): Likewise.
11462 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11463 Likewise.
11464
2b328d4e
DK
114652010-01-26 Doug Kwan <dougkwan@google.com>
11466
11467 * arm.cc (set): Include.
11468 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11469 pointer type.
2e702c99 11470 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11471 (Arm_output_section::append_text_sections_to_list): New method.
11472 (Arm_output_section::fix_exidx_coverage): Ditto.
11473 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11474 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11475 Relobj::set_section_offset() instead of
11476 Sized_relobj::invalidate_section_offset().
2e702c99 11477 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11478 parameter for section headers. Ignore relocation sections for
11479 unallocated sections and EXIDX sections.
11480 (Target_arm::fix_exidx_coverage): New method.
11481 (Target_arm::output_section_address_less_than): New type.
11482 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11483 linked text section instead of the EXIDX section.
11484 (Arm_output_section::create_stub_group): Add an assertion to check
11485 that this is not an EXIDX output section.
11486 (Arm_output_section::append_text_sections_to_list): New method.
11487 (Arm_output_section::fix_exidx_coverage): Ditto.
11488 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11489 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11490 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11491 first pass.
11492 (Target_arm::fix_exidx_coverage): New method.
11493 * object.h (Relobj::set_output_section): New method.
11494 (Sized_relobj::invalidate_section_offset): Remove method.
11495 (Sized_relobj::do_invalidate_section_offset): Remove method.
11496 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11497
c7f3c371
DK
114982010-01-25 Doug Kwan <dougkwan@google.com>
11499
11500 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11501 Fix warning due to signed and unsigned comparison on a 32-bit host.
11502
8923b24c
DK
115032010-01-22 Doug Kwan <dougkwan@google.com>
11504
11505 * arm.cc (Target_arm::do_relax): Record an output section for section
11506 offset adjustment it contains any stub table that has changed.
11507 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11508 offsets in an output section if necessary.
11509 * output.cc (Output_section::Output_section): Initialize
11510 section_offsets_need_adjustments_.
11511 (Output_section::add_input_section_for_script): Renamed to
11512 Output_section::add_simple_input_section.
11513 (Output_section::save_states): Add a comment.
11514 (Output_section::discard_states): New method defintion.
11515 (Output_section::adjust_section_offsets): Same.
11516 * output.h (Output_section::add_input_section_for_script): Renamed to
11517 Output_section::add_simple_input_section.
11518 (Output_section::discard_states): New method declaration.
11519 (Output_section::adjust_section_offsets): Same.
11520 (Output_section::section_offsets_need_adjustment,
11521 Output_section::set_section_offsets_need_adjustment): New method
11522 definitions.
11523 (Output_section::section_offsets_need_adjustment_): New data member.
11524 * script-sections.cc
11525 (Output_section_element_input::set_section_address): Adjust code for
11526 renaming of Output_section::add_input_section_for_script.
11527 (Orphan_output_section::set_section_address): Same.
11528
9b2fd367
DK
115292010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11530
11531 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11532 Fix_v4bx enum values .
11533 * gold/options.h (General_options): New option definitions.
11534 (General_options::fix_v4bx): New method.
11535 (General_options::Fix_v4bx): New enum.
11536 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11537 (General_options::parse_fix_v4bx_interworking): New method.
11538
80d0d023
DK
115392010-01-22 Doug Kwan <dougkwan@google.com>
11540
11541 * arm.cc (Arm_exidx_fixup): New class.
11542
af2cdeae
DK
115432010-01-21 Doug Kwan <dougkwan@google.com>
11544
11545 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11546 classes.
11547 (Arm_exidx_section_offset_map): New type.
11548
993d07c1
DK
115492010-01-21 Doug Kwan <dougkwan@google.com>
11550
11551 * arm.cc (Arm_exidx_input_section): New class.
11552 (Arm_relobj::exidx_input_section_by_link,
11553 Arm_relobj::exidx_input_section_by_shndx,
11554 Arm_relobj::make_exidx_input_section): New methods.
11555 (read_arm_attributes_section): Remove.
11556 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11557 information about them.
11558 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11559 to here.
11560
5ac169d4
DK
115612010-01-20 Doug Kwan <dougkwan@google.com>
11562
11563 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11564 Input_section_specifier to Section_id.
11565 (Target_arm::new_arm_input_section: Adjust code for change of key
11566 type.
11567 (Target_arm::find_arm_input_section): Ditto.
11568 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11569 (Section_id): Remove.
11570 (Garbage_collection::Section_id_hash): Remove.
11571 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11572 (Section_id): Remove.
11573 (Icf::Section_id_hash): Remove.
11574 * object.h (Section_id, Const_section_id, Section_id_hash,
11575 Const_section_id_hash): New type definitions.
11576 * output.cc (Output_section::add_relaxed_input_section): Change to
11577 use Const_section_id instead of Input_section_specifier as key type.
11578 (Output_section::add_merge_input_section): Ditto.
11579 (Output_section::build_relaxation_map): Change to use Section_id
11580 instead of Input_section_specifier as key type.
2e702c99 11581 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11582 Ditto.
11583 (Output_section::convert_input_sections_to_relaxed_sections): Change
11584 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11585 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11586 (Output_section::find_relaxed_input_section): Ditto.
11587 * output.h (Input_section_specifier): Remove class.
11588 (Output_section::Output_section_data_by_input_section_map): Change
11589 key type to Const_section_id.
11590 (Output_section::Output_relaxed_input_section_by_input_section_map):
11591 Ditto.
11592 (Output_section::Relaxation_map): Change key type to Section_id.
11593
a2162063
ILT
115942010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11595
11596 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11597 (class Arm_v4bx_stub): New class.
11598 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11599 (Stub_factory::make_arm_v4bx_stub): New method.
11600 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11601 (Stub_table::empty): Handle v4bx stubs.
11602 (Stub_table::add_arm_v4bx_stub): New method.
11603 (Stub_table::find_arm_v4bx_stub): New method.
11604 (Arm_relocate_functions::v4bx): New method.
11605 (Target_arm::fix_v4bx): New method.
11606 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11607 (Stub_table::relocate_stubs): Likewise.
11608 (Stub_table::do_write): Likewise.
11609 (Stub_table::update_data_size_and_addralign): Likewise.
11610 (Stub_table::finalize_stubs): Likewise.
11611 (Target_arm::Scan::local): Likewise.
11612 (Target_arm::Scan::global): Likewise.
11613 (Target_arm::do_finalize_sections): Likewise.
11614 (Target_arm::Relocate::relocate): Likewise.
11615 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11616 Likewise.
11617 (Target_arm::scan_reloc_for_stub): Likewise.
11618 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11619
5696ab0b
ILT
116202010-01-19 Ian Lance Taylor <iant@google.com>
11621
11622 * output.cc (Output_section_headers::do_sized_write): Write large
11623 segment count to sh_info field.
11624 (Output_file_header::do_sized_write): For large segment count,
11625 write PN_XNUM to e_phnum field.
11626
800d0f56
ILT
116272010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11628
11629 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11630 (Arm_relocate_functions::thm_jump8): New function.
11631 (Arm_relocate_functions::thm_jump11): New function.
11632 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11633 R_ARM_THM_JUMP11.
11634 (Target_arm::Scan::global): Likewise.
11635 (Target_arm::Relocate::relocate): Likewise.
11636 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11637 Likewise.
11638
41263c05
DK
116392010-01-14 Doug Kwan <dougkwan@google.com>
11640
11641 * arm.cc (map, utility): Include headers.
11642 (Target_arm::apply_cortex_a8_workaround): New method.
11643 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11644 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11645 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11646 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11647 the --[no-]fix-cortex-a8 command line options.
11648 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11649 (Target_arm::relocate_stub): Use addend in instruction template.
11650 * options.h (DEFINE_bool): Set the user-set flag.
11651 (General_options): Add --[no-]-fix-cortex options.
11652 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11653 : Update fast look-up map after conversion.
41263c05 11654
459e9b03
ST
116552010-01-14 Sriraman Tallam <tmsriram@google.com>
11656
11657 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11658 in the first pass of do_layout.
11659
b521dfe4
DK
116602010-01-13 Doug Kwan <dougkwan@google.com>
11661
11662 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11663 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11664 apparent compiler problem of not folding static constant integral
11665 data members of elfcpp::Elf_sizes<32>.
11666
44272192
DK
116672010-01-13 Doug Kwan <dougkwan@google.com>
11668
11669 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11670 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11671 Arm_relobj::scan_section_for_cortex_a8_erratum,
11672 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11673 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11674 sections to scan for relocation stubs into a new method
11675 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11676 relocation and Cortex-A8 stub scanning.
11677 (Target_arm::do_relax): Force stubs to be after stubbed sections
11678 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11679 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11680 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11681
44b71ece
ILT
116822010-01-12 Ian Lance Taylor <iant@google.com>
11683
11684 * target-reloc.h (visibility_error): New inline function.
11685 (relocate_section): Call visibility_error.
11686 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11687 (MOSTLYCLEANFILES): Likewise.
11688 (protected_4_pic.o, protected_3.err): New targets.
11689 * testsuite/protected_4.cc: New file.
11690
a120bc7f
DK
116912010-01-12 Doug Kwan <dougkwan@google.com>
11692
11693 * arm.cc (Cortex_a8_reloc): New class.
11694 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11695 and cortex_a8_relocs_info_.
11696 (Target_arm::fix_cortex_a8): New method definition.
11697 (Target_arm::Cortex_a8_relocs_info): New type.
11698 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11699 New data member declarations.
11700 (Target_arm::scan_reloc_for_stub): Record information about
11701 relocations for THUMB branches that might be exempted from the
11702 Cortex-A8 workaround.
11703 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11704 at the beginning of a relaxation pass.
11705
20138696
DK
117062010-01-12 Doug Kwan <dougkwan@google.com>
11707
11708 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11709 (Arm_relobj::Mapping_symbol_position,
11710 Arm_reloj::Mapping_symbol_position_less,
11711 Arm_relobj::Mapping_symbols_info): New types.
11712 (Target_arm::is_mapping_symbol_name): New method definition.
11713 (Arm_relobj::do_count_local_symbols): Save information about mapping
11714 symbols.
11715
089d69dc
DK
117162010-01-11 Doug Kwan <dougkwan@google.com>
11717
11718 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11719 Arm_relocate_functions::thumb32_branch_upper,
11720 Arm_relocate_functions::thumb32_branch_lower,
11721 Arm_relocate_functions::thumb32_cond_branch_offset,
11722 Arm_relocate_functions::thumb32_cond_branch_upper,
11723 Arm_relocate_functions::thumb32_cond_branch_lower,
11724 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11725 branch offset encoding.
11726 (Arm_relocate_functions::thumb_branch_common): Use new branch
11727 offset encoding methods to avoid code duplication.
11728 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11729 (Stub_addend_reader::operator()): Use new branch encoding method
11730 to avoid code duplication.
11731
99e5bff2
DK
117322010-01-11 Doug Kwan <dougkwan@google.com>
11733
11734 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11735 (Target_arm::do_finalize_sections): Define special EXIDX section
11736 symbols only if referenced.
11737 * gc.h (Garbage_collection::add_reference): New method.
11738 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11739 code duplication.
11740
98e090bd
ILT
117412010-01-11 Ian Lance Taylor <iant@google.com>
11742
d0a91bd8
ILT
11743 * script.cc (Version_script_info::build_expression_list_lookup):
11744 Change complaing about duplicate wildcard match from error to
11745 warning.
11746
98e090bd
ILT
11747 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11748 of 2009-12-30.
11749 (Version_script_info::Version_script_info): Initialize globs_,
11750 default_version_, default_is_global_, and exact_. Don't
11751 initialize globals_ or locals_.
11752 (Version_script_info::build_lookup_tables): Build local symbols
11753 first.
11754 (Version_script_info::unquote): New function.
11755 (Version_script_info::add_exact_match): New function.
11756 (Version_script_info::build_expression_list_lookup): Remove lookup
11757 parameter. Add is_global parameter. Change all callers. Handle
11758 wildcard pattern specially. Unquote pattern. Call
11759 add_exact_match.
11760 (Version_script_info::get_name_to_match): New function.
11761 (Version_script_info::get_symbol_version): New function.
11762 (Version_script_info::get_symbol_version_helper): Remove.
11763 (Version_script_info::check_unmatched_names): Call unquote.
11764 * script.h (class Version_script_info): Change get_symbol_version
11765 to be non-inline and add is_global parameter; change all callers.
11766 Rewrite symbol_is_local. Update declarations. Define struct
11767 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11768 Remove globals_ and locals_ members. Add exact_, globs_,
11769 default_version_, is_global_.
11770 (Version_script_info::Glob): Remove pattern, add expression and
11771 is_global. Update constructor. Change all callers.
11772 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11773 default version.
11774 (Versions::symbol_section_contents): If a symbol is undefined, or
11775 defined in a dynamic object, set the version index to
11776 VER_NDX_LOCAL.
11777 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11778 symbol_is_local.
11779 (Symbol_table::add_from_pluginobj): Likewise.
11780 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11781
d56962d3
DK
117822010-01-11 Doug Kwan <dougkwan@google.com>
11783
11784 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11785 (incremental_dump_LDADD): Add linking option for libintl.
11786 * Makefile.in: Regenerate.
11787
94e6ee91
L
117882010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11789
11790 PR gold/11144
11791 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11792 instead of -Ds.
11793 * testsuite/Makefile.in: Regenerated.
11794
e96c574b
DK
117952010-01-10 Doug Kwan <dougkwan@google.com>
11796
11797 * options.h (DEFINE_var): Use parentheses around argument varname__
11798 in macro body to avoid any unintended subsequent substitutions.
11799
7198066b
ILT
118002010-01-10 Ian Lance Taylor <iant@google.com>
11801
ba4d53bf
ILT
11802 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11803 candidates before doing symbol resolution.
11804
7198066b
ILT
11805 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11806 ODR candidates if only one is weak.
11807
a2beed37
ILT
118082010-01-08 Ian Lance Taylor <iant@google.com>
11809
11810 * script.cc (Version_script_info::build_expression_list_lookup):
11811 Don't warn about ambiguous version, just record the ambiguity.
11812 (Version_script_info::get_symbol_version_helper): Give error if
11813 version is ambiguous.
11814
2fb7225c
DK
118152010-01-08 Doug Kwan <dougkwan@google.com>
11816
11817 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11818 prev_data_size_ and prev_addralign_. Remove initializer for
11819 deleted data member has_been_changed_.
11820 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11821 to determine if the table is empty.
11822 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11823 Remove.
11824 (Stub_table::add_reloc_stub): Define method in class definition
11825 instead of just declaring it there.
11826 (Stub_table::add_cortex_a8_stub): New method definition.
11827 (Stub_table::update_data_size_and_addralign): Ditto.
11828 (Stub_table::finalize_stubs): Ditto.
11829 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11830 (Stub_table::do_addralign_): Return address alignment in the
11831 (Stub_table::do_reset_address_and_file_offset): Define method in
11832 class definition instead of declaring it there. Set current data
11833 size to be the data size of the previous pass.
11834 (Stub_table::set_final_data_size): Use current data size as the
11835 final data size.
11836 (Stub_table::relocate_stub): Change parameter type of stub from
11837 Reloc_stub pointer to Stub pointer.
11838 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11839 (Stub_table::Cortex_a8_stub_list): New typedef.
11840 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11841 Stub_table::prev_addralign_): New data member.
11842 (Arm_relobj::Arm_relobj): Initialize data member
11843 section_has_cortex_a8_workaround_.
11844 (Arm_relobj::section_has_cortex_a8_workaround,
11845 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11846 definitions.
11847 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11848 declarations.
11849 (Target_arm::relocate_stub): Change parameter type of stub from
11850 Reloc_stub pointer to Stub pointer.
11851 (Insn_template::size, Insn_template::alignment): Handle
11852 THUMB16_SPECIAL_TYPE.
11853 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11854 Stub_table::update_data_size_and_addralign,
11855 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11856 definitions.
11857 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11858 (Stub_table::do_write): Ditto.
11859 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11860
880cd20d
ILT
118612010-01-08 Ian Lance Taylor <iant@google.com>
11862
11863 PR 11108
11864 * symtab.h (class Symbol): Remove fields is_target_special_ and
11865 has_plt_offset_. Add field is_defined_in_discarded_section_.
11866 (Symbol::is_defined_in_discarded_section): New function.
11867 (Symbol::set_is_defined_in_discarded_section): New function.
11868 (Symbol::has_plt_offset): Rewrite.
11869 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11870 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11871 Don't initialize is_target_special_ or has_plt_offset_.
11872 Initialize is_defined_in_discarded_section_.
11873 (Symbol_table::add_from_relobj): If appropriate, set
11874 is_defined_in_discarded_section.
11875 * resolve.cc (Symbol::override_base_with_special): Don't test
11876 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11877 * target-reloc.h (relocate_section): Do special handling for
11878 symbols defined in discarded sections for global symbols as well
11879 as local symbols.
11880
2703e3eb
ILT
118812010-01-08 Ian Lance Taylor <iant@google.com>
11882
11883 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11884 the SHT_SYMTAB case.
11885
339d40a3
ILT
118862010-01-08 Ian Lance Taylor <iant@google.com>
11887
11888 * object.cc (Sized_relobj::do_layout): Don't get confused if
11889 layout_eh_frame returns NULL.
11890
abecea76
ILT
118912010-01-08 Ian Lance Taylor <iant@google.com>
11892
11893 PR 11084
11894 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11895 dynamic symbol table, use the normal symbol table.
11896 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11897 symbol table.
11898
6b7dd3f3
ILT
118992010-01-08 Ian Lance Taylor <iant@google.com>
11900
11901 PR 11072
11902 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11903 sections.
11904
36c50e63
L
119052010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11906
11907 * version.cc (print_version): Change to "Copyright 2010".
11908
e291e7b9
ILT
119092010-01-08 Ian Lance Taylor <iant@google.com>
11910
11911 PR 10287
11912 PR 11063
11913 * i386.cc (class Target_i386): Change return type of plt_section
11914 to be non-const.
11915 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11916 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11917 tls_desc_rel_ field.
11918 (Output_data_plt_i386::rel_tls_desc): New function.
11919 (Target_i386::rel_tls_desc_section): New function.
11920 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11921 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11922 R_386_TLS_DESC reloc in rel_tls_desc_section.
11923 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11924 Define struct Tlsdesc_info.
11925 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11926 (Target_x86_64::do_reloc_symbol_index): New function.
11927 (Target_x86_64::add_tlsdesc_info): New function.
11928 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11929 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11930 tlsdesc_rel_ field.
11931 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11932 all callers.
11933 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11934 (Target_x86_64::rela_tlsdesc_section): New function.
11935 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11936 handling.
11937 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11938 (Target_x86_64::do_reloc_addend): New function.
11939 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11940 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11941 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11942 (Output_reloc::type): New function.
11943 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11944 (Output_reloc::is_target_specific): New function.
11945 (Output_reloc::target_arg): New function.
11946 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11947 absolute relocs and target specific relocs.
11948 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11949 add_target_specific.
11950 (class Output_data_reloc) [SHT_RELA]: Likewise.
11951 * output.cc (Output_reloc::Output_reloc): Add four new versions
11952 for absolute relocs and target specific relocs.
11953 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11954 (Output_reloc::get_symbol_index): Likewise.
11955 (Output_reloc::local_section_offset): Check that local_sym_index_
11956 is not TARGET_CODE or 0.
11957 (Output_reloc::symbol_value): Likewise.
11958 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11959 reloc.
11960 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11961 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11962 functions.
11963 * layout.cc (add_target_dynamic_tags): Use output section for
11964 DT_PLTRELSZ and DT_JMPREL.
11965
3a44184e
ILT
119662010-01-07 Ian Lance Taylor <iant@google.com>
11967
11968 PR 11061
11969 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11970 function.
11971 (class Output_data_reloc_generic): Define.
11972 (class Output_data_reloc_base): Change base class to
11973 Output_data_reloc_generic. Change add() method to call
11974 bump_relative_reloc_count for a relative reloc. Remove
11975 sort_relocs_ field.
11976 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11977 to sort_relocs().
11978 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11979 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11980 appropriate.
11981 * layout.h (class Layout): Update declaration.
11982
ea715a34
ILT
119832010-01-07 Ian Lance Taylor <iant@google.com>
11984
11985 * output.h (class Output_data): Add const version of
11986 output_section and do_output_section.
11987 (class Output_section_data): Add const version of
11988 do_output_section.
11989 (class Output_section): Likewise.
11990 * layout.cc (Layout::add_target_dynamic_tags): New function.
11991 * layout.h (class Layout): Update declarations.
11992 * arm.cc (Target_arm::do_finalize_sections): Use
11993 add_target_dynamic_tags.
11994 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11995 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11996 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11997 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11998
659948a4
ILT
119992010-01-07 Ian Lance Taylor <iant@google.com>
12000
12001 PR 11042
12002 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12003 object as needed.
12004
9d3b86f6
ILT
120052010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12006 Ian Lance Taylor <iant@google.com>
12007
12008 PR 11019
12009 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12010 Xindex::read_symtab_xindex.
12011
bb0d3eb0
DK
120122010-01-07 Doug Kwan <dougkwan@google.com>
12013
12014 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12015 (Insn_template::thumb16_bcond_insn): New method declaration.
12016 (Insn_template): Fix spelling.
12017 (Stub::thumb16_special): New method declaration.
12018 (Stub::do_write): Define virtual method which was previously pure
12019 virtual.
12020 (Stub::do_thumb16_special): New method declaration.
12021 (Stub::do_fixed_endian_write): New template member.
12022 (Reloc_stub::do_write): Remove.
12023 (Reloc_stub::do_fixed_endian_write): Remove.
12024 (Cortex_a8_stub): New class definition.
12025 (Stub_factory::make_cortex_a8_stub): New method definition.
12026 (Stub_factory::Stub_factory): Add missing static storage class
12027 qualifier for elf32_arm_stub_a8_veneer_blx.
12028
ffeef7df
ILT
120292010-01-07 Ian Lance Taylor <iant@google.com>
12030
dc3f80fe
ILT
12031 PR 10980
12032 * options.h (class General_options): Add --warn-unresolved-symbols
12033 and --error-unresolved-symbols.
12034 * errors.cc (Errors::undefined_symbol): Implement
12035 --warn-unresolved-symbols.
12036
ffeef7df
ILT
12037 * options.h (class General_options): Add -z text and -z textoff.
12038 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12039
f1ec9ded
ST
120402010-01-06 Sriraman Tallam <tmsriram@google.com>
12041
12042 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12043 (Garbage_collection::cident_sections): New function.
12044 (Garbage_collection::add_cident_section): New function.
12045 (Garbage_collection::cident_sections_): New member.
12046 (gc_process_relocs): Add references to sections whose names are C
12047 identifiers.
12048 * gold.h (cident_section_start_prefix): New constant.
12049 (cident_section_stop_prefix): New constant.
12050 (is_cident): New function.
12051 * layout.cc (Layout::define_section_symbols): Replace string constants
12052 with the newly defined constants.
12053 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12054 C identifiers.
12055 * testsuite/Makefile.am: Add gc_orphan_section_test.
12056 * testsuite/Makefile.in: Regenerate.
12057 * testsuite/gc_orphan_section_test.cc: New file.
12058 * testsuite/gc_orphan_section_test.sh: New file.
12059
6eda8c29
ILT
120602010-01-06 Ian Lance Taylor <iant@google.com>
12061
b9674e17
ILT
12062 PR 10980
12063 * options.h (class General_options): Add --warn-shared-textrel.
12064 * layout.cc (Layout::finish_dynamic_section): Implement
12065 --warn-shared-textrel.
12066
6eda8c29
ILT
12067 PR 10980
12068 * options.h (class General_options): Add --warn-multiple-gp.
12069
32dcd44e
ILT
120702010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12071
12072 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12073 $(THREADSLIB) and $(LIBDL).
12074 * Makefile.in: Rebuild.
12075
a192ba05
ILT
120762010-01-06 Ian Lance Taylor <iant@google.com>
12077
12078 PR 10980
12079 * options.cc (General_options::parse_section_start): New function.
12080 (General_options::section_start): New function.
12081 (General_options::General_options): Initialize all members.
12082 * options.h: Include <map>
12083 (class General_options): Add --section-start. Add section_starts_
12084 member.
12085 * layout.cc (Layout::attach_allocated_section_to_segment): If
12086 --section-start was used, set the address of the segment. Remove
12087 local sort_sections.
12088 (Layout::relaxation_loop_body): If the address of the load segment
12089 has been set by --section-start, don't use it.
12090 * output.h (Output_segment::update_flags_for_output_section): New
12091 function.
12092 * output.cc (Output_segment::add_output_section): Call
12093 update_flags_for_output_section.
12094
dde3f402
ILT
120952010-01-05 Ian Lance Taylor <iant@google.com>
12096
62dfdd4d
ILT
12097 PR 10980
12098 * options.h (class General_options): Add --undefined-version.
12099 * script.cc (struct Version_expression): Add was_matched_by_symbol
12100 field.
12101 (Version_script_info::matched_symbol): New function.
12102 (Version_script_info::get_symbol_version_helper): Call
12103 matched_symbol.
12104 (Version_script_info::check_unmatched_names): New function.
12105 * script.h (class Version_script_info): Update declarations.
12106 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12107
9c4ae156
ILT
12108 * options.h (class General_options): Use DEFINE_bool_alias for
12109 allow_multiple_definition.
12110 * resolve.cc (Symbol_table::should_override): Don't test
12111 allow_multiple_definition.
12112
dde3f402
ILT
12113 PR 10980
12114 * options.h (class General_options): Add --cref.
12115 * main.cc (main): Print cref table if --cref. Don't close mapfile
12116 until after printing cref table.
12117 * cref.cc: Include "symtab.h".
12118 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12119 (Cref_table_compare::operator()): New function.
12120 (Cref_inputs::gather_cref): New function.
12121 (filecol): New static const.
12122 (Cref_inputs::print_cref): New function.
12123 (Cref::print_cref): New function.
12124 * cref.h: Include <cstdio>.
12125 (class Cref): Update declarations.
12126 * mapfile.h (Mapfile::file): New function.
12127 * object.h (class Object): Define Symbols. Declare virtual
12128 do_get_global_symbols.
12129 (Object::get_global_symbols): New function.
12130 * object.cc (Input_objects::add_object): Pass object to cref_ if
12131 --cref.
12132 (Input_objects::archive_start): Likewise.
12133 (Input_objects::archive_stop): Likewise.
12134 (Input_objects::print_cref): New function.
12135 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12136 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12137 --cref.
12138 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12139 function.
12140 * plugin.h (class Sized_pluginobj): Update declarations.
12141
8781f709
ILT
121422010-01-05 Ian Lance Taylor <iant@google.com>
12143
12144 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12145 to is_default_version. Rename insdef to insdefault.
12146 (Symbol_table::add_from_relobj): Rename def to is_default_version
12147 and local to is_forced_local.
12148 (Symbol_table::add_from_pluginobj): Likewise.
12149 (Symbol_table::add_from_dynobj): Likewise.
12150 (Symbol_table::define_special_symbol): Rename insdef to
12151 insdefault.
12152
fe35d28d
ILT
121532010-01-04 Ian Lance Taylor <iant@google.com>
12154
30bc8c46
ILT
12155 PR 10980
12156 * options.h (class General_options): Add
12157 --allow-multiple-definition and -z muldefs.
12158 * resolve.cc (Symbol_table::should_override): Don't warn about a
12159 multiple symbol definition if --allow-multiple-definition or -z
12160 muldefs.
12161
7eaea549
ILT
12162 PR 10980
12163 * options.h (class General_options): Add --add-needed and
12164 --copy-dt-needed-entries. Tweak --as-needed help entry.
12165 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12166 error if --copy-dt-needed-entries aka --add-needed is used and
12167 would cause a change in behaviour.
12168
fe35d28d
ILT
12169 PR 10980
12170 * options.h (class General_options): Add -G as a short version of
12171 --shared. Add no-op options -assert, -g, and -i.
12172
55a2bb35
ST
121732010-01-04 Sriraman Tallam <tmsriram@google.com>
12174
12175 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12176 check for .text or .gnu.linkonce.t sections.
12177 * icf.cc (Icf::find_identical_sections): Ditto.
12178 Change the detection for mangled function name within the section
12179 name.
12180 * icf.h (is_section_foldable_candidate): New function.
12181
719328e1
ILT
121822009-12-30 Ian Lance Taylor <iant@google.com>
12183
12184 PR 10980
12185 * options.h (class General_options): Permit two dashes with
12186 --retain-symbols-file.
12187
d7bb5745
ILT
121882009-12-30 Ian Lance Taylor <iant@google.com>
12189
403a15dd
ILT
12190 PR 10979
12191 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12192 don't put the file header and segment headers in the text
12193 segment.
12194
eda294df
ILT
12195 PR 10979
12196 * common.cc (Sort_commons::operator()): Stabilize sort when both
12197 entries are NULL.
12198 (Symbol_table::do_allocate_commons_list): When allocating common
12199 symbols, skip a symbol which is no longer common.
12200 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12201 an object before checking its type.
12202 * testsuite/common_test_2.c: New file.
12203 * testsuite/common_test_3.c: New file.
12204 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12205 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12206 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12207 (common_test_2_pic.o, common_test_2.so): New targets.
12208 (common_test_3_pic.o, common_test_3.so): New targets.
12209 * testsuite/Makefile.in: Rebuild.
12210
d7bb5745
ILT
12211 PR 10979
12212 * script.cc (read_input_script): If we see a new SECTIONS clause,
12213 and we have added an input section, give an error.
12214 * layout.h (class Layout): Add have_added_input_section function.
12215 Add have_added_input_section_ field.
12216 * layout.cc (Layout::Layout): Initialize
12217 have_added_input_section_.
12218 (Layout::layout): Set have_added_input_section_.
12219 (Layout::layout_eh_frame): Likewise.
12220
fc59c572
ILT
122212009-12-30 Ian Lance Taylor <iant@google.com>
12222
12223 PR 10931
12224 * options.h (class General_options): Add --sort-common option.
12225 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12226 * common.cc (Sort_common): Add sort_order parameter to
12227 constructor. Add sort_order_ field.
12228 (Sort_commons::operator): Check sort_order_.
12229 (Symbol_table::allocate_commons): Determine the sort order.
12230 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12231 Change all callers.
12232 (Symbol_table::do_allocate_commons_list): Likewise.
12233
1c74fab0
ILT
122342009-12-30 Ian Lance Taylor <iant@google.com>
12235
12236 PR 10916
12237 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12238 symbols from this object, don't change the visibility of an
12239 undefined symbol.
12240 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12241
6affe781
ILT
122422009-12-30 Ian Lance Taylor <iant@google.com>
12243
12244 PR 10861
12245 * script.h (class Version_script_info): Define Language enum.
12246 Update declarations. Define Glob, Exact, and Lookup types. Add
12247 new fields globals_, locals_, and is_finalized_.
12248 * script.cc: Various formatting fixes.
12249 (class Parser_closure): Change language_stack_ from a vector of
12250 std::string to one of Version_script_info::Language. Adjust all
12251 uses accordingly.
12252 (class Lazy_demangler): Remove.
12253 (struct Version_expression): Change language from std::string to
12254 Version_script_info::Language.
12255 (Version_script_info::Version_script_info): New function.
12256 (Version_script_info::~Version_script_info): Don't call clear.
12257 (Version_script_info::finalize): New function.
12258 (Version_script_info::build_lookup_tables): New function.
12259 (Version_script_info::build_expression_list_lookup): New
12260 function.
12261 (Version_script_info::get_symbol_version_helper): Rewrite to use
12262 lookup tables.
12263 (Version_script_info::print_expression_list): Adjust to use
12264 Version_script_info::Language.
12265 (script_push_lex_into_version_mode): Check that the version script
12266 has not been finalized.
12267 (version_script_push_lang): Change language string to
12268 Version_script_info::Language.
12269 * options.cc (Command_line::version_script): New function.
12270 * options.h (class General_options): Add finalize_dynamic_list
12271 function. Change version_script from declaration to definition.
12272 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12273 * testsuite/version_script.map: Remove duplicate def of foo.
12274 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12275 version_script.map.
12276 * testsuite/Makefile.in: Rebuild.
12277
818bf354
ILT
122782009-12-30 Ian Lance Taylor <iant@google.com>
12279
12280 PR 10843
12281 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12282 if the input symbol index is 0, make the output symbol index 0.
12283
ebcc8304
ILT
122842009-12-30 Ian Lance Taylor <iant@google.com>
12285
12286 PR 10670
12287 * options.h (class General_options): Add -x/--discard-all.
12288 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12289 --discard-all. If the local symbol needs a dynamic entry, check
12290 that before handling --discard-locals.
12291
176fe33f
ILT
122922009-12-30 Ian Lance Taylor <iant@google.com>
12293
bb321bb1
ILT
12294 PR 10450
12295 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12296 flags to PF_R.
12297 (Output_segment::add_output_section): Don't change the flags if
12298 the type is PT_TLS.
12299
176fe33f
ILT
12300 PR 10450
12301 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12302 GNU hash table if they need a dynamic value. Otherwise, don't add
12303 them if they are defined in a dynamic object or are forced local.
12304
e8cd95c7
ILT
123052009-12-29 Ian Lance Taylor <iant@google.com>
12306
1b81fb71
ILT
12307 PR 10450
12308 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12309 .gnu.hash table for a 32-bit target.
12310
8d6d383d
ILT
12311 PR 10450
12312 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12313 regular and a dynamic object only needs a dynamic symbol table
12314 entry if it is externally visible.
12315
e785ec03
ILT
12316 PR 10450
12317 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12318 constructor. Add global_offset_table_ field.
12319 (Target_i386::got_section): Set global_offset_table_.
12320 (Target_i386::do_finalize_sections): Set global_offset_table_
12321 size.
12322 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12323 in constructor. Add global_offset_table_ field.
12324 (Target_x86_64::got_section): Set global_offset_table_.
12325 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12326 size.
12327
1a2dff53
ILT
12328 * layout.cc (Layout::Layout): Initialize increase_relro_.
12329 (Layout::get_output_section): Add is_relro, is_last_relro, and
12330 is_first_non_relro parameters. Change all callers.
12331 (Layout::choose_output_section): Likewise.
12332 (Layout::add_output_section_data): Likewise.
12333 (Layout::make_output_section): Likewise.
12334 (Layout::set_segment_offsets): Clear increase_relro when using a
12335 linker script.
12336 * layout.h (class Layout): Add increase_relro method. Add
12337 increase_relro_ field. Update declarations.
12338 * output.cc (Output_section::Output_section): Initialize
12339 is_last_relro_ and is_first_non_relro_.
12340 (Output_segment::add_output_section): Group relro sections is
12341 do_sort is true. Handle is_last_relro and is_first_non_relro.
12342 (Output_segment::maximum_alignment): Remove relro handling.
12343 (Output_segment::set_section_addresses): Add increase_relro
12344 parameter. Change all callers. Add initial alignment to align
12345 relro sections on separate page. Remove old relro handling.
12346 (Output_segment::set_section_list_addresses): Remove in_relro
12347 parameter. Change all callers.
12348 (Output_segment::set_offset): Add increase parameter. Change all
12349 callers. Remove old relro handling.
12350 * output.h (class Output_section): Add new methods: is_last_relro,
12351 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12352 Add is_last_relro_ and is_first_non_relro_ fields.
12353 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12354 Create separate .got.plt section. Call increase_relro.
12355 * x86_64.cc (Target_x86_64::got_section): Likewise.
12356 * testsuite/relro_script_test.t: Add .got.plt.
12357
f0ba79e2
ILT
12358 PR 10450
12359 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12360 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12361 (Layout::finalize): Call set_dynamic_symbol_size.
12362 (Layout::set_dynamic_symbol_size): New function.
12363 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12364 set_dynamic_symbol_size.
12365
e8cd95c7
ILT
12366 PR 10450
12367 * output.h (class Output_section): Add is_entsize_zero_ field.
12368 * output.cc (Output_section::Output_section): Initialize
12369 is_entsize_zero_.
12370 (Output_section::set_entsize): If two different entsizes are
12371 requested, force it to zero.
12372 (Output_section::add_input_section): Set flags for .debug_str
12373 before updating section flags. Set entsize.
12374 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12375 and SHF_STRING if all input sections have those flags.
12376
3e1b9a8a
RÁE
123772009-12-29 Rafael Espindola <espindola@google.com>
12378
12379 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12380 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12381 reporting.
3e1b9a8a 12382
3dcad376
ST
123832009-12-29 Sriraman Tallam <tmsriram@google.com>
12384
12385 * options.cc (General_options::parse_version): Allow -v to exit
12386 without an error if there is nothing to link.
12387
084e2665
ILT
123882009-12-29 Ian Lance Taylor <iant@google.com>
12389
12390 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12391 using a version of gcc before 4.1.
12392 * configure: Rebuild.
12393
250acde3
CD
123942009-12-28 Chris Demetriou <cgd@google.com>
12395
12396 * attributes.cc (Output_attributes_section_data::do_write): Use
12397 std::vector::front rather than std::vector::data.
12398
99fff23b
ILT
123992009-12-28 Ian Lance Taylor <iant@google.com>
12400
12401 * symtab.h (class Symbol_table): Add enum Defined.
12402 * resolve.cc (Symbol_table::should_override): Add defined
12403 parameter. Change all callers. Test whether object is NULL
12404 before calling a method on it.
12405 (Symbol_table::report_resolve_problem): Add defined parameter.
12406 Change all callers.
12407 (Symbol_table::should_override_with_special): Likewise.
12408 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12409 parameter. Change all callers.
12410 (Symbol_table::do_define_in_output_data): Likewise.
12411 (Symbol_table::define_in_output_segment): Likewise.
12412 (Symbol_table::do_define_in_output_segment): Likewise.
12413 (Symbol_table::define_as_constant): Likewise.
12414 (Symbol_table::do_define_as_constant): Likewise.
12415 * script.h (class Symbol_assignment): Add is_defsym parameter to
12416 constructor; change all callers.
12417 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12418 parameter. Change all callers. Add is_defsym_ field.
12419 (class Parser_closure): Add parsing_defsym parameter to
12420 constructor; change all callers. Add parsing_defsym accessor
12421 function. Add parsing_defsym_ field.
12422
556bd683
ILT
124232009-12-28 Ian Lance Taylor <iant@google.com>
12424
12425 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12426 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12427
1782c879
ILT
124282009-12-23 Ian Lance Taylor <iant@google.com>
12429
12430 * i386.cc (Target_i386::do_calls_non_split): Recognize
12431 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12432 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12433 -fsplit-stack prologue when using %r11.
1782c879 12434
329ca2b1
ST
124352009-12-21 Sriraman Tallam <tmsriram@google.com>
12436
12437 * options.cc (General_options::parse_version): Make -v continue and do
12438 the link like GNU ld does.
12439
d675ff46
RÁE
124402009-12-17 Rafael Avila de Espindola <espindola@google.com>
12441
12442 * Makefile.am (CCFILES): Add timer.cc.
12443 (HFILES): Add timer.h.
12444 * configure.ac: Check for sysconf and times.
12445 * main.cc: include timer.h.
12446 (main): Use Timer instead of get_run_time.
12447 * timer.cc: New.
12448 * timer.h: New.
12449 * workqueue.cc: include timer.h.
12450 (Workqueue::find_and_run_task):
12451 Report user, sys and wall time.
12452 * Makefile.in: Regenerate.
12453 * config.in: Regenerate.
12454 * configure: Regenerate.
12455
d6344fb5
DK
124562009-12-16 Doug Kwan <dougkwan@google.com>
12457
12458 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12459 sections.
12460 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12461 relaxed input sections.
12462 * output.cc (Output_section::find_relaxed_input_section): Change
12463 return type to Output_relaxed_input_section pointer. Adjust code
12464 for new type of relaxed_input_section_map_.
12465 * output.h (Output_section::find_relaxed_input_section): Change
12466 return type to Output_relaxed_input_section pointer.
12467 (Output_section::Output_relaxed_input_section_by_input_section_map):
12468 New type.
12469 (Output_section::relaxed_input_section_map_): Change type to
12470 Output_section::Output_relaxed_input_section_by_input_section_map.
12471 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12472 input section.
12473
0e0d5469
ILT
124742009-12-15 Ian Lance Taylor <iant@google.com>
12475
12476 * layout.cc (Layout::create_shstrtab): Only write out after input
12477 sections if we are compressing debug sections.
12478
0649a889
ILT
124792009-12-15 Ian Lance Taylor <iant@google.com>
12480
12481 * archive.cc (Archive::add_symbols): Only look up a symbol without
12482 a version if there is, in fact, a version.
12483
2ea97941
ILT
124842009-12-14 Ian Lance Taylor <iant@google.com>
12485
12486 Revert -Wshadow changes, all changes from:
12487 2009-12-11 Doug Kwan <dougkwan@google.com>
12488 2009-12-11 Nick Clifton <nickc@redhat.com>
12489 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12490
b0eec2cc
DK
124912009-12-11 Doug Kwan <dougkwan@google.com>
12492
12493 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12494 due to -Wshadow.
12495 * attributes.cc (Object_attribute::size): Ditto.
12496 (Attributes_section_data::size): Ditto.
12497 (Attributes_section_data::Attributes_section_data): Ditto.
12498 (Output_attributes_section_data::do_write): Ditto.
12499 * attributes.h (Object_attribute::set_type): Ditto.
12500 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12501
91d6fa6a
NC
125022009-12-11 Nick Clifton <nickc@redhat.com>
12503
12504 * archive.cc: Fix shadowed variable warnings.
12505 * arm.cc: Likewise.
12506 * compressed_output.cc: Likewise.
12507 * compressed_output.h: Likewise.
12508 * configure: Likewise.
12509 * dwarf_reader.cc: Likewise.
12510 * dynobj.cc: Likewise.
12511 * dynobj.h: Likewise.
12512 * ehframe.cc: Likewise.
12513 * ehframe.h: Likewise.
12514 * errors.cc: Likewise.
12515 * expression.cc: Likewise.
12516 * fileread.cc: Likewise.
12517 * fileread.h: Likewise.
12518 * freebsd.h: Likewise.
12519 * i386.cc: Likewise.
12520 * icf.cc: Likewise.
12521 * incremental.h: Likewise.
12522 * layout.cc: Likewise.
12523 * layout.h: Likewise.
12524 * mapfile.cc: Likewise.
12525 * merge.cc: Likewise.
12526 * merge.h: Likewise.
12527 * object.cc: Likewise.
12528 * object.h: Likewise.
12529 * options.h: Likewise.
12530 * output.cc: Likewise.
12531 * output.h: Likewise.
12532 * parameters.cc: Likewise.
12533 * plugin.cc: Likewise.
12534 * powerpc.cc: Likewise.
12535 * reduced_debug_output.cc: Likewise.
12536 * reduced_debug_output.h: Likewise.
12537 * reloc.cc: Likewise.
12538 * reloc.h: Likewise.
12539 * resolve.cc: Likewise.
12540 * script-sections.cc: Likewise.
12541 * script.cc: Likewise.
12542 * script.h: Likewise.
12543 * sparc.cc: Likewise.
12544 * symtab.cc: Likewise.
12545 * symtab.h: Likewise.
12546 * target-select.cc: Likewise.
12547 * target-select.h: Likewise.
12548 * token.h: Likewise.
12549 * workqueue.cc: Likewise.
12550 * workqueue.h: Likewise.
12551 * x86_64.cc: Likewise.
12552
a0351a69
DK
125532009-12-10 Doug Kwan <dougkwan@google.com>
12554
12555 * arm.cc (attributes.h): New include.
12556 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12557 (Arm_relobj::~Arm_relobj): Delete object pointed by
12558 attributes_section_data_.
12559 (Arm_relobj::attributes_section_data): New method definition.
12560 (Arm_relobj::attributes_section_data_): New data member declaration.
12561 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12562 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12563 attributes_section_data_.
12564 (Arm_dynobj::attributes_section_data): New method definition.
12565 (Arm_dynobj::attributes_section_data_): New data member declaration.
12566 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12567 initialization value of may_use_blx_ to false.
2e702c99 12568 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12569 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12570 object attributes to compute results instead of hard-coding.
12571 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12572 Target_arm::get_secondary_compatible_arch,
12573 Target_arm::set_secondary_compatible_arch
12574 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12575 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12576 New method declarations.
12577 (Target_arm::get_aeabi_object_attribute): New method definition.
12578 (Target_arm::attributes_section_data_): New data member declaration.
12579 (read_arm_attributes_section): New template definition.
12580 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12581 (Arm_dynobj::do_read_symbols): Ditto.
12582 (Target_arm::do_finalize_sections): Merge attributes sections from
12583 input. Check for BLX use after attributes section merging.
12584 Fix __exidx_start and __exidx_end visibility. Create an
12585 .ARM.attributes section if necessary.
12586 (Target_arm::get_secondary_compatible_arch,
12587 Target_arm::set_secondary_compatible_arch,
12588 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12589 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12590 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12591 New method definitions.
12592
b59befec
ILT
125932009-12-09 Ian Lance Taylor <iant@google.com>
12594
12595 * plugin.cc (Plugin::load): Don't cast from void* to a function
12596 pointer.
12597
1276bc89
ILT
125982009-12-09 Ian Lance Taylor <iant@google.com>
12599
12600 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12601 information fields.
12602
2f2de248
L
126032009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12604
12605 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12606 Replace two_file_shared_1.so with two_file_shared_2.so.
12607 * testsuite/Makefile.in: Regenerated.
12608
4f787271
DK
126092009-12-08 Doug Kwan <dougkwan@google.com>
12610
12611 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12612 (HFILES): Add attributes.h and int_encoding.h.
12613 * Makefile.in: Regenerate.
12614 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12615 function definitions to int_encoding.cc
12616 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12617 prototypes to int_encoding.h
12618 * reduced_debug_output.cc (int_encoding.h): New include.
12619 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12620 function definitions to int_encoding.cc
12621 (insert_into_vector, read_from_pointer): Move template definitions to
12622 int_encoding.h
12623 * attributes.cc: New file.
12624 * attributes.h: New file.
12625 * int_encoding.cc: New file.
12626 * int_encoding.h: New file.
12627
20b52f1a
RÁE
126282009-12-07 Rafael Avila de Espindola <espindola@google.com>
12629
12630 PR gold/11055
12631 * incremental-dump.cc (dump_incremental_inputs): New.
12632 (main): Use dump_incremental_inputs.
12633
53d7974c
L
126342009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12635
12636 PR gold/10893
12637 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12638 checking elfcpp::STT_FUNC.
12639 (Target_i386::Relocate::relocate): Likewise.
12640 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12641
12642 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12643 symbols from shared libraries into normal FUNC symbols.
12644
12645 * symtab.h (Symbol): Add is_func and use it.
12646
05a352e6
DK
126472009-12-05 Doug Kwan <dougkwan@google.com>
12648
12649 * arm.cc (Target_arm::arm_info): Initialize new fields
12650 attributes_section and attributes_vendor.
12651 * i386.cc (Target_i386::i386_info): Same.
12652 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12653 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12654 fields attributes_section and attributes_vendor.
53d7974c 12655 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12656 * target.h (Target::attributes_section, Target::attributes_vendor,
12657 Target::is_attributes_section, Target::attribute_arg_type,
12658 Target::attributes_order): New method definitions.
12659 (Target::Target_info::attributes_section,
12660 Target::Target_info::attributes_vendor): New fields.
12661 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12662 virtual method definitions.
12663 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12664 attributes_section and attributes_vendor.
12665 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12666
f4e5969c
DK
126672009-12-05 Doug Kwan <dougkwan@google.com>
12668
12669 * arm.cc: Update comments about interworking and stub generation.
12670 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12671 considered as non-PIC.
12672 (Arm_relocate_functions::base_abs): Fix formatting.
12673 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12674 of function to use GOT entry address instead of offset.
12675 (Target_arm::Scan::global): Issue an error if a symbol would need a
12676 PLT does not get one because it is untyped. Remove code to create
12677 dynamic symbols for relative branches.
12678 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12679 takes unsigned integer instead of boolean.
12680
1abce4a6
L
126812009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12682
12683 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12684 (two_file_test_LDADD): Likewise.
12685 (common_test_1_LDADD): Likewise.
12686 (exception_test_LDADD) Likewise.
12687 (weak_test_LDADD): Likewise.
12688 (many_sections_test_LDADD): Likewise.
12689 (initpri1_LDADD): Likewise.
12690 (script_test_1_LDADD): Likewise.
12691 (script_test_2_LDADD): Likewise.
12692 (justsyms_LDADD): Likewise.
12693 (binary_test_LDADD): Likewise.
12694 (large_LDADD): Likewise.
12695 * testsuite/Makefile.in: Regenerated.
12696
adcf2816 126972009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12698
adcf2816
L
12699 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12700 (Symbol_table::override_with_special): Likewise.
12701 (Symbol_table::add_from_object): Likewise.
12702
28e67f5d
RÁE
127032009-12-04 Rafael Avila de Espindola <espindola@google.com>
12704
12705 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12706 Don't set the data_offset twice.
12707
ae10a101
RÁE
127082009-12-04 Rafael Avila de Espindola <espindola@google.com>
12709
12710 * testsuite/Makefile.in: Regenerate.
12711
f59f41f3
DK
127122009-12-03 Doug Kwan <dougkwan@google.com>
12713
12714 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12715 (Target_arm::do_finalize_sections): Add parameter for symbol table
12716 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12717 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12718 parameter for symbol table pointer.
12719 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12720 an additional parameter for a pointer to symbol table.
12721 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12722 parameter for a symbol table pointer.
12723 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12724 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12725 Ditto.
12726 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12727 parameter for a symbol table pointer.
12728
ca55d848
RÁE
127292009-12-03 Rafael Avila de Espindola <espindola@google.com>
12730
12731 * incremental.cc (Incremental_inputs_header)
12732 (Incremental_inputs_header_write, Incremental_inputs_entry)
12733 (Incremental_inputs_entry_write): Move ...
12734 * incremental.h (Incremental_inputs_header)
12735 (Incremental_inputs_header_write, Incremental_inputs_entry)
12736 (Incremental_inputs_entry_write): here.
12737
3aec4f9c
RÁE
127382009-12-02 Rafael Avila de Espindola <espindola@google.com>
12739
12740 * incremental.cc (make_sized_incremental_binary): Set the target.
12741 Error if it is incompatible.
12742 * output.h (Output_file): Add filename method.
12743
9c0ae74d
RÁE
127442009-12-02 Rafael Avila de Espindola <espindola@google.com>
12745
12746 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12747 from the get_* methods.
12748
a45500ae
RÁE
127492009-12-02 Rafael Avila de Espindola <espindola@google.com>
12750
12751 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12752 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12753 Write 0 for the data_offset of scripts.
12754
325e6408
RÁE
127552009-12-02 Rafael Avila de Espindola <espindola@google.com>
12756
12757 * testsuite/Makefile.am: Add the incremental_test.sh test.
12758 * testsuite/incremental_test.sh: New.
12759 * testsuite/incremental_test_1.c: New.
12760 * testsuite/incremental_test_2.c: New.
12761
954c3e2e
RÁE
127622009-12-01 Rafael Avila de Espindola <espindola@google.com>
12763
703d02da 12764 * incremental-dump.cc (main): Fix typos.
954c3e2e 12765
f8086623
RÁE
127662009-11-27 Rafael Avila de Espindola <espindola@google.com>
12767
12768 PR gold/11025
12769 * incremental-dump.cc (main): Use llu to print 64 bit values.
12770
3b0dd6ac
L
127712009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12772 H.J. Lu <hongjiu.lu@intel.com>
12773
12774 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12775 $(LIBDL).
12776 (incremental_dump_LDADD): Likewise.
12777 * Makefile.in: Regenerated.
12778
a6d1ef57 127792009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12780
a6d1ef57
DK
12781 Revert:
12782
12783 2009-11-25 Doug Kwan <dougkwan@google.com>
12784
12785 * arm.cc (Target_arm::Target_arm): Move method definition
12786 outside of class definition. Add code to handle
12787 --target1-rel, --target1-abs and --target2= options.
12788 (Target_arm::get_reloc_reloc_type): Change method to be
12789 non-static and const.
12790 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12791 New data member declaration.
12792 (Target_arm::Scan::local, Target_arm::Scan::global,
12793 Target_arm::Relocate::relocate,
12794 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12795 Adjust call to Target_arm::get_real_reloc_type.
12796 (Target_arm::get_real_reloc_type): Use command line options
12797 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12798 * options.h (--target1-rel, --target1-abs, --target2): New
12799 ARM-only options.
12800
50aeb7d4
DK
128012009-11-25 Doug Kwan <dougkwan@google.com>
12802
12803 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12804 class definition. Add code to handle --target1-rel, --target1-abs
12805 and --target2= options.
12806 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12807 and const.
12808 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12809 member declaration.
12810 (Target_arm::Scan::local, Target_arm::Scan::global,
12811 Target_arm::Relocate::relocate,
12812 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12813 call to Target_arm::get_real_reloc_type.
12814 (Target_arm::get_real_reloc_type): Use command line options to
12815 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12816 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12817 options.
12818
51938283
DK
128192009-11-25 Doug Kwan <dougkwan@google.com>
12820
12821 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12822 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12823 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12824 formatting.
12825 (Arm_relocate_functions::thm_call): Replace body with a call to
12826 Arm_relocate_functions::thumb_branch_common.
12827 (Arm_relocate_functions::thm_jump24,
12828 Arm_relocate_functions::thm_xpc22): New method definitions.
12829 (Arm_relocate_functions::thumb_branch_common): New method definition.
12830 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12831 operator.
12832 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12833 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12834
e2b8f3c4
RÁE
128352009-11-24 Rafael Avila de Espindola <espindola@google.com>
12836
12837 * Makefile.am: Build incremental-dump
12838 * Makefile.in: Regenerate.
12839 * incremental-dump.cc: New.
12840 * incremental.cc (Incremental_inputs_header_data,
12841 Incremental_inputs_entry_data): Move to incremental.h
12842 * incremental.h: (Incremental_inputs_header_data,
12843 Incremental_inputs_entry_data): Move from incremental.cc
12844
bcba9aec
RÁE
128452009-11-24 Rafael Avila de Espindola <espindola@google.com>
12846
12847 * incremental.cc (Incremental_inputs_header,
12848 Incremental_inputs_header_write, Incremental_inputs_entry,
12849 Incremental_inputs_entry_write): Add a typedef with the data type.
12850
7c3afe08
RÁE
128512009-11-24 Rafael Avila de Espindola <espindola@google.com>
12852
12853 * incremental.cc (Incremental_inputs_header,
12854 Incremental_inputs_header_write, Incremental_inputs_entry,
12855 Incremental_inputs_entry_write): Update comment about which
12856 type has the filed descriptions.
12857
d204b6e9
DK
128582009-11-15 Doug Kwan <dougkwan@google.com>
12859
12860 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12861 (Arm_relocate_functions::arm_branch_common): Change method defintion
12862 in class definition to a method declaration and update list of formal
12863 parameters.
12864 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12865 Arm_relocation_functions::jump24): Adjust call to
12866 Arm_relocate_functions::arm_branch_common. Update list of formal
12867 parameters.
12868 (Arm_relocate_functions::xpc25): New method definition.
12869 (Arm_relocate_functions::arm_branch_common): Move method defintion
12870 out from class definition. Use stubs for mode-switching and extending
12871 branch ranges.
12872 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12873 specially. Change code to enable use of stubs in ARM branches.
12874
43d12afe
DK
128752009-11-10 Doug Kwan <dougkwan@google.com>
12876
12877 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12878 in method declaration.
12879 (Target_arm::relocate_stub): New method declaration.
12880 (Target_arm::default_target): Change to return a pointer instead of
12881 a const reference.
12882 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12883 Target_arm::default_target.
12884 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12885 method definition.
12886 (Target_arm::relocate_section): Adjust view.
12887 (Target_arm::relocate_stub): New method definition.
12888
ac33a407
DK
128892009-11-10 Doug Kwan <dougkwan@google.com>
12890
12891 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12892 a format warning.
12893 * incremental.cc (open_incremental_binary): Initialized local
12894 variables to avoid warnings.
12895 * object.cc (make_elf_object): Ditto.
12896 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12897 a format warning.
e1df38aa 12898
88ee28e9
L
12899009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12900
12901 PR gold/10930
12902 * testsuite/plugin_test.c: Include "config.h".
12903
2daedcd6
DK
129042009-11-09 Doug Kwan <dougkwan@google.com>
12905
12906 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12907 (arm_symbol_value): Remove.
12908 (Arm_relocate_functions::arm_branch_common,
12909 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12910 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12911 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12912 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12913 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12914 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12915 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12916 Arm_relocate_functions::thm_mobw_abs_nc,
12917 Arm_relocate_functions::thm_mov_abs,
12918 Arm_relocate_functions::movw_prel_nc,
12919 Arm_relocate_functions::thm_movt_abs,
12920 Arm_relocate_functions::movt_prel,
12921 Arm_relocate_functions::thm_movw_prel_nc,
12922 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12923 (Target_arm::Relocate::relocate): Only decompose address into two
12924 parts if relocation type uses the thumb-bit and pass the actual
12925 bit instead of a flag indicating that the thumb-bit is used. Adjust
12926 calls to methods in Arm_relocate_functions for this change.
12927
1276bc89 129282009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12929
12930 PR 10925
12931 * reloc.cc: Instantiate
12932 Sized_relobj::initialize_input_to_output_maps and
12933 Sized_relobj:free_input_to_output_maps.
12934
e53ad1b5
ILT
129352009-11-06 Ian Lance Taylor <iant@google.com>
12936
12937 PR 10876
12938 * defstd.cc (in_segment): Set only_if_ref true for "end".
12939
eb44217c
DK
129402009-11-06 Doug Kwan <dougkwan@google.com>
12941
12942 * arm.cc (class Reloc_stub): Correct a comment.
12943 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12944 (Target_arm::scan_section_for_stubs): New method declaration.
12945 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12946 Change methods from private to protected.
12947 (Target_arm::do_may_relax): New method definition.
12948 (Target_arm::do_relax, Target_arm::group_sections,
12949 Target_arm::scan_reloc_for_stub,
12950 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12951 (Target_arm::arm_input_section_map_): New data member declaration.
12952 (Target_arm::scan_reloc_for_stub,
12953 Target_arm::scan_reloc_section_for_stubs,
12954 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12955 Target_arm::do_relax): New method definitions.
12956
5d329b7d
ILT
129572009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12958
12959 * configure.ac: Check for (struct stat)::st_mtim
12960 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12961 * config.in: Regenerate.
12962 * configure: Regenerate.
12963
96a0d71b
ILT
129642009-11-05 Ian Lance Taylor <iant@google.com>
12965
12966 PR 10910
12967 * output.cc (Output_segment::add_output_section): Add missing
12968 return statement.
12969
594c8e5e
ILT
129702009-11-04 Ian Lance Taylor <iant@google.com>
12971
12972 PR 10880
12973 * object.h (class Object): Add is_needed and set_is_needed
12974 methods. Add is_needed_ field. Make bool fields into bitfields.
12975 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12976 defined in a dynamic object and referenced by a regular object,
12977 set is_needed for the dynamic object.
12978 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12979 if the file is marked with as_needed and it is not needed.
12980
22b127cc
ILT
129812009-11-04 Ian Lance Taylor <iant@google.com>
12982
12983 PR 10887
12984 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12985 tags if data is discarded by linker script.
12986 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12987 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12988 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12989 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12990
f5c870d2
ILT
129912009-11-04 Ian Lance Taylor <iant@google.com>
12992
12993 * layout.cc (Layout::get_output_section): Add is_interp and
12994 is_dynamic_linker_section parameters. Change all callers.
12995 (Layout::choose_output_section): Likewise.
12996 (Layout::make_output_section): Likewise.
12997 (Layout::add_output_section_data): Add is_dynamic_linker_section
12998 parameter. Change all callers.
12999 * layout.h (class Layout): Update declarations.
13000 * output.h (class Output_section): Add is_interp, set_is_interp,
13001 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13002 Add is_interp_, is_dynamic_linker_section_ fields. Change
13003 generate_code_fills_at_write_ to a bitfield.
13004 * output.cc (Output_section::Output_sections): Initialize new
13005 fields.
13006 (Output_segment::add_output_section): Add do_sort parameter.
13007 Change all callers.
13008
1ae4d23b
ILT
130092009-11-03 Ian Lance Taylor <iant@google.com>
13010
13011 PR 10860
13012 * options.h (class General_options): Add --warn-common.
13013 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13014 merging two common symbols.
13015 (Symbol_table::should_override): Handle --warn-common when merging
13016 a common symbol with a defined symbol. Use report_resolve_problem
13017 for multiple definitions.
13018 (Symbol_table::report_resolve_problem): New function.
13019 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13020
55da9579
DK
130212009-11-03 Doug Kwan <dougkwan@google.com>
13022
13023 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13024 stub_factory_.
13025 (Target_arm::stub_factory): New method definition.
13026 (Target_arm::new_arm_input_section,
13027 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13028 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 13029 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
13030 New type definitions.
13031 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13032 member declarations.
13033 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13034 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13035 New method definitions.
13036
37a9ac43
ILT
130372009-11-03 Ian Lance Taylor <iant@google.com>
13038
13039 * options.h (class General_options): Add --warn_constructors.
13040
b3d6a3d4
ILT
130412009-11-03 Ian Lance Taylor <iant@google.com>
13042
13043 PR 10893
13044 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13045 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13046
934b01dd
ILT
130472009-11-03 Ian Lance Taylor <iant@google.com>
13048
13049 PR 10895
13050 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13051 --msgid-bugs-address.
13052 (install-pdf): New target.
13053 (install-data_yes): Look up one directory to find mkinstalldirs.
13054
03c1939b
L
130552009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13056
13057 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13058 tree.
13059
ebd95253
DK
130602009-10-30 Doug Kwan <dougkwan@google.com>
13061
13062 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13063
e9bbb538
DK
130642009-10-30 Doug Kwan <dougkwan@google.com>
13065
13066 * arm.cc (Stub_addend_reader): New struct template definition
13067 and partial specializations.
13068 (Stub_addend_reader::operator()): New method definition for a
13069 partially specialized template.
13070
d5b40221
DK
130712009-10-30 Doug Kwan <dougkwan@google.com>
13072
13073 * arm.cc (Arm_relobj::processor_specific_flags): New method
13074 definition.
13075 (Arm_relobj::do_read_symbols): New method declaration.
13076 (Arm_relobj::processor_specific_flags_): New data member declaration.
13077 (Arm_dynobj): New class definition.
13078 (Target_arm::do_finalize_sections): Add input_objects parameter.
13079 (Target_arm::do_adjust_elf_header): New method declaration.
13080 (Target_arm::are_eabi_versions_compatible,
13081 (Target_arm::merge_processor_specific_flags): New method declaration.
13082 (Target_arm::do_make_elf_object): New overloaded method definitions
13083 and declaration.
13084 (Arm_relobj::do_read_symbols): New method definition.
13085 (Arm_dynobj::do_read_symbols): Ditto.
13086 (Target_arm::do_finalize_sections): Add input_objects parameters.
13087 Merge processor-specific flags from all input objects.
13088 (Target_arm::are_eabi_versions_compatible,
13089 Target_arm::merge_processor_specific_flags,
13090 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13091 New method definitions.
13092 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13093 Input_objects pointer type parameter.
13094 * layout.cc (Layout::finalize): Pass input objects to target's.
13095 finalize_sections function.
13096 * output.cc (Output_file_header::do_sized_write): Set ELF file
13097 header's processor-specific flags.
13098 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13099 Input_objects pointer type parameter.
13100 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13101 * target.h (Input_objects): New forward class declaration.
13102 (Target::processor_specific_flags,
13103 Target::are_processor_specific_flags_sect): New method definitions.
13104 (Target::finalize_sections): Add input_objects parameter.
13105 (Target::Target): Initialize processor_specific_flags_ and
13106 are_processor_specific_flags_set_.
13107 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13108 parameter.
13109 (Target::set_processor_specific_flags): New method definition.
13110 (Target::processor_specific_flags_,
13111 Target::are_processor_specific_flags_set_): New data member
13112 declarations.
13113 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13114 Input_objects pointer type parameter.
13115
ebabffbd
DK
131162009-10-30 Doug Kwan <dougkwan@google.com>
13117
13118 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13119
ad0f2072
ILT
131202009-10-28 Ian Lance Taylor <iant@google.com>
13121
13122 * object.h (class Relobj): Drop options parameter from
13123 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13124 do_scan_relocs, do_relocate. Change all callers.
13125 (class Sized_relobj): Drop options parameters from
13126 do_gc_process_relocs, do_scan_relocs, do_relocate,
13127 do_relocate_sections, relocate_sections, emit_relocs_scan,
13128 emit_relocs_scan_reltype. Change all callers.
13129 (struct Relocate_info): Remove options field and all references to
13130 it.
13131 * reloc.h (class Read_relocs): Remove options constructor
13132 parameter and options_ field. Change all callers.
13133 (class Gc_process_relocs, class Scan_relocs): Likewise.
13134 (class Relocate_task): Likewise.
13135 * target-reloc.h (scan_relocs): Remove options parameter. Change
13136 all callers.
13137 (scan_relocatable_relocs): Likewise.
13138 * target.h (class Sized_target): Remove options parameter from
13139 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13140 all callers.
13141 * gc.h (gc_process_relocs): Remove options parameter. Change all
13142 callers.
13143 * arm.cc: Update functions to remove options parameters.
13144 * i386.cc: Likewise.
13145 * powerpc.cc: Likewise.
13146 * sparc.cc: Likewise.
13147 * x86_64.cc: Likewise.
13148 * testsuite/testfile.cc: Likewise.
13149
8ffa3667
DK
131502009-10-28 Doug Kwan <dougkwan@google.com>
13151
13152 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13153 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13154 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13155 New method definitions.
13156
40f36857
CC
131572009-10-28 Cary Coutant <ccoutant@google.com>
13158
13159 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13160 (Plugin::cleanup_done_): New member.
13161 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13162 (Plugin_manager::cleanup_done_): Remove.
13163 (Plugin_manager::add_input_file): Edit error message.
13164 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13165 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13166
2c849493
ILT
131672009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13168
13169 * fileread.cc: (File_read::View::~View): Use the new
13170 data_ownership_ filed.
13171 (File_read::~File_read): Dispose the new whole_file_view_.
13172 (File_read::open): Mmap the whole file if needed.
13173 (File_read::open): Use whole_file_view_ instead of contents_.
13174 (File_read::find_view): Use whole_file_view_ if applicable.
13175 (File_read::do_read): Use whole_file_view_ instead of contents_.
13176 (File_read::make_view): Use whole_file_view_ instead of contents_,
13177 update File_read::View::View call.
13178 (File_read::find_or_make_view): Update File_read::View::View
13179 call.
13180 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13181 remove contents_
13182 (File_read::View::Data_ownership): New enum.
13183 (File_read::View::View): Replace bool mapped_ with Data_ownership
13184 argument.
13185 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13186 (File_read::View::data_ownership_): New field.
13187 (File_read::contents_): Remove (replaced by whole_file_view_).
13188 (File_read::whole_file_view_): New field.
13189 * options.h (class General_options): Add --keep-files-mapped.
13190
24998053
CC
131912009-10-27 Cary Coutant <ccoutant@google.com>
13192
13193 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13194 * testsuite/Makefile.am (plugin_test_5): New test case.
13195 * testsuite/Makefile.in: Regenerate.
13196
72adc4fa
DK
131972009-10-25 Doug Kwan <dougkwan@google.com>
13198
13199 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13200 from private to protected to allow access by child class.
13201 (Sized_relobj::do_relocate_sections): New method declaration.
13202 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13203 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13204 Sized_relobj::relocate_sections. Instantiate template explicitly
13205 for different target sizes and endianity.
13206
07f508a2
DK
132072009-10-24 Doug Kwan <dougkwan@google.com>
13208
13209 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13210 (Arm_input_section::as_arm_input_section): New method.
13211 (Arm_output_section): New class definition.
13212 (Arm_output_section::create_stub_group,
13213 Arm_output_section::group_sections): New method definitions.
13214
10ad9fe5
DK
132152009-10-22 Doug Kwan <dougkwan@google.com>
13216
13217 * arm.cc (Arm_input_section): New class definition.
13218 (Arm_input_section::init, Arm_input_section:do_write,
13219 Arm_input_section::set_final_data_size,
13220 Arm_input_section::do_reset_address_and_file_offset): New method
13221 definitions.
13222
56ee5e00
DK
132232009-10-21 Doug Kwan <dougkwan@google.com>
13224
13225 * arm.cc (Stub_table, Arm_input_section): New forward class
13226 declarations.
13227 (Stub_table): New class defintion.
13228 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13229 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13230 New method definition.
13231
b569affa
DK
132322009-10-21 Doug Kwan <dougkwan@google.com>
13233
13234 * arm.cc: Update copyright comments.
13235 (Target_arm): New forward class template declaration.
13236 (Arm_address): New type.
13237 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13238 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13239 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13240 constants.
13241 (Insn_template): Same.
13242 (DEF_STUBS): New macro.
13243 (Stub_type): New enum type.
13244 (Stub_template): New class definition.
13245 (Stub): Same.
13246 (Reloc_stub): Same.
13247 (Stub_factory): Same.
13248 (Target_arm::Target_arm): Initialize may_use_blx_ and
13249 should_force_pic_veneer_.
13250 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13251 Target_arm::should_force_pic_veneer,
13252 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13253 Target_arm::using_thumb_only, Target_arm:;default_target): New
13254 method defintions.
13255 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13256 New data member declarations.
13257 (Insn_template::size, Insn_template::alignment): New method defintions.
13258 (Stub_template::Stub_template): New method definition.
13259 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13260 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13261 (Stub_factory::Stub_factory): New method definition.
13262 * gold.h (string_hash): New template.
13263 * output.h (Input_section_specifier::hash_value): Use
13264 gold::string_hash.
13265 (Input_section_specifier::string_hash): Remove.
13266 * stringpool.cc (Stringpool_template::string_hash): Use
13267 gold::string_hash.
13268
6c172549
DK
132692009-10-20 Doug Kwan <dougkwan@google.com>
13270
13271 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13272 symbols of relaxed input sections.
13273 * output.h (Output_section::find_relaxed_input_section): Make
13274 method public.
13275
c5617f2f
DK
132762009-10-16 Doug Kwan <dougkwan@google.com>
13277
13278 * dynobj.cc (Versions::Versions): Initialize version_script_.
13279 Only insert base version symbol definition for a shared object
13280 if version script defines any version versions.
13281 (Versions::define_base_version): New method definition.
13282 (Versions::add_def): Check that base version is not needed.
13283 (Versions::add_need): Define base version lazily.
13284 * dynobj.h (Versions::define_base_version): New method declaration.
13285 (Versions::needs_base_version_): New data member declaration.
13286 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13287 (check_DATA): Add no_version_test.stdout.
13288 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13289 New make rules.
13290 * testsuite/Makefile.in: Regenerate.
13291 * testsuite/no_version_test.c: New file.
13292 * testsuite/no_version_test.sh: Ditto.
13293
3c12dcdb
DK
132942009-10-16 Doug Kwan <dougkwan@google.com>
13295
13296 * expression.cc (class Segment_start_expression): New class definition.
13297 (Segment_start_expression::value): New method definition.
13298 (script_exp_function_segment_start): Return a new
13299 Segment_start_expression.
13300 * gold/script-c.h (script_saw_segment_start_expression): New function
13301 prototype.
13302 * script-sections.cc (Script_sections::Script_sections): Initialize
13303 SAW_SEGMENT_START_EXPRESSION_ to false.
13304 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13305 and -Tbbs options to specify section addresses if given in
13306 command line and no SEGMENT_START expression is seen in a script.
13307 * script-sections.h (Script_sections::saw_segment_start_expression,
13308 Script_sections::set_saw_segment_start_expression): New method
13309 definition.
13310 (Script_sections::saw_segment_start_expression_): New data member
13311 declaration.
13312 * script.cc (script_saw_segment_start_expression): New function.
13313 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13314 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13315 script_test_7.sh and script_test_8.sh.
13316 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13317 script_test_8.stdout.
13318 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13319 (script_test_6, script_test_6.stdout, script_test_7,
13320 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13321 * Makefile.in: Regenerate.
13322 * testsuite/script_test_6.sh: New file.
13323 * testsuite/script_test_6.t: Same.
13324 * testsuite/script_test_7.sh: Same.
13325 * testsuite/script_test_7.t: Same.
13326 * testsuite/script_test_8.sh: Same.
13327
64b1ae37
DK
133282009-10-16 Doug Kwan <dougkwan@google.com>
13329
13330 * output.cc (Output_segment::set_section_list_address): Cast
13331 expressions to unsigned long long type to avoid format warnings.
13332
661be1e2
ILT
133332009-10-15 Ian Lance Taylor <iant@google.com>
13334
12edd763 13335 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13336 dot assignment to script_sections_.
12edd763
ILT
13337 * script-sections.cc (Script_sections::add_dot_assignment):
13338 Initialize if necessary.
13339
68b6574b
ILT
13340 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13341 program headers with no load segment if there is a linker script.
13342
661be1e2
ILT
13343 * layout.cc (Layout::set_segment_offsets): Align the file offset
13344 to the segment aligment for -N or -n with no load segment.
13345 * output.cc (Output_segment::add_output_section): Don't crash if
13346 the first section is a TLS section.
13347 (Output_segment::set_section_list_addresses): Print an error
13348 message if the address moves backward in a linker script.
13349 * script-sections.cc
13350 (Output_section_element_input::set_section_addresses): Don't
13351 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13352 (Orphan_output_section::set_section_addresses): Likewise.
13353
f15f61a7
DK
133542009-10-15 Doug Kwan <dougkwan@google.com>
13355
13356 * layout.cc (Layout::finish_dynamic_section): Generate tags
13357 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13358 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13359 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13360
82bb573a
ILT
133612009-10-14 Ian Lance Taylor <iant@google.com>
13362
13363 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13364 fields.
13365 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13366 data_shdr fields of relinfo.
13367 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13368 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13369 R_386_TLS_LDO_32, adjust based on section flags.
13370 (Target_i386::Relocate::fix_up_ldo): Remove.
13371
374ad285
ILT
133722009-10-13 Ian Lance Taylor <iant@google.com>
13373
13374 Add support for -pie.
13375 * options.h (class General_options): Add -pie and
13376 --pic-executable.
13377 (General_options::output_is_position_independent): Test -pie.
13378 (General_options::output_is_executable): Return true if not shared
13379 and not relocatable.
13380 (General_options::output_is_pie): Remove.
13381 * options.cc (General_options::finalize): Reject incompatible uses
13382 of -pie.
13383 * gold.cc (queue_middle_tasks): A -pie link is not static.
13384 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13385 * symtab.cc (Symbol::final_value_is_known): Return false if
13386 output_is_position_independent.
13387 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13388 output_is_position_independent.
13389 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13390 output_is_position_independent.
13391 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13392 output_is_position_independent.
13393 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13394 two_file_pie_test.
13395 (basic_pie_test.o, basic_pie_test): New targets.
13396 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13397 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13398 (two_file_pie_test): New target.
13399 * testsuite/Makefile.in: Rebuild.
13400 * README: Remove note saying that -pie is not supported.
13401
c6585162
ILT
134022009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13403
13404 * options.h (class General_options): Add -init and -fini.
13405 * layout.cc (Layout::finish_dynamic_section): Emit
13406 given init and fini functions.
13407
032ce4e9
ST
134082009-10-13 Sriraman Tallam <tmsriram@google.com>
13409
13410 * gc.h (gc_process_relocs): Check if icf is enabled using new
13411 function.
13412 * gold.cc (queue_initial_tasks): Likewise.
13413 (queue_middle_tasks): Likewise.
13414 * object.cc (do_layout): Likewise.
13415 * symtab.cc (is_section_folded): Likewise.
13416 * main.cc (main): Likewise.
13417 * reloc.cc (Read_relocs::run): Likewise.
13418 (Sized_relobj::do_scan_relocs): Likewise.
13419 * icf.cc (is_function_ctor_or_dtor): New function.
13420 (Icf::find_identical_sections): Check if function is ctor or dtor when
13421 safe icf is chosen.
13422 * options.h (General_options::icf): Change option to be an enum.
13423 (Icf_status): New enum.
13424 (icf_enabled): New method.
13425 (icf_safe_folding): New method.
13426 (set_icf_status): New method.
13427 (icf_status_): New variable.
13428 * (options.cc) (General_options::finalize): Set icf_status_.
13429 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13430 icf_test and icf_keep_unique_test to use the --icf enum flag.
13431 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13432 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13433
f345227a
ST
134342009-10-12 Sriraman Tallam <tmsriram@google.com>
13435
13436 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13437 includes to gc.h and icf.h.
13438 * arm.cc: Include gc.h.
13439 * gold.cc: Likewise.
13440 * i386.cc: Likewise.
13441 * powerpc.cc: Likewise.
13442 * sparc.cc: Likewise.
13443 * x86_64.cc: Likewise.
13444 * gc.h: Include icf.h.
13445
1c7814ed
ILT
134462009-10-11 Ian Lance Taylor <iant@google.com>
13447
13448 * plugin.cc: Include "gold.h" before other header files.
13449
ae3b5189
CD
134502009-10-10 Chris Demetriou <cgd@google.com>
13451
13452 * options.h (Input_file_argument::Input_file_type): New enum.
13453 (Input_file_argument::is_lib_): Replace with...
13454 (Input_file_argument::type_): New member.
13455 (Input_file_argument::Input_file_argument): Take Input_file_type
13456 'type' rather than boolean 'is_lib' as second argument.
13457 (Input_file_argument::is_lib): Use type_.
13458 (Input_file_argument::is_searched_file): New function.
13459 (Input_file_argument::may_need_search): Handle is_searched_file.
13460 * options.cc (General_options::parse_library): Support -l:filename.
13461 (General_options::parse_just_symbols): Update for Input_file_argument
13462 changes.
13463 (Command_line::process): Likewise.
13464 * archive.cc (Archive::get_file_and_offset): Likewise.
13465 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13466 * script.cc (read_script_file, script_add_file): Likewise.
13467 * fileread.cc (Input_file::Input_file): Likewise.
13468 (Input_file::will_search_for): Handle is_searched_file.
13469 (Input_file::open): Likewise.
13470 * readsyms.cc (Read_symbols::get_name): Likewise.
13471 * testsuite/Makefile.am (searched_file_test): New test.
13472 * testsuite/Makefile.in: Regenerate.
13473 * testsuite/searched_file_test.cc: New file.
13474 * testsuite/searched_file_test_lib.cc: New file.
13475
f3048a1d
ILT
134762009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13477 Ian Lance Taylor <iant@google.com>
13478
13479 * descriptor.cc: Include <cstdio> and "binary-io.h".
13480 (Descriptors::open): Open the files in binary mode always.
13481 * script.cc (Lex::get_token): Treat \r as whitespace.
13482
d4780e57
ILT
134832009-10-09 Ian Lance Taylor <iant@google.com>
13484
13485 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13486
d9a893b8
ILT
134872009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13488 Ian Lance Taylor <iant@google.com>
13489
13490 * configure.ac: Check for readv function also.
13491 * fileread.cc (readv): Define if not HAVE_READV.
13492 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13493 does not exist.
13494 * config.in: Regenerate.
13495 * configure: Regenerate.
13496
c0a62865
DK
134972009-10-09 Doug Kwan <dougkwan@google.com>
13498
13499 * layout.cc (Layout::make_output_section): Call target hook to make
13500 ordinary output section.
13501 (Layout::finalize): Adjust parameter list of call the
13502 Target::may_relax().
13503 * layout.h (class Layout::section_list): New method.
13504 * merge.h (Output_merge_base::entsize): Change visibility to public.
13505 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13506 New methods.
13507 (Output_merge_string::do_is_string): New method.
13508 * object.cc (Sized_relobj::do_setup): renamed from
13509 Sized_relobj::set_up.
13510 * object.h (Sized_relobj::adjust_shndx,
13511 Sized_relobj::initializ_input_to_output_maps,
13512 Sized_relobj::free_input_to_output_maps): Change visibilities to
13513 protected.
13514 (Sized_relobj::setup): Virtualize.
13515 (Sized_relobj::do_setup): New method declaration.
13516 (Sized_relobj::invalidate_section_offset,
13517 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13518 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13519 * options.cc (parse_int): New function.
13520 * options.h (parse_int): New declaration.
13521 (DEFINE_int): New macro.
13522 (stub_group_size): New option.
13523 * output.cc (Output_section::Output_section): Initialize memebers
13524 merge_section_map_, merge_section_by_properties_map_,
13525 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13526 (Output_section::add_input_section): Handled deferred code-fill
13527 generation and remove an old comment.
13528 (Output_section::add_relaxed_input_section): New method definition.
13529 (Output_section::add_merge_input_section): Use merge section by
13530 properties map to speed to search. Update merge section maps
13531 as appropriate.
13532 (Output_section::build_relaxation_map): New method definition.
13533 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13534 Same.
13535 (Output_section::relax_input_section): Renamed to
13536 Output_section::convert_input_sections_to_relaxed_sections and change
13537 interface to take a vector of pointers to relaxed sections.
13538 (Output_section::find_merge_section,
13539 Output_section::find_relaxed_input_section): New method definitions.
13540 (Output_section::is_input_address_mapped,
13541 Output_section::output_offset, Output_section::output_address):
13542 Use output section data maps to speed up searching.
13543 (Output_section::find_starting_output_address): Add comments.
13544 (Output_section::do_write,
13545 Output_section::write_to_postprocessing_buffer): Do code-fill
13546 generation as appropriate.
13547 (Output_section::get_input_sections): Invalidate relaxed input section
13548 map.
13549 (Output_section::restore_states): Adjust type of checkpoint .
13550 Invalidate relaxed input section map.
13551 * output.h (Output_merge_base): New class declaration.
13552 (Input_section_specifier): New class defintion.
13553 (class Output_relaxed_input_section) Change base class to
13554 Output_section_data_build.
13555 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13556 base class initializer.
13557 (Output_section::add_relaxed_input_section): New method declaration.
13558 (Output_section::Input_section): Change visibility to protected.
2e702c99 13559 (Output_section::Input_section::relobj,
c0a62865
DK
13560 Output_section::Input_section::shndx): Handle relaxed input sections.
13561 Output_section::input_sections) Change visibility to protected. Also
13562 define overload to return a non-const pointer.
13563 (Output_section::Merge_section_properties): New class defintion.
13564 (Output_section::Merge_section_by_properties_map,
13565 Output_section::Output_section_data_by_input_section_map,
13566 Output_section::Relaxation_map): New types.
13567 (Output_section::relax_input_section): Rename method to
13568 Output_section::convert_input_sections_to_relaxed_sections and change
13569 interface to take a vector of relaxed section pointers.
13570 (Output_section::find_merge_section,
13571 Output_section::find_relaxed_input_section,
13572 Output_section::build_relaxation_map,
13573 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13574 New method declarations.
13575 (Output_section::merge_section_map_
13576 Output_section::merge_section_by_properties_map_,
13577 Output_section::relaxed_input_section_map_,
13578 Output_section::is_relaxed_input_section_map_valid_,
13579 Output_section::generate_code_fills_at_write_): New data members.
13580 * script-sections.cc
13581 (Output_section_element_input::set_section_addresses): Call
13582 current_data_size and addralign methods of relaxed input sections.
13583 (Orphan_output_section::set_section_addresses): Call current_data_size
13584 and addralign methods of relaxed input sections.
13585 * symtab.cc (Symbol_table::compute_final_value): Extract template
13586 from the body of Symbol_table::sized_finalize_symbol.
13587 (Symbol_table::sized_finalized_symbol): Call
13588 Symbol_table::compute_final_value.
13589 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13590 (Symbol_table::compute_final_value): New templated method declaration.
13591 * target.cc (Target::do_make_output_section): New method defintion.
13592 * target.h (Target::make_output_section): New method declaration.
13593 (Target::relax): Add more parameters for input objects, symbol table
13594 and layout. Adjust call to do_relax.
13595 (Target::do_make_output_section): New method declaration.
13596 (Target::do_relax): Add parameters for input objects, symbol table
13597 and layout.
13598
d446d6c4
ILT
135992009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13600
13601 * pread.c: Include stdio.h.
13602
bc06c745
ILT
136032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13604
13605 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13606 defined.
13607
75aea3d0
ILT
136082009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13609
13610 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13611 Change read_shndx type to unsigned int.
13612 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13613 int.
13614 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13615 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13616 Change read_shndx type to unsigned int.
13617 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13618 int.
13619 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13620 * layout.cc (Layout::create_symtab_sections): Cast the result of
13621 local_symcount * symsize to off_t in the gold_assert.
13622
be8fcb75
ILT
136232009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13624
13625 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13626 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13627 R_ARM_BASE_ABS.
13628 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13629 (Arm_relocate_functions::thm_abs5): New function.
13630 (Arm_relocate_functions::abs12): New function.
13631 (Arm_relocate_functions::abs16): New function.
13632 (Arm_relocate_functions::base_abs): New function.
13633 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13634 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13635 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13636 R_ARM_BASE_ABS.
13637 (Scan::global): Likewise.
13638 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13639 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13640 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13641 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13642 R_ARM_BASE_ABS.
13643
c2a122b6
ILT
136442009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13645
13646 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13647 (Arm_relocate_functions::movt_prel): New function.
13648 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13649 (Arm_relocate_functions::thm_movt_prel): New function.
13650 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13651 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13652 (Scan::global, Relocate::relocate): Likewise.
13653 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13654
c4aa1e2d
ILT
136552009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13656
13657 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13658 Incremental_checker.
13659 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13660 unsigned int.
13661 (class Incremental_inputs_header): New class.
13662 (Incremental_inputs_header_writer): Edit comment.
13663 (Incremental_inputs_entry): New class.
13664 (Incremental_inputs_entry_writer): Edit comment.
13665 (Sized_incremental_binary::do_find_incremental_inputs_section):
13666 Add *strtab_shndx parameter, fill it.
13667 (Sized_incremental_binary::do_check_inputs): New method.
13668 (Incremental_checker::can_incrementally_link_output_file): Use
13669 Sized_incremental_binary::check_inputs.
13670 (Incremental_inputs::report_command_line): Save command line in
13671 command_line_.
13672 * incremental.h:
13673 (Incremental_binary::find_incremental_inputs_section): New
13674 method.
13675 (Incremental_binary::do_find_incremental_inputs_section): Add
13676 strtab_shndx parameter.
13677 (Incremental_binary::do_check_inputs): New pure virtual method.
13678 (Sized_incremental_binary::do_check_inputs): Declare.
13679 (Incremental_checker::Incremental_checker): Add incremental_inputs
13680 parameter, use it to initialize incremental_inputs_.
13681 (Incremental_checker::incremental_inputs_): New field.
13682 (Incremental_checker::command_line): New method.
13683 (Incremental_checker::inputs): New method.
13684 (Incremental_checker::command_line_): New field.
13685
c549a694
ILT
136862009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13687
13688 * incremental.cc: Include <cstdarg> and "target-select.h".
13689 (vexplain_no_incremental): New function.
13690 (explain_no_incremental): New function.
13691 (Incremental_binary::error): New method.
13692 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13693 method.
13694 (make_sized_incremental_binary): New function.
13695 (open_incremental_binary): New function.
13696 (can_incrementally_link_file): Add checks if output is ELF and has
13697 inputs section.
13698 * incremental.h: Include "elfcpp_file.h" and "output.h".
13699 (Incremental_binary): New class.
13700 (Sized_incremental_binary): New class.
13701 (open_incremental_binary): Declare.
13702 * object.cc (is_elf_object): Use
13703 elfcpp::Elf_recognizer::is_elf_file.
13704 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13705 * output.h (Output_file::filesize): New method.
13706
fd3c5f0b
ILT
137072009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13708
13709 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13710 New function.
13711 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13712 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13713 function.
13714 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13715 function.
13716 (Arm_relocate_functions::movw_abs_nc): New function.
13717 (Arm_relocate_functions::movt_abs): New function.
13718 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13719 (Arm_relocate_functions::thm_movt_abs): New function.
13720 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13721 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13722 (Scan::global): Likewise.
13723 (Relocate::relocate): Likewise.
13724 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13725
7f5309a5
ILT
137262009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13727
13728 * arm.cc (Arm_relocate_functions::got_prel) New function.
13729 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13730 (Relocate::relocate): Likewise.
13731 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13732
364c7fa5
ILT
137332009-10-06 Ian Lance Taylor <iant@google.com>
13734
13735 * options.h (class General_options): Define
13736 split_stack_adjust_size parameter.
13737 * object.h (class Object): Add uses_split_stack_ and
13738 has_no_split_stack_ fields. Add uses_split_stack and
13739 has_no_split_stack accessor functions. Declare
13740 handle_split_stack_section.
13741 (class Reloc_symbol_changes): Define.
13742 (class Sized_relobj): Define Function_offsets. Declare
13743 split_stack_adjust, split_stack_adjust_reltype, and
13744 find_functions.
13745 * object.cc (Object::handle_split_stack_section): New function.
13746 (Sized_relobj::do_layout): Call handle_split_stack_section.
13747 * dynobj.cc (Sized_dynobj::do_layout): Call
13748 handle_split_stack_section.
13749 * reloc.cc (Sized_relobj::relocate_sections): Call
13750 split_stack_adjust for executable sections in split_stack
13751 objects. Pass reloc_map to relocate_section.
13752 (Sized_relobj::split_stack_adjust): New function.
13753 (Sized_relobj::split_stack_adjust_reltype): New function.
13754 (Sized_relobj::find_functions): New function.
13755 * target-reloc.h: Include "object.h".
13756 (relocate_section): Add reloc_symbol_changes parameter. Change
13757 all callers.
13758 * target.h (class Target): Add calls_non_split method. Declare
13759 do_calls_non_split virtual method. Declare match_view and
13760 set_view_to_nop.
13761 * target.cc: Include "elfcpp.h".
13762 (Target::do_calls_non_split): New function.
13763 (Target::match_view): New function.
13764 (Target::set_view_to_nop): New function.
13765 * gold.cc (queue_middle_tasks): Give an error if mixing
13766 split-stack and non-split-stack objects with -r.
13767 * i386.cc (Target_i386::relocate_section): Add
13768 reloc_symbol_changes parameter.
13769 (Target_i386::do_calls_non_split): New function.
13770 * x86_64.cc (Target_x86_64::relocate_section): Add
13771 reloc_symbol_changes parameter.
13772 (Target_x86_64::do_calls_non_split): New function.
13773 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13774 parameter.
13775 * powerpc.cc (Target_powerpc::relocate_section): Add
13776 reloc_symbol_changes parameter.
13777 * sparc.cc (Target_sparc::relocate_section): Add
13778 reloc_symbol_changes parameter.
13779 * configure.ac: Call AM_CONDITIONAL for the default target.
13780 * configure: Rebuild.
13781 * testsuite/Makefile.am (TEST_AS): New variable.
13782 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13783 (check_DATA): Add split_i386 and split_x86_64 files.
13784 (SPLIT_DEFSYMS): Define.
13785 (split_i386_[1234n].o): New targets.
13786 (split_i386_[124]): New targets.
13787 (split_i386_[1234r].stdout): New targets.
13788 (split_x86_64_[1234n].o): New targets.
13789 (split_x86_64_[124]): New targets.
13790 (split_x86_64_[1234r].stdout): New targets.
13791 (MOSTLYCLEANFILES): Add new executables.
13792 * testsuite/split_i386.sh: New file.
13793 * testsuite/split_x86_64.sh: New file.
13794 * testsuite/split_i386_1.s: New file.
13795 * testsuite/split_i386_2.s: New file.
13796 * testsuite/split_i386_3.s: New file.
13797 * testsuite/split_i386_4.s: New file.
13798 * testsuite/split_i386_n.s: New file.
13799 * testsuite/split_x86_64_1.s: New file.
13800 * testsuite/split_x86_64_2.s: New file.
13801 * testsuite/split_x86_64_3.s: New file.
13802 * testsuite/split_x86_64_4.s: New file.
13803 * testsuite/split_x86_64_n.s: New file.
13804 * testsuite/testfile.cc (Target_test): Update relocation_section
13805 function.
13806 * testsuite/Makefile.in: Rebuild.
13807
e8a9fcda
ILT
138082009-10-06 Ian Lance Taylor <iant@google.com>
13809
13810 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13811 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13812 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13813 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13814 the address on ldo_addrs_.
13815 (Target_i386::Relocate::fix_up_ldo): New function.
13816
e99daf92
ILT
138172009-10-06 Rafael Espindola <espindola@google.com>
13818
13819 * plugin.cc (add_input_library): New.
13820 (Plugin::load): Add add_input_library to tv.
13821 (Plugin_manager::add_input_file): Add the is_lib argument.
13822 (add_input_file): Update call to Plugin_manager::add_input_file.
13823 (add_input_library): New.
13824 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13825
966d4097
DK
138262009-09-30 Doug Kwan <dougkwan@google.com>
13827
13828 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13829 symbol and call Symbol::may_need_copy_reloc to determine if
13830 a copy reloc is needed.
13831 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13832 nocopyreloc is given in command line.
13833 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13834 given in command line.
13835 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13836 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13837 of the removed Target_i386::may_need_copy_reloc.
13838 * options.h (copyreloc): New option with default value false.
13839 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13840 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13841 instead of the removed Target_powerpc::may_need_copy_reloc.
13842 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13843 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13844 instead of the removed Target_sparc::may_need_copy_reloc.
13845 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13846 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13847 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13848 instead of the removed Target_x86_64::may_need_copy_reloc.
13849
029ba973
ILT
138502009-09-30 Ian Lance Taylor <iant@google.com>
13851
13852 * object.h (class Object): Remove target_ field, and target,
13853 sized_target, and set_target methods.
13854 (Object::sized_target): Remove.
13855 (class Sized_relobj): Update declarations. Remove sized_target.
13856 * object.cc (Sized_relobj::setup): Remove target parameter.
13857 Change all callers.
13858 (Input_objects::add_object): Don't do anything with the target.
13859 (make_elf_sized_object): Add punconfigured parameter. Change all
13860 callers. Set or test parameter target.
13861 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13862 Change all callers.
13863 * parameters.cc (Parameters::set_target): Change parameter type to
13864 be non-const.
13865 (Parameters::default_target): Remove.
13866 (set_parameters_target): Change parameter type to be non-const.
13867 (parameters_force_valid_target): New function.
13868 (parameters_clear_target): New function.
13869 * parameters.h (class Parameters): Update declarations. Remove
13870 default_target method. Add sized_target and clear_target
13871 methods. Change target_ to be non-const.
13872 (set_parameters_target): Update declaration.
13873 (parameters_force_valid_target): Declare.
13874 (parameters_clear_target): Declare.
13875 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13876 as NULL if we aren't searching.
13877 (Add_symbols::run): Don't check for compatible target.
13878 * fileread.cc (Input_file::open_binary): Call
13879 parameters_force_valid_target.
13880 * gold.cc (queue_middle_tasks): Likewise.
13881 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13882 set_target on object.
13883 * dynobj.h (class Sized_dynobj): Update declarations.
13884 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13885 make_elf_object returns NULL.
13886 (Archive::include_member): Don't check whether object target is
13887 compatible.
13888 * output.cc (Output_section::add_input_section): Get target from
13889 parameters.
13890 (Output_section::relax_input_section): Likewise.
13891 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13892 parameters.
13893 (Sized_relobj::do_scan_relocs): Likewise.
13894 (Sized_relobj::relocate_sections): Likewise.
13895 * resolve.cc (Symbol_table::resolve): Likewise.
13896 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13897 parameter. Change all callers.
13898 (Symbol_table::add_from_object): Get target from parameters.
13899 (Symbol_table::add_from_relobj): Don't check object target.
13900 (Symbol_table::add_from_dynobj): Likewise.
13901 (Symbol_table::define_special_symbol): Get target from
13902 parameters.
13903 * symtab.h (class Symbol_table): Update declaration.
13904 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13905 parameter. Change all callers. Clear parameter target.
13906 (Binary_test): Test target here.
13907 * testsuite/object_unittest.cc (gold_testsuite): Remove
13908 target_test_pointer parameter. Change all callers.
13909 (Object_test): Test target here.
13910
a6a22b83
ILT
139112009-09-26 Ian Lance Taylor <iant@google.com>
13912
13913 * testsuite/initpri1.c: Don't try to use constructor priorities if
13914 compiling with gcc before 4.3.
13915
6a8f49fe
ILT
139162009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13917
13918 * testsuite/retain_symbols_file_test.sh (check_present): Change
13919 output file name to retain_symbols_file_test.stdout.
13920 (check_absent): Likewise.
13921
8c604651
CS
139222009-09-18 Craig Silverstein <csilvers@google.com>
13923
13924 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13925 * options.cc: Include <cerrno> and <fstream>.
13926 (General_options::finalize): Parse -retain-symbols-file tag.
13927 * options.h: New flag.
13928 (General_options): New method should_retain_symbol, new
13929 variable symbols_to_retain.
13930 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13931 should_retain_symbol map.
13932 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13933 * testsuite/Makefile.in: Regenerate.
13934 * testsuite/retain_symbols_file_test.sh: New file.
13935
ca58b19f
NC
139362009-09-18 Nick Clifton <nickc@redhat.com>
13937
13938 * po/es.po: Updated Spanish translation.
13939
20e6d0d6
DK
139402009-09-17 Doug Kwan <dougkwan@google.com>
13941
13942 * debug.h (DEBUG_RELAXATION): New constant.
13943 (DEBUG_ALL): Add DEBUG_RELAXATION.
13944 (debug_string_to_enum): Add relaxation debug option.
13945 * layout.cc
13946 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13947 Layout::Relaxation_debug_check::read_sections,
13948 Layout::Relaxation_debug_check::read_sections): New method definitions.
13949 (Layout::Layout): Initialize data members
13950 record_output_section_data_from_scrips_,
13951 script_output_section_data_list_ and relaxation_debug_check_.
13952 (Layout::save_segments, Layout::restore_segments,
13953 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13954 Layout::relaxation_loop_body): New method definitions.
13955 (Layout::finalize): Support relaxation. Move section layout code to
13956 Layout::relaxation_loop_body.
13957 (Layout::set_asection_address_from_script): Move code for orphan
13958 section placement out.
13959 (Layout::place_orphan_sections_in_script): New method definition.
13960 * layout.h (Output_segment_headers, Output_file_header):
13961 New forward class declarations.
13962 (Layout::~Layout): Define.
13963 (Layout::new_output_section_data_from_script): New method definition.
13964 (Layout::place_orphan_sections_in_script): New method declaration.
13965 (Layout::Segment_states): New type declaration.
13966 (Layout::save_segments, Layout::restore_segments,
13967 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13968 Layout::relaxation_loop_body): New method declarations.
13969 (Layout::Output_section_data_list): New type declaration.
13970 (Layout::Relaxation_debug_check): New class definition.
13971 (Layout::record_output_section_data_from_script_,
13972 Layout::script_output_section_data_list_, Layout::segment_states_,
13973 Layout::relaxation_debug_check_): New data members.
13974 * output.cc: (Output_section_headers::do_size): New method definition.
13975 (Output_section_headers::Output_section_headers): Move size
13976 computation to Output_section_headers::do_size.
13977 (Output_segment_headers::do_size): New method definition.
e1df38aa 13978 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13979 Output_file_header::do_size and call it.
13980 (Output_file_header::do_size): New method definition.
13981 (Output_data_group::Output_data_group): Adjust call to
13982 Output_section_data.
13983 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13984 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13985 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13986 RELAXED_INPUT_SECTION_CODE.
13987 (Output_section::Output_section): Initialize data member checkpoint_.
13988 (Output_section::~Output_section): Delete checkpoint object pointed
13989 by checkpoint_.
13990 (Output_section::add_input_section): Always add an Input_section if
13991 relaxing.
13992 (Output_section::add_merge_input_section): Add assert.
13993 (Output_section::relax_input_section): New method definition.
13994 (Output_section::set_final_data_size): Set load address to zero for
13995 an unallocated section.
13996 (Output_section::do_address_and_file_offset_have_reset_values):
13997 New method definition.
13998 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13999 Handle relaxed input section.
14000 (Output_section::sort_attached_input_sections): Checkpoint input
14001 section list lazily.
14002 (Output_section::get_input_sections): Change type of input_sections to
14003 list of Simple_input_section pointers. Checkpoint input section list
14004 lazily. Also handle relaxed input sections.
14005 (Output_section::add_input_section_for_script): Take a reference to
14006 a Simple_input_section object instead of Relobj pointer and section
14007 index as parameter. Handle relaxed input sections.
14008 (Output_section::save_states, Output_section::restore_states): New
14009 method definitions.
14010 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14011 (Output_data::is_data_size_fixed): New method definition.
14012 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14013 if it is fixed.
14014 (Output_data::address_and_file_offset_have_reset_values): New method
14015 definition.
14016 (Output_data::do_address_and_file_offset_have_reset_values): New method
14017 definition.
14018 (Output_data::set_data_size): Check that data size is not fixed.
14019 (Output_data::fix_data_size): New method definition.
14020 (Output_data::is_data_size_fixed_): New data member.
14021 (Output_section_headers::set_final_data_size): New method definition.
14022 (Output_section_headers::do_size): New method declaration.
14023 (Output_segment_headers::set_final_data_size): New method definition.
14024 (Output_segment_headers::do_size): New method declaration.
14025 (Output_file_header::set_final_data_size)::New method definition.
14026 (Output_file_header::do_size)::New method declaration.
14027 (Output_section_data::Output_section_data): Add new parameter
14028 is_data_size_fixed and use it to fix data size.
14029 (Output_data_const::Output_data_const): Adjust call to base class
14030 constructor and fix data size.
14031 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14032 base class constructor and fix data size.
14033 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14034 base class constructor and fix data size.
14035 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14036 class constructor and fix data size.
14037 (Output_data_group::set_final_data_size): New method definition.
14038 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14039 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14040 class constructor and fix data size.
14041 (Output_relaxed_input_section): New class definition.
14042 (Output_section::Simple_input_section): New class definition.
14043 (Output_section::get_input_sections): Adjust parameter list.
14044 (Output_section::add_input_section_for_script): Same.
14045 (Output_section::save_states, Output_section::restore_states,
14046 Output_section::do_address_and_file_offset_have_reset_values,
14047 (Output_section::Input_section::Input_section): Handle
14048 RELAXED_INPUT_SECTION_CODE. Add new overload for
14049 Output_relaxed_input_section.
14050 (Output_section::Input_section::is_input_section,
14051 Output_section::Input_section::set_output_section): Handle relaxed
14052 input section.
14053 (Output_section::Input_section::is_relaxed_input_section,
14054 Output_section::Input_section::output_section_data,
14055 Output_section::Input_section::relaxed_input_section): New method
14056 definitions.
14057 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14058 value.
14059 (Output_section::Input_section::u1_): Update comments.
14060 (Output_section::Input_section::u2_): Add new union member poris.
14061 (Output_section::Checkpoint_output_section): New classs definition.
14062 (Output_section::relax_input_section): New method declaration.
14063 (Output_section::checkpoint_): New data member.
14064 (Output_segment): Update comments.
14065 (Output_segment::Output_segment): Un-privatize copy constructor.
14066 (Output_segment::operator=): Un-privatize.
14067 * script-sections.cc (Output_section_element::Input_section_list):
14068 Change element type to Output_section::Simple_input_section.
14069 (Output_section_element_dot_assignment::set_section_addresses):
14070 Register output section data for relaxation clean up.
14071 (Output_data_exression::Output_data_expression): Adjust call to base
14072 constructor to fix data size.
14073 (Output_section_element_data::set_section_addresses): Register
14074 Output_data_expression object for relaxation clean up.
14075 (struct Input_section_info): Replace Relobj pointer and section index
14076 pair with Output_section::Simple_input_section and Convert struct to a
14077 class.
14078 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14079 Input_section_info data member to use accessors.
20e6d0d6
DK
14080 (Output_section_element_input::set_section_addresses): Use layout
14081 parameter. Adjust code to use Output_section::Simple_input_section
14082 and Input_secction_info classes. Register filler for relaxation
14083 clean up.
14084 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14085 and section index pair with Output_section::Simple_input_section
14086 class. Adjust code accordingly.
14087 (Phdrs_element::release_segment): New method definition.
14088 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14089 segment list.
14090 (Script_sections::release_segments): New method definition.
14091 * gold/script-sections.h (Script_sections::release_segments): New
14092 method declaration.
14093 * gold/target.h (Target::may_relax, Target::relax,
14094 Target::do_may_relax, Target::do_relax): New method definitions.
14095
5e445df6
ILT
140962009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14097
14098 * arm.cc (has_signed_unsigned_overflow): New function.
14099 (Arm_relocate_functions::abs8): New function.
14100 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14101 (Target_arm::Scan::global): Likewise.
14102 (Target_arm::relocate::relocate): Likewise.
14103 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14104 Likewise.
14105
8c604651 141062009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14107
14108 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14109 * testsuite/Makefile.in: Regenerate.
14110
1e9cc1c2
NC
141112009-09-11 Nick Clifton <nickc@redhat.com>
14112
14113 * po/gold.pot: Updated by the Translation project.
14114
6a89f575
CC
141152009-09-08 Cary Coutant <ccoutant@google.com>
14116
14117 * output.cc (Output_file::open): Add execute permission to empty file.
14118 * testsuite/Makefile.am (permission_test): New test.
14119 * testsuite/Makefile.in: Regenerate.
14120
fdcac5af
ILT
141212009-09-02 Ian Lance Taylor <iant@google.com>
14122
14123 * output.cc (Output_file::resize): Call map_no_anonymous rather
14124 than map.
14125
44453f85
ILT
141262009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14127
14128 * gold.cc: Include "incremental.h".
14129 (queue_initial_tasks): Call Incremental_checker methods.
14130 * incremental.cc: Include "output.h".
14131 (Incremental_checker::can_incrementally_link_output_file): New
14132 method.
14133 * incremental.h (Incremental_checker): New class.
14134
14135 * output.cc (Output_file::open_for_modification): New method.
14136 (Output_file::map_anonymous): Changed return type to bool. Record
14137 map in base_ field.
14138 (Output_file::map_no_anonymous): New method, broken out of map.
14139 (Output_file::map): Use map_no_anonymous and map_anonymous.
14140 * output.h (class Output_file): Update declarations.
14141
293c1386
CC
141422009-08-24 Cary Coutant <ccoutant@google.com>
14143
14144 * options.h (Command_line::Pre_options): New class.
14145 (Command_line::pre_options): New member.
14146 * options.cc (gold::options::ready_to_register): New variable.
14147 (One_option::register_option): Do nothing if not registering options.
14148 Assert if same short option registered twice.
14149 (General_options::General_options): Turn off option registration when
14150 done constructing.
14151 (Command_line::Pre_options::Pre_options): New constructor.
14152
f773f3d2
CC
141532009-08-24 Cary Coutant <ccoutant@google.com>
14154
06a73cfe
CC
14155 * options.h (General_options::no_keep_memory): Remove incorrect
14156 short option.
f773f3d2 14157
a15af8e2
RW
141582009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14159
14160 * Makefile.am (am__skiplex, am__skipyacc): New.
14161 * Makefile.in: Regenerate.
14162
c462b41b
RW
141632009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14164
14ec8efd
RW
14165 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14166 (INCLUDES): ... this.
14167 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14168 (AM_CPPFLAGS): Renamed from ...
14169 (INCLUDE): ... this.
14170 * Makefile.in, testsuite/Makefile.in: Regenerate.
14171
81ecdfbb
RW
14172 * Makefile.in: Regenerate.
14173 * aclocal.m4: Likewise.
14174 * config.in: Likewise.
14175 * configure: Likewise.
14176 * testsuite/Makefile.in: Likewise.
14177
c462b41b
RW
14178 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14179 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14180 * Makefile.in: Regenerate.
14181 * testsuite/Makefile.in: Regenerate.
14182
2da73f13
CC
141832009-08-19 Cary Coutant <ccoutant@google.com>
14184
14185 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14186 symbols in shared libraries overridden by hidden or internal symbols
14187 in the main program.
14188
2db70501
CD
141892009-08-19 Chris Demetriou <cgd@google.com>
14190
14191 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14192 checking source file names in error messages.
14193
f733487b
DK
141942009-08-18 Doug Kwan <dougkwan@google.com>
14195
14196 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14197 an elcpp::Ehdr as parameter. Adjust call to set_target.
14198 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14199 an elfcpp::Ehdr as parameter.
14200 * object.cc (Object::set_target): Remove the version that looks up
14201 a target and sets it.
14202 (Sized_relobj::setup): Take a Target object instead of
14203 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14204 (make_elf_sized_object): Find target and ask target to
14205 make an ELF object.
14206 * object.h: (Object::set_target): Remove the version that looks up
14207 a target and sets it.
14208 (Sized_relobj::setup): Take a Target object instead of
14209 an elfcpp:Ehdr as parameter.
14210 * target.cc: Include dynobj.h.
14211 (Target::do_make_elf_object_implementation): New.
2e702c99 14212 (Target::do_make_elf_object): New.
f733487b
DK
14213 * target.h (Target::make_elf_object): New template declaration.
14214 (Target::do_make_elf_object): New method declarations.
14215 (Target::do_make_elf_object_implementation): New template declaration.
14216
cc70f101
ILT
142172009-08-14 Ian Lance Taylor <iant@google.com>
14218
14219 * gold.h (FUNCTION_NAME): Define.
14220 (gold_unreachable): Use FUNCTION_NAME.
14221
ef5e0cb1
ST
142222009-08-12 Sriraman Tallam <tmsriram@google.com>
14223
14224 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14225 symbol in the --keep-unique list is not found.
14226
48c187ce
ST
142272009-08-12 Sriraman Tallam <tmsriram@google.com>
14228
14229 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14230 been maked as --keep-unique.
14231 (Icf::unfold_section): New function.
14232 * icf.h (Icf::unfold_section): New function.
14233 * options.h (General_options::keep_unique): New option.
14234 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14235 * testsuite/Makefile.in: Regenerate.
14236 * testsuite/icf_keep_unique_test.sh: New file.
14237 * testsuite/icf_keep_unique_test.cc: New file.
14238
645afe0c
CC
142392009-08-12 Cary Coutant <ccoutant@google.com>
14240
14241 PR 10471
14242 * resolve.cc (Symbol_table::resolve): Check for references from
14243 dynamic objects to hidden and internal symbols.
14244 * testsuite/Makefile.am (hidden_test.sh): New test.
14245 * testsuite/Makefile.in: Regenerate.
14246 * testsuite/hidden_test.sh: New script.
14247 * testsuite/hidden_test_1.c: New test source.
14248 * testsuite/hidden_test_main.c: New test source.
14249
11af873f
DK
142502009-08-11 Doug Kwan <dougkwan@google.com>
14251
14252 * arm.cc: Update comments.
14253 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14254 segment to locate the .ARM.exidx section if present.
14255
b9f7d72d
DK
142562009-08-09 Doug Kwan <dougkwan@google.com>
14257
14258 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14259 patch.
14260
ddd3c53c
ST
142612009-08-07 Sriraman Tallam <tmsriram@google.com>
14262 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14263 compiler warnings.
14264
27721062
ST
142652009-08-06 Sriraman Tallam <tmsriram@google.com>
14266
14267 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14268 valid tls_segment only for non-debug-section relocations.
14269 * testsuite/Makefile.am: Add gc_tls_test.
14270 * testsuite/Makefile.in: Regenerate.
14271 * testsuite/gc_tls_test.cc: New file.
14272 * testsuite/gc_tls_test.sh: New file.
14273
ef15dade 142742009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14275
ef15dade
ST
14276 * icf.cc: New file.
14277 * icf.h: New file.
14278 * Makefile.am (CCFILES): Add icf.cc.
14279 (HFILES): Add icf.h
14280 * Makefile.in: Regenerate.
14281 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14282 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14283 section, symbol and addend information for the relocs.
14284 * gold.cc (queue_middle_tasks): Call identical code folding.
14285 * gold.h: Add defines for multimap.
14286 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14287 to the call of finalize_local_symbols.
14288 * main.cc (main): Create object of class Icf.
14289 * object.cc (Sized_relobj::do_layout): Allow this function to be
14290 called twice during icf.
14291 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14292 to sections marked as identical by icf.
14293 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14294 when available.
14295 (Sized_relobj::do_section_entsize): New function.
14296 * object.h (Object::section_entsize): New function.
14297 (Object::do_section_entsize): New pure virtual function.
14298 (Relobj::finalize_local_symbols): Add new parameter.
14299 (Relobj::do_section_entsize): New function.
14300 * options.h (General_options::icf): New option.
14301 (General_options::icf_iterations): New option.
14302 (General_options::print_icf_sections): New option.
14303 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14304 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14305 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14306 icf.
14307 * symtab.cc (Symbol_table::is_section_folded): New function.
14308 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14309 to sections marked as identical by icf.
14310 * symtab.h (Symbol_table::set_icf): New function.
14311 (Symbol_table::icf): New function.
14312 (Symbol_table::is_section_folded): New function.
14313 (Symbol_table::icf_): New data member.
14314 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14315 * testsuite/Makefile.am: Add commands to build icf_test.
14316 * testsuite/Makefile.in: Regenerate.
14317 * testsuite/icf_test.sh: New file.
14318 * testsuite/icf_test.cc: New file.
14319
c3b65ac4
CD
143202009-07-24 Chris Demetriou <cgd@google.com>
14321
14322 * layout.cc (is_compressible_debug_section): Fix incorrect
14323 comment about compressed section names.
14324
1caf2c51
ILT
143252009-07-20 Ian Lance Taylor <ian@airs.com>
14326
14327 PR 10419
14328 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14329
1ef4d87f
ILT
143302009-07-16 Ian Lance Taylor <iant@google.com>
14331
14332 PR 10400
14333 * layout.h: #include <map>.
14334 (class Kept_section): Change from struct to class. Add accessors
14335 and setters. Add section size to Comdat_group mapping. Change
14336 Comdat_group to std::map. Add is_comdat_ field. Add
14337 linkonce_size field in union.
14338 (class Layout): Update declaration of find_or_add_kept_section.
14339 Don't declare find_kept_object.
14340 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14341 parameter. Add object, shndx, is_comdat, and is_group_name
14342 parameters. Change all callers. Adjust for new Kept_section.
14343 (Layout::find_kept_object): Remove.
14344 * object.cc (Sized_relobj::include_section_group): Update use of
14345 Kept_section. Rename secnum to shndx. Only record
14346 Kept_comdat_section if sections are the same size.
14347 (Sized_relobj::include_linkonce_section): Update use of
14348 Kept_section. Only record Kept_comdat_section if sections are the
14349 same size. Set size of linkonce section.
14350 (Sized_relobj::map_to_kept_section): Update call to
14351 get_kept_comdat_section.
14352 * object.h (class Sized_relobj): Rename fields in
14353 Kept_comdat_section to drop trailing underscores; change object
14354 field to Relobj*. Change Kept_comdat_section_table to store
14355 struct rather than pointer.
14356 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14357 Add kept_object and kept_shndx parameters. Change all callers.
14358 (Sized_relobj::get_kept_comdat_section): Change return type to
14359 bool. Add kept_object and kept_shndx parameters. Change all
14360 callers.
14361 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14362 Layout::find_or_add_kept_section.
14363
37c3b7b0
ILT
143642009-07-09 Ian Lance Taylor <iant@google.com>
14365
14366 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14367 Reserve space in the hash table.
14368
98fa85cb
ILT
143692009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14370
14371 * fileread.cc (File_read::get_mtime): New method.
14372 * fileread.h (Timespec): New structure.
14373 (File_read::get_mtime): New method.
14374 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14375 Renamed from timestamp_nsec.
14376 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14377 Elf_Xword.
e1df38aa 14378 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14379 timestamp_nsec.
e1df38aa 14380 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14381 (Incremental_inputs::report_obejct): Save mtime; style fix.
14382 (Incremental_inputs::report_script): Save mtime; style fix.
14383 (Incremental_inputs::finalize_inputs): Style fix.
14384 (Incremental_inputs::finalize): Style fix.
14385 (Incremental_inputs::create_input_section_data): Store inputs
14386 mtime.
14387 * incremental.h (Incremental_inputs::report_script): Add mtime
14388 argument.
14389 (Incremental_inputs::Input_info::Input_info): Intialize only one
14390 union member.
14391 (Incremental_inputs::Input_info::archive): Move to nameless
14392 union.
14393 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14394 (Incremental_inputs::Input_info::script): Move to nameless union.
14395 (Incremental_inputs::mtime): New field.
14396 * script.cc (read_input_script): Pass file mtime to
14397 Incremental_input.
14398 * script.h (Script_info::inputs): Style fix.
14399
c9d70757
ILT
144002009-07-01 Ian Lance Taylor <ian@airs.com>
14401
14402 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14403 instead of 32.
14404
9c547ec3
ILT
144052009-06-24 Ian Lance Taylor <iant@google.com>
14406
14407 PR 10156
14408 * layout.cc (Layout::choose_output_section): If we find an
14409 existing section, update the flags.
14410 (Layout::create_notes): New function, broken out of
14411 Layout::finalize.
14412 (Layout::finalize): Don't create note sections.
14413 (Layout::create_note): Don't crash if linker script discards
14414 section.
14415 (Layout::create_gold_note): Likewise.
14416 (Layout::create_build_id): Likewise. Don't set
14417 after_input_sections on the section.
14418 (Layout::create_executable_stack_info): Remove target parameter.
14419 Change caller.
14420 * layout.h (class Layout): Declare create_notes. Update
14421 declaration of create_executable_stack_info.
14422 * gold.cc (queue_middle_tasks): Call create_notes.
14423 * output.cc (Output_section::update_flags_for_input_section): Move
14424 here from output.h. If SHF_ALLOC flag is newly set, mark address
14425 invalid.
14426 * output.h (Output_data::mark_address_invalid): New function.
14427 (class Output_section): Only declare, not define,
14428 update_flags_for_input_section. Remove set_flags.
14429
55458500
ILT
144302009-06-24 Ian Lance Taylor <iant@google.com>
14431
14432 * script-sections.cc (Output_section_definition::
14433 set_section_addresses): Rename shadowing local load_address to
14434 laddr.
14435
1307d6cd
ILT
144362009-06-24 Ian Lance Taylor <iant@google.com>
14437
14438 PR 10244
14439 * reloc.cc (relocate_sections): Skip empty relocation sections.
14440
ec3f783e
ILT
144412009-06-23 Ian Lance Taylor <iant@google.com>
14442
14443 PR 10156
14444 * layout.cc (Layout::create_note): Use choose_output_section
14445 rather than make_output_section.
14446
459c9f1c
ILT
144472009-06-23 Ian Lance Taylor <iant@google.com>
14448
14449 PR 10237
14450 * options.cc (General_options::parse_V): Set printed_version_.
14451 (General_options::General_options): Initialize printed_version_.
14452 * options.h (class General_options): Add printed_version_ field.
14453 * gold.cc (queue_initial_tasks): If there are no input files,
14454 don't give a fatal error if we printed the version information.
14455 (queue_middle_tasks): If using -r with a shared object, give a
14456 fatal error rather than an ordinary error.
14457
1518dc8f
ILT
144582009-06-23 Ian Lance Taylor <iant@google.com>
14459
14460 PR 10219
14461 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14462 (Layout::make_output_section): Set have_stabstr_section_ if we see
14463 a .stab*str section.
14464 (Layout::finalize): Call link_stabs_sections.
14465 (Layout::link_stabs_sections): New file.
14466 * layout.h (class Layout): Add have_stabstr_section_ field.
14467 Declare link_stabs_sections.
14468
3d857b98
DK
144692009-06-23 Doug Kwan <dougkwan@google.com>
14470
14471 * Makefile.am (libgold_a_LIBADD): New.
14472 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14473 * Makefile.in: Regenerate.
3d857b98
DK
14474 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14475 * configure: Regenerate.
14476 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14477 * fileread.cc: Include sys/state.h
14478 * gold.h: Declare memmem and strndup if found missing.
14479 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14480
0639a6f6
ILT
144812009-06-23 Ian Lance Taylor <iant@google.com>
14482
14483 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14484 * configure: Rebuild.
14485
8d63875c
ILT
144862009-06-23 Ian Lance Taylor <iant@google.com>
14487
14488 PR 10147
14489 * object.cc (Object::section_contents): Don't try to get a view if
14490 the section has length zero.
14491 (Object::handle_gnu_warning_section): If the section is empty, use
14492 the name of the section as the warning.
14493
f7c8a183
ILT
144942009-06-23 Ian Lance Taylor <iant@google.com>
14495
14496 PR 10133
14497 * stringpool.h (class Stringpool_template): Add optimize_ field.
14498 (Stringpool_template::set_optimize): New function.
14499 * stringpool.cc (Stringpool_template::Stringpool_template):
14500 Initialize optimize_ field.
14501 (Stringpool_template::set_string_offsets): Test local optimize
14502 fild rather than parameter.
14503 * layout.cc (Layout::Layout): Call set_optimize on the section
14504 name stringpool.
14505
e6a307ba
ILT
145062009-06-22 Ian Lance Taylor <iant@google.com>
14507
14508 PR 10030
14509 * yyscript.y: Parse TARGET.
14510 * script.cc (script_set_target): New function.
14511 * script-c.h (script_set_target): Declare.
14512 * options.cc (General_options::string_to_object_format): Rename
14513 from string_to_object_format in anonymous namespace. Change
14514 callers.
14515 * options.h (class General_options): Declare
14516 string_to_object_format.
14517
3ee173de
ILT
145182009-06-22 Ian Lance Taylor <iant@google.com>
14519
14520 * script-sections.cc (Script_sections::create_segments): Don't put
14521 program headers in a PT_LOAD segment if -n or -N.
14522
145232009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14524
14525 PR 10141
14526 * options.h (class General_options): Add -z lazy and -z now. Sort
14527 -z options into alphabetical order.
14528 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14529
cd6739a1 145302009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14531
14532 * layout.cc (Layout::make_output_section): Call
14533 Target::new_output_section.
14534 (Layout::attach_allocated_section_to_segment): Put large section
14535 sections in a separate load segment with the large segment flag
14536 set.
14537 (Layout::segment_precedes): Sort large data segments after other
14538 load segments.
14539 (align_file_offset): New static function.
14540 (Layout::set_segment_offsets): Use align_file_offset.
14541 * output.h (class Output_section): Add is_small_section_ and
14542 is_large_section_ fields.
14543 (Output_section::is_small_section): New function.
14544 (Output_section::set_is_small_section): New function.
14545 (Output_section::is_large_section): New function.
14546 (Output_section::set_is_large_section): New function.
14547 (Output_section::is_large_data_section): New function.
14548 (class Output_segment): Add is_large_data_segment_ field.
14549 (Output_segment::is_large_data_segment): New function.
14550 (Output_segment::set_is_large_data_segment): New function.
14551 * output.cc (Output_section::Output_section): Initialize new
14552 fields.
14553 (Output_segment::Output_segment): Likewise.
14554 (Output_segment::add_output_section): Add assertion that large
14555 data sections always go in large data segments. Force small data
14556 sections to the end of the list of data sections. Force small BSS
14557 sections to the start of the list of BSS sections. For large BSS
14558 sections to the end of the list of BSS sections.
14559 * symtab.h (class Symbol): Declare is_common_shndx.
14560 (Symbol::is_defined): Check Symbol::is_common_shndx.
14561 (Symbol::is_common): Likewise.
14562 (class Symbol_table): Define enum Commons_section_type. Update
14563 declarations. Add small_commons_ and large_commons_ fields.
14564 * symtab.cc (Symbol::is_common_shndx): New function.
14565 (Symbol_table::Symbol_table): Initialize new fields.
14566 (Symbol_table::add_from_object): Put small and large common
14567 symbols in the right list.
14568 (Symbol_table::sized_finalized_symbol): Check
14569 Symbol::is_common_shndx.
14570 (Symbol_table::sized_write_globals): Likewise.
14571 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14572 common symbol lists. Don't call do_allocate_commons_list if the
14573 list is empty.
14574 (Symbol_table::do_allocate_commons_list): Remove is_tls
14575 parameter. Add comons_section_type parameter. Change all
14576 callers. Handle small and large common symbols.
14577 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14578 Symbol::is_common_shndx.
14579 * resolve.cc (symbol_to_bits): Likewise.
14580 * target.h (Target::small_common_shndx): New function.
14581 (Target::small_common_section_flags): New function.
14582 (Target::large_common_shndx): New function.
14583 (Target::large_common_section_flags): New function.
14584 (Target::new_output_section): New function.
14585 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14586 small_common_section_flags, and large_common_section_flags
14587 fields.
14588 (Target::do_new_output_section): New virtual function.
14589 * arm.cc (Target_arm::arm_info): Initialize new fields.
14590 * i386.cc (Target_i386::i386_info): Likewise.
14591 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14592 Likewise.
14593 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14594 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14595 (Target_x86_64::do_new_output_section): New function.
14596 * configure.ac: Define conditional MCMODEL_MEDIUM.
14597 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14598 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14599 (large_LDFLAGS): Define.
14600 * testsuite/large.c: New file.
14601 * testsuite/testfile.cc (Target_test::test_target_info):
14602 Initialize new fields.
14603 * configure, testsuite/Makefile.in: Rebuild.
14604
bb04269c
DK
146052009-06-05 Doug Kwan <dougkwan@google.com>
14606
14607 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14608 * Makefile.in: Regenerate.
bb04269c
DK
14609 * i386.cc (class Target_i386): Define new virtual method to
14610 override do_is_local_label_name in parent.
14611 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14612 local symbols if --discard-locals or -X is given.
14613 * options.h (class General_options): Declare new options
14614 '--discard-locals' and '-X' for discarding locals.
14615 * target.h (class Target): Define new methods is_local_label_name.
14616 Declare new virtual method do_is_local_label_name.
14617 * target.cc: New file.
14618 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14619 (check_SCRIPTS): Add discard_locals_test.sh.
14620 (check_DATA): Add discard_local_tests.syms.
14621 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14622 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14623 * testsuite/Makefile.in: Regenerate.
14624 * testsuite/discard_locals_test.c: New file.
14625 * testsuite/discard_locals_test.sh: Same.
14626
805bb01c
DK
146272009-06-05 Doug Kwan <dougkwan@google.com>
14628
14629 * object.cc (Sized_relobj::Sized_relobj): Initialize
14630 discarded_eh_frame_shndx_ to -1U.
14631 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14632 section.
14633 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14634 a discarded .eh_frame section.
14635 (Sized_relobj::do_finalize_local_symbols): Ditto.
14636 * object.h (class Sized_relobj): Declare new member
14637 discarded_eh_frame_shndx_.
14638 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14639 (local_labels_test.o, local_labels_test): New rules.
14640 * testsuite/Makefile.in: Regenerate.
14641
1dcd334d
DK
146422009-06-04 Doug Kwan <dougkwan@google.com>
14643
14644 * layout.cc (Layout::section_name_mapping): Add mapping for
14645 special ARM sections.
14646
96d49306
DK
146472009-06-03 Doug Kwan <dougkwan@google.com>
14648
14649 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14650 (utils::has_overflow): Same.
14651
dff16297
ILT
146522009-06-03 Ian Lance Taylor <iant@google.com>
14653
14654 * layout.cc (Layout::section_name_mapping): New array, replacing
14655 Layout::linkonce_mapping.
14656 (Layout::section_name_mapping_count): New variable, replacing
14657 Layout::linkonce_mapping_count.
14658 (Layout::linkonce_output_name): Remove.
14659 (Layout::output_section_name): Rewrite.
14660 * layout.h (class Layout): Rename Linkonce_mapping to
14661 Section_name_mapping, linkonce_mapping to section_name_mapping,
14662 linkonce_mapping_count to section_name_mapping_count. Don't
14663 declare linkonce_output_name.
14664
c121c671
DK
146652009-06-03 Doug Kwan <dougkwan@google.com>
14666
14667 * gold/arm.cc (namespace utils): New.
14668 (Target_arm::reloc_is_non_pic): Define new method.
14669 (class Arm_relocate_functions): New.
14670 (Target_arm::Relocate::relocate): Handle relocation types used by
14671 Android.
14672
07800fab
ILT
146732009-06-03 Ian Lance Taylor <iant@google.com>
14674
14675 * arm.cc (Target_arm::scan::global): Use || instead of |.
14676
c121c671
DK
146772009-06-02 Doug Kwan <dougkwan@google.com>
14678
14679 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14680 issued_non_pic_error_.
14681 (class Target_arm::Scan): Declare new method check_non_pic.
14682 Define new method symbol_needs_plt_entry.
14683 Declare new data member issued_non_pic_error_.
14684 (class Target_arm::Relocate): Declare new method
14685 should_apply_static_reloc.
14686 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14687 (Target_arm::Scan::check_non_pic): Define new method.
14688 (Target_arm::Scan::local): Handle a small subset of reloc types used
14689 by Android.
14690 (Target_arm::Scan::local): Same.
14691 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14692
b19b0c6d
ILT
146932009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14694
14695 * incremental.cc (Incremental_inputs::report_command_line): Filter
14696 out --incremental-* options.
14697
94cdfcff
DK
146982009-05-29 Doug Kwan <dougkwan@google.com>
14699
14700 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14701 template class.
14702 (class Target_arm): Update comment.
14703 (Target_arm::Target_arm): Initialize new data members GOT_,
14704 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14705 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14706 and Target_arm::rel_dyn_section.
14707 Declare new_enum Target_arm::Got_type.
14708 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14709 and DYNBSS_.
14710 Update commments for member do_dynsym_value.
14711 (Target_arm::got_size, Target_arm::plt_section,
14712 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14713 new methods inside class defintion.
14714 (Target_arm::got_section): Define new method.
14715 (Target_arm::rel_dyn_section): Same.
14716 (Output_data_plt_arm): New template class.
14717 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14718 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14719 (Output_data_plt_arm::add_entry): Same.
14720 (Output_data_plt_arm::first_plt_entry): Define new
14721 static data member for PLT instruction template.
14722 (Output_data_plt_arm::plt_entry): Same.
14723 (Output_data_plt_arm::do_write): Define new method.
14724 (Target_arm::make_plt_entry): Same.
14725 (Target_arm::do_finalize_sections): Same.
14726 (Target_arm::do_dynsym_value): Same.
14727
4a657b0d
DK
147282009-05-28 Doug Kwan <dougkwan@google.com>
14729
14730 * Makefile.am (TARGETSOURCES): Add arm.cc.
14731 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14732 * Makefile.in: Regenerate.
14733 * arm.cc: New file.
14734 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14735
e7ae8c36
DK
147362009-05-26 Doug Kwan <dougkwan@google.com>
14737
14738 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14739 (General_options::check_excluded_libs): Strip off directories in
14740 archive name before matching like GNU ld does.
14741 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14742 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14743 (exclude_libs_test_LDFLAGS): Add linker option
14744 -Wl,--exclude-libs,libexclude_libs_test_3
14745 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14746 an explicit archive without using -l.
14747 (alt/libexclude_libs_test_3.a): New make rule.
14748 * testsuite/Makefile.in: Regenerate.
14749 * testsuite/exclude_libs_test.c : Declare lib3_default().
14750 (main): Call it.
14751 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14752 * exclude_libs_test_3.c: New file.
14753
f12e7348
NC
147542009-05-26 Nick Clifton <nickc@redhat.com>
14755
14756 * po/id.po: New Indonesian translation.
14757 * po/gold.pot: Updated template file.
14758
4daadc0d
ST
147592009-05-22 Sriraman Tallam <tmsriram@google.com>
14760
e1df38aa 14761 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14762 gc_comdat_test files. Add -Wl,--gc-sections to build
14763 gc_comdat_test.
14764 * testsuite/Makefile.in: Regenerate.
14765 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14766
531813ad
ST
147672009-05-21 Sriraman Tallam <tmsriram@google.com>
14768
14769 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14770 kept comdat section was garbage collected.
14771 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14772 * testsuite/Makefile.in: Regenerate.
14773 * testsuite/gc_comdat_test.sh: New file.
14774 * testsuite/gc_comdat_test_1.cc: New file.
14775 * testsuite/gc_comdat_test_2.cc: New file.
14776
65514900
CC
147772009-05-19 Doug Kwan <dougkwan@google.com>
14778
14779 * archive.cc (Archive::Archive): Move constructor from archive.h
14780 to here. Initialize no_export_.
14781 (Archive::get_elf_object_for_member): Set no_export flag of object.
14782 * archive.h (Archive::Archive): Move constructor body to
14783 archive.cc.
14784 (Archive::no_export): New method.
14785 (Archive::no_export_): New field.
14786 * object.h (Object::Object): Initialize no_export_ to false.
14787 (Object::no_export, Object::set_no_export): New methods.
14788 (Object::no_export_): New field.
14789 * options.cc (General_options::parse_exclude_libs): New method.
14790 (General_options::check_excluded_libs) Same.
14791 * options.h (exclude_libs): New option.
14792 (General_options::check_excluded_libs): New method declaration.
14793 (General_options::excluded_libs_): New field.
14794 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14795 default or protected visibility if an object has no-export flag set.
14796 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14797 (check_SCRIPTS): Add exclude_libs_test.sh.
14798 (check_DATA): Add exclude_libs_test.syms.
14799 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14800 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14801 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14802 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14803 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14804 libexclude_libs_test_2.a): New rules.
14805 * testsuite/Makefile.in: Regenerate.
14806 * testsuite/exclude_libs_test.c: New file.
14807 * testsuite/exclude_libs_test.sh: Ditto.
14808 * testsuite/exclude_libs_test_1.c: Ditto.
14809 * testsuite/exclude_libs_test_2.c: Ditto.
14810
1b77ea50
ILT
148112009-05-15 Ian Lance Taylor <iant@google.com>
14812
14813 * configure.ac: Check for declarations for cases where libiberty.h
14814 checks HAVE_DECL_xxx.
14815 * configure, config.in: Rebuild.
14816
072fe7ce
ILT
148172009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14818
14819 * gold.h (Incremental_argument_list): Remove (invalid) forward
14820 declaration.
14821 * incremental.cc (Incremental_inputs::report_achive): New method.
14822 (Incremental_inputs::report_object): New method.
14823 (Incremental_inputs::report_script): New method.
14824 (Incremental_inputs::finalize_inputs): New method.
14825 (Incremental_inputs::finalize): Call finalize_inputs().
14826 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14827 Create inputs entries.
14828 * incremental.h (Incremental_input_type): New enum.
14829 (Incremental_inputs::Incremental_input): Initialize new fields.
14830 (Incremental_inputs::report_inputs): New method.
14831 (Incremental_inputs::report_achive): New method.
14832 (Incremental_inputs::report_object): New method.
14833 (Incremental_inputs::report_script): New method.
14834 (Incremental_inputs::finalize_inputs): New method.
14835 (Incremental_inputs::Input_info): New struct.
14836 (Incremental_inputs::Input_info_map): New typedef.
14837 (Incremental_inputs::lock_): New field.
14838 (Incremental_inputs::Inputs_): New field.
14839 (Incremental_inputs::Inputs_map): New field.
14840 * main.cc (main): Call Incremental_input::report_inputs.
14841 * options.h (Input_argument_list): Typedef moved from
14842 Input_arguments.
14843 (Input_file_group::Files): Remove, use ::Input_argument_list.
14844 (Input_file_group::Input_argument_list): Remove, use
14845 ::Input_argument_list.
14846 * plugin.cc (Plugin_manager::add_input_file): Add error in
14847 incremental build.
14848 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14849 functions.
14850 * script.cc (read_input_script): Call
14851 Incremental_input::report_script.
14852 * script.h (Script_info): New class.
14853
b0481b0b
ILT
148542009-04-27 Ian Lance Taylor <iant@google.com>
14855
14856 * x86_64.cc (do_adjust_output_section): Set entsize to
14857 plt_entry_size.
14858
b22a5a41 148592009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14860
14861 * output.cc (Output_file::close): After short writes, continue
14862 writing from the correct offset in the buffer being written.
14863
40fde488
CD
148642009-04-23 Chris Demetriou <cgd@google.com>
14865
14866 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14867 * configure: Regenerate.
14868 * config.in: Regenerate.
14869 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14870 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14871
3ce2c28e
ILT
148722009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14873
14874 * incremental.cc (Incremental_inputs_header_data): Renamed from
14875 Incremental_input_header_data.
14876 (Incremental_inputs_header_data::data_size): New field.
14877 (Incremental_inputs_header_data::put_input_file_count): Renamed
14878 from input_file_count.
14879 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14880 from command_line_offset.
14881 (Incremental_inputs_header_data::put_reserved): Renamed from
14882 put_reserved.
14883 (Incremental_inputs_entry_data): Renamed from
14884 Incremental_input_entry_data.
14885 (Incremental_inputs_entry_data::data_size): New field.
14886 (Incremental_inputs::report_command_line): New method.
14887 (Incremental_inputs::finalize): New method.
14888 (Incremental_inputs::create_incremental_inputs_data): New method.
14889 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14890 * incremental.h: New file.
14891 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14892 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14893 incremental builds.
703d02da 14894 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14895 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14896 (Layout::create_incremental_info_sections): New method.
14897 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14898 * main.cc (main): Notify Incremental_input of the command line.
14899
e55bde5e
ILT
149002009-04-01 Ian Lance Taylor <iant@google.com>
14901 Mikolaj Zalewski <mikolajz@google.com>
14902
14903 * gold.h (reserve_unordered_map): Define, three versions, one for
14904 each version of Unordered_map.
14905 * layout.cc (Layout::Layout): Remove options parameter. Add
14906 number_of_input_files parameter. Don't initialize options_.
14907 Initialize number_of_input_files_ and resized_signatures_. Move
14908 sections_are_attached_.
14909 (Layout::layout_group): Reserve space for group_signatures_.
14910 (Layout::find_or_add_kept_section): Change name parameter to be a
14911 reference. Resize signatures_ map when it gets large enough.
14912 (Layout::layout_eh_frame): Use parameters->options() instead of
14913 this->options_.
14914 (Layout::make_output_section): Likewise.
14915 (Layout::attach_allocated_section_to_segment): Likewise.
14916 (Layout::finalize, Layout::create_executable_stack): Likewise.
14917 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14918 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14919 * layout.h (class Layout): Update declarations. Remove options_
14920 field. Add number_of_input_files_ and resized_signatures_
14921 fields. Move sections_are_attached_ field.
14922 * main.cc (main): Pass number of input files to Layout
14923 constructor. Don't pass options.
14924
154b857c
ILT
149252009-03-30 Ian Lance Taylor <iant@google.com>
14926
14927 * ffsll.c (ffsll): Correct implementation.
14928
2f35ab9b
ILT
149292009-03-27 Ian Lance Taylor <iant@google.com>
14930
fd03461a
ILT
14931 * ffsll.c: New file.
14932 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14933 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14934 * ftruncate.c (ftruncate): Declare before definition.
14935 * mremap.c (mremap): Likewise.
14936 * pread.c (pread): Likewise.
14937 * configure, Makefile.in, config.in: Rebuild.
14938
2f35ab9b
ILT
14939 * mremap.c: New file.
14940 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14941 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14942 (mremap): Declare if HAVE_MREMAP is not defined.
14943 * configure, Makefile.in, config.in: Rebuild.
14944
33aea2fd
CC
149452009-03-27 Cary Coutant <ccoutant@google.com>
14946
14947 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14948 position independent.
14949 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14950 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14951
6d479619
CC
149522009-03-24 Cary Coutant <ccoutant@google.com>
14953
14954 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14955 an executable.
14956 (needs_dynamic_reloc): Likewise.
14957
afc06bb8
ILT
149582009-03-24 Ian Lance Taylor <iant@google.com>
14959
14960 * yyscript.y (file_cmd): Recognize EXTERN.
14961 (extern_name_list, extern_name_list_body): New nonterminals.
14962 * script.cc (script_add_extern): Define.
14963 * script-c.h (script_add_extern): Declare.
14964
f6060a4d
ILT
149652009-03-24 Rafael Avila de Espindola <espindola@google.com>
14966
14967 * object.cc (is_elf_object): Define.
14968 * object.h (is_elf_object): Declare.
14969 * archive.cc (Archive::get_elf_object_for_member): Call
14970 is_elf_object.
33aea2fd 14971 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14972
26736d8e
ILT
149732009-03-24 Elliott Hughes <enh@google.com>
14974
14975 * output.cc (Output_file::map_anonymous): Define.
14976 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14977 try an anonymous one. Report the size if the mmap fails.
14978 * output.h (class Output_file): Declare map_anonymous.
14979
22fd9730
ILT
149802009-03-24 Ian Lance Taylor <iant@google.com>
14981
14982 * target-select.cc (instantiate_target): Don't acquire the lock if
14983 the instantiated_target_ field has already been set.
14984
cb010894
ILT
149852009-03-23 Ian Lance Taylor <iant@google.com>
14986
7f055c20
ILT
14987 * gold-threads.h (class Initialize_lock): Define.
14988 * gold-threads.cc (class Initialize_lock_once): Define.
14989 (initialize_lock_control): New static variable.
14990 (initialize_lock_pointer): New static variable.
14991 (initialize_lock_once): New static function.
14992 (Initialize_lock::Initialize_lock): Define.
14993 (Initialize_lock::initialize): Define.
14994 * target-select.h: Include "gold-threads.h".
14995 (class Target_selector): Add lock_ and initialize_lock_ fields.
14996 Don't define instantiate_target, just declare it.
14997 * target-select.cc (Target_selector::Target_selector): Initialize
14998 new fields.
14999 (Target_selector::instantiate_target): Define.
15000 * descriptors.h: Include "gold-threads.h".
15001 (class Descriptors): Add initialize_lock_ field.
15002 * descriptors.cc (Descriptors::Descriptors): Initialize new
15003 field.
15004 (Descriptors::open): Use initialize_lock_ field
15005 * errors.h (class Errors): Add initialize_lock_ field.
15006 * errors.cc (Errors::Errors): Initialize new field.
15007 (Errors::initialize_lock): Use initialize_lock_ field.
15008 * powerpc.cc (class Target_selector_powerpc): Remove
15009 instantiated_target_ field. In do_recognize call
15010 instantiate_target rather than do_instantiate_target. In
15011 do_instantiate_target just allocate a new target.
15012 * sparc.cc (class Target_selector_sparc): Likewise.
15013
36959681
ILT
15014 * freebsd.h: New file.
15015 * i386.cc: Include "freebsd.h".
15016 (Target_i386): Derive from Target_freebsd rather than
15017 Sized_target.
15018 (Target_selector_i386): Derive from Target_selector_freebsd rather
15019 than Target_selector.
15020 * x86_64.cc: Include "freebsd.h".
15021 (Target_x86_64): Derive from Target_freebsd rather than
15022 Sized_target.
15023 (Target_selector_x86_64): Derive from Target_selector_freebsd
15024 rather than Target_selector.
15025 * target.h (class Target): Add adjust_elf_header and
15026 do_adjust_elf_header.
15027 * output.cc (Output_file_header:: do_sized_write): Call target
15028 adjust_elf_header routine.
15029 * configure.tgt: Set targ_osabi.
15030 * configure.ac: Define GOLD_DEFAULT_OSABI.
15031 * parameters.cc (Parameters::default_target): Pass
15032 GOLD_DEFAULT_OSABI to select_target.
15033 * target-select.h (class Target_selector): Make instantiate_target
15034 protected rather than private.
15035 * Makefile.am (HFILES): Add freebsd.h.
15036 * configure, Makefile.in, config.in: Rebuild.
15037
cb010894
ILT
15038 * merge.cc (do_add_input_section): Correct pend value. Change
15039 message about last entry not being null terminated from error to
15040 warning.
15041
0e879927
ILT
150422009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15043
15044 * incremental.cc: New file.
15045 * Makefile.am (CCFILES): Add incremental.cc.
15046 * Makefile.in: Rebuild.
15047
41105937
PP
150482009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15049
15050 * layout.cc (Layout::output_section_name): Preserve names
15051 of '.note.' sections.
e1df38aa 15052
60439920
ILT
150532009-03-19 Ian Lance Taylor <iant@google.com>
15054
15055 * descriptors.cc (Descriptors::open): Check that the options are
15056 valid before using them.
15057
0d371ad3
ILT
150582009-03-18 Ian Lance Taylor <iant@google.com>
15059
15060 * script-sections.h: Include <list>.
15061 (class Script_sections): Change Sections_elements from std::vector
15062 to std::list. Typedef public Elements_iterator. Add
15063 orphan_section_placement_, data_segment_align_start_, and
15064 saw_data_segment_align_ fields. Remove data_segment_align_index_
15065 field.
15066 * script-sections.cc (class Orphan_section_placement): New class.
15067 (class Sections_element): Add virtual functions is_relro and
15068 orphan_section_init. Remove virtual function place_orphan_here.
15069 (class Output_section_definition): Add is_relro and
15070 orphan_section_init. Remove place_orphan_here.
15071 (class Orphan_output_section): Likewise.
15072 (Script_sections::Script_sections): Update for field changes.
15073 (Script_sections::data_segment_align): Set saw_data_segment_align_
15074 and data_segment_align_start_, not data_segment_align_index.
15075 (Script_sections::data_segment_relro_end): Check
15076 saw_data_segment_align_. Use data_segment_align_start_ rather
15077 than data_segment_align_index_.
15078 (Script_sections::place_orphan): Rewrite to use
15079 Orphan_section_placement.
15080
9201d894
ILT
150812009-03-17 Ian Lance Taylor <iant@google.com>
15082
9c5b8369
ILT
15083 * archive.cc (Archive::add_symbols): Check for a version attached
15084 to the symbol name in the archive map.
15085 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15086 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15087 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15088 (ver_test_11.a): New target.
15089 * testsuite/Makefile.in: Rebuild.
15090
9201d894
ILT
15091 * configure.ac: Check for chsize and posix_fallocate. Replace
15092 ftruncate.
15093 * ftruncate.c: New file, from gnulib.
15094 * output.cc (posix_fallocate): Define dummy version if not
15095 HAVE_POSIX_FALLOCATE.
15096 (Output_file::map): Call posix_fallocate rather than lseek and
15097 write.
15098 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15099 * configure, Makefile.in, config.in: Rebuild.
15100
ef4ab7a8 151012009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15102
ef4ab7a8
PP
15103 * layout.h (Layout::create_note): Add section_name parameter.
15104 * layout.cc (Layout::create_note): Likewise.
15105 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15106
8c500701
ILT
151072009-03-17 Ian Lance Taylor <iant@google.com>
15108
e85b18e1
ILT
15109 * descriptors.cc: Include "options.h".
15110 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15111 (Descriptors::open): Always use O_CLOEXEC when opening a new
15112 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15113 then set FD_CLOEXEC.
15114
9efe6174
ILT
15115 * sparc.cc (class Target_sparc): Add has_got_section.
15116 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15117 make sure we have a GOT section.
15118
15119 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15120 (Target_sparc::Scan::local): Likewise.
15121 (Target_sparc::Scan::global): Likewise.
15122 (Target_sparc::Relocate::relocate): Likewise.
15123 (Target_sparc::Relocate::relocate_tls): Likewise.
15124
8c500701
ILT
15125 * symtab.cc (Symbol_table::define_default_version): New function,
15126 broken out of add_from_object.
15127 (Symbol_table::add_from_object): Call define_default_version.
15128 (Symbol_table::define_special_symbol): Add resolve_oldsym
15129 parameter. Change all callers. If the version for a symbol comes
15130 from a version script, resolve it with the symbol with the same
15131 name with no version. Also add the symbol without a version if
15132 appropriate.
15133 (do_define_in_output_data): If resolving with oldsym, don't delete
15134 sym.
15135 (do_define_in_output_segment): Likewise.
15136 (do_define_as_constant): Likewise.
15137 * symtab.h (class Symbol_table): Update declarations.
15138
f1ed28fb
ILT
151392009-03-13 Ian Lance Taylor <iant@google.com>
15140
15f8229b
ILT
15141 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15142 (Read_symbols::requeue): New function.
15143 (Read_symbols::do_read_symbols): If make_elf_object fails because
15144 the target type is not configured, and the file was searched for,
15145 issue a warning and retry with the next directory.
15146 (Add_symbols::run): If the file has an incompatible format, and
15147 it was searched for, requeue the Read_symbols task. On error,
15148 release the object.
15149 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15150 dirindex parameter to constructor. Change all callers. Declare
15151 incompatible_warning and requeue.
15152 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15153 input_argument_ and input_group_ fields. Add them to
15154 constructor. Change all callers.
15155 (class Read_script): Add dirindex_ field. Add it to constructor.
15156 Change all callers.
15157 * archive.cc (Archive::setup): Remove input_objects parameter.
15158 Change all callers.
15159 (Archive::get_file_and_offset): Likewise.
15160 (Archive::read_all_symbols): Likewise.
15161 (Archive::read_symbols): Likewise.
15162 (Archive::get_elf_object_for_member): Remove input_objects
15163 parameter. Add punconfigured parameter. Change all callers.
15164 (Archive::add_symbols): Change return type to bool. Check return
15165 value of include_member.
15166 (Archive::include_all_members): Likewise.
15167 (Archive::include_member): Change return type to bool. Return
15168 false if first included object has incompatible target. Set
15169 included_member_ field.
15170 (Add_archive_symbols::run): If add_symbols returns false, requeue
15171 Read_symbols task.
15172 * archive.h (class Archive): Add included_member_ field.
15173 Initialize it in constructor. Add input_file and searched_for
15174 methods. Update declarations.
15175 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15176 input_argument_ fields. Add them to constructor. Change all
15177 callers.
15178 * script.cc: Include "target-select.h".
15179 (class Parser_closure): Add skip_on_incompatible_target_ and
15180 found_incompatible_target_ fields. Add
15181 skip_on_incompatible_target parameter to constructor. Change all
15182 callers. Add methods skip_on_incompatible_target,
15183 clear_skip_on_incompatible_target, found_incompatible_target, and
15184 set_found_incompatible_target.
15185 (read_input_script): Add dirindex parameter. Change all callers.
15186 If parser finds an incompatible target, requeue Read_symbols
15187 task.
15188 (script_set_symbol): Clear skip_on_incompatible_target in
15189 closure.
15190 (script_add_assertion, script_parse_option): Likewise.
15191 (script_start_sections, script_add_phdr): Likewise.
15192 (script_check_output_format): New function.
15193 * script.h (read_input_script): Update declaration.
15194 * script-c.h (script_check_output_format): Declare.
15195 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15196 (ignore_cmd): Remove OUTPUT_FORMAT.
15197 * fileread.cc (Input_file::Input_file): Add explicit this.
15198 (Input_file::will_search_for): New function.
15199 (Input_file::open): Add pindex parameter. Change all callers.
15200 * fileread.h (class Input_file): Add input_file_argument method.
15201 Declare will_search_for. Update declarations.
15202 * object.cc (make_elf_object): Add punconfigured parameter.
15203 Change all callers.
15204 * object.h (class Object): Make input_file public. Add
15205 searched_for method.
15206 (make_elf_object): Update declaration.
15207 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15208 restart search.
15209 * dirsearch.h (class Dirsearch): Update declaration.
15210 * options.h (class General_options): Add --warn-search-mismatch.
15211 * parameters.cc (Parameters::is_compatible_target): New function.
15212 * parameters.h (class Parameters): Declare is_compatible_target.
15213 * workqueue.cc (Workqueue::add_blocker): New function.
15214 * workqueue.h (class Workqueue): Declare add_blocker.
15215
f1ed28fb
ILT
15216 * fileread.cc (Input_file::open): Remove options parameter.
15217 Change all callers.
15218 (Input_file::open_binary): Likewise.
15219 * script.cc (read_input_script): Likewise.
15220 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15221 options parameter from constructor. Change all callers.
15222 (class Read_script): Likewise.
15223 * fileread.h (class Input_file): Update declarations.
15224 * script.h (read_input_script): Update declaration.
15225
34dd024a
NC
152262009-03-10 Nick Clifton <nickc@redhat.com>
15227
15228 * po/es.po: New Spanish translation.
15229
6d71b17c
CC
152302009-03-06 Cary Coutant <ccoutant@google.com>
15231
15232 * options.cc (parse_short_option): Keep dash_z from registering itself.
15233
031cdbed
ILT
152342009-03-03 Ian Lance Taylor <iant@google.com>
15235
15236 PR 9918
15237 * target-reloc.h (relocate_section): Pass output_section to
15238 relocate.
15239 * i386.cc (Target_i386::should_apply_static_reloc): Add
15240 output_section parameter. Change all callers.
15241 (Target_i386::Relocate::relocate): Add output_section parameter.
15242 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15243 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15244 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15245 * testsuite/two_file_shared.sh: New script.
15246 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15247 (check_DATA): Add two_file_shared.dbg.
15248 (two_file_shared.dbg): New target.
15249 * testsuite/Makefile.in: Rebuild.
15250
15d5fa16
ILT
152512009-03-01 Ian Lance Taylor <iant@google.com>
15252
15253 * configure.ac: Check for byteswap.h.
15254 * configure: Rebuild.
15255 * config.in: Rebuild.
15256
8a4c0b0d
ILT
152572009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15258
15259 * layout.cc (Layout::find_or_add_kept_section): New function.
15260 (Layout::add_comdat): Removed.
15261 * layout.h (struct Kept_section): Move out of class Layout.
15262 Remove trailing underscores from field names. Add group_sections
15263 field. Rename group_ field to is_group. Change all uses.
15264 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15265 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15266 comdat_groups_ field.
15267 (Sized_relobj::include_section_group): Use
15268 find_or_add_kept_section and Kept_section::group_sections.
15269 (Sized_relobj::include_linkonce_section): Likewise.
15270 * object.cc (class Sized_relobj): Don't define Comdat_group or
15271 Comdat_group_table. Remove find_comdat_group and
15272 add_comdat_group. Remove comdat_groups_ field.
15273 * plugin.cc (include_comdat_group): Use
15274 Layout::find_or_add_kept_section.
15275
b4ecf66b
ILT
152762009-02-28 Ian Lance Taylor <iant@google.com>
15277
14359ca0
ILT
15278 * README: --gc-sections and map files are now supported. Document
15279 some build requirements.
15280
b4ecf66b
ILT
15281 PR 6992
15282 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15283 relocatable link set the value of the section symbol to zero.
15284 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15285 relocatable link don't include the section address in the local
15286 symbol value.
15287
0602e05a
ILT
152882009-02-27 Ian Lance Taylor <iant@google.com>
15289
fd9d194f
ILT
15290 PR 6811
15291 * options.h (class Search_directory): Add is_system_directory.
15292 (class General_options): Declare is_in_system_directory.
15293 * options.cc (get_relative_sysroot): Make static.
15294 (get_default_sysroot): Make static.
15295 (General_optoins::is_in_system_directory): New function.
15296 * fileread.cc (Input_file::is_in_system_directory): New function.
15297 * fileread.h (class Input_file): Declare is_in_system_directory.
15298 * object.h (class Object): Add is_in_system_directory.
15299 (class Input_objects): Remove system_library_directory_ field.
15300 * object.cc (Input_objects::add_object): Don't set
15301 system_library_directory_.
15302 (input_objects::found_in_system_library_directory): Remove.
15303 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15304 parameter. Change all callers.
15305 (Symbol_table::sized_write_globals): Likewise.
15306 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15307 Call Object::is_in_system_directory.
15308 * symtab.h (class Symbol_table): Update declarations.
15309
61edd21f
ILT
15310 PR 5990
15311 * descriptors.h (Open_descriptor): Add is_on_stack field.
15312 * descriptors.cc (Descriptors::open): If the descriptor is on the
15313 top of the stack, remove it. Initialize is_on_stack field.
15314 (Descriptors::release): Only add pod to stack if it is not on the
15315 stack already.
15316 (Descriptors::close_some_descriptor): Clear stack_next and
15317 is_on_stack fields.
15318
e29e076a
ILT
15319 PR 7091
15320 * output.cc (Output_section::find_starting_output_address): Rename
15321 from starting_output_address; add PADDR parameter; change return
15322 type.
15323 * output.h (class Output_section): Declare
15324 find_starting_output_address instead of starting_output_address.
15325 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15326 section symbol for which we can't find a merge section.
15327
0602e05a
ILT
15328 PR 9836
15329 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15330 hidden or internal, force the symbol to be local.
15331 * resolve.cc (Symbol::override_visibility): Define.
15332 (Symbol::override_base): Use override_visibility.
15333 (Symbol_table::resolve): Likewise.
15334 (Symbol::override_base_with_special): Likewise.
15335 (Symbol_table::override_with_special): If the visibility is hidden
15336 or internal, force the symbol to be local.
15337 * symtab.h (class Symbol): Add set_visibility and
15338 override_visibility.
15339 * testsuite/ver_test_1.sh: New file.
15340 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15341 (check_DATA): Add ver_test_1.syms.
15342 (ver_test_1.syms): New target.
15343 * testsuite/Makefile.in: Rebuild.
15344
401a9a73
CC
153452009-02-25 Cary Coutant <ccoutant@google.com>
15346
15347 * layout.cc (Layout::choose_output_section): Don't rename sections
15348 when using a linker script that has a SECTIONS clause.
15349 * Makefile.in: Regenerate.
15350
15351 * testsuite/Makefile.am (script_test_5.sh): New test case.
15352 * testsuite/Makefile.in: Regenerate.
15353 * testsuite/script_test_5.cc: New file.
15354 * testsuite/script_test_5.sh: New file.
15355 * testsuite/script_test_5.t: New file.
15356
f488e4b0
CC
153572009-02-13 Rafael Avila de Espindola <espindola@google.com>
15358
15359 * archive.cc (Archive::include_member): Update calls to add_symbols.
15360 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15361 the Layout argument.
15362 * dynobj.h (do_add_symbols): Add the Layout argument.
15363 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15364 Layout argument.
15365 * object.h (Object::add_symbols): Add the Layout argument.
15366 (Object::do_add_symbols): Add the Layout argument.
15367 (Sized_relobj::do_add_symbols): Add the Layout argument.
15368 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15369 Unify the two versions.
15370 (Add_plugin_symbols): Remove.
15371 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15372 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15373 (Add_plugin_symbols): Remove.
15374 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15375 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15376 (Add_symbols::run): Make it work with Pulginobj.
15377
89dd1680
ILT
153782009-02-06 Ian Lance Taylor <iant@google.com>
15379
15380 * object.cc (Sized_relobj::do_layout): Make info message start
15381 with lower case letter.
15382
266d0a74
ILT
153832009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15384
602b464e
ILT
15385 * binary.cc: Fix file comment.
15386
266d0a74
ILT
15387 * options.h (enum Incremental_disposition): Define.
15388 (class General_options): Add new options: --incremental,
15389 --incremental_changed, --incremental_unchanged,
15390 --incremental_unknown. Add incremental_disposition_ and
15391 implicit_incremental_ fields.
15392 (General_options::incremental_disposition): New function.
15393 (class Position_dependent_options): Add incremental_disposition
15394 option.
15395 (Position_dependent_options::copy_from_options): Set incremental
15396 dispositions.
15397 * options.cc (General_options::parse_incremental_changed): New
15398 function.
2e702c99
RM
15399 (General_options::parse_incremental_unchanged): New function.
15400 (General_options::parse_incremental_unknown): New function.
15401 (General_options::General_options): Initialize new fields
266d0a74 15402 incremental_disposition_ and implicit_incremental_.
2e702c99 15403 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15404 without --incremental.
15405
f073bbf7
CD
154062009-02-06 Chris Demetriou <cgd@google.com>
15407
15408 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15409 pointer and to report location as the file name associated with
15410 the symbol.
15411 (gold_undefined_symbol_at_location): New function to replace the
15412 old gold_undefined_symbol functionality.
15413 * target-reloc.h (relocate_section): Update to use
15414 gold_undefined_symbol_at_location.
15415 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15416 Call gold_undefined_symbol function rather than gold_error.
15417 * errors.h (Errors::undefined_symbol): Take location as a
15418 string, rather than calculating it from a relocation.
15419 * errors.cc (Errors::fatal): Print "fatal error:" before the
15420 formatted message.
15421 (Errors::error, Errors::error_at_location): Print "error: "
15422 before the formatted message.
15423 (Errors::undefined_symbol): Take location as a string, rather
15424 than calculating it from a relocation.
15425 (gold_undefined_symbol_at_location): New function akin to
15426 old gold_undefined_symbol, calculates location from relocation.
15427 (gold_undefined_symbol): Change to take only a Symbol pointer
15428 and to report location as the file name associated with the symbol.
15429 * testsuite/debug_msg.sh: Update for changed error messages.
15430 * testsuite/undef_symbol.sh: Likewise.
15431
8e94a90c
ILT
154322009-02-04 Duncan Sands <baldrick@free.fr>
15433
15434 PR 9812
15435 * reduced_debug_output.h
15436 (Output_reduced_debug_abbrev_section::failed): Use format for
15437 gold_warning.
15438 (Output_reduced_debug_info_section::faild): Likewise.
15439
88a0e15b
ILT
154402009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15441
15442 * script.cc (Lazy_demangler): New class.
2e702c99 15443 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15444 symbol only once.
15445
5efc7cd2
CC
154462009-01-29 Cary Coutant <ccoutant@google.com>
15447
15448 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15449 to __tls_get_addr.
15450 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15451
e0ebcf42
ILT
154522009-01-28 Ian Lance Taylor <iant@google.com>
15453
5efc7cd2 15454 * version.cc (version_string): Bump to 1.9.
75fe7426 15455
e0ebcf42
ILT
15456 * gold.h: Include <cstring> and <stdint.h>.
15457 * version.cc: Include <cstdio>.
15458 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15459 warning.
15460 * reduced_debug_output.cc (insert_into_vector): Rename from
15461 Insert_into_vector; change all callers. Use Swap_unaligned to
15462 avoid aliasing issue; remove union since it is unnecessary.
15463
8e2813be 154642009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15465
15466 * Makefile.am (CCFILES): Add gc.cc.
15467 (HFILES): Add gc.h.
15468 * Makefile.in: Regenerate.
15469 * gold.cc (Gc_runner): New class.
15470 (queue_initial_tasks): Call garbage collection related tasks
15471 when corresponding options are invoked.
15472 (queue_middle_gc_tasks): New function.
15473 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15474 processed early before laying out sections during garbage collection.
15475 * gold.h (queue_middle_gc_tasks): New function.
15476 (is_prefix_of): Move from "layout.cc".
15477 * i386.cc (Target_i386::gc_process_relocs): New function.
15478 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15479 * main.cc (main): Create object of class "Garbage_collection".
15480 * object.cc (Relobj::copy_symbols_data): New function.
15481 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15482 (Sized_relobj::do_layout): Allow this function to be called twice
15483 during garbage collection and defer layout of section during the
6d03d481
ST
15484 first call.
15485 * object.h (Relobj::get_symbols_data): New function.
15486 (Relobj::is_section_name_included): New function.
15487 (Relobj::copy_symbols_data): New function.
15488 (Relobj::set_symbols_data): New function.
15489 (Relobj::get_relocs_data): New function.
15490 (Relobj::set_relocs_data): New function.
15491 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15492 (Relobj::gc_process_relocs): New function.
15493 (Relobj::do_gc_process_relocs): New pure virtual function.
15494 (Relobj::sd_): New data member.
15495 (Sized_relobj::is_output_section_offset_invalid): New function.
15496 (Sized_relobj::do_gc_process_relocs): New function.
15497 * options.h (General_options::gc_sections): Modify to not be a no-op.
15498 (General_options::print_gc_sections): New option.
15499 * plugin.cc (Plugin_finish::run): Remove function call to
15500 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15501 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15502 * reloc.cc (Read_relocs::run): Add task to process relocs and
15503 determine unreferenced sections when doing garbage collection.
15504 (Gc_process_relocs): New class.
15505 (Sized_relobj::do_gc_process_relocs): New function.
15506 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15507 sections that are garbage collected.
15508 * reloc.h (Gc_process_relocs): New class.
15509 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15510 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15511 symbols whose corresponding sections are garbage collected.
15512 (Symbol_table::Symbol_table): Add new parameter for the garbage
15513 collection object.
15514 (Symbol_table::gc_mark_undef_symbols): New function.
15515 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15516 (Symbol_table::gc_mark_dyn_syms): New function.
15517 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15518 as garbage.
15519 (Symbol_table::add_from_object): Likewise.
15520 (Symbol_table::add_from_relobj): When building shared objects, do not
15521 treat externally visible symbols as garbage.
15522 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15523 table information for static and relocatable links.
15524 * symtab.h (Symbol_table::set_gc): New function.
15525 (Symbol_table::gc): New function.
15526 (Symbol_table::gc_mark_undef_symbols): New function.
15527 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15528 (Symbol_table::gc_mark_dyn_syms): New function.
15529 (Symbol_table::gc_): New data member.
e1df38aa 15530 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15531 function.
15532 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15533 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15534
3b293544
CF
155352009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15536
15537 * options.h (General_options::gc_sections): Define as a no-op for now.
15538 (General_options::no_keep_memory): Ditto.
15539 (General_options::Bshareable): Define.
15540 * options.cc (General_options::finalize): Honor -Bshareable.
15541
83d22aa8
AS
155422009-01-20 Andreas Schwab <schwab@suse.de>
15543
15544 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15545 read the value in the contents, since we don't use it. Use the
15546 template endianness when writing.
15547 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15548
cd536b21
AS
155492009-01-19 Andreas Schwab <schwab@suse.de>
15550
15551 * configure.tgt (powerpc64-*): Fix targ_obj.
15552
99e9a495
ILT
155532009-01-15 Ian Lance Taylor <iant@google.com>
15554
15555 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15556 local symbols when stripping all symbols.
15557
bbbfea06
CC
155582009-01-14 Cary Coutant <ccoutant@google.com>
15559
99e9a495 15560 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15561
0f7c0701
CC
155622009-01-14 Cary Coutant <ccoutant@google.com>
15563
15564 * archive.cc (Archive::get_elf_object_for_member): Remove call
15565 to File_read::claim_for_plugin.
15566 * descriptors.cc (Descriptors::open): Remove reference to
15567 is_claimed.
15568 (Descriptors::claim_for_plugin): Remove.
15569 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15570 (Descriptors::is_claimed): Remove.
15571 (claim_descriptor_for_plugin): Remove.
15572 * fileread.cc (File_read::claim_for_plugin): Remove.
15573 * fileread.h (File_read::claim_for_plugin): Remove.
15574 (File_read::descriptor): Reopen descriptor if necessary.
15575 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15576 (Plugin_manager::all_symbols_read): Add task parameter. Change
15577 all callers.
15578 (Plugin_manager::get_input_file): New function.
15579 (Plugin_manager::release_input_file): New function.
15580 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15581 corresponding data member.
15582 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15583 and pass to base constructor. Change all callers.
15584 (get_input_file, release_input_file): New functions.
15585 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15586 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15587 (Plugin_manager::all_symbols_read): Add task parameter.
15588 (Plugin_manager::get_input_file): New function.
15589 (Plugin_manager::release_input_file): New function.
15590 (Plugin_manager::task_): New data member.
15591 (Pluginobj::Pluginobj): Add filesize parameter.
15592 (Pluginobj::filename): New function.
15593 (Pluginobj::descriptor): New function.
15594 (Pluginobj::filesize): New function.
15595 (Pluginobj::filesize_): New data member.
15596 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15597 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15598 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15599
15600 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15601 with archive libraries.
15602 * testsuite/Makefile.in: Regenerate.
15603 * testsuite/plugin_test.c (struct sym_info): New type.
15604 (get_input_file, release_input_file): New static variables.
15605 (onload): Capture new transfer vector entries.
15606 (claim_file_hook): Stop reading at end of file according to filesize.
15607 Factor out parsing of readelf output into separate function.
15608 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15609 APIs and get the source file name from the symbol table. Convert
15610 source file name to corresponding object file name. Print info
15611 message when adding new input files.
15612 (parse_readelf_line): New function.
15613 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15614 * testsuite/plugin_test_2.sh: Likewise.
15615 * testsuite/plugin_test_3.sh: Likewise.
15616 * testsuite/plugin_test_4.sh: New test case.
15617
62a6d109
ILT
156182009-01-07 Ian Lance Taylor <iant@google.com>
15619
15620 * version.cc (version_string): Bump to 1.8.
15621
483620e8
CC
156222008-12-23 Cary Coutant <ccoutant@google.com>
15623
15624 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15625 * plugin.cc (Plugin_manager::finish): Rename as
15626 layout_deferred_objects. Move cleanup to separate function.
15627 (Plugin_manager::cleanup): New function.
15628 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15629 separately.
15630 * plugin.h (Plugin_manager::finish): Rename as
15631 layout_deferred_objects.
15632 (Plugin_manager::cleanup): New function.
15633 (Plugin_manager::cleanup_done): New field.
15634
d66a9eb3
CC
156352008-12-23 Cary Coutant <ccoutant@google.com>
15636
15637 * plugin.cc (is_visible_from_outside): New function.
15638 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15639 so we don't return "IR only" status for exported symbols or -r links.
15640
15641 * testsuite/Makefile.am (plugin_test_3): New test case.
15642 * testsuite/Makefile.in: Regenerate.
15643 * testsuite/plugin_test_3.sh: New file.
15644
5995b570
CC
156452008-12-22 Cary Coutant <ccoutant@google.com>
15646
15647 * object.cc (Sized_relobj::layout_section): New function.
15648 (Sized_relobj::do_layout): Defer layout of input sections until after
15649 plugin has provided replacement files.
15650 (Sized_relobj::do_layout_deferred_sections): New function.
15651 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15652 (Relobj::layout_deferred_sections): New function.
15653 (Relobj::do_layout_deferred_sections): New function.
15654 (Sized_relobj::do_layout_deferred_sections): New function.
15655 (Sized_relobj::layout_section): New function.
15656 (Sized_relobj::Deferred_layout): New structure.
15657 (Sized_relobj::deferred_layout_): New field.
15658 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15659 Change all callers. Layout deferred sections.
15660 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15661 references.
15662 (Plugin_hook::run): Move code from do_plugin_hook inline.
15663 (Plugin_hook::do_plugin_hook): Remove.
15664 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15665 (Plugin_manager::finish): Renamed, was cleanup.
15666 (Plugin_manager::should_defer_layout): New function.
15667 (Plugin_manager::add_deferred_layout_object): New function.
15668 (Plugin_manager::Deferred_layout_list): New type.
15669 (Plugin_manager::deferred_layout_objects_): New field.
15670 (Plugin_hook::do_plugin_hook): Remove.
15671
ee769c88
ILT
156722008-12-17 Ian Lance Taylor <iant@google.com>
15673
15674 * options.h (class General_options): Add --no case for
15675 --export-dynamic.
15676
abc8dcba
CC
156772008-12-16 Cary Coutant <ccoutant@google.com>
15678
15679 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15680 vector.
15681 (Plugin_manager::claim_file): Create plugin object even if
15682 plugin did not call the add_symbols callback.
15683 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15684 asking for more symbols than were added.
15685 * testsuite/Makefile.am (plugin_test_1): Add test case with
15686 no global symbols.
15687 (empty.syms): New target.
15688 * testsuite/Makefile.in: Regenerate.
15689 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15690 message. Don't call add_symbols if no globals.
15691 (all_symbols_read_hook): Don't provide replacement for empty
15692 claimed file.
15693
b0074644
ILT
156942008-12-12 Ian Lance Taylor <iant@google.com>
15695
68943102
ILT
15696 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15697 r_type == 0 for a local symbol with r_sym == 0.
15698 (scan_relocatable_relocs): Pass r_sym to
15699 local_non_section_strategy.
15700 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15701 r_sym parameter.
15702
b0074644
ILT
15703 * configure.ac: Update test for TLS descriptors: they are
15704 supported as of glibc 2.9.
15705 * configure: Rebuild.
15706
c2508178
ILT
157072008-12-11 Ian Lance Taylor <iant@google.com>
15708
15709 PR 7091
15710 * target-reloc.h (Default_scan_relocatable_relocs): For each
15711 function, map r_type == 0 to RELOC_DISCARD.
15712
2756a258
CC
157132008-12-10 Cary Coutant <ccoutant@google.com>
15714
15715 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15716 object to override a kept COMDAT group from a plugin object.
15717
bb6f53d3
ILT
157182008-12-09 Ian Lance Taylor <iant@google.com>
15719
fbc558e1
ILT
15720 PR 7088
15721 * yyscript.y (file_cmd): Handle INPUT.
15722
bb6f53d3
ILT
15723 * testsuite/initpri1.c: Change all declarations to be full
15724 prototypes by adding void, to avoid compiler warnings.
15725
4674ecfc
CC
157262008-12-05 Rafael Avila de Espindola <espindola@google.com>
15727
15728 * options.cc (General_options::parse_plugin_opt): New.
15729 (General_options::add_plugin): The argument now is just the filename.
15730 (General_options::add_plugin_option): New.
15731 * options.h (plugin_opt): New.
15732 (add_plugin): Change argument name.
15733 (add_plugin_option): New.
15734 * plugin.cc (Plugin::load): Don't parse the plugin option.
15735 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15736 (Plugin::add_option): New.
15737 (Plugin::args_): Change type.
15738 (Plugin::filename_): New.
15739 (Plugin_manager::add_plugin_option): New.
15740 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15741 * testsuite/Makefile.in: Regenerate.
15742
fd06b4aa
CC
157432008-12-05 Cary Coutant <ccoutant@google.com>
15744
15745 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15746 Handle --strip-lto-sections option.
15747 * options.h (strip_lto_sections): New option.
15748
6c52134c
CC
157492008-12-01 Cary Coutant <ccoutant@google.com>
15750
15751 * plugin.cc (ld_plugin_message): Change format parameter to const.
15752 Fix mismatch between new[] and delete.
15753
a45248e0
CC
157542008-11-14 Cary Coutant <ccoutant@google.com>
15755
15756 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15757 instead of -1U.
15758
c82fbeee
CS
157592008-11-05 Craig Silverstein <csilvers@google.com>
15760
15761 * options.cc (General_options::parse_dynamic_list): New function.
15762 * options.h (General_options): New flags dynamic_list,
15763 dynamic_list_data, dynamic_list_cpp_new, and
15764 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15765 (General_options::in_dynamic_list): New function.
15766 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15767 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15768 (Lex::can_continue_name): Likewise.
15769 (yylex): Likewise.
15770 (read_script_file): New parameter script_options.
15771 (read_dynamic_list): New function.
15772 (Script_options::define_dynamic_list): New function.
15773 (dynamic_list_keyword_parsecodes): New variable.
15774 (dynamic_list_keywords): New variable.
15775 * script.h (Script_options::define_dynamic_list): New function
15776 prototype.
15777 (read_dynamic_list): New function prototype.
15778 * symtab.cc (strprefix): New macro.
15779 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15780 dynamic_list_data, dynamic_list_cpp_new, and
15781 dynamic_list_cpp_typeinfo.
15782 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15783 (dynamic_list_expr): New rule.
15784 (dynamic_list_nodes): Likewise.
15785 (dynamic_list_node): Likewise.
15786 * testsuite/Makefile.am (dynamic_list): New test.
15787 * testsuite/Makefile.in: Regenerated.
15788 * testsuite/dynamic_list.t: New file.
15789 * testsuite/dynamic_list.sh: New file.
15790
e0bb29a5
CS
157912008-11-05 Craig Silverstein <csilvers@google.com>
15792
15793 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15794 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15795 (t11_last): Likewise.
15796 * testsuite/ver_test_6.c (main): Likewise.
15797
4e1e25e0
CC
157982008-10-07 Cary Coutant <ccoutant@google.com>
15799
15800 * options.c (General_options::finalize): Add check for -static and
15801 -shared.
15802 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15803 is not empty.
15804
92f03fcb
CC
158052008-10-02 Cary Coutant <ccoutant@google.com>
15806
15807 * plugin.cc (make_sized_plugin_object): Fix conditional
15808 compilation to work when not all targets are enabled.
15809
fbd8a257
CC
158102008-09-29 Cary Coutant <ccoutant@google.com>
15811
15812 * archive.cc (Archive::get_file_and_offset): Use filename instead
15813 of name to get library path.
15814 (Archive::include_member): Unlock external member of a thin archive.
15815
15816 * testsuite/Makefile.am (TEST_AR): New variable.
15817 (thin_archive_test_1): New test.
15818 (thin_archive_test_2): New test.
81636b3f
CC
15819 * testsuite/Makefile.in: Regenerate.
15820 * testsuite/thin_archive_main.cc: New file.
15821 * testsuite/thin_archive_test_1.cc: New file.
15822 * testsuite/thin_archive_test_2.cc: New file.
15823 * testsuite/thin_archive_test_3.cc: New file.
15824 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15825
eff45813
CC
158262008-09-29 Cary Coutant <ccoutant@google.com>
15827
15828 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15829 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15830 instead of -1U.
15831 (Sized_relobj::do_finalize_local_symbols): Likewise.
15832 (Sized_relobj::map_to_kept_section): Likewise.
15833 * object.h (Sized_relobj::invalid_address): New constant.
15834 (Sized_relobj::do_output_section_offset): Check for invalid_address
15835 and return -1ULL.
15836 * output.cc (Output_reloc::local_section_offset): Use constant
15837 invalid_address instead of -1U.
15838 (Output_reloc::get_address): Likewise.
15839 (Output_section::output_address): Change -1U to -1ULL.
15840 * output.h (Output_reloc::invalid_address): New constant.
15841 * reloc.cc (Sized_relobj::write_sections): Use constant
15842 invalid_address instead of -1U.
15843 (Sized_relobj::relocate_sections): Likewise.
15844 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15845 values for merge sections.
15846 * target-reloc.h (relocate_for_relocatable): Use constant
15847 invalid_address instead of -1U.
15848
89fc3421
CC
158492008-09-19 Cary Coutant <ccoutant@google.com>
15850
15851 Add plugin functionality for link-time optimization (LTO).
15852 * configure.ac (plugins): Add --enable-plugins option.
15853 * configure: Regenerate.
15854 * config.in: Regenerate.
15855 * Makefile.am (LIBDL): New variable.
15856 (CCFILES): Add plugin.cc.
15857 (HFILES): Add plugin.h.
15858 (ldadd_var): Add LIBDL.
15859 * Makefile.in: Regenerate.
15860
15861 * archive.cc: Include "plugin.h".
15862 (Archive::setup): Don't preread archive symbols when using a plugin.
15863 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15864 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15865 files.
15866 (Archive::include_member): Add symbols from plugin objects.
15867 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15868 * descriptors.cc (Descriptors::open): Check for file descriptors
15869 abandoned by plugins.
15870 (Descriptors::claim_for_plugin): New function.
15871 * descriptors.h (Descriptors::claim_for_plugin): New function.
15872 (Open_descriptor::is_claimed): New field.
15873 (claim_descriptor_for_plugin): New function.
15874 * fileread.cc (File_read::claim_for_plugin): New function.
15875 * fileread.h (File_read::claim_for_plugin): New function.
15876 (File_read::descriptor): New function.
15877 * gold.cc: Include "plugin.h".
15878 (queue_initial_tasks): Add task to call plugin hooks for generating
15879 new object files.
15880 * main.cc: Include "plugin.h".
15881 (main): Load plugin libraries.
15882 * object.h (Pluginobj): Declare.
15883 (Object::pluginobj): New function.
15884 (Object::do_pluginobj): New function.
15885 (Object::set_target): New function.
15886 * options.cc: Include "plugin.h".
15887 (General_options::parse_plugin): New function.
15888 (General_options::General_options): Initialize plugins_ field.
15889 (General_options::add_plugin): New function.
15890 * options.h (Plugin_manager): Declare.
15891 (General_options): Add --plugin option.
15892 (General_options::has_plugins): New function.
15893 (General_options::plugins): New function.
15894 (General_options::add_plugin): New function.
15895 (General_options::plugins_): New field.
15896 * plugin.cc: New file.
15897 * plugin.h: New file.
15898 * readsyms.cc: Include "plugin.h".
15899 (Read_symbols::do_read_symbols): Check for archive before checking
15900 for ELF file. Call plugin hooks to claim files.
15901 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15902 from a real object file; force override when processing replacement
15903 files.
15904 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15905 (Symbol::init_base_object): Likewise.
15906 (Symbol::init_base_output_data): Likewise.
15907 (Symbol::init_base_output_segment): Likewise.
15908 (Symbol::init_base_constant): Likewise.
15909 (Symbol::init_base_undefined): Likewise.
15910 (Symbol::output_section): Assert that object is not a plugin.
15911 (Symbol_table::add_from_pluginobj): New function.
15912 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15913 undefined.
15914 (Symbol_table::sized_write_globals): Likewise.
15915 (Symbol_table::add_from_pluginobj): Instantiate template.
15916 * symtab.h (Sized_pluginobj): Declare.
15917 (Symbol::in_real_elf): New function.
15918 (Symbol::set_in_real_elf): New function.
15919 (Symbol::in_real_elf_): New field.
15920 (Symbol_table::add_from_pluginobj): New function.
15921
15922 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15923 (LIBDL): New variable.
15924 (LDADD): Add LIBDL.
15925 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15926 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15927 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15928 (MOSTLYCLEANFILES): Likewise.
15929 * testsuite/Makefile.in: Regenerate.
15930 * testsuite/plugin_test.c: New file.
15931 * testsuite/plugin_test_1.sh: New file.
15932 * testsuite/plugin_test_2.sh: New file.
15933
de31bda5
ILT
159342008-09-16 Ian Lance Taylor <iant@google.com>
15935
9c2d0ef9
ILT
15936 * target-reloc.h (relocate_section): Check whether a symbol is
15937 defined by the ABI before reporting an undefined symbol error.
15938 * target.h (Target::is_defined_by_abi): Make parameter const.
15939 (Target::do_is_defined_by_abi): Likewise.
15940 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15941 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15942 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15943 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15944 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15945 * testsuite/Makefile.in: Rebuild.
15946
de31bda5
ILT
15947 * fileread.cc (make_view): Add casts to avoid warning.
15948
9fa33bee
AO
159492008-09-16 Alexandre Oliva <aoliva@redhat.com>
15950
15951 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15952 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15953
183fd0e3
AO
159542008-09-16 Alexandre Oliva <aoliva@redhat.com>
15955
15956 * options.h (General_options::output_is_executable): New.
15957 (General_options::output_is_pie): New.
15958 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15959 for shared libraries.
15960 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15961
7be8330a
CD
159622008-09-11 Chris Demetriou <cgd@google.com>
15963
15964 * options.h (origin): New -z option.
15965 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15966 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15967 in DT_FLAGS_1.
15968
a9caad02
CC
159692008-09-05 Cary Coutant <ccoutant@google.com>
15970
15971 * fileread.cc (File_read::make_view): Add check for attempt to map
15972 beyond end of file.
15973
ae6dce4d
CC
159742008-09-05 Cary Coutant <ccoutant@google.com>
15975
15976 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15977 explicit instantiations.
15978
d7ab2a47
KVH
159792008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15980
15981 PR gold/6858
15982 * options.cc (General_options::finalize): Allow undefined symbols
15983 in shlibs if linking -shared.
15984
15985 PR gold/6859
15986 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15987 symbols as not needing a dynsym entry.
15988
1e52a9c1
CS
159892008-08-20 Craig Silverstein <csilvers@google.com>
15990
15991 * fileread.cc (File_read::open): Do not lock the file unless it
15992 was successfully opened.
15993
d85c80a3
CC
159942008-08-14 Cary Coutant <ccoutant@google.com>
15995
15996 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15997 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15998 * testsuite/tls_test.cc (struct int128): 128-bit struct
15999 for testing TLS relocs with non-zero addend.
16000 (v12): New TLS variable.
16001 (t12): New test.
16002 (t_last): Add check for v12.
16003 * testsuite/tls_test.h (t12): New function.
16004 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16005
2d924fd9
ILT
160062008-08-13 Ian Lance Taylor <iant@google.com>
16007
16008 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16009 set tls_segment_ or relro_segment_.
16010 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16011 when appropriate.
16012 * output.h (Output_section::clear_is_relro): New function.
16013 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16014 sections specially even when output_data_ is empty.
16015 (Output_segment::maximum_alignment): When first section is relro,
16016 only force alignment for PT_LOAD segments.
16017 * script.cc (script_data_segment_align): New function.
16018 (script_data_segment_relro_end): New function.
16019 * script-c.h (script_data_segment_align): Declare.
16020 (script_data_segment_relro_end): Declare.
16021 * script-sections.h (class Script_sections): Declare
16022 data_segment_align and data_segment_relro_end. Add fields
16023 segment_align_index_ and saw_relro_end_.
16024 * script-sections.cc (class Sections_element): Add set_is_relro
16025 virtual function. Add new bool* parameter to place_orphan_here.
16026 Add get_output_section virtual function.
16027 (class Output_section_definition): Add set_is_relro. Add new
16028 bool* parameter to place_orphan_here. Add get_output_section.
16029 Add is_relro_ field.
16030 (Output_section_definition::Output_section_definition): Initialize
16031 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16032 and is_relro_ fields.
16033 (Output_section_definition::place_orphan_here): Add is_relro
16034 parameter.
16035 (Output_section_definition::set_section_addresses): Set relro for
16036 output section.
16037 (Output_section_definition::alternate_constraint): Likewise.
16038 (class Orphan_output_section): Add new bool* parameter to
16039 place_orphan_here. Add get_output_section.
16040 (Orphan_output_section::place_orphan_here): Add is_relro
16041 parameter.
16042 (Script_sections::Script_sections): Initialize
16043 data_segment_align_index_ and saw_relro_end_.
16044 (Script_sections::data_segment_align): New function.
16045 (Script_sections::data_segment_relro_end): New function.
16046 (Script_sections::place_orphan): Set or clear is_relro.
16047 (Script_sections::set_section_addresses): Force alignment of first
16048 TLS section.
16049 * yyscript.y (exp): Call script_data_segment_align and
16050 script_data_segment_relro_end.
16051 * testsuite/relro_script_test.t: New file.
16052 * testsuite/relro_test.cc (using_script): Declare.
16053 (t1, t2): Test using_script.
16054 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16055 (relro_script_test_SOURCES): Define.
16056 (relro_script_test_DEPENDENCIES): Define.
16057 (relro_script_test_LDFLAGS): Define.
16058 (relro_script_test_LDADD): Define.
16059 (relro_script_test.so): New target.
16060 * testsuite/Makefile.in: Rebuild.
16061
f827c9a9
CC
160622008-08-06 Cary Coutant <ccoutant@google.com>
16063
16064 * archive.cc (Archive::total_archives, Archive::total_members)
16065 (Archive::total_members_loaded): New variables.
16066 (Archive::setup): Add parameter. Add option to preread
16067 archive symbols.
16068 (Archive::read_armap): Add counter.
16069 (Archive::get_file_and_offset): New function.
16070 (Archive::get_elf_object_for_member): New function.
16071 (Archive::read_all_symbols): New function.
16072 (Archive::read_symbols): New function.
16073 (Archive::add_symbols): Add counters.
16074 (Archive::include_all_members): Use armap to find members if it's
16075 already built.
16076 (Archive::include_member): Skip reading symbols if already read.
16077 Factored code into Archive::get_file_and_offset and
16078 Archive::get_elf_object_for_member. Changed call to
16079 Mapfile::report_include_archive_member.
16080 (Archive::print_stats): New function.
16081 * archive.h: Declare Object and Read_symbols_data classes.
16082 (Archive::Archive): Add initializers for new members.
16083 (Archive::setup): Add parameter.
16084 (Archive::print_stats): New function.
16085 (Archive::total_archives, Archive::total_members)
16086 (Archive::total_members_loaded): New variables.
16087 (Archive::get_file_and_offset): New function.
16088 (Archive::get_elf_object_for_member): New function.
16089 (Archive::read_all_symbols): New function.
16090 (Archive::read_symbols): New function.
16091 (Archive::Archive_member): New class.
16092 (Archive::members_): New member.
16093 (Archive::num_members_): New member.
16094 * main.cc: Include archive.h.
16095 (main): Call Archive::print_stats.
16096 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16097 archive parameter; member_name is now the fully-decorated name.
16098 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16099 * options.h: (General_options): Add --preread-archive-symbols option.
16100 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16101 Archive::setup.
16102
de4c45bd
ILT
161032008-08-04 Ian Lance Taylor <iant@google.com>
16104
16105 * symtab.h (Symbol::use_plt_offset): New function.
16106 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16107 * powerpc.cc (Relocate::relocate): Likewise.
16108 * sparc.cc (Relocate::relocate): Likewise.
16109 * x86_64.cc (Relocate::relocate): Likewise.
16110 * testsuite/weak_plt.sh: New test.
16111 * testsuite/weak_plt_main.cc: New test.
16112 * testsuite/weak_plt_shared.cc: New test.
16113 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16114 (check_PROGRAMS): Add weak_plt.
16115 (check_DATA): Add weak_plt_shared.so.
16116 (weak_plt_main_pic.o, weak_plt): New targets.
16117 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16118 * testsuite/Makefile.in: Rebuild.
16119
16120 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16121 gcctestdir/ld.
16122 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16123 * testsuite/Makefile.in: Rebuild.
16124
323ee3f4
AM
161252008-08-04 Alan Modra <amodra@bigpond.net.au>
16126
16127 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16128 * Makefile.in: Regenerate.
16129 * po/POTFILES.in: Regenerate.
16130
7c07ecec
ILT
161312008-07-29 Ian Lance Taylor <iant@google.com>
16132
16133 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16134 symbols before other symbols.
16135 * testsuite/script_test_2.cc (test_addr): Declare.
16136 (test_addr_alias): Declare.
16137 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16138 values.
7c07ecec
ILT
16139 * testsuite/script_test_2.t: Define test_addr_alias and
16140 test_addr.
16141
5778530e
ILT
161422008-07-24 Ian Lance Taylor <iant@google.com>
16143
2a00e4fb
ILT
16144 PR 5990
16145 * descriptors.cc: New file.
16146 * descriptors.h: New file.
16147 * gold-threads.h (class Hold_optional_lock): New class.
16148 * fileread.cc: Include "descriptors.h".
16149 (File_read::~File_read): Release descriptor rather than closing
16150 it.
16151 (File_read::open) [file]: Call open_descriptor rather than open.
16152 Set is_descriptor_opened_.
16153 (File_read::open) [memory]: Assert that descriptor is not open.
16154 (File_read::reopen_descriptor): New function.
16155 (File_read::release): Release descriptor.
16156 (File_read::do_read): Make non-const. Reopen descriptor.
16157 (File_read::read): Make non-const.
16158 (File_read::make_view): Reopen descriptor.
16159 (File_read::do_readv): Likewise.
16160 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16161 Update declarations.
16162 * layout.cc: Include "descriptors.h".
16163 (Layout::create_build_id): Use open_descriptor rather than open.
16164 * output.cc: Include "descriptors.h".
16165 (Output_file::open): Use open_descriptor rather than open.
16166 * archive.cc (Archive::const_iterator): Change Archive to be
16167 non-const.
16168 (Archive::begin, Archive::end): Make non-const.
16169 (Archive::count_members): Likewise.
16170 * archive.h (class Archive): Update declarations.
16171 * object.h (Object::read): Make non-const.
16172 * Makefile.am (CCFILES): Add descriptors.cc.
16173 (HFILES): Add descriptors.h.
16174 * Makefile.in: Rebuild.
16175
801647d1
ILT
16176 PR 6716
16177 * gold.h: Always include <clocale>. Add Solaris workarounds
16178 following code in binutils/sysdep.h.
16179
5edd166e
ILT
16180 PR 6048
16181 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16182 this->eh_frame_hdr_ is NULL before using it.
16183
c89ad728
ILT
16184 * dynobj.cc (Versions::Versions): Update comment.
16185
aa86f06b
ILT
16186 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16187 the base version name.
16188
5778530e
ILT
16189 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16190 array size plus one.
16191 (Stringpool_template::set_string_offsets): Subtract one from key
16192 before using it as an array index.
16193 (Stringpool_template::get_offset_with_length): Likewise.
16194 (Stringpool_template::write_to_buffer): Likewise.
16195 * stringpool.h (Stringpool_template::get_offset_from_key):
16196 Likewise.
16197
057ead22
ILT
161982008-07-23 Ian Lance Taylor <iant@google.com>
16199
7f649c59
ILT
16200 PR 6658
16201 * object.h (Merged_symbol_value::value): Do our best to handle a
16202 negative addend.
16203
057ead22
ILT
16204 PR 6647
16205 * script.cc (Version_script_info::get_versions): Don't add empty
16206 version tag to return value.
16207 (Version_script_info::get_symbol_version_helper): Change return
16208 type to bool. Add pversion parameter. Change all callers.
16209 (script_register_vers_node): Don't require a non-NULL tag.
16210 * script.h (class Version_script_info): Update declarations.
16211 (Version_script_info::get_symbol_version): Change return type to
16212 bool. Add version parameter. Change all callers.
16213 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16214 handling. Handle an empty version from a version script.
16215 (Symbol_table::define_special_symbol): Likewise.
16216 * testsuite/ver_test_10.script: New file.
16217 * testsuite/ver_test_10.sh: New file.
16218 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16219 (check_DATA): Add ver_test_10.syms.
16220 (ver_test_10.syms, ver_test_10.so): New target.
16221 * testsuite/Makefile.in: Rebuild.
16222
58e54ac2
CD
162232008-07-23 Simon Baldwin <simonb@google.com>
16224
16225 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16226 to zero for undefined symbols from dynamic libraries.
16227
95d14cd3
ILT
162282008-07-23 Ian Lance Taylor <iant@google.com>
16229
16230 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16231 Change all callers.
16232 * symtab.h (class Symbol_table): Update declaration.
16233 * testsuite/ver_test_9.cc: New file.
16234 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16235 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16236 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16237 (ver_test_9.so, ver_test_9.o): New targets.
16238 * testsuite/Makefile.in: Rebuild.
16239
92de84a6
ILT
162402008-07-22 Ian Lance Taylor <iant@google.com>
16241
34810851
ILT
16242 * options.h (class General_options): Define --check-sections.
16243 * layout.cc (Layout::set_segment_offsets): Handle
16244 --check-sections.
16245
af6156ef
ILT
16246 * options.h (class General_options): Define -n/--nmagic and
16247 -N/--omagic.
16248 * options.cc (General_options::finalize): For -n/--nmagic or
16249 -N/--omagic, set -static.
16250 * layout.cc (Layout::attach_allocated_section_to_segment): If
16251 -N/--omagic, don't put read-only and read-write sections in
16252 different segments.
16253 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16254 finding a read-only segment.
16255 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16256 don't set the minimum segment alignment to the common page size,
16257 and don't set the file offset to the address modulo the page size.
16258 * script-sections.cc (Script_sections::create_segments): If
16259 -n/--omagic, don't put read-only and read-write sections in
16260 different segments.
16261
92de84a6
ILT
16262 * cref.cc: New file.
16263 * cref.h: New file.
16264 * options.h (class General_options): Add --print-symbol-counts.
16265 * main.cc (main): Issue defined symbol report if requested.
16266 * archive.cc (Archive::interpret_header): Make into a const member
16267 function.
16268 (Archive::add_symbols): Call Input_objects::archive_start and
16269 archive_stop.
16270 (Archive::const_iterator): Define new class.
16271 (Archive::begin, Archive::end): New functions.
16272 (Archive::include_all_members): Rewrite to use iterator.
16273 (Archive::count_members): New function.
16274 * archive.h (class Archive): Update declarations.
16275 (Archive::filename): New function.
16276 * object.cc: Include "cref.h".
16277 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16278 (Sized_relobj::do_get_global_symbol_counts): New function.
16279 (Input_objects::add_object): Add object to cross-referencer.
16280 (Input_objects::archive_start): New function.
16281 (Input_objects::archive_stop): New function.
16282 (Input_objects::print_symbol_counts): New function.
16283 * object.h: Declare Cref and Archive.
16284 (Object::get_global_symbol_counts): New function.
16285 (Object::do_get_global_symbol_counts): New pure virtual function.
16286 (class Sized_relobj): Add defined_count_ field. Update
16287 declarations.
16288 (class Input_objects): Add cref_ field. Update constructor.
16289 Update declarations.
16290 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16291 defined_count_.
16292 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16293 symbol counts.
16294 (Sized_dynobj::do_get_global_symbol_counts): New function.
16295 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16296 defined_count_. Update declarations. Define Symbols typedef.
16297 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16298 parameter. Change all callers.
16299 (Symbol_table::add_from_dynobj): Add sympointers and defined
16300 parameters. Change all callers.
16301 * symtab.h (class Symbol_table): Update declarations.
16302 * Makefile.am (CCFILES): Add cref.cc.
16303 (HFILES): Add cref.h.
16304 * Makefile.in: Rebuild.
16305
3f7c5e1d
CD
163062008-07-22 Simon Baldwin <simonb@google.com>
16307
16308 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16309 to zero when writing undefined symbols.
16310
e0b64032
ILT
163112008-07-22 Ian Lance Taylor <iant@google.com>
16312
16313 * output.cc (Output_section::add_input_section): Don't try to
16314 merge empty merge sections.
16315
096b02cf
CS
163162008-07-21 Craig Silverstein <csilvers@google.com>
16317
16318 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16319 Include symbol version in error message.
cd536b21 16320
1d1f116d
CD
163212008-07-20 Chris Demetriou <cgd@google.com>
16322
cd536b21 16323 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16324 (RANDOM_SEED_CFLAGS): New substituted variable.
16325 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16326 * configure: Rebuild.
16327 * Makefile.in: Likewise.
16328 * testsuite/Makefile.in: Likewise.
16329
a18f591e
ILT
163302008-07-18 Ian Lance Taylor <iant@google.com>
16331
16332 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16333 where we see NAME/NULL and NAME/VERSION as separate symbols.
16334 * testsuite/ver_test_main.cc (main): Call t4.
16335 (t4, t4_2a): Define.
16336 * testsuite/ver_test_2.cc (t4_2): Define.
16337 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16338 * testsuite/ver_test_4.cc (t4_2a): Define.
16339 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16340 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16341
c6e3f6ed
ILT
163422008-07-17 Ian Lance Taylor <iant@google.com>
16343
16344 * dynobj.cc (Versions::add_def): If we give an error about a
16345 missing version, go ahead and create the version anyhow.
16346
ef9beddf
ILT
163472008-07-10 Ian Lance Taylor <iant@google.com>
16348
16349 Handle output sections with more than 0x7fffffff bytes.
16350 * object.h (class Relobj): Change map_to_output_ to
16351 output_sections_, and just keep a section pointer. Change all
16352 uses. Move comdat group support to Sized_relobj.
16353 (Relobj::is_section_specially_mapped): Remove.
16354 (Relobj::output_section): Remove poff parameter. Change all
16355 callers.
16356 (Relobj::output_section_offset): New function.
16357 (Relobj::set_section_offset): Rewrite.
16358 (Relobj::map_to_output): Remove.
16359 (Relobj::output_sections): New function.
16360 (Relobj::do_output_section_offset): New pure virtual function.
16361 (Relobj::do_set_section_offset): Likewise.
16362 (class Sized_relobj): Add section_offsets_ field. Add comdat
16363 group support from Relobj. Update declarations.
16364 (Sized_relobj::get_output_section_offset): New function.
16365 (Sized_relobj::do_output_section_offset): New function.
16366 (Sized_relobj::do_set_section_offset): New function.
16367 * object.cc (Relobj::output_section_address): Remove.
16368 (Sized_relobj::Sized_relobj): Initialize new fields.
16369 (Sized_relobj::include_section_group): Cast find_kept_object to
16370 Sized_relobj.
16371 (Sized_relobj::include_linkonce_section): Likewise.
16372 (Sized_relobj::do_layout): Use separate arrays for output section
16373 and output offset.
16374 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16375 output_sections.
16376 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16377 output_sections and section_offsets.
16378 (Sized_relobj::write_local_symbols): Likewise.
16379 (map_to_kept_section): Compute output address directly.
16380 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16381 output_sections and section_offsets.
16382 (Sized_relobj::write_sections): Likewise.
16383 (Sized_relobj::relocate_sections): Likewise.
16384 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16385 * output.h (class Output_reloc): Update declarations. Change
16386 u2_.relobj to Sized_relobj*.
16387 (class Output_data_reloc): Change add functions to use
16388 Sized_relobj*.
16389 * output.cc (Output_reloc::Output_reloc): Change relobj to
16390 Sized_relobj*.
16391 (Output_reloc::local_section_offset): Change return type to
16392 Elf_Addr. Use get_output_section_offset.
16393 (Output_reloc::get_address): Likewise.
16394 (Output_section::is_input_address_mapped): Don't call
16395 is_section_specially_mapped.
16396 (Output_section::output_offset): Likewise.
16397 (Output_section::output_address): Likewise.
16398 (Output_section::starting_output_address): Likewise.
16399 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16400 parameter to Sized_relobj*.
16401 (Copy_relocs::need_copy_reloc): Likewise.
16402 (Copy_relocs::save): Likewise.
16403 * copy-relocs.h (class Copy_relocs): Update declarations.
16404 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16405 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16406 * target-reloc.h (relocate_for_relocatable): Change
16407 offset_in_output_section type to Elf_Addr. Change code that uses
16408 it as well.
16409 * layout.cc (Layout::layout): Always set *off.
16410 * mapfile.cc (Mapfile::print_input_section): Use
16411 output_section_offset.
16412 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16413 Sized_relobj*.
16414 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16415 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16416 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16417
5cb66f97
ILT
164182008-07-03 Ian Lance Taylor <iant@google.com>
16419
16420 * layout.cc (Layout::include_section): Do not discard unrecognized
16421 SHT_STRTAB sections.
16422
afe47622
CS
164232008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16424
16425 * script.cc (Lex::can_continue_name): Make '?' allowable in
16426 version-script names.
16427 * testsuite/version_script.map: Change glob pattern to use '?'
16428
5adf9721
ILT
164292008-06-30 Manish Singh <yosh@gimp.org>
16430
16431 PR 6585
16432 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16433 Correct typo.
16434
e6fde208
ILT
164352008-06-30 Ian Lance Taylor <iant@google.com>
16436
16437 PR 6660
16438 PR 6682
16439 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16440 versions]: Don't try to read the value in the contents, since we
16441 don't use it. Use the template endianness when writing.
16442
3f2e6a2d
CC
164432008-06-25 Cary Coutant <ccoutant@google.com>
16444
16445 * fileread.cc (File_read::make_view): Assert on zero-length view.
16446 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16447 symbol table when there are no symbols to read.
16448
c43d3a48
CS
164492008-06-23 Craig Silverstein <csilvers@google.com>
16450
16451 * version.cc (version_string): Bump to 1.7
16452
5f494ea0
CS
164532008-06-18 Craig Silverstein <csilvers@google.com>
16454
16455 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16456 constant 0xFFFF to type Valtype.
16457 (Powerpc_relocate_functions::rel16_ha): Likewise.
16458
c42e122e
ILT
164592008-06-17 Ian Lance Taylor <iant@google.com>
16460
f34787f8
ILT
16461 * output.h (Output_section::Input_section): Initialize p2align_ to
16462 zero for Output_section_data constructors.
16463 (Output_section::Input_section::addralign): If not an input
16464 section, return the alignment of the Output_section_data.
16465 * testsuite/copy_test.cc: New file.
16466 * testsuite/copy_test_1.cc: New file.
16467 * testsuite/copy_test_2.cc: New file.
16468 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16469 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16470 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16471 (copy_test_1_pic.o, copy_test_1.so): New targets.
16472 (copy_test_2_pic.o, copy_test_2.so): New targets.
16473 * testsuite/Makefile.in: Rebuild.
16474
c42e122e
ILT
16475 * script-sections.cc (Script_sections::place_orphan): Initialize
16476 local variable exact.
16477
ce3ac18a
DE
164782008-06-13 David Edelsohn <edelsohn@gnu.org>
16479
16480 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16481
42cacb20
DE
164822008-06-12 David Edelsohn <edelsohn@gnu.org>
16483 David S. Miller <davem@davemloft.net>
16484
16485 * powerpc.cc: New file.
16486 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16487 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16488 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16489 * Makefile.in: Rebuild.
16490
7b308235
ILT
164912008-06-09 Ian Lance Taylor <iant@google.com>
16492
16493 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16494 <exception>.
16495 (throwing, orig_terminate): New static variables.
16496 (terminate_handler): New static function.
16497 (t2): Set terminate handler.
16498
f0b886e3
ILT
164992008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16500
16501 PR 6584
cd536b21 16502 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16503 alignment.
16504
3e90f135
CC
165052008-05-30 Cary Coutant <ccoutant@google.com>
16506
16507 * archive.cc (Archive::include_all_members) Correct to step
16508 over symbol table and extended name table in thin archives.
16509
e09ad04a
ILT
165102008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16511
16512 PR 6407
16513 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16514 calculation.
16515
62b01cb5
ILT
165162008-05-28 Caleb Howe <cshowe@google.com>
16517
16518 * reduced_debug_output.cc: New file.
16519 * reduced_debug_output.h: New file.
92de84a6 16520 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16521 * options.cc (General_options::finalize): Add strip_debug_non_line
16522 to the strip heirarchy.
16523 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16524 fields.
16525 * layout.cc: Include "reduced_debug_output.h".
16526 (Layout::Layout): Initialize new fields.
16527 (line_only_debug_sections): New static array.
16528 (is_lines_only_debug_sections): New static inline function.
16529 (Layout::include_section): Handle --strip-debug-non-line.
16530 (Layout::make_output_section): If --strip-debug-non-line, build
16531 new output sections for .debug_abbrev and .debug_info.
16532 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16533 gold. Warn about possible overflow.
16534 (read_signed_LEB_128): Likewise.
16535 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16536 (read_signed_LEB_128): Declare.
16537 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16538 (HFILES): Add reduced_debug_output.h.
16539 * Makefile.in: Rebuild.
16540
7d9e3d98
ILT
165412008-05-21 Ian Lance Taylor <iant@google.com>
16542
16543 * mapfile.cc: New file.
16544 * mapfile.h: New file.
16545 * options.h (class General_options): Add -M/--print-map and -Map.
16546 * options.cc (General_options::finalize): Make -M equivalent to
16547 -Map -.
16548 * main.cc: Include <cstdio> and "mapfile.h".
16549 (main): Open mapfile if requested.
16550 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16551 constructor. Change caller.
16552 (queue_initial_tasks): Add mapfile parameter. Change caller.
16553 (queue_middle_tasks): Likewise.
16554 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16555 declarations.
16556 * archive.cc: Include "mapfile.h".
16557 (Archive::add_symbols): Add mapfile parameter. Change all
16558 callers. Pass mapfile, symbol, and reason to include_member.
16559 (Archive::include_all_members): Add mapfile parameter. Change all
16560 callers.
16561 (Archive::include_member): Add mapfile, sym, and why parameters.
16562 Change all callers. Report inclusion to map file.
16563 * archive.h: Include "fileread.h".
16564 (class Archive): Update declarations.
16565 (Archive::file): New const method.
16566 (class Add_archive_symbols): Add mapfile_ field. Update
16567 constructor. Change all callers.
16568 * readsyms.h (class Read_symbols): Likewise.
16569 (class Finish_group): Likewise.
16570 (class Read_script): Likewise.
16571 * common.cc: Include "mapfile.h".
16572 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16573 all callers.
16574 (Symbol_table::do_allocate_commons): Likewise.
16575 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16576 symbol allocation to mapfile.
16577 * common.h (class Allocate_commons_task): Add mapfile_ field.
16578 Update constructor. Change all callers.
16579 * symtab.h (class Symbol_table): Update declarations.
16580 * layout.cc: Include "mapfile.h".
16581 (Layout_task_runner::run): Print information to mapfile.
16582 (Layout::create_gold_note): Change Output_data_fixed_space to
16583 Output_data_zero_fill.
16584 (Layout::create_build_id): Likewise.
16585 (Layout::print_to_mapfile): New function.
16586 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16587 constructor. Change caller.
16588 (class Layout): Declare print_to_mapfile.
16589 * output.cc (Output_section::Input_section::print_to_mapfile): New
16590 function.
16591 (Output_section::add_input_section): If producing a map, always
16592 add to input_sections_ list.
16593 (Output_section::do_print_to_mapfile): New function.
16594 (Output_segment::print_sections_to_mapfile): New function.
16595 (Output_segment::print_section_list_to_mapfile): New function.
16596 * output.h: Include "mapfile.h".
16597 (Output_data::print_to_mapfile): New function.
16598 (Output_data::do_print_to_mapfile): New virtual function.
16599 (Output_segment_headers::do_print_to_mapfile): New function.
16600 (Output_file_header::do_print_to_mapfile): New function.
16601 (Output_data_const::do_print_to_mapfile): New function.
16602 (class Output_data_const_buffer): Add map_name_ field. Update
16603 constructor. Change all callers. Add do_print_to_mapfile
16604 function.
16605 (class Output_data_fixed_space): Likewise.
16606 (class Output_data_space): Likewise.
16607 (class Output_data_zero_fill): New class.
16608 (Output_data_strtab::do_print_to_mapfile): New function.
16609 (Output_data_reloc_base::do_print_to_mapfile): New function.
16610 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16611 (Output_data_group::do_print_to_mapfile): New function.
16612 (Output_data_got::do_print_to_mapfile): New function.
16613 (Output_data_dynamic::do_print_to_mapfile): New function.
16614 (Output_symtab_xindex::do_print_to_mapfile): New function.
16615 (class Output_section): Declare do_print_to_mapflie. Declare
16616 print_to_mapfile in Input_section.
16617 (class Output_segment): Declare new functions.
16618 * object.h (Sized_relobj::symbol_count): New function.
16619 * script-sections.cc
16620 (Output_section_element_dot_assignment::set_section_addresses):
16621 Change Output_data_fixed_space to Output_data_zero_fill.
16622 (Output_data_expression::do_print_to_mapfile): New function.
16623 * script.cc (read_input_script): Add mapfile parameter. Change
16624 all callers.
16625 * script.h (read_input_script): Update declaration.
16626 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16627 (Eh_frame::do_print_to_mapfile): New function.
16628 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16629 (Output_merge_string::do_print_to_mapfile): New function.
16630 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16631 function.
16632 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16633 function.
16634 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16635 function.
16636 * Makefile.am (CCFILES): Add mapfile.cc.
16637 (HFILES): Add mapfile.h.
16638 * Makefile.in: Rebuild.
16639
9f1d377b
ILT
166402008-05-19 Ian Lance Taylor <iant@google.com>
16641
16642 * options.h (class General_options): Add -z relro.
16643 * layout.cc (Layout::Layout): Initialize relro_segment_.
16644 (Layout::add_output_section_data): Return the output section.
16645 (Layout::make_output_section): Rcognize relro sections and mark
16646 them appropriately.
16647 (Layout::attach_allocated_section_to_segment): Put relro sections
16648 in a PT_GNU_RELRO segment.
16649 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16650 section as relro.
16651 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16652 PT_TLS segments.
16653 (Layout::linkonce_mapping): Map d.rel.ro.local to
16654 .data.rel.ro.local.
16655 (Layout::output_section_name): Us .data.rel.ro.local for any
16656 section which begins with that.
16657 * layout.h (class Layout): Update add_output_section_data
16658 declaration. Add relro_segment_ field.
16659 * output.cc (Output_section::Output_section): Initialize is_relro_
16660 and is_relro_local_ fields.
16661 (Output_segment::add_output_section): Group relro sections.
16662 (Output_segment::is_first_section_relro): New function.
16663 (Output_segment::maximum_alignment): If there is a relro section,
16664 align the segment to the common page size.
16665 (Output_segment::set_section_addresses): Track whether we are
16666 looking at relro sections. If the last section is a relro
16667 section, align to the common page size.
16668 (Output_segment::set_section_list_addresses): Add in_relro
16669 parameter. Change all callers. Align to the page size when
16670 moving from relro to non-relro section.
16671 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16672 segment.
16673 * output.h (class Output_section): Add is_relro_ and
16674 is_relro_local_ fields.
16675 (Output_section::is_relro): New function.
16676 (Output_section::set_is_relro): New function.
16677 (Output_section::is_relro_local): New function.
16678 (Output_section::set_is_relro_local): New function.
16679 (class Output_segment): Update declarations.
16680 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16681 * sparc.cc (Target_sparc::got_section): Likewise.
16682 * x86_64.cc (Target_x86_64::got_section): Likewise.
16683 * testsuite/relro_test_main.cc: New file.
16684 * testsuite/relro_test.cc: New file.
16685 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16686 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16687 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16688 (relro_test.so, relro_test_pic.o): New targets.
16689 * testsuite/Makefile.in: Rebuild.
16690
a984ee1d
ILT
166912008-05-16 Ian Lance Taylor <iant@google.com>
16692
01676dcd
ILT
16693 * output.cc (Output_segment::add_output_section): Remove front
16694 parameter.
16695 * output.h (class Output_segment): Remove
16696 add_initial_output_section and overloaded add_output_section.
16697 Update declaration of remaining add_output_section.
16698 * layout.cc (Layout::create_interp): Call add_output_section
16699 rather than add_initial_output_section.
16700 (Layout::finish_dynamic_section): Likewise.
16701
497897f9
ILT
16702 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16703 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16704 know the dynamic type.
16705 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16706 field. Initialize it in constructor.
16707 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16708 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16709 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16710 reloc.
16711
a984ee1d
ILT
16712 * output.cc (Output_reloc::get_address): Change return type to
16713 Elf_Addr.
16714 * output.h (class Output_reloc): Update get_address declaration.
16715 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16716 for section addresses.
16717
55ba0940
ILT
167182008-05-09 Ian Lance Taylor <iant@google.com>
16719
16720 PR 6493
16721 * gold.cc (gold_nomem): Use return value of write.
16722
75517b77
ILT
167232008-05-08 Ian Lance Taylor <iant@google.com>
16724
16725 * symtab.c (Symbol::init_base_output_data): Add version
16726 parameter. Change all callers.
16727 (Symbol::init_base_output_segment): Likewise.
16728 (Symbol::init_base_constant): Likewise.
16729 (Symbol::init_base_undefined): Likewise.
16730 (Sized_symbol::init_output_data): Likewise.
16731 (Sized_symbol::init_output_segment): Likewise.
16732 (Sized_symbol::init_constant): Likewise.
16733 (Sized_symbol::init_undefined): Likewise.
16734 (Symbol_table::do_define_in_output_data): If the new symbol has a
16735 version, mark it as the default.
16736 (Symbol_table::do_define_in_output_segment): Likewise.
16737 (Symbol_table::do_define_as_constant): Likewise.
16738 * symtab.h (class Symbol): Update declarations.
16739 (class Sized_symbol): Likewise.
16740 * resolve.cc (Symbol::override_version): New function.
c42e122e 16741 (Symbol::override_base): Call override_version.
75517b77
ILT
16742 (Symbol::override_base_with_special): Likewise.
16743 * testsuite/ver_script_8.script: New file.
16744 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16745 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16746 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16747 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16748
f1f70eae
ILT
167492008-05-06 Ian Lance Taylor <iant@google.com>
16750
f3e9c5c5
ILT
16751 PR 6049
16752 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16753 functions.
16754 (class General_options): Remove existing --undefined, and add
16755 --no-undefined instead. Add new --undefined as synonym for -u.
16756 * archive.cc (Archive::add_symbols): Check whether symbol was
16757 named with -u.
16758 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16759 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16760 all uses. Add IS_UNDEFINED. Update declarations to split
16761 different versions of init_base. Declare init_base_undefined.
16762 (Symbol::is_defined): Handle IS_UNDEFINED.
16763 (Symbol::is_undefined): Likewise.
16764 (Symbol::is_weak_undefined): Call is_undefined.
16765 (Symbol::is_absolute): Handle IS_CONSTANT.
16766 (class Sized_symbol): Update declarations to split different
16767 versions of init. Declare init_undefined.
16768 (class Symbol_table): Declare new functions.
16769 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16770 Change all callers.
16771 (Symbol::init_base_output_data): Likewise.
16772 (Symbol::init_base_output_segment): Likewise.
16773 (Symbol::init_base_constant): Likewise.
16774 (Symbol::init_base_undefined): New function.
16775 (Sized_symbol::init_object): Rename from init. Change all
16776 callers.
16777 (Sized_symbol::init_output_data): Likewise.
16778 (Sized_symbol::init_output_segment): Likewise.
16779 (Sized_symbol::init_constant): Likewise.
16780 (Sized_symbol::init_undefined): New function.
16781 (Symbol_table::add_undefined_symbols_from_command_line): New
16782 function.
16783 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16784 function.
16785 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16786 (Symbol::output_section): Likewise.
16787 (Symbol::set_output_section): Likewise.
16788 (Symbol_table::sized_finalize_symbol): Likewise.
16789 (Symbol_table::sized_write_globals): Likewise.
16790 * resolve.cc (Symbol_table::should_override): Likewise.
16791 (Symbol::override_base_with_special): Likewise.
16792
8bdcdf2c
ILT
16793 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16794 symbol, change it to have default visibility.
16795 * testsuite/protected_1.cc: New file.
16796 * testsuite/protected_2.cc: New file.
16797 * testsuite/protected_3.cc: New file.
16798 * testsuite/protected_main_1.cc: New file.
16799 * testsuite/protected_main_2.cc: New file.
16800 * testsuite/protected_main_3.cc: New file.
16801 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16802 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16803 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16804 (protected_1.so): New target.
16805 (protected_1_pic.o, protected_2_pic.o): New targets.
16806 (protected_3_pic.o): New target.
16807 (check_PROGRAMS): Add protected_2.
16808 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16809 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16810 * testsuite/Makefile.in: Rebuild.
16811
2b706932
ILT
16812 * options.h (DEFINE_var): Add set_user_set_##varname__.
16813 (DEFINE_bool_alias): New macro.
16814 (class General_options): Define -Bstatic using DEFINE_bool_alias
16815 rather than DEFINE_special. Add --undefined as an alias for -z
16816 defs.
16817 * options.cc (General_options::parse_Bstatic): Remove.
16818
d82a5bcc
ILT
16819 * options.h (class General_options): Add --fatal-warnings.
16820 * main.cc (main): Implement --fatal-warnings.
16821 * errors.h (Errors::warning_count): New function.
16822
f1f70eae
ILT
16823 * options.h (class General_options): Add -Bsymbolic-functions.
16824 * symtab.h (Symbol::is_preemptible): Check for
16825 -Bsymbolic-functions.
16826
8825ac63
ILT
168272008-05-05 Ian Lance Taylor <iant@google.com>
16828
d98bc257
ILT
16829 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16830 as noVARNAME rather than no-VARNAME.
16831 (class General_options): Add option -z combreloc.
16832 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16833 get_address.
16834 (Output_reloc::sort_before) [SHT_REL]: New function.
16835 (Output_reloc::sort_before) [SHT_RELA]: New function.
16836 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16837 Sort_relocs_comparison.
16838 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16839 parameter. Change all callers.
16840 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16841 sort_relocs parameter. Change all callers.
16842 * output.cc (Output_reloc::get_address): New function, broken out
16843 of write_rel.
16844 (Output_reloc::write_rel): Call it.
16845 (Output_reloc::compare): New function.
16846 (Output_data_reloc_base::do_write): Optionally sort relocs.
16847
60b2b4e7
ILT
16848 * configure.ac: If targ_extra_obj is set, link it in.
16849 * configure.tgt: Initialize all variables.
16850 (x86_64*): Set targ_extra_obj and targ_extra_size.
16851 * configure: Rebuild.
16852
8825ac63
ILT
16853 * object.cc (Sized_relobj::include_section_group): Adjust section
16854 indexes read from group data. Build vector to pass to
16855 layout_group.
16856 * layout.cc (Layout::layout_group): Add flags and shndxes
16857 parameters. Remove contents parameter. Change caller. Update
16858 explicit instantiations.
16859 * layout.h (class Layout): Update layout_group declaration.
16860 * output.cc (Output_data_group::Output_data_group): Add flags and
16861 input_shndxes parameters. Remove contents parameter. Change
16862 caller.
16863 (Output_data_group::do_write): Change input_sections_ to
16864 input_shndxes_.
16865 * output.h (class Output_data_group): Update constructor
16866 declaration. Rename input_sections_ to input_shndxes_.
16867 * testsuite/many_sections_test.cc: Add template.
16868
e94cf127
CC
168692008-04-30 Cary Coutant <ccoutant@google.com>
16870
4418b2d5
CC
16871 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16872
e94cf127
CC
16873 * layout.cc (Layout::include_section): Refactored check for debug
16874 info section.
16875 (Layout::add_comdat): Add new parameters. Change type
16876 of signature parameter. Add object and shndx to signatures table.
16877 (Layout::find_kept_object): New function.
16878 * layout.h: Include <cstring>.
16879 (Layout::is_debug_info_section): New function.
16880 (Layout::add_comdat): Add new parameters.
16881 (Layout::find_kept_object): New function.
16882 (Layout::Kept_section): New struct.
16883 (Layout::Signatures): Change type of map range.
16884 * object.cc (Relobj::output_section_address): New function.
16885 (Sized_relobj::include_section_group): Add new parameters. Change
16886 calls to Layout::add_comdat. Change to build table of kept comdat
16887 groups and table mapping discarded sections to kept sections.
16888 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16889 (Sized_relobj::do_layout): Change calls to include_section_group and
16890 include_linkonce_section.
16891 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16892 value to zero when section is discarded.
16893 (Sized_relobj::map_to_kept_section): New function.
16894 * object.h (Relobj::output_section_address): New function.
16895 (Relobj::Comdat_group): New type.
16896 (Relobj::find_comdat_group): New function.
16897 (Relobj::Comdat_group_table): New type.
16898 (Relobj::Kept_comdat_section): New type.
16899 (Relobj::Kept_comdat_section_table): New type.
16900 (Relobj::add_comdat_group): New function.
16901 (Relobj::set_kept_comdat_section): New function.
16902 (Relobj::get_kept_comdat_section): New function.
16903 (Relobj::comdat_groups_): New field.
16904 (Relobj::kept_comdat_sections_): New field.
16905 (Symbol_value::input_value): Update comment.
16906 (Sized_relobj::map_to_kept_section) New function.
16907 (Sized_relobj::include_linkonce_section): Add new parameter.
16908 * target-reloc.h (Comdat_behavior): New type.
16909 (get_comdat_behavior): New function.
16910 (relocate_section): Add code to map a discarded section to the
16911 corresponding kept section when applying a relocation.
16912
e4e5049b
CS
169132008-04-30 Craig Silverstein <csilvers@google.com>
16914
16915 * dwarf_reader.cc (next_generation_count): New static var.
16916 (Addr2line_cache_entry): New struct.
16917 (addr2line_cache): New static var.
16918 (Dwarf_line_info::one_addr2line): Added caching.
16919 (Dwarf_line_info::clear_addr2line_cache): New function.
16920 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16921 cache-size parameter.
16922 (Dwarf_line_info::one_addr2line_cache): New function.
16923 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16924 new cache-size argument to one_addr2line(), and clear cache.
16925
d09e9154
CC
169262008-04-28 Cary Coutant <ccoutant@google.com>
16927
16928 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16929 R_386_PC8 relocations.
16930
7ef73768
ILT
169312008-04-23 Ian Lance Taylor <iant@google.com>
16932
55438702
ILT
16933 * object.cc (Sized_relobj::include_section_group): Check for
16934 invalid section group.
16935
c165fb93
ILT
16936 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16937 header size.
16938
7ef73768
ILT
16939 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16940 than read for file header.
16941 * archive.cc (Archive::include_member): Likewise.
16942
6194aaab
L
169432008-04-23 Paolo Bonzini <bonzini@gnu.org>
16944
16945 * aclocal.m4: Regenerate.
16946 * configure: Regenerate.
16947
d491d34e
ILT
169482008-04-19 Ian Lance Taylor <iant@google.com>
16949
5ea2bac6
ILT
16950 * version.cc (version_string): Bump to 1.6.
16951
7bc3e21a
ILT
16952 * testsuite/Makefile.am (many_sections_r_test): New target.
16953 (many_sections_r_test_SOURCES): Remove.
16954 (many_sections_r_test_DEPENDENCIES): Remove.
16955 (many_sections_r_test_LDFLAGS): Remove.
16956 (many_sections_r_test_LDADD): Remove.
16957
7fcd3aa9
ILT
16958 * object.cc (Sized_relobj::do_add_symbols): Always pass
16959 local_symbol_count_ to add_from_relobj.
16960
4c94d6ae
ILT
16961 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16962 every thousand variables.
16963 * testsuite/Makefile.in: Rebuild.
16964
d491d34e
ILT
16965 * object.cc (Xindex::initialize_symtab_xindex): New function.
16966 (Xindex::read_symtab_xindex): New function.
16967 (Xindex::sym_xindex_to_shndx): New function.
16968 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16969 available.
16970 (Sized_relobj::do_initialize_xindex): New function.
16971 (Sized_relobj::do_read_symbols): Adjust section links.
16972 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16973 parameter. Change all callers.
16974 (Sized_relobj::include_section_group): Adjust section links and
16975 symbol section indexes.
16976 (Sized_relobj::do_layout): Adjust section links.
16977 (Sized_relobj::do_count_local_symbols): Adjust section links and
16978 symbol section indexes.
16979 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16980 ordinary and special symbols.
16981 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16982 dynsym_xindex parameters. Change all callers. Adjust section
16983 links. Use SHN_XINDEX when needed.
16984 (Sized_relobj::get_symbol_location_info): Adjust section links.
16985 Don't get fooled by special symbols.
16986 * object.h (class Xindex): Define.
16987 (class Object): Add xindex_ parameter. Declare virtual functoin
16988 do_initialize_xindex.
16989 (Object::adjust_sym_shndx): New function.
16990 (Object::set_xindex): New protected function.
16991 (class Symbol_value): Add is_ordinary_shndx_ field.
16992 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16993 (Symbol_value::value): Assert ordinary section.
16994 (Symbol_value::initialize_input_to_output_map): Likewise.
16995 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16996 Change all callers.
16997 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16998 all callers.
16999 (class Sized_relobj): Update declarations.
17000 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17001 parameter. Change all callers.
17002 (Sized_relobj::adjust_shndx): New function.
17003 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17004 field.
17005 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17006 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17007 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17008 (Sized_dynobj::read_dynsym_section): Adjust section links.
17009 (Sized_dynobj::read_dynamic): Likewise.
17010 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17011 section links.
17012 (Sized_dynobj::do_initialize_xindex): New function.
17013 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17014 do_initialize_xindex.
17015 (Sized_dynobj::adjust_shndx): New function.
17016 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17017 dynsym_xindex_ fields.
17018 (Layout::finalize): Add a call to set_section_indexes before
17019 creating the symtab sections.
17020 (Layout::set_section_indexes): Don't do anything if the section
17021 already has a section index.
17022 (Layout::create_symtab_sections): Add shnum parameter. Change
17023 caller. Create .symtab_shndx section if needed.
17024 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17025 caller.
17026 (Layout::allocated_output_section_count): New function.
17027 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17028 needed.
17029 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17030 fields. Update declarations.
17031 (Layout::symtab_xindex): New function.
17032 (Layout::dynsym_xindex): New function.
17033 (class Write_symbols_task): Add layout_ field.
17034 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17035 Change caller.
17036 * output.cc (Output_section_headers::Output_section_headers): Add
17037 shstrtab_section parameter. Change all callers.
17038 (Output_section_headers::do_sized_write): Store overflow values
17039 for section count and section string table section index in
17040 section header zero.
17041 (Output_file_header::do_sized_write): Check for overflow of
17042 section count and section string table section index.
17043 (Output_symtab_xindex::do_write): New function.
17044 (Output_symtab_xindex::endian_do_write): New function.
17045 * output.h (class Output_section_headers): Add shstrtab_section_.
17046 Update declarations.
17047 (class Output_symtab_xindex): Define.
17048 (Output_section::has_out_shndx): New function.
17049 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17050 field.
17051 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17052 Change all callers.
17053 (Sized_symbol::init): Likewise.
17054 (Symbol::output_section): Check for ordinary symbol.
17055 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17056 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17057 callers.
17058 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17059 Change all callers. Simplify handling of symbols from sections
17060 not included in the link.
17061 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17062 distinction.
17063 (Weak_alias_sorter::operator()): Assert that symbols are
17064 ordinary.
17065 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17066 distinction.
17067 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17068 parameters. Change all callers.
17069 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17070 symbol distinction. Use SHN_XINDEX when needed.
17071 (Symbol_table::write_section_symbol): Add symtab_xindex
17072 parameter. Change all callers.
17073 (Symbol_table::sized_write_section_symbol): Likewise. Use
17074 SHN_XINDEX when needed.
17075 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17076 declarations.
17077 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17078 (Symbol::is_defined): Check is_ordinary.
17079 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17080 (Symbol::is_absolute, Symbol::is_common): Likewise.
17081 (class Sized_symbol): Update declarations.
17082 (class Symbol_table): Update declarations.
17083 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17084 parameters. Change all callers.
17085 (Sized_symbol::override): Likewise.
17086 (Symbol_table::override): Likewise.
17087 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17088 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17089 is_ordinary, and orig_st_shndx parameters. Change all callers.
17090 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17091 to be in an ordinary section.
17092 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17093 object and is_ordinary parameters. Change all callers.
17094 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17095 Change all callers. Don't add undefined or non-ordinary symbols
17096 to reloc_map_.
17097 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17098 Change all callers.
17099 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17100 declarations.
17101 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17102 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17103 (Sized_relobj::relocate_sections): Likewise.
17104 * target-reloc.h (scan_relocs): Adjust section symbol index.
17105 (scan_relocatable_relocs): Likewise.
17106 * i386.cc (Scan::local): Check for ordinary symbols.
17107 * sparc.cc (Scan::local): Likewise.
17108 * x86_64.cc (Scan::local): Likewise.
17109 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17110 to symbol_section_and_value.
17111 * testsuite/many_sections_test.cc: New file.
17112 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17113 (check_PROGRAMS): Add many_sections_test.
17114 (many_sections_test_SOURCES): Define.
17115 (many_sections_test_DEPENDENCIES): Define.
17116 (many_sections_test_LDFLAGS): Define.
17117 (BUILT_SOURCES): Add many_sections_define.h.
17118 (many_sections_define.h): New target.
17119 (BUILT_SOURCES): Add many_sections_check.h.
17120 (many_sections_check.h): New target.
17121 (check_PROGRAMS): Add many_sections_r_test.
17122 (many_sections_r_test_SOURCES): Define.
17123 (many_sections_r_test_DEPENDENCIES): Define.
17124 (many_sections_r_test_LDFLAGS): Define.
17125 (many_sections_r_test_LDADD): Define.
17126 (many_sections_r_test.o): New target.
17127 * testsuite/Makefile.in: Rebuild.
17128
c5818ff1
CC
171292008-04-17 Cary Coutant <ccoutant@google.com>
17130
17131 * errors.cc (Errors::info): New function.
17132 (gold_info): New function.
17133 * errors.h (Errors::info): New function.
17134 * gold.h (gold_info): New function.
17135 * object.cc (Input_objects::add_object): Print trace output.
17136 * options.cc (options::parse_set): New function.
17137 (General_options::parse_wrap): Deleted.
17138 (General_options::General_options): Deleted initializer.
17139 * options.h (options::String_set): New typedef.
17140 (options::parse_set): New function.
17141 (DEFINE_set): New macro.
17142 (General_options::wrap): Changed to use DEFINE_set. Changed
17143 callers of any_wrap_symbols and is_wrap_symbol.
17144 (General_options::trace, General_options::trace_symbol):
17145 New options.
17146 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17147 (General_options::wrap_symbols_): Deleted.
17148 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17149
b5be4a7c
DM
171502008-04-17 David S. Miller <davem@davemloft.net>
17151
17152 * options.cc (General_options::parse_V): New function.
17153 * options.h: Add entries for -V and -Qy.
17154
155a0dd7
ILT
171552008-04-17 Ian Lance Taylor <iant@google.com>
17156
17157 * common.cc (Symbol_table::allocate_commons): Remove options
17158 parameter. Change caller.
17159 (Symbol_table::do_allocate_commons): Remove options parameter.
17160 Change caller. Just call do_allocate_commons_list twice.
17161 (Symbol_table::do_allocate_commons_list): New function, broken out
17162 of do_allocate_commons.
17163 * common.h (class Allocate_commons_task): Remove options_ field.
17164 Update constructor.
17165 * symtab.cc (Symbol_table::Symbol_table): Initialize
17166 tls_commons_.
17167 (Symbol_table::add_from_object): Put TLS common symbols on
17168 tls_commons_ list.
17169 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17170 which are IN_OUTPUT_DATA.
17171 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17172 allocate_commons and do_allocate_commons declarations. Declare
17173 do_allocate_commons_list.
17174 * gold.cc (queue_middle_tasks): Update creation of
17175 Allocate_commons_task to not pass options.
17176 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17177 (TLS_TEST_C_FLAGS): New variable.
17178 (tls_test_c_pic.o): New target.
17179 (tls_test_shared.so): Link in tls_test_c_pic.o.
17180 (tls_test_c_pic_ie.o): New target.
17181 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17182 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17183 (tls_test_c.o): New target.
17184 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17185 (tls_pic_test_LDADD): Likewise.
17186 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17187 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17188 (tls_test_c_gnu2.o): New target.
17189 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17190 tls_test_c_gnu2.o.
17191 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17192 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17193 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17194 * testsuite/tls_test.cc: Include "config.h".
17195 (t_last): Call t11_last.
17196 * testsuite/tls_test.h (t11, t11_last): Declare.
17197 * testsuite/tls_test_c.c: New file.
17198 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17199 * configure.ac: Check for OpenMP support.
17200 * configure, config.in, Makefile.in: Rebuild.
17201 * testsuite/Makefile.in: Rebuild.
17202
edfbb029
CC
172032008-04-16 Cary Coutant <ccoutant@google.com>
17204
17205 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17206 (Target_i386::tls_base_symbol_defined_): New field.
17207 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17208 (Target_i386::Scan::global): Likewise.
17209 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17210 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17211 (Target_x86_64::tls_base_symbol_defined_): New field.
17212 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17213 (Target_x86_64::Scan::global): Likewise.
17214
f3c69fca
CC
172152008-04-16 Cary Coutant <ccoutant@google.com>
17216
17217 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17218 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17219 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17220 building shared libraries.
17221 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17222 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17223 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17224 * testsuite/Makefile.in: Rebuild.
17225 * testsuite/weak_undef.h: New file.
17226 * testsuite/weak_undef_file1.cc: Add extra test cases.
17227 * testsuite/weak_undef_file2.cc: Likewise.
17228 * testsuite/weak_undef_test.cc: Likewise.
17229
7c414435
DM
172302008-04-16 David S. Miller <davem@davemloft.net>
17231
32b769e1
DM
17232 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17233 Add issued_non_pic_error_ field. Declare check_non_pic.
17234 (Target_sparc::Scan::check_non_pic): New function.
17235 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17236 (Target_sparc::Scan::global): Likewise.
17237
11936fb1
DM
17238 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17239 * configure: Rebuild.
17240
7c414435
DM
17241 * options.h (DEFINE_enable): New macro.
17242 (new_dtags): New enable option.
17243 (initfirst, interpose, loadfltr, nodefaultlib,
17244 nodelete, nodlopen, nodump): New -z options.
17245 * layout.cc (Layout:finish_dynamic_section): If new
17246 dtags enabled, emit DT_RUNPATH. Also, emit a
17247 DT_FLAGS_1 containing any specified -z flags.
17248
85c7bf8b
ILT
172492008-04-16 Ian Lance Taylor <iant@google.com>
17250
12c0daef
ILT
17251 * copy-relocs.cc: New file.
17252 * copy-relocs.h: New file.
17253 * reloc.cc: Remove Copy_relocs code.
17254 * reloc.h: Likewise.
17255 * reloc-types.h (struct Reloc_types) [both versions]: Add
17256 get_reloc_addend_noerror.
17257 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17258 variants of add_global which take an addend which must be zero.
17259 * i386.cc: Include "copy-relocs.h".
17260 (class Target_i386): Change type of copy_relocs_ to variable,
17261 update initializer.
17262 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17263 Change all callers.
17264 (Target_i386::do_finalize_sections): Change handling of
17265 copy_relocs_.
17266 * sparc.cc: Include "copy-relocs.h".
17267 (class Target_sparc): Change type of copy_relocs_ to variable,
17268 update initializer.
17269 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17270 Change all callers.
17271 (Target_sparc::do_finalize_sections): Change handling of
17272 copy_relocs_.
17273 * x86_64.cc: Include "copy-relocs.h".
17274 (class Target_x86_64): Change type of copy_relocs_ to variable,
17275 update initializer.
17276 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17277 class. Change all callers.
17278 (Target_x86_64::do_finalize_sections): Change handling of
17279 copy_relocs_.
17280 * Makefile.am (CCFILES): Add copy-relocs.cc.
17281 (HFILES): Add copy-relocs.h.
17282
4f4995b6
ILT
17283 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17284
85c7bf8b
ILT
17285 * testsuite/script_test_4.sh: Permit leading zeroes.
17286
4f2a9edd
ILT
172872008-04-15 Ian Lance Taylor <iant@google.com>
17288
e6188289
ILT
17289 * script-sections.cc (Script_sections::create_segments): Use
17290 header_size_adjustment even when there is enough room for the
17291 headers.
17292 * testsuite/script_test_4.sh: New file.
17293 * testsuite/script_test_4.t: New file.
17294 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17295 (check_DATA): Add script_test_4.stdout.
17296 (MOSTLYCLEANFILES): Likewise.
17297 (script_test_4): New target.
17298 (script_test_4.stdout): New target.
17299 * testsuite/Makefile.in: Rebuild.
17300
4f2a9edd
ILT
17301 * sparc.cc: Add definitions for Output_data_plt_sparc class
17302 constants.
17303
f5314dd5
DM
173042008-04-14 David S. Miller <davem@davemloft.net>
17305
17306 * sparc.cc: New file.
17307 * Makefile.am (TARGETSOURCES): Add sparc.cc
17308 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17309 * configure.tgt: Document targ_extra_size and
17310 targ_extra_big_endian. Add entries for sparc-* and
17311 sparc64-*.
17312 * configure.ac: Handle targ_extra_size and
17313 targ_extra_big_endian.
17314 * Makefile.in: Rebuild.
17315 * configure: Likewise.
17316 * po/POTFILES.in: Likewise.
17317 * po/gold.pot: Likewise.
17318
154e0e9a
ILT
173192008-04-14 Ian Lance Taylor <iant@google.com>
17320
17321 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17322 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17323 in the name/type/flags to section mapping. Don't call
17324 allocate_output_section.
17325 (Layout::choose_output_section): Change parameter from adjust_name
17326 to is_input_section. Don't permit input sections after sections
17327 are attached to segments. Don't call allocate_output_section.
17328 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17329 not write_enable_output_section.
17330 (Layout::make_output_section): Don't push to
17331 unattached_section_list_ nor call attach_to_segment. Call
17332 attach_section_to_segment if sections are attached.
17333 (Layout::attach_sections_to_segments): New function.
17334 (Layout::attach_section_to_segment): New function.
17335 (Layout::attach_allocated_section_to_segment): Rename from
17336 attach_to_segment. Remove flags parameter.
17337 (Layout::allocate_output_section): Remove function.
17338 (Layout::write_enable_output_section): Remove function.
17339 * layout.h (class Layout): Update for above changes. Add new
17340 field sections_are_attached_.
17341 * output.h (Output_section::update_flags_for_input_section): New
17342 function.
17343 * output.cc (Output_section::add_input_section): Call
17344 update_flags_for_input_section.
17345 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17346
009a67a2
CC
173472008-04-11 Cary Coutant <ccoutant@google.com>
17348
17349 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17350 thought unnecessary.
17351 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17352
759b1a24
ILT
173532008-04-11 Ian Lance Taylor <iant@google.com>
17354
17355 * output.h (class Output_section_data): Remove inline definition
17356 of set_addralign.
17357 * output.cc (Output_section_data::set_addralign): New function.
17358
c2b45e22
CC
173592008-04-11 Cary Coutant <ccoutant@google.com>
17360
17361 Add support for TLS descriptors for i386 and x86_64.
17362 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17363 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17364 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17365 GOT_TYPE_TLS_DESC.
17366 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17367 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17368 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17369 relocations.
17370 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17371 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17372 Fix problem with initial-exec relocations.
17373 (Target_i386::Relocate::relocate_tls): Likewise.
17374 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17375 relaxation.
17376 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17377 support for section-plus-offset dynamic table entries.
17378 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17379 (Output_data_dynamic::Dynamic_entry): Add support for
17380 section-plus-offset dynamic table entries.
17381 (Output_data_dynamic::Classification): Likewise.
17382 (Output_data_dynamic::classification_): Renamed offset_.
17383 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17384 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17385 (Target_x86_64::make_plt_section): New function.
17386 (Target_x86_64::reserve_tlsdesc_entries): New function.
17387 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17388 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17389 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17390 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17391 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17392 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17393 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17394 add extra PLT entry for TLS descriptors.
17395 (Output_data_plt_x86_64::got_): New field.
17396 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17397 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17398 fields.
17399 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17400 descriptors.
17401 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17402 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17403 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17404 R_386_TLS_DESC_CALL relocations.
17405 (Target_x86_64::Scan::global): Likewise.
17406 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17407 for TLS descriptors.
17408 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17409 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17410 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17411 GD-to-IE relaxation.
17412 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17413 and TLS_DESCRIPTORS.
17414 * Makefile.in: Rebuild.
17415 * configure: Rebuild.
17416 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17417 (tls_test_shared2.so): New target.
17418 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17419 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17420 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17421 (tls_shared_gd_to_ie_test_LDADD): New variable.
17422 (tls_shared_gnu2_gd_to_ie_test): New target.
17423 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17424 New targets.
17425 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17426 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17427 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17428 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17429 (tls_shared_gnu2_test): New target.
17430 (tls_test_gnu2_shared.so): New target.
17431 (tls_shared_gnu2_test_SOURCES): New variable.
17432 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17433 (tls_shared_gnu2_test_LDFLAGS): New variable.
17434 (tls_shared_gnu2_test_LDADD): New variable.
17435 * testsuite/Makefile.in: Rebuild.
17436 * testsuite/Makefile.
17437
83bfb6b7
ILT
174382008-04-11 Ian Lance Taylor <iant@google.com>
17439
17440 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17441 justsyms.t.
17442 * testsuite/Makefile.in: Rebuild.
17443
17444 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17445 long.
17446 * testsuite/script_test_2.cc (main): Adjust test.
17447
706e1f5e
ILT
174482008-04-11 David S. Miller <davem@davemloft.net>
17449 Ian Lance Taylor <iant@google.com>
17450
17451 * options.h (General_options): Add entries for '-Y' and
17452 '-relax'.
17453 * options.cc (General_options:finalize): If -Y was used, add those
17454 entries to the library path instead of the default "/lib" and
17455 "/usr/lib".
17456
7c98e6bb
DM
174572008-04-11 David S. Miller <davem@davemloft.net>
17458
17459 * testsuite/justsyms.t: Start at 0x100.
17460 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17461 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17462 long.
17463 * testsuite/script_test_2.cc: Adjust string and section length
17464 checks.
7c98e6bb 17465
99a37bfd
ILT
174662008-04-09 Ian Lance Taylor <iant@google.com>
17467
2cefc357
ILT
17468 PR gold/5996
17469 * script-sections.cc (Sections_element::allocate_to_segment): Add
17470 orphan parameter.
17471 (Output_section_definition::allocate_to_segment): Likewise.
17472 (Orphan_output_section::allocate_to_segment): Likewise.
17473 (Script_sections::attach_sections_using_phdrs_clause): Don't
17474 propagate non-PT_LOAD segments to orphan sections.
17475 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17476 readelf rather than objdump.
17477 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17478 .interp section and PT_INTERP segment are the same size.
17479 * testsuite/Makefile.in: Rebuild.
17480
99a37bfd
ILT
17481 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17482 aliases for symbols defined in the same object.
17483 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17484 (weak_alias_test_SOURCES): New variable.
17485 (weak_alias_test_DEPENDENCIES): New variable.
17486 (weak_alias_test_LDFLAGS): New variable.
17487 (weak_alias_test_LDADD): New variable.
17488 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17489 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17490 (weak_alias_test_3.o): New target.
17491 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17492 * testsuite/weak_alias_test_main.cc: New file.
17493 * testsuite/weak_alias_test_1.cc: New file.
17494 * testsuite/weak_alias_test_2.cc: New file.
17495 * testsuite/weak_alias_test_3.cc: New file.
17496
780e49c5
ILT
174972008-04-08 Ian Lance Taylor <iant@google.com>
17498
cdb0b8f5
ILT
17499 * options.h (class General_options): Add --noinhibit-exec option.
17500 * main.cc (main): Check --noinhibit-exec.
17501
0864d551
ILT
17502 * options.h (class General_options): Define --wrap as a special
17503 option. Add wrap_symbols_ field.
17504 (General_options::any_wrap_symbols): New function.
17505 (General_options::is_wrap_symbol): New function.
17506 * options.cc (General_options::parse_wrap): New function.
17507 (General_options::General_options): Initialize wrap_symbols_.
17508 * symtab.cc (Symbol_table::wrap_symbol): New function.
17509 (Symbol_table::add_from_object): Handle --wrap.
17510 * symtab.h (class Symbol_table): Declare wrap_symbol.
17511 * target.h (Target::wrap_char): New function.
17512 (Target::Target_info): Add wrap_char field.
17513 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17514 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17515 * testsuite/testfile.cc (Target_test::test_target_info):
17516 Likewise.
17517
789aa6de
ILT
17518 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17519 there is one.
17520
2c38906f
ILT
17521 * layout.h (class Layout): Add added_eh_frame_data_ field.
17522 * layout.cc (Layout::Layout): Initialize new field.
17523 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17524 output section until we find a section we merged successfully.
17525 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17526 that the size be non-zero.
17527
780e49c5
ILT
17528 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17529 qualifier.
17530
7fcd0256
ILT
175312008-04-08 Craig Silverstein <csilvers@google.com>
17532
17533 * configure.ac: Export new conditional variable HAVE_ZLIB.
17534 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17535 on HAVE_ZLIB.
17536 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17537 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17538
6835af53
ILT
175392008-04-07 Ian Lance Taylor <iant@google.com>
17540
e24f324c
ILT
17541 * version.cc (version_string): Set to "1.5".
17542
a036edd8
ILT
17543 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17544 Add issued_non_pic_error_ field. Declare check_non_pic.
17545 (Target_x86_64::Scan::check_non_pic): New function.
17546 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17547 (Target_x86_64::Scan::global): Likewise.
17548
624f8810
ILT
17549 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17550 addend parameter. Change caller. Handle merge sections.
17551 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17552 Address to Addend. Don't add in the result of
17553 local_section_offset, pass down the addend and use the returned
17554 value.
17555 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17556 Update declarations of local_section_offset and symbol_value.
17557 * testsuite/two_file_test_1.cc (t18): New function.
17558 * testsuite/two_file_test_2.cc (f18): New function.
17559 * testsuite/two_file_test_main.cc (main): Call t18.
17560 * testsuite/two_file_test.h (t18, f18): Declare.
17561
6835af53
ILT
17562 * configure.ac: Don't test for objdump, c++filt, or readelf.
17563 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17564 conditionals.
17565 (TEST_READELF): New variable.
17566 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17567 (check_PROGRAMS): Add two_file_strip_test.
17568 (two_file_strip_test): New target.
17569 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17570 (two_file_same_shared_strip_test_SOURCES): New variable.
17571 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17572 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17573 (two_file_same_shared_strip_test_LDADD): New variable.
17574 (two_file_shared_strip.so): New target.
17575 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17576 (ver_test_5.syms, ver_test_7.syms): Likewise.
17577 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17578 (strip_test_3.stdout): Use TEST_OBJDUMP.
17579 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17580
86925eef
CC
175812008-04-04 Cary Coutant <ccoutant@google.com>
17582
17583 * symtab.h (Symbol::is_weak_undefined): New function.
17584 (Symbol::is_strong_undefined): New function.
17585 (Symbol::is_absolute): New function.
17586 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17587 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17588 absolute symbols.
17589 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17590 (weak_undef_test): New target.
17591 * testsuite/Makefile.in: Rebuild.
17592 * testsuite/weak_undef_file1.cc: New file.
17593 * testsuite/weak_undef_file2.cc: New file.
17594 * testsuite/weak_undef_test.cc: New file.
17595
126f3ece
ILT
175962008-04-03 Craig Silverstein <csilvers@google.com>
17597
17598 * compressed_output.h (class Output_compressed_section): Use
17599 unsigned buffer.
17600 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17601 add zlib header.
17602 (zlib_compressed_suffix): Removed.
17603 (Output_compressed_section::set_final_data_size): Use unsigned
17604 buffers.
17605 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17606 Fix linker invocation.
17607 (flagstest_o_specialfile_and_compress_debug_sections):
17608 Likewise.
17609 * testsuite/Makefile.in: Regenerated.
17610
deae2a14
DM
176112008-04-02 David S. Miller <davem@davemloft.net>
17612
17613 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17614 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17615
70752818
ILT
176162008-04-02 Craig Silverstein <csilvers@google.com>
17617
17618 * TODO: New file.
17619
39d0cb0e
ILT
176202008-04-02 Ian Lance Taylor <iant@google.com>
17621
17622 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17623 parameters. Update for new key type to views_. Change all
17624 callers.
17625 (File_read::read): Adjust for byteshift in returned view.
17626 (File_read::add_view): New function, broken out of
17627 find_and_make_view.
17628 (File_read::make_view): New function, broken out of
17629 find_and_make_view.
17630 (File_read::find_or_make_view): Add offset and aligned
17631 parameters. Rewrite accordingly. Change all callers.
17632 (File_read::get_view): Add offset and aligned parameters. Adjust
17633 for byteshift in return value.
17634 (File_read::get_lasting_view): Likewise.
17635 * fileread.h (class File_read): Update declarations.
17636 (class File_read::View): Add byteshift_ field. Add byteshift to
17637 constructor. Add byteshift method.
17638 * archive.h (Archive::clear_uncached_views): New function.
17639 (Archive::get_view): Add aligned parameter. Change all callers.
17640 * object.h (Object::get_view): Add aligned parameter. Change all
17641 callers.
17642 (Object::get_lasting_view): Likewise.
17643
17644 * fileread.cc (File_read::release): Don't call clear_views if
17645 there are multiple objects.
17646 * fileread.h (File_read::clear_uncached_views): New function.
17647 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17648 on the archive.
17649
a1207466
CC
176502008-03-31 Cary Coutant <ccoutant@google.com>
17651
17652 Add thin archive support.
17653 * archive.cc (Archive::armagt): New const.
17654 (Archive::setup): Remove task parameter and calls to unlock.
17655 (Archive::unlock_nested_archives): New function.
17656 (Archive::read_header): Add nested_off parameter. Change
17657 all callers.
17658 (Archive::interpret_header): Likewise.
17659 (Archive::include_all_members): Change to handle thin
17660 archives.
17661 (Archive::include_member): Likewise.
17662 * archive.h (Archive::Archive): Add new parameters and
17663 initializers.
17664 (Archive::armagt): New const.
17665 (Archive::setup): Remove task parameter.
17666 (Archive::unlock_nested_archives): New function.
17667 (Archive::read_header): Add nested_off parameter.
17668 (Archive::interpret_header): Likewise.
17669 (Archive::Nested_archive_table): New typedef.
17670 (Archive::is_thin_archive_): New field.
17671 (Archive::nested_archives_): New field.
17672 (Archive::options_): New field.
17673 (Archive::dirpath_): New field.
17674 (Archive::task_): New field.
17675 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17676 for thin archives. Pass additional parameters to
17677 Archive::Archive. Unlock the archive file after calling
17678 Archive::setup.
cd536b21 17679
479f6503
ILT
176802008-03-29 Ian Lance Taylor <iant@google.com>
17681
686c8caf
ILT
17682 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17683 version symbol to be local.
17684 * testsuite/ver_test_4.sh: New file.
17685 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17686 (check_DATA): Add ver_test_4.syms.
17687 (ver_test_4.syms): New target.
17688 * testsuite/Makefile.in: Rebuild.
17689
ab794b6b
ILT
17690 * output.cc
17691 (Output_section::Input_section_sort_entry::has_priority): New
17692 function.
17693 (Output_section::Input_section_sort_entry::match_file_name): New
17694 function.
17695 (Output_section::Input_section_sort_entry::match_section_name):
17696 Remove.
17697 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17698 Remove.
17699 (Output_section::Input_section_sort_entry::match_section_file):
17700 Remove.
17701 (Output_section::Input_section_sort_compare::operator()): Rewrite
17702 using new Input_section_sort_entry functions. Sort crtbegin and
17703 crtend first. Sort sections with no priority before sections with
17704 a priority.
17705 * testsuite/initpri1.c (d3): Check j != 4.
17706 (cd5): New constructor/destructor function.
17707 (main): Check j != 2.
17708
479f6503
ILT
17709 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17710 new symbol when resolving, don't call set_is_default.
17711 * testsuite/ver_test_7.cc: New file.
17712 * testsuite/ver_test_7.sh: New file.
17713 * testsuite/Makefile.am (ver_test_7.so): New target.
17714 (ver_test_7.o): New target.
17715 (check_SCRIPTS): Add ver_test_7.sh.
17716 (check_DATA): Add ver_test_7.syms.
17717 (ver_test_7.syms): New target.
17718
2fd32231
ILT
177192008-03-28 Ian Lance Taylor <iant@google.com>
17720
17721 * layout.cc (Layout::layout): If we see an input section with a
17722 name that needs sorting, set the must_sort flag for the output
17723 section.
17724 (Layout::make_output_section): If the name of the output section
17725 indicates that it might require sorting, set the may_sort flag.
17726 * output.h (Output_section::may_sort_attached_input_sections): New
17727 function.
17728 (Output_section::set_may_sort_attached_input_sections): New
17729 function.
17730 (Output_section::must_sort_attached_input_sections): New
17731 function.
17732 (Output_section::set_must_sort_attached_input_sections): New
17733 function.
17734 (class Output_section): Declare Input_section_sort_entry. Define
17735 Input_section_sort_compare. Declare
17736 sort_attached_input_sections. Add new fields:
17737 may_sort_attached_input_sections_,
17738 must_sort_attached_input_sections_,
17739 attached_input_sections_are_sorted_.
17740 * output.cc (Output_section::Output_section): Initialize new
17741 fields.
17742 (Output_section::add_input_section): Add an entry to
17743 input_sections_ if may_sort or must_sort are true.
17744 (Output_section::set_final_data_size): Call
17745 sort_attached_input_sections if necessary.
17746 (Output_section::Input_section_sort_entry): Define new class.
17747 (Output_section::Input_section_sort_compare::operator()): New
17748 function.
17749 (Output_section::sort_attached_input_sections): New function.
17750 * configure.ac: Check whether the compiler supports constructor
17751 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17752 * testsuite/initpri1.c: New file.
17753 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17754 CONSTRUCTOR_PRIORITY.
17755 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17756 (initpri1_LDFLAGS): New variable.
17757 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17758
18e6b24e
ILT
177592008-03-27 Ian Lance Taylor <iant@google.com>
17760
49bdd526
ILT
17761 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17762 * testsuite/common_test_1.c: New file.
17763 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17764 (common_test_1_SOURCES): New variable.
17765 (common_test_1_DEPENDENCIES): New variable.
17766 (common_test_1_LDFLAGS): New variable.
17767
18e6b24e
ILT
17768 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17769 and commons_ correctly when NAME/VERSION does not override
17770 NAME/NULL.
17771 * testsuite/ver_test_6.c: New file.
17772 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17773 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17774 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17775
04bf7072
ILT
177762008-03-26 Ian Lance Taylor <iant@google.com>
17777
5871526f
ILT
17778 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17779 of an undefined symbol from a version script.
17780 * testsuite/Makefile.am (ver_test_5.so): New target.
17781 (ver_test_5.o): New target.
17782 (check_SCRIPTS): Add ver_test_5.sh.
17783 (check_DATA): Add ver_test_5.syms.
17784 (ver_test_5.syms): New target.
17785 * testsuite/ver_test_5.cc: New file.
17786 * testsuite/ver_test_5.script: New file.
17787 * testsuite/ver_test_5.sh: New file.
17788 * Makefile.in, testsuite/Makefile.in: Rebuild.
17789
04bf7072
ILT
17790 PR gold/5986
17791 Fix problems building gold with gcc 4.3.0.
17792 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17793 (gold_error_at_location, gold_warning_at_location): Use it.
17794 * configure.ac: Check whether we can compile and use a template
17795 function with a printf attribute.
17796 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17797 when jumping over bytes.
17798 * object.cc: Instantiate Object::read_section_data.
17799 * debug.h: Include <cstring>
17800 * dwarf_reader.cc: Include <algorithm>
17801 * main.cc: Include <cstring>.
17802 * options.cc: Include <cstring>.
17803 * output.cc: Include <cstring>.
17804 * script.cc: Include <cstring>.
17805 * script.h: Include <string>.
17806 * symtab.cc: Include <cstring> and <algorithm>.
17807 * target-select.cc: Include <cstring>.
17808 * version.cc: Include <string>.
17809 * testsuite/testmain.cc: Include <cstdlib>.
17810 * configure, config.in: Rebuild.
17811
874c5b28
ILT
178122008-03-25 Ian Lance Taylor <iant@google.com>
17813
819d6c3a
ILT
17814 * options.cc: Include "../bfd/bfdver.h".
17815 (options::help): Print bug reporting address.
17816
f4b2c6f5
ILT
17817 * version.cc (print_version): Adjust output for current value of
17818 BFD_VERSION_STRING.
17819
17820 * NEWS: New file.
17821
e96caa79
ILT
17822 * options.cc (options::help): Print list of supported targets.
17823 * target-select.h: Include <vector>.
17824 (class Target_selector): Make machine_, size_, and is_big_endian_
17825 fields const. Add bfd_name_ and instantiated_target_ fields.
17826 (Target_selector::Target_selector): Add bfd_name parameter.
17827 (Target_selector::recognize): Make non-virtual, call
17828 do_recognize.
17829 (Target_selector::recognize_by_name): Make non-virtual, call
17830 do_recognize_by_name.
17831 (Target_selector::supported_names): New function.
17832 (Target_selector::bfd_name): New function.
17833 (Target_selector::do_instantiate_target): New pure virtual
17834 function.
17835 (Target_selector::do_recognize): New virtual function.
17836 (Target_selector::do_recognize_by_name): New virtual function.
17837 (Target_selector::instantiate_target): New private function.
17838 (supported_target_names): Declare.
17839 * target-select.cc (Target_selector::Target_selector): Update for
17840 new parameter and fields.
17841 (select_target_by_name): Check that the name matches before
17842 calling recognize_by_name.
17843 (supported_target_names): New function.
17844 * i386.cc (class Target_selector_i386): Update Target_selector
17845 constructor call. Remove recognize and recognize_by_name. Add
17846 do_instantiate_target.
17847 * x86_64.cc (class Target_selector_x86_64): Likewise.
17848 * testsuite/testfile.cc (class Target_selector_test): Update for
17849 changes to Target_selector.
17850
874c5b28
ILT
17851 * README: Rewrite, with some notes on unsupported features.
17852
0a65a3a7
CC
178532008-03-24 Cary Coutant <ccoutant@google.com>
17854
17855 * i386.cc (Target_i386::Got_type): New enum declaration.
17856 (Target_i386::Scan::local): Updated callers of Output_data_got
17857 member functions.
17858 (Target_i386::Scan::global): Likewise.
17859 (Target_i386::Relocate::relocate): Likewise.
17860 (Target_i386::Relocate::relocate_tls): Likewise.
17861 * object.h (Got_offset_list): New class.
17862 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17863 (Sized_relobj::local_got_offset): Likewise.
17864 (Sized_relobj::set_local_got_offset): Likewise.
17865 (Sized_relobj::local_has_tls_got_offset): Removed.
17866 (Sized_relobj::local_tls_got_offset): Removed.
17867 (Sized_relobj::set_local_tls_got_offset): Removed.
17868 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17869 * output.cc (Output_data_got::add_global): Added got_type parameter.
17870 (Output_data_got::add_global_with_rel): Likewise.
17871 (Output_data_got::add_global_with_rela): Likewise.
17872 (Output_data_got::add_global_pair_with_rel): New function.
17873 (Output_data_got::add_global_pair_with_rela): New function.
17874 (Output_data_got::add_local): Added got_type parameter.
17875 (Output_data_got::add_local_with_rel): Likewise.
17876 (Output_data_got::add_local_with_rela): Likewise.
17877 (Output_data_got::add_local_pair_with_rel): New function.
17878 (Output_data_got::add_local_pair_with_rela): New function.
17879 (Output_data_got::add_global_tls): Removed.
17880 (Output_data_got::add_global_tls_with_rel): Removed.
17881 (Output_data_got::add_global_tls_with_rela): Removed.
17882 (Output_data_got::add_local_tls): Removed.
17883 (Output_data_got::add_local_tls_with_rel): Removed.
17884 (Output_data_got::add_local_tls_with_rela): Removed.
17885 * output.h (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 * resolve.cc (Symbol::override_base_with_special): Removed
17902 reference to has_got_offset_ field.
17903 * symtab.cc (Symbol::init_fields): Replaced initialization
17904 of got_offset_ with got_offsets_. Removed initialization
17905 of has_got_offset_
53fcba31 17906 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17907 (Symbol::got_offset): Likewise.
17908 (Symbol::set_got_offset): Likewise.
17909 (Symbol::has_tls_got_offset): Removed.
17910 (Symbol::tls_got_offset): Removed.
17911 (Symbol::set_tls_got_offset): Removed.
17912 (Symbol::got_offset_): Removed.
17913 (Symbol::tls_mod_got_offset_): Removed.
17914 (Symbol::tls_pair_got_offset_): Removed.
17915 (Symbol::got_offsets_): New field.
17916 (Symbol::has_got_offset): Removed.
17917 (Symbol::has_tls_mod_got_offset): Removed.
17918 (Symbol::has_tls_pair_got_offset): Removed.
17919 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17920 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17921 member functions.
17922 (Target_x86_64::Scan::global): Likewise.
17923 (Target_x86_64::Relocate::relocate): Likewise.
17924 (Target_x86_64::Relocate::relocate_tls): Likewise.
17925
bd52eafb
BE
179262008-03-25 Ben Elliston <bje@au.ibm.com>
17927
17928 * yyscript.y: Fix spelling error in comment.
17929
8b105e34
ILT
179302008-03-24 Ian Lance Taylor <iant@google.com>
17931
8ed814a9
ILT
17932 * options.h (class General_options): Define build_id option.
17933 * layout.h (class Layout): Declare write_build_id, create_note,
17934 create_build_id. Add build_id_note_ member.
17935 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17936 "libiberty.h", "md5.h", "sha1.h".
17937 (Layout::Layout): Initialize eh_frame_data_,
17938 eh_frame_hdr_section_, and build_id_note_.
17939 (Layout::finalize): Call create_build_id.
17940 (Layout::create_note): New function, broken out of
17941 Layout::create_gold_note.
17942 (Layout::create_gold_note): Call create_note.
17943 (Layout::create_build_id): New function.
17944 (Layout::write_build_id): New function.
17945 (Close_task_runner::run): Call write_build_id.
17946
8b105e34
ILT
17947 * x86_64.cc: Correct license to GPLv3.
17948
086a1841
ILT
179492008-03-23 Ian Lance Taylor <iant@google.com>
17950
17951 * options.cc: Include "demangle.h".
17952 (parse_optional_string): New function.
17953 (parse_long_option): Handle takes_optional_argument.
17954 (parse_short_option): Update dash_z initializer. Handle
17955 takes_optional_argument.
17956 (General_options::General_options): Initialize do_demangle_.
17957 (General_options::finalize): Set do_demangle_. Handle demangling
17958 style.
17959 * options.h (parse_optional_string): Declare.
17960 (struct One_option): Add optional_arg field. Update constructor.
17961 Update call constructor calls. Add takes_optional_argument
17962 function.
17963 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17964 (DEFINE_optional_string): Define.
17965 (General_options::demangle): Change from DEFINE_bool to
17966 DEFINE_optional_string.
17967 (General_options::no_demangle): New function.
17968 (General_options::do_demangle): New function.
17969 (General_options::set_do_demangle): New function.
17970 (General_options::execstack_status_): Move definition to end of
17971 class definition.
17972 (General_options::static_): Likewise.
17973 (General_options::do_demangle_): New field.
17974 * object.cc (big_endian>::get_symbol_location_info): Call
17975 Options::do_demangle, not Options::demangle.
17976 * symtab.cc (demangle): Likewise.
17977
cbb93e63
ILT
179782008-03-22 Ian Lance Taylor <iant@google.com>
17979
17980 * gold.h: Include <cstddef> and <sys/types.h>
17981 * options.h: Include <cstring>.
17982
ec531623
ILT
179832008-03-21 Ian Lance Taylor <iant@google.com>
17984
17985 * Added source code to GNU binutils.
752937aa 17986\f
b90efa5b 17987Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17988
17989Copying and distribution of this file, with or without modification,
17990are permitted in any medium without royalty provided the copyright
17991notice and this notice are preserved.
17992
17993Local Variables:
17994mode: change-log
17995left-margin: 8
17996fill-column: 74
17997version-control: never
17998End:
This page took 1.222944 seconds and 4 git commands to generate.