Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
6e0813d3
CC
12015-12-11 Cary Coutant <ccoutant@gmail.com>
2
3 * target.h (Target::calls_non_split): Add prelocs, reloc_count
4 parameters.
5 (Target::do_calls_non_split): Likewise.
6 * target.cc (Target::do_calls_non_split): Likewise.
7 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Adjust
8 call to Target::calls_non_split.
9 * i386.cc (Target_i386::do_calls_non_split): Add prelocs, reloc_count
10 parameters.
11 * powerpc.cc (Target_powerpc::do_calls_non_split): Likewise.
12 * x86_64.cc (Target_x86_64::do_calls_non_split): Likewise.
13
6b2353a5
CC
142015-12-11 Cary Coutant <ccoutant@gmail.com>
15
16 * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize
17 output_views_.
18 * object.h (Object::get_output_view): New function.
19 (Object::do_get_output_view): New function.
20 (Sized_relobj_file::do_get_output_view): New function.
21 (Sized_relobj_file::output_views_): New data member.
22 * reloc.cc: (Sized_relobj_file::do_relocate): Store pointer to
23 output views in class object.
24 (Sized_relobj_file::do_get_output_view): New function.
25
bebf4942
L
262015-12-10 H.J. Lu <hongjiu.lu@intel.com>
27
28 PR ld/19317
29 * symtab.cc (Symbol_table::add_from_relobj): Don't complain
30 plugin needed to handle slim lto object for relocatable link.
31
dcfc7dd4
AM
322015-12-09 Alan Modra <amodra@gmail.com>
33
34 * powerpc.cc (Target_powerpc::Relocate::relocate): New constant
35 d_offset. Use throughout.
36 (Target_powerpc::relocate_relocs): Likewise.
37
e3a7574e
AM
382015-12-09 Alan Modra <amodra@gmail.com>
39
40 * powerpc.cc (Target_powerpc::Relocate::relocate): Edit ELFv2
41 entry code.
42 (Target_powerpc::relocate_relocs): Edit relocs to suit.
43
91a65d2f
AM
442015-12-09 Alan Modra <amodra@gmail.com>
45
46 * object.h (struct Relocate_info): Add "rr".
47 * reloc.h (Relocatable_relocs::set_strategy): New accessor.
48 * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
49 relinfo.rr for relocate_section and relocate_relocs.
50 * powerpc.cc (relocate): Add rel_type and preloc parameters.
51 Delete rela and r_type params, instead recalculate these from
52 preloc.
53 (relocate_relocs): Delete Relocatable_relocs* param, instead
54 use relinfo->rr.
55 * aarch64.cc: Likewise.
56 * arm.cc: Likewise.
57 * i386.cc: Likewise.
58 * mips.cc: Likewise.
59 * s390.cc: Likewise.
60 * sparc.cc: Likewise.
61 * target.h: Likewise.
62 * tilegx.cc: Likewise.
63 * x86_64.cc: Likewise.
64 * testsuite/testfile.cc: Likewise.
65 * target-reloc.h (relocate_section): Adjust to suit.
66 (apply_relocation, relocate_relocs): Likewise.
67
549dba71
AM
682015-12-07 Alan Modra <amodra@gmail.com>
69
70 * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
71 (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
72 (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
73
7ef8ae7c
VR
742015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
75
76 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
77 Local_got_entry_key for searching in local_got_offsets_.
78 * object.h (class Local_got_entry_key): New class.
79 (Relobj::local_has_got_offset): New overloaded method.
80 (Relobj::local_got_offset): Likewise.
81 (Relobj::set_local_got_offset): Likewise.
82 (Relobj::do_local_has_got_offset): Add addend argument.
83 (Relobj::do_local_got_offset): Likewise.
84 (Relobj::do_set_local_got_offset): Likewise.
85 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
86 Local_got_entry_key for searching through local_got_offsets_.
87 (Sized_relobj::do_local_got_offset): Likewise.
88 (Sized_relobj::do_set_local_got_offset): Likewise.
89 (Sized_relobj::Local_got_offsets): Change type of the key from
90 unsigned int to Local_got_entry_key, and add hash and equal_to.
91 * output.cc (Got_entry::write): Take addend into account for
92 calculating value of the local symbol for GOT.
93 (Output_data_got::add_local): New definition of overloaded method.
94 (Output_data_got::add_local_with_rel): Likewise.
95 (Output_data_got::add_local_pair_with_rel): Likewise.
96 * output.h (Output_data_got::add_local): New declaration of overloaded
97 method.
98
74b03b91
CC
992015-11-25 Cary Coutant <ccoutant@gmail.com>
100
101 PR gold/19291
102 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
103 subtract section address from symbol value.
104
751e4d66
AM
1052015-11-25 Alan Modra <amodra@gmail.com>
106
107 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
108 to 256 byte boundary.
109
32d849b3
AM
1102015-11-19 Alan Modra <amodra@gmail.com>
111
112 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
113 GOT16 and TOC16 relocs to RELATIVE_REF.
114
db1ff028
CC
1152015-11-14 Cary Coutant <ccoutant@gmail.com>
116
117 PR gold/19244
118 PR gold/18548
119 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
120 local symbols only for predefined symbols.
121
a680de9a
PB
1222015-11-11 Alan Modra <amodra@gmail.com>
123 Peter Bergner <bergner@vnet.ibm.com>
124
125 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
126 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
127 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
128 (Target_powerpc::Scan::global): Likewise.
129 (Target_powerpc::Relocate::relocate): Likewise.
130
cc203475
VR
1312015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
132
133 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
134 sections.
135
859d7987
CC
1362015-11-09 Cary Coutant <ccoutant@gmail.com>
137 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
138
139 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
140 with type, offset, addend.
141 (Copy_relocs::save): Likewise.
142 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
143 (Copy_relocs::save): Likewise.
144 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
145 and r_addend to Copy_relocs::copy_reloc.
146 * arm.cc (Target_arm::copy_reloc): Likewise.
147 * i386.cc (Target_i386::copy_reloc): Likewise.
148 * mips.cc (Target_mips::copy_reloc): Likewise.
149 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
150 * s390.cc (Target_s390::copy_reloc): Likewise.
151 * sparc.cc (Target_sparc::copy_reloc): Likewise.
152 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
153 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
154
96f9814d
CC
1552015-11-05 Cary Coutant <ccoutant@gmail.com>
156
157 PR gold/19119
158 PR gold/19172
159 PR gold/19197
160 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
161 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
162 * options.h (General_options): Remove "obsolete" from -m.
163 * parameters.cc (set_parameters_target): Check if input target
164 is compatible with output emulation set by "-m emulation".
165
0eccf19f
CC
1662015-11-05 Cary Coutant <ccoutant@gmail.com>
167
168 PR gold/19163
169 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
170 certain relocations if --no-apply-dynamic-relocs is set.
171 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
172
c1e7d6a8
AM
1732015-11-03 Alan Modra <amodra@gmail.com>
174
175 * po/POTFILES.in: Regenerate.
176
26f187cd
NC
1772015-10-30 Nick Clifton <nickc@redhat.com>
178
179 * po/zh_CN.po: New (simplified) Chinese translation.
180
41e83f2b
L
1812015-10-29 H.J. Lu <hongjiu.lu@intel.com>
182
183 PR gold/19184
184 * incremental.cc (Got_plt_view_info): Add got_entry_size.
185 (Local_got_offset_visitor::visit): Replace got_entry_size_
186 with info_.got_entry_size.
187 (Local_got_offset_visitor::got_entry_size_): Removed.
188 (Global_got_offset_visitor::visit): Replace got_entry_size_
189 with info_.got_entry_size.
190 (Global_got_offset_visitor::got_entry_size_): Removed.
191 (Output_section_incremental_inputs::write_got_plt): Initialize
192 view_info.got_entry_size.
193 * target.h (Sized_target::got_entry_size): New virtual function.
194 * x86_64.cc (Target_x86_64::got_entry_size): New function.
195
238830c6
MK
1962015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
197
198 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
199 * testsuite/script_test_12a.c: Likewise.
200 * testsuite/script_test_1a.cc: Likewise.
201 * testsuite/script_test_2.cc: Likewise.
202
bd890911
MK
2032015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
204
205 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
206
a817ff49
MK
2072015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
208
209 PR gold/18959
210 * stringpool.cc (Stringpool_template::new_key_offset): Align all
211 strings, even zero-length.
212 (Stringpool_template::set_string_offsets): Likewise.
213
e79a4bad
MK
2142015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
215
216 * s390.cc: New file.
217 * Makefile.am (TARGETSOURCES): Add s390.cc.
218 (ALL_TARGETOBJS): Add s390.o.
219 * Makefile.in: Regenerate.
220 * configure.ac: Add s390 support.
221 * configure: Regenerate.
222 * configure.tgt: Add s390-*-* and s390x-*-*.
223 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
224 support.
225
6f97897d
MK
2262015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
227
228 * archive.cc (Archive::sym64name): New const.
229 (Archive::setup): Add support for SYM64 armap.
230 (Archive::read_armap): Likewise.
231 (Archive::interpret_header): Likewise.
232 (Archive::const_iterator::read_next_header): Likewise.
233 * archive.h (Archive::sym64name): New const.
234 (Archive::read_armap): Add mapsize template parameter.
235
8d9743bd
MK
2362015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
237
238 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
239 target-specific entry size.
240 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
241 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
242 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
243 hash_entry_size.
244 * target.h (Target::hash_entry_size): New method.
245 (Target::Target_info::hash_entry_size): New data member.
246
247 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
248 * arm.cc (Target_arm::arm_info): Likewise.
249 (Target_arm_nacl::arm_nacl_info): Likewise.
250 * i386.cc (Target_i386::i386_info): Likewise.
251 (Target_i386_nacl::i386_nacl_info): Likewise.
252 (Target_iamcu::iamcu_info): Likewise.
253 * mips.cc (Target_mips::mips_info): Likewise.
254 (Target_mips_nacl::mips_nacl_info): Likewise.
255 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
256 * sparc.cc (Target_sparc::sparc_info): Likewise.
257 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
258 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
259 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
260 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
261
3043c1ab
L
2622015-10-28 H.J. Lu <hongjiu.lu@intel.com>
263
264 PR gold/19177
265 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
266 and R_386_GOT32X relocations without base register.
267
4d2f5d58
HS
2682015-10.27 Han Shen <shenhan@google.com>
269
270 PR gold/19042 - unsupported reloc 311/312.
271
272 * aarch64.cc (Target_aarch64::Scan::local): Add support for
273 reloc 311/312.
274
2891b491
L
2752015-10-22 H.J. Lu <hongjiu.lu@intel.com>
276
277 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
278 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
279 as R_X86_64_GOTPCREL.
280 (Target_x86_64<size>::Scan::local): Likewise.
281 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
282 Likewise.
283 (Target_x86_64<size>::Scan::global): Likewise.
284 (Target_x86_64<size>::Relocate::relocate): Likewise.
285 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
286 Likewise.
287
493d4b48
L
2882015-10-22 H.J. Lu <hongjiu.lu@intel.com>
289
290 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
291 R_386_GOT32X the same as R_386_GOT32.
292 (Target_i386::Scan::local): Likewise.
293 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
294 (Target_i386::Scan::global): Likewise.
295 (Target_i386::Relocate::relocate): Likewise.
296 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
297 Likewise.
298
0fd15345
L
2992015-10-20 H.J. Lu <hongjiu.lu@intel.com>
300
301 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
302 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
303 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
304 x86_64_mov_to_lea1.o.
305 * testsuite/Makefile.in: Regenerated.
306
64571972
L
3072015-10-16 H.J. Lu <hongjiu.lu@intel.com>
308
309 PR gold/19119
310 * options.h (General_options): Remove "obsolete" from -m.
311 * parameters.cc (set_parameters_target): Check if input target
312 is compatible with output emulation set by "-m emulation".
313
01f573ad
L
3142015-10-13 H.J. Lu <hongjiu.lu@intel.com>
315
316 PR gold/19118
317 * i386.cc (Target_iamcu): New class.
318 (Target_selector_iamcu): Likewise.
319 (Target_iamcu::iamcu_info): New variable.
320 (target_selector_iamcu): Likewise.
321
3b0357da
AS
3222015-10-07 Andreas Schwab <schwab@suse.de>
323
324 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
325
9eacb935
CC
3262015-10-06 Cary Coutant <ccoutant@gmail.com>
327
328 PR gold/18855
329 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
330 parameter.
331 (Sparc_relocate_functions::gdop_lox10): Likewise.
332 (Target_sparc::Relocate::relocate): Use addend when computing
333 symbol value for R_SPARC_GOTDATA_OP*.
334
3d4fde69
CC
3352015-09-07 Cary Coutant <ccoutant@gmail.com>
336
337 PR gold/18930
338 PR gold/18886
339 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
340 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
341
358de988
L
3422015-09-02 H.J. Lu <hongjiu.lu@intel.com>
343
344 PR gold/18886
345 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
346 shared libraries into normal FUNC symbols.
347 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
348 symbols aren't from shared libraries.
349
d49044c7
AM
3502015-09-02 Alan Modra <amodra@gmail.com>
351
352 PR 18878
353 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
354 (Target_powerpc::Branch_info::make_stub): Determine whether long
355 branch stub is for save/restore function.
356 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
357 (Stub_table): Add need_save_res_.
358 (Stub_table:clear_stubs): Clear need_save_res_.
359 (Stub_table:set_address_and_size): Add save/restore section size.
360 (Stub_table::add_long_branch_entry): Add save_res param. Set
361 need_save_res_, but don't add space for save/restore stubs.
362 (Stub_table::find_long_branch_entry): Return offset to local copy
363 of save/restore func.
364 (Stub_table::do_write): Don't output save/restore stubs. Instead
365 copy the save/restore functions.
366 (Output_data_save_res:contents): New accessor.
367 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
368
7c61d651
CC
3692015-08-25 Cary Coutant <ccoutant@gmail.com>
370
371 PR gold/18847
372 * script-sections.cc (Memory_region::set_address): New method.
373 (Script_sections::find_memory_region): Add explicit_only parameter.
374 (Output_section_definition::set_section_addresses): Handle case where
375 script specifies both address and vma region.
376 * script-sections.h (Script_sections::find_memory_region): Add
377 explicit_only parameter.
378
4bfacfd3
CC
3792015-08-25 Cary Coutant <ccoutant@gmail.com>
380
381 PR gold/18859
382 * object.cc (Input_objects::add_object): Store objects in a map,
383 indexed by soname; update as-needed flag when necessary.
384 * object.h (Object::clear_as_needed): New method.
385 (Input_objects::so_names_): Change from set to map.
386
1757d35c
CC
3872015-08-25 Cary Coutant <ccoutant@gmail.com>
388
389 PR gold/14746
390 * expression.cc (Expression::Expression_eval_info): Add
391 is_valid_pointer field.
392 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
393 Adjust all callers.
394 (Addr_expression::value_from_output_section): Check whether address
395 is valid.
396 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
397 if evaluation failed due to address that is not yet valid.
398 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
399 parameter.
400
3ac0a36c
CC
4012015-08-25 Cary Coutant <ccoutant@gmail.com>
402
403 PR gold/18866
404 PR gold/18703
405 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
406
9215b98b
AM
4072015-08-20 Alan Modra <amodra@gmail.com>
408
409 PR gold/18846
410 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
411 Subtract os->address() from addend.
412 * powerpc.cc (relocate_relocs): Likewise.
413
40fc1451
SD
4142015-08-12 Simon Dardis <simon.dardis@imgtec.com>
415
416 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
417 lazy_stub_normal_1, lazy_stub_normal_1_n64,
418 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
419 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
420 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
421 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
422 of 'addu/daddu'.
423
37a42ee9
L
4242015-07-27 H.J. Lu <hongjiu.lu@intel.com>
425
426 * configure: Regenerated.
427
ab3b14b0
DK
4282015-07-26 Doug Kwan <dougkwan@google.com>
429
430 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
431 disassembler output format.
432
cdb06167
HS
4332015-07-23 Ian Coolidge <icoolidge@google.com>
434 Plumb --pic-veneer option for gold.
435
436 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
437 generation.
438 * options.h (General_options): Add --pic-veneer option.
439
5b2af7dd
L
4402015-07-22 H.J. Lu <hongjiu.lu@intel.com>
441
442 PR gold/18663
443 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
444 script_test_1a.cc script_test_1b.cc.
445 (script_test_11_r.o): Replace script_test_11.o with
446 script_test_11a.o script_test_11b.o.
447 (script_test_11.o): Removed.
448 (script_test_11a.o): New.
449 (script_test_11b.o): Likewise.
450 * testsuite/Makefile.in: Regenerated.
451 * testsuite/script_test_1.h: New file.
452 * testsuite/script_test_1b.cc: Likewise.
453 * testsuite/script_test_11.h: Likewise.
454 * testsuite/script_test_11b.c: Likewise.
455 * testsuite/script_test_1.cc: Renamed to ...
456 * testsuite/script_test_1a.cc: This.
457 Include "script_test_1.h".
458 (main): Call check_int and check_ptr.
459 * testsuite/script_test_11.c: Renamed to ...
460 * testsuite/script_test_11a.c: This.
461 Include "script_test_11.h".
462 (main): Call ptr_equal.
463
cd78ea77
L
4642015-07-22 H.J. Lu <hongjiu.lu@intel.com>
465
466 PR gold/18628
467 * testsuite/ifuncdep2.c (global): Change protected to hidden.
468 * testsuite/ifuncmod1.c (global): Likewise.
469 * testsuite/ifuncmod5.c (global): Likewise.
470
f945ba50
AM
4712015-07-22 Alan Modra <amodra@gmail.com>
472
473 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
474
5417c94d
CC
4752015-07-21 Cary Coutant <ccoutant@gmail.com>
476
477 PR gold/18548
478 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
479 forced local symbol even when oldsym != NULL.
480 (Symbol_table::do_define_in_output_segment): Likewise.
481 (Symbol_table::do_define_as_constant): Likewise.
482
cb5cf5e2
CC
4832015-07-21 Cary Coutant <ccoutant@gmail.com>
484
b8c6c5ef 485 PR gold/18698
cb5cf5e2
CC
486 * archive.cc (Library_base::should_include_member): Don't use entry
487 point for relocatable links, or if target is not yet valid.
488 * parameters.cc (Parameters::entry): Check target_valid().
489
0ef3814f
HS
4902015-07-20 Han Shen <shenhan@google.com>
491
492 Optimize erratum 843419 fix.
493
494 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
495 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
496 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
497 (E843419_stub): New sub-class of Erratum_stub.
498 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
499 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
500 (AArch64_relobj::create_erratum_stub): Add 1 argument.
501 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
502
2bca0377
HS
5032015-07-20 Han Shen <shenhan@google.com>
504
505 Fix arm elf header flags wrt hardfp bit.
506
507 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
508
f54f5e31
L
5092015-07-20 H.J. Lu <hongjiu.lu@intel.com>
510
511 PR gold/18689
512 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
513 from input group section for relocatable link.
514 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
515 (check_DATA): Add pr18689.stdout.
516 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
517 (pr18689.stdout): New rule.
518 (pr18689a.o): Likewise.
519 (pr18689b.o): Likewise.
520 (pr18689.o): Likewise.
521 * testsuite/pr18689.c: New file.
522 * testsuite/pr18689.sh: Likewise.
523 * testsuite/Makefile.in: Regenerated.
524
c20ceeb2
YW
5252015-07-20 Yiran Wang <yiran@google.com>
526 Cary Coutant <ccoutant@gmail.com>
527
528 PR gold/15574
529 * resolve.cc (Symbol_table): Remove warning about references
530 from shared objects to hidden symbols.
531 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
532 * testsuite/Makefile.in: Regenerate.
533 * testsuite/hidden_test.sh: Check dynamic symbol table; update
534 expected error messages.
535
19a7fe52
L
5362015-07-14 H.J. Lu <hongjiu.lu@intel.com>
537
538 * compressed_output.cc (Output_compressed_section::set_final_data_size):
539 Make --compress-debug-sections=zlib the same as
540 --compress-debug-sections=zlib-gabi.
541 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
542 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
543 ".zdebug_".
544 * testsuite/Makefile.in: Regenerated.
545
fb8b9dbc
L
5462015-07-12 H.J. Lu <hongjiu.lu@intel.com>
547
548 PR gold/18322
549 * compressed_output.cc (zlib_compress): Add argument for
550 compression header size. Set header size to compression header
551 size if it isn't 0. Don't write out the zlib header here.
552 (Output_compressed_section::set_final_data_size): Support
553 zlib-gnu and zlib-gabi compressions. Pass compression header
554 size to zlib_compress and write out compression header. Set
555 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
556 clear the SHF_COMPRESSED bit
557 * options.h (compress_debug_sections): Add zlib-gnu and
558 zlib-gabi.
559 * output.h (Output_section::set_flags): New.
560 * testsuite/Makefile.am (check_PROGRAMS): Add
561 flagstest_compress_debug_sections_none,
562 flagstest_compress_debug_sections_gnu and
563 flagstest_compress_debug_sections_gabi.
564 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
565 flagstest_compress_debug_sections.stdout,
566 flagstest_compress_debug_sections.cmp,
567 flagstest_compress_debug_sections.check,
568 flagstest_compress_debug_sections_gnu.stdout,
569 flagstest_compress_debug_sections_gnu.cmp,
570 flagstest_compress_debug_sections_gnu.check,
571 flagstest_compress_debug_sections_gabi.stdout,
572 flagstest_compress_debug_sections_gabi.cmp and
573 flagstest_compress_debug_sections_gabi.check.
574 (flagstest_compress_debug_sections_none): New.
575 (flagstest_compress_debug_sections_none.stdout): Likewise.
576 (flagstest_compress_debug_sections.stdout): Likewise.
577 (flagstest_compress_debug_sections.check): Likewise.
578 (flagstest_compress_debug_sections.cmp): Likewise.
579 (flagstest_compress_debug_sections_gnu): Likewise.
580 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
581 (flagstest_compress_debug_sections_gnu.check): Likewise.
582 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
583 (flagstest_compress_debug_sections_gabi): Likewise.
584 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
585 (flagstest_compress_debug_sections_gnu.check): Likewise.
586 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
587 * testsuite/Makefile.in: Regenerated.
588
48058663
L
5892015-07-12 H.J. Lu <hongjiu.lu@intel.com>
590
591 PR gold/18321
592 * compressed_output.h (decompress_input_section): Add arguments
593 for ELF class, big endian and sh_flags.
594 * compressed_output.cc (decompress_input_section): Likewise.
595 Support the SHF_COMPRESSED section.
596 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
597 functions.
598 * plugin.h (Pluginobj): Likewise.
599 * layout.cc (Layout::get_output_section_flags): Also clear the
600 SHF_COMPRESSED bit.
601 * object.h (Compressed_section_info): Add flag to store sh_flags.
602 (Object): Add pure virtual elfsize and is_big_endian member
603 functions.
604 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
605 prefix here.
606 (build_compressed_section_map): Check SHF_COMPRESSED for
607 uncompressed size. Store sh_flags in Compressed_section_info.
608 Pass size, big_endian and sh_flags to decompress_input_section.
609 Skip the ".debug"/".zdebug" prefix when passing section name to
610 need_decompressed_section.
611 (Sized_relobj_file<size, big_endian>::do_find_special_section):
612 Don't check ".zdebug_*" sections.
613 (Object::decompressed_section_contents): Pass ELF class, big
614 endian and sh_flags to decompress_input_section.
615 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
616 Likewise.
617 * testsuite/Makefile.am (check_DATA): Add
618 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
619 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
620 gdb_index_test_2_gabi.stdout.
621 (debug_msg_cdebug_gabi.o): New.
622 (odr_violation1_cdebug_gabi.o): Likewise.
623 (odr_violation2_cdebug_gabi.o): Likewise.
624 (debug_msg_cdebug_gabi.err): Likewise.
625 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
626 (gdb_index_test_cdebug_gabi.o): Likewise.
627 (gdb_index_test_2_gabi): Likewise.
628 (gdb_index_test_2_gabi.stdout): Likewise.
629 * testsuite/gdb_index_test_2_gabi.sh: New file.
630 * testsuite/Makefile.in: Regenerated.
631
73854cdd
HS
6322015-07-09 Han Shen <shenhan@google.com>
633
634 Use "gold_info" instead of "gold_warning" for erratum fix.
635
636 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
637 'gold_info'.
638 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
639
61163dfa
HS
6402015-07-09 Han Shen <shenhan@google.com>
641
642 Drop missing symbol warning for arm/aarch64.
643
644 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
645 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
646 symbol warning.
647
b91deca9
HS
6482015-07-07 Han Shen <shenhan@google.com>
649
650 Make gold aarch64 accept long form of mapping symbols.
651
652 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
653 of mapping symbols.
654
15162bef
DK
6552015-06-29 Doug Kwan <dougkwan@google.com>
656
657 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
658 at address expected by test.
659 * testsuite/arm_cortex_a8_b.s: Ditto.
660 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
661 * testsuite/arm_cortex_a8_bl.s: Ditto.
662 * testsuite/arm_cortex_a8_blx.s: Ditto.
663 * testsuite/arm_cortex_a8_local.s: Ditto.
664 * testsuite/arm_fix_v4bx.s: Ditto.
665 * testsuite/arm_unaligned_reloc.s: Ditto.
666 * testsuite/thumb_bl_out_of_range.s: Ditto.
667 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
668 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 669
56b06706
HS
6702015-06-29 Han Shen <shenhan@google.com>
671
672 Patch for erratum 843419 internal error.
673
72f4393d
L
674 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
675 (Erratum_stub::update_erratum_insn): New method.
676 (Stub_table::relocate_stubs): Modified to place relocated insn.
677 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 678
2f0c79aa
HS
6792015-06-12 Han Shen <shenhan@google.com>
680
681 Fix erratum 835769.
682
72f4393d
L
683 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
684 defintion outside class definition.
685 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
686 (AArch64_insn_utilities::aarch64_op31): New member.
687 (AArch64_insn_utilities::aarch64_ra): New member.
688 (AArch64_insn_utilities::aarch64_mac): New member.
689 (AArch64_insn_utilities::aarch64_mlxl): New member.
690 (ST_E_835769): New global enum member.
691 (Stub_table::relocate_stubs): Add 835769 handler.
692 (Stub_template_repertoire::Stub_template_repertoire): Install new
693 stub type.
694 (AArch64_relobj::scan_errata): This func is renamed from
695 scan_erratum_843419.
696 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
697 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
698 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
699 (Target_aarch64::scan_erratum_835769_span): New method.
700 (Target_aarch64::create_erratum_stub): New method.
701 (Target_aarch64::is_erratum_835769_sequence): New method.
702 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
703 code into create_erratum_stub.
704 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 705
5d7908e0
CC
7062015-06-11 Cary Coutant <ccoutant@gmail.com>
707
708 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
709 outside class body.
710 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
711
dd68f8fa
CC
7122015-06-11 Cary Coutant <ccoutant@gmail.com>
713
714 PR gold/17731
715 * layout.cc (corresponding_uncompressed_section_name): New function.
716 (Layout::choose_output_section): Call it.
717 * layout.h (corresponding_uncompressed_section_name): New function.
718 * script-sections.cc (Input_section_info::set_section_name): Check
719 for compressed debug section (.zdebug style).
720
a3a0c391
JY
7212015-06-11 Jing Yu <jingyu@google.com>
722
723 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
724 * testsuite/Makefile.in: Regenerate.
725
970cdef2
DI
7262015-06-11 Davide Italiano <dccitaliano@gmail.com>
727
728 * gold.h (is_cident): Correct typo.
729
a48d0c12
HS
7302015-06-10 Han Shen <shenhan@google.com>
731 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
732
733 Now fixing for 843419 is fully functional.
734
735 The first part of the erratum fix CL is here -
736 https://sourceware.org/ml/binutils/2015-04/msg00229.html
737
738 * aarch64.cc(global enum): New constants representing stub types.
739 (Stub_template): New POD struct.
740 (Stub_template_repertoire): New class.
741 (Stub_base): New class.
742 (Erratum_stub): New class.
743 (Reloc_stub): Refactored to be a subclass of Stub_base.
744 (Reloc_stub::Stub_type): Removed.
745 (Reloc_stub::offset): Moved to Stub_base.
746 (Reloc_stub::set_offset): Moved to Stub_base.
747 (Reloc_stub::destination_address): Moved to Stub_base.
748 (Reloc_stub::set_destination_address): Moved to Stub_base.
749 (Reloc_stub::reset_destination_address): Moved to Stub_base.
750 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
751 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
752 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
753 (Reloc_stub::write): Moved to Stub_base.
754 (Reloc_stub::invalid_offset): Moved to Stub_base.
755 (Reloc_stub::invalid_address): Moved to Stub_base.
756 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
757 (Reloc_stub::stub_insns_): Moved to Stub_base.
758 (Reloc_stub::offset_): Moved to Stub_base.
759 (Reloc_stub::destination_address_): Moved to Stub_base.
760 (Stub_table::The_aarch64_relobj): New typedef.
761 (Stub_table::The_erratum_stub): New typedef.
762 (Stub_table::The_erratum_stub_less): New typedef.
763 (Stub_table::The_erratum_stub_set): New typedef.
764 (Stub_table::The_erratum_stub_set_iter): New typedef.
765 (Stub_table::empty): Added emptiness testing for erratum stubs.
766 (Stub_table::add_erratum_stub): New method to add an erratum stub.
767 (Stub_table::find_erratum_stub): New method.
768 (Stub_table::find_erratum_stubs_for_input_section): New method.
769 (Stub_table::erratum_stub_address): New method.
770 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
771 (Stub_table::do_addralign): Modified to handle erratum stubs.
772 (Stub_table::erratum_stubs_): New member.
773 (Stub_table::erratum_stub_size_): New member.
774 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
775 (Stub_table::do_write): Modified to handle erratum stubs.
776 (AArch64_relobj::The_erratum_stub): New typedef.
777 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
778 (AArch64_relobj::fix_errata): New method.
779 (Target_aarch64::The_reloc_stub_type): Removed.
780 (Target_aarch64::The_erratum_stub): New typede.
781 (AArch64_relocate_functions::construct_b): New method.
782
1e1b2efc
NC
7832015-06-08 Nick Clifton <nickc@redhat.com>
784
785 * po/fr.po: New French Translation.
786
b8cf5075
CC
7872015-06-07 Cary Coutant <ccoutant@gmail.com>
788
789 PR gold/18288
790 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
791 callers. Don't use STT_COMMON to check for common symbols.
792 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
793 symbol that's not in a common section.
794 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
795 common symbols.
796
bdd2d2b7
CC
7972015-06-04 Cary Coutant <ccoutant@gmail.com>
798
799 PR gold/18200
800 * Makefile.am (diststuff): Add target.
801 * Makefile.in: Regenerate.
802
cd3c333f
CC
8032015-06-04 Cary Coutant <ccoutant@gmail.com>
804
805 PR gold/17498
806 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
807 temporary locals in merge sections.
808 * options.cc (General_options::parse_discard_all): New method.
809 (General_options::parse_discard_locals): New method.
810 (General_options::parse_discard_none): New method.
811 (General_options::General_options): Initialize discard_locals_.
812 * options.h (--discard-all): Convert to special option.
813 (--discard-locals): Likewise.
814 (--discard-none): New option.
815 (General_options::discard_all): New method.
816 (General_options::discard_locals): New method.
817 (General_options::discard_sec_merge): New method.
818 (General_options::Discard_locals): New enum.
819 (General_options::discard_locals_): New data member.
820
8086551f
CC
8212015-06-03 Cary Coutant <cary@google.com>
822
823 * script-sections.cc (Script_sections::Script_sections): Initialize
824 segments_created_.
825 (Script_sections::create_note_and_tls_segments): Set flag when
826 segments are created.
827 (Script_sections::expected_segment_count): Count PT_INTERP.
828 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
829 segments are created.
830 * script-sections.h (Script_sections::segments_created_): New data
831 member.
832
374082df
CC
8332015-06-03 Cary Coutant <ccoutant@gmail.com>
834
835 PR gold/15370
836 * script-sections.cc
837 (Output_section_element_input::set_section_addresses): When there
838 are several patterns with no sort spec, put all sections in the same
839 bin.
840 * testsuite/Makefile.am (script_test_12): New testcase.
841 (script_test_12i): New testcase.
842 * testsuite/Makefile.in: Regenerate.
843 * testsuite/script_test_12.t: New test linker script.
844 * testsuite/script_test_12i.t: New test linker script.
845 * testsuite/script_test_12a.c: New test source file.
846 * testsuite/script_test_12b.c: New test source file.
847
775ed62e
CC
8482015-06-02 Cary Coutant <ccoutant@gmail.com>
849
850 * nacl.h (Sniff_file): Switch parameters to get_view to get an
851 aligned view.
852
9c7fe3c5
CC
8532015-06-03 Cary Coutant <ccoutant@gmail.com>
854
72f4393d
L
855 PR gold/17819
856 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
857 separate task to schedule the build id computation.
858 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
859 add Output_file and offset.
860 (Hash_task::run): Get and release the input views.
861 (Hash_task::is_runnable): Always return NULL (always runnable).
862 (Layout::queue_build_id_tasks): Remove.
863 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
864 parameters; use them instead of class members.
865 (Build_id_task_runner::run): New function.
866 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
867 to write_build_id.
868 * layout.h (Layout::queue_build_id_tasks): Remove.
869 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
870 parameters.
871 (Layout::array_of_hashes_): Remove.
872 (Layout::size_of_array_of_hashes_): Remove.
873 (Layout::input_view_): Remove.
874 (Build_id_task_runner): New class.
875 (Close_task_runner::Close_task_runner): Add array_of_hashes and
876 size_of_hashes parameters.
877 (Close_task_runner::array_of_hashes_): New data member.
878 (Close_task_runner::size_of_hashes_): New data member.
879 * testsuite/Makefile.am
880 (flagstest_compress_debug_sections_and_build_id_tree): New test.
881 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 882
400f8944
RÁE
8832015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
884
885 * merge.cc (get_input_merge_map): Update for data structure change.
886 (get_or_make_input_merge_map): Update for data structure change.
887 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
888 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
889
bbec1a5d
AM
8902015-05-16 Alan Modra <amodra@gmail.com>
891
892 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
893 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
894 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
895 (lis_0): Rename from lis_0_0.
896
efc6fa12
CC
8972015-04-29 Cary Coutant <cary@google.com>
898 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
899
900 * gc.h (Garbage_collection::is_section_garbage): Change Object*
901 to Relobj*.
902 (Garbage_collection::add_reference): Likewise.
903 (Garbage_collection::gc_process_relocs): Likewise. Don't push
904 object/shndx pair onto *secvec for dynamic objects. Don't follow
905 relocations pointing to dynamic objects for GC.
906 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
907 (Icf::unfold_section): Likewise.
908 (Icf::is_section_folded): Likewise.
909 (Icf::get_folded_section): Likewise.
910 * icf.h: (Icf::get_folded_section): Likewise.
911 (Icf::unfold_section): Likewise.
912 (Icf::is_section_folded): Likewise.
913 (Icf::section_has_function_pointers): Likewise.
914 (Icf::set_section_has_function_pointers): Likewise.
915 * object.h (Section_id): Likewise.
916 (Const_section_id): Likewise.
917 * output.cc (Output_section::update_section_layout): Likewise.
918 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
919 Likewise.
920 * plugin.cc (update_section_order): Likewise.
921 (unique_segment_for_sections): Likewise.
922 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
923 (Target_powerpc::do_gc_add_reference): Likewise.
924 (Target_powerpc::gc_process_relocs): Likewise.
925 (Target_powerpc::do_gc_add_reference): Likewise.
926 * symtab.cc (Symbol_table::is_section_folded): Likewise.
927 (Symbol_table::gc_mark_symbol): Likewise.
928 * symtab.h: (Symbol_table::is_section_folded): Likewise.
929 * target.h: (Sized_target::gc_add_reference): Likewise.
930 (Sized_target::do_gc_add_reference): Likewise.
931
f9d3ecaa
NC
9322015-04-29 Nick Clifton <nickc@redhat.com>
933
934 * po/fi.po: Updated Finnish translation.
935
faa2211d
AM
9362015-04-28 Alan Modra <amodra@gmail.com>
937
938 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
939 than unsigned int for find_global_entry result temp. Compare
940 against invalid_address.
941 (Target_powerpc::do_plt_address_for_global): Likewise.
942 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
943 on plt call stub existence for debug info. Do assert for plt
944 and global entry stub existence if an alloc section.
945
6ec65f28
AM
9462015-04-28 Alan Modra <amodra@gmail.com>
947
948 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
949 on missing global entry stub due to bogus debug info.
950
7a2a1c79
HS
9512015-04-27 Han Shen <shenhan@google.com>
952
953 * options.h (--fix-cortex-a53-843419): Rename option.
954 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
955 option.
956 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
957
cfbf0e3c
RÁE
9582015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
959
960 PR gold/18327
961 * output.cc (Output_section::is_input_address_mapped): Assume a missing
962 entry is mapped.
963 * testsuite/Makefile.am: Add the eh_test test.
964 * testsuite/Makefile.in: Regenerate.
965 * testsuite/eh_test_a.cc: New test.
966 * testsuite/eh_test_b.cc: New test.
967
6ec65f28
AM
9682015-04-23 Sriraman Tallam <tmsriram@google.com>
969
a100d66f
ST
970 * options.h (--weak-unresolved-symbols): New option.
971 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
972 binding to weak with new option.
973 * symtab.h (is_weak_undefined): Check for new option.
974 (is_strong_undefined): Check for new option.
975 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
976 * testsuite/Makefile.in: Regenerate.
977 * testsuite/weak_unresolved_symbols_test.cc: New file.
978
4b889c30
IC
9792015-04-20 Ian Coolidge <icoolidge@google.com>
980
981 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
982 GNU_UNIQUE.
983
4277535c
RÁE
9842015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
985
986 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
987 push_back.
988 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
989 * object.cc (Sized_relobj_file::do_layout): Use push_back.
990 * powerpc.cc (process_gc_mark): Use push_back.
991 (Target_powerpc::do_gc_mark_symbol): Use push_back.
992 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
993
7a2a1c79 9942015-04-16 Han Shen <shenhan@google.com>
5019d64a 995
6ec65f28
AM
996 * aarch64.cc (AArch64_insn_utilities): New utility class.
997 (AArch64_relobj::Mapping_symbol_position): New struct.
998 (AArch64_relobj::Mapping_symbol_info): New typedef.
999 (AArch64_relobj::do_count_local_symbols): New function overriding
1000 parent's implementation.
1001 (AArch64_relobj::mapping_symbol_info_): New member
1002 (AArch64_relobj::scan_erratum_843419): New method.
1003 (Target_aarch64::scan_erratum_843419_span): New method.
1004 (Target_aarch64::is_erratum_843419_sequence): New method.
1005 * options.h (fix_cortex_a53): New option.
5019d64a 1006
a6a17750
CC
10072015-04-09 Cary Coutant <ccoutant@google.com>
1008
1009 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
1010 in a PIE link.
1011 * testsuite/Makefile.am (tls_pie_test.sh): New test.
1012 * testsuite/Makefile.in: Regenerate.
1013 * testsuite/tls_pie_test.sh: New.
1014
437ddf0c
CC
10152015-04-09 Cary Coutant <ccoutant@google.com>
1016
1017 * debug.h (DEBUG_LOCATION): New.
1018 (DEBUG_ALL): Include DEBUG_LOCATION.
1019 (debug_string_to_enum): Add DEBUG_LOCATION.
1020 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
1021 output to print correct context.
1022 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
1023 up to 4 more locations at the beginning of the function.
1024 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
1025 result before sorting list of line numbers.
1026 * testsuite/debug_msg.sh: Allow range of line numbers for
1027 canonical results on optimized code.
1028
24491327
HS
10292015-04-07 HC Yen <hc.yen@mediatek.com>
1030
1031 Add AArch32 support for gold linker.
1032 gold/
1033 * arm.cc: Add V8 arch combine table.
1034
7fa5525f
RÁE
10352015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1036
1037 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
1038
5368dcf2
RÁE
10392015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1040
1041 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
1042 to find by using the return value of insert.
1043
9dbb4b02
RÁE
10442015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1045
1046 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
1047 constructor call.
1048
1fa29f10
IT
10492015-04-06 Ilya Tocar <ilya.tocar@intel.com>
1050
1051 PR gold/17641
1052 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
1053 (Target_x86_64::Scan::local): Don't create GOT entry, when we
1054 can convert mov to lea.
1055 (Target_x86_64::Scan::global): Ditto.
1056 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
1057 %reg to lea foo(%rip), %reg if possible.
1058 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
1059 * testsuite/x86_64_mov_to_lea1.s: New.
1060 * testsuite/x86_64_mov_to_lea2.s: Ditto.
1061 * testsuite/x86_64_mov_to_lea3.s: Ditto.
1062 * testsuite/x86_64_mov_to_lea4.s: Ditto.
1063 * testsuite/x86_64_mov_to_lea.sh: Ditto.
1064
39f3de7c
L
10652015-04-02 H.J. Lu <hongjiu.lu@intel.com>
1066
1067 * configure: Regenerated.
1068
c4fc4724
IT
10692015-04-01 Ilya Tocar <ilya.tocar@intel.com>
1070
1071 PR gold/17640
1072 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1073 (Target_i386::Scan::local): Don't create GOT entry, when we
1074 can convert GOT to GOTOFF.
1075 (Target_i386::Scan::global): Ditto.
1076 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1077 lea foo@GOTOFF(%reg), %reg if possible.
1078 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1079 * testsuite/i386_mov_to_lea1.s: New.
1080 * testsuite/i386_mov_to_lea2.s: Ditto.
1081 * testsuite/i386_mov_to_lea3.s: Ditto.
1082 * testsuite/i386_mov_to_lea4.s: Ditto.
1083 * testsuite/i386_mov_to_lea5.s: Ditto.
1084 * testsuite/i386_mov_to_lea.sh: Ditto.
1085
918357b9
L
10862015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1087
1088 * Makefile.am (ZLIB): New.
1089 (ZLIBINC): Likewise.
1090 (AM_CFLAGS): Add $(ZLIBINC).
1091 (AM_CXXFLAGS): Likewise.
1092 (ldadd_varldadd_var): Add $(ZLIB).
1093 (incremental_dump_LDADD): Likewise.
1094 (dwp_LDADD): Likewise.
1095 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1096 <zlib.h>.
1097 (zlib_compress): Don't check HAVE_ZLIB_H.
1098 (zlib_decompress): Likewise.
1099 * options.h (compress_debug_sections): Likewise.
1100 * configure.ac (AM_CONDITIONAL): Removed.
1101 * testsuite/Makefile.am (ZLIB): New.
1102 (LDADD): Add $(ZLIB).
1103 Don't check HAVE_ZLIB.
1104 * Makefile.in: Regenerated.
1105 * config.in: Likewise.
1106 * configure: Likewise.
1107 * testsuite/Makefile.in: Likewise.
1108
6b0ad2eb
JY
11092015-03-30 Jing Yu <jingyu@google.com>
1110
1111 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1112 TLSLD_ADD_DTPREL_LO12_NC.
1113 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1114 _TLS_MODULE_BASE_ point to the start of tls segment.
1115 (Target_aarch64::optimize_tls_reloc): Add cases for
1116 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1117 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1118 (Target_aarch64::Scan::local): Likewise.
1119 (Target_aarch64::Scan::global): Likewise.
1120 (Target_aarch64::Relocate::relocate): Likewise.
1121 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1122 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1123 relocations.
1124
0916f9e7
RÁE
11252015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1126
1127 * merge.cc (Object_merge_map::add_mapping): call
1128 Object_merge_map::Input_merge_map::add_mapping.
1129 (Object_merge_map::Input_merge_map::add_mapping): New.
1130 (Output_merge_data::do_add_input_section): Call
1131 get_or_make_input_merge_map before a loop.
1132 (Output_merge_string<Char_type>::finalize_merged_data): Call
1133 get_or_make_input_merge_map before a loop.
1134 * merge.h (Object_merge_map): Make Input_merge_map public.
1135 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1136 (Relobj::get_or_create_merge_map): New.
1137 * object.h (Relobj::get_or_create_merge_map): New.
1138
282c9750
AM
11392015-03-24 Alan Modra <amodra@gmail.com>
1140
1141 PR 18147
1142 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1143 relocation errors for branches to strong undefined symbols.
1144
67f95b96
RÁE
11452015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1146
1147 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1148 (Object_merge_map::is_merge_section_for): Remove.
1149 (Object_merge_map::find_merge_section): New.
1150 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1151 (Object_merge_map::find_merge_section): New.
1152 (Object_merge_map::get_input_merge_map): Add a const version.
1153 * object.cc (Relobj::is_merge_section_for): Remove.
1154 (Relobj::find_merge_section): New.
1155 * object.h (Relobj::is_merge_section_for): Remove.
1156 (Relobj::find_merge_section): New.
1157 * output.cc
1158 (Output_section::Input_section::is_merge_section_for): Remove.
1159 (Output_section::add_merge_input_section): Don't call
1160 add_merge_input_section.
1161 (Output_section::find_merge_section): Return const. Use
1162 object->find_merge_section.
1163 (Output_section::build_lookup_maps): Don't build a map for
1164 merge sections.
1165 (Output_section::is_input_address_mapped): Return false if
1166 section is not found.
1167 (Output_section::find_starting_output_address): Use
1168 find_merge_section instead of is_merge_section_for.
1169 (Output_section::add_script_input_section): Don't build a map for
1170 merge sections.
1171 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1172 (Output_section_lookup_maps::find_merge_section): Remove.
1173 (Output_section_lookup_maps::add_merge_input_section) Remove.
1174 (Output_section::find_merge_section): Return const.
1175
152f7024
CC
11762015-03-22 Cary Coutant <cary@google.com>
1177
1178 PR gold/18106
1179 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1180 non-SIB form of lea, with nop after the call.
1181
bccffdfd
CC
11822015-03-21 Cary Coutant <cary@google.com>
1183
1184 PR gold/14217
1185 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1186 .tdata section.
1187 (Output_segment::set_section_addresses): Don't align size of relro
1188 segment for .tbss.
1189
1c582fe7
CC
11902015-03-21 Cary Coutant <cary@google.com>
1191
1192 PR gold/18010
1193 * stringpool.cc (Stringpool_template): Don't optimize if section
1194 alignment is greater than sizeof(char).
1195
410da591
CC
11962015-03-21 Cary Coutant <cary@google.com>
1197
1198 PR gold/18048
1199 * script-c.h (script_include_directive): Add first_token parameter.
1200 * script.cc (script_include_directive): Add first_token parameter, and
1201 pass it to read_script_file.
1202 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1203 (PARSING_MEMORY_DEF): New tokens.
1204 (top): Add new productions for INCLUDE files.
1205 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1206 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1207 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1208 (section_cmd): Pass PARSING_SECTION_CMDS.
1209 (file_or_sections_cmd): Remove.
1210 (memory_def): Pass PARSING_MEMORY_DEF.
1211 * testsuite/Makefile.am (memory_test_2): New test.
1212 * testsuite/Makefile.in: Regenerate.
1213 * testsuite/memory_test_inc.t: New script file.
1214 * testsuite/memory_test_inc_1.t.src: New script file.
1215 * testsuite/memory_test_inc_2.t.src: New script file.
1216 * testsuite/memory_test_inc_3.t.src: New script file.
1217
0d5bbdb0
CC
12182015-03-21 Cary Coutant <cary@google.com>
1219
1220 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1221 (Sized_relobj_dwo::setup): Build compressed section map.
1222 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1223 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1224 section map.
1225 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1226 compressed_sections_ field.
1227 (build_compressed_section_map): Take Object instead of
1228 Sized_relobj_file parameter; add decompress_if_needed parameter.
1229 (Sized_relobj_file::do_find_special_sections): Store compressed
1230 section map in parent Object.
1231 (Sized_relobj_file::do_decompressed_section_contents): Move
1232 implementation to Object::decompressed_section_contents.
1233 (Sized_relobj_file::do_discard_decompressed_sections): Move
1234 implementation to Object::discard_decompressed_sections.
1235 * object.h (build_compressed_section_map): Declare.
1236 (Object::Object): Add compressed_sections_ field.
1237 (Object::section_is_compressed): Move implementation here.
1238 (Object::decompressed_section_contents): De-virtualize.
1239 (Object::discard_decompressed_sections): De-virtualize.
1240 (Object::do_section_is_compressed): Delete.
1241 (Object::do_decompressed_section_contents): Delete.
1242 (Object::set_compressed_sections): New method.
1243 (Object::compressed_sections): New method.
1244 (Object::compressed_sections_): New data member.
1245 (Compressed_section_info, Compressed_section_map): Move to top of file.
1246 (Sized_relobj_file::do_section_is_compressed): Delete.
1247 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1248 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1249 (Sized_relobj_file::compressed_sections_): Move to Object class.
1250
bd9e0d46
CC
12512015-03-21 Cary Coutant <ccoutant@google.com>
1252
1253 PR gold/18152
1254 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1255 deferred objects.
1256
943c8b43
CC
12572015-03-11 Cary Coutant <ccoutant@google.com>
1258
1259 * options.cc (General_options::finalize): Don't allow -z relro
1260 with incremental linking.
1261 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1262 (incremental_test_2): Likewise.
1263 (incremental_test_3): Likewise.
1264 (incremental_test_4): Likewise.
1265 (incremental_test_5): Likewise.
1266 (incremental_test_6): Likewise.
1267 (incremental_copy_test): Likewise.
1268 (incremental_common_test_1): Likewise.
1269 (incremental_comdat_test_1): Likewise.
1270 * testsuite/Makefile.in: Regenerate.
1271
e1663197
CC
12722015-03-09 Cary Coutant <ccoutant@google.com>
1273
1274 PR gold/14675
1275 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1276 return enum indicating whether .eh_frame section is empty, optimizable,
1277 unrecognized, or an end marker. Adjust explicit instantiations.
1278 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1279 (Eh_frame::add_ehframe_input_section): Change return type.
1280 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1281 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1282 to the .eh_frame output section until we see the end marker.
1283 (Layout::finalize_eh_frame_section): New.
1284 * layout.h: (Layout::finalize_eh_frame_section): New.
1285
beb8418f
L
12862015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1287
1288 * output.cc (Relobj::initialize_input_to_output_map<size>):
1289 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1290
48c73428
CC
12912015-03-04 Cary Coutant <ccoutant@google.com>
1292
1293 * parameters.cc (Parameters::set_target_once): Call
1294 Target::select_as_default_target just once from here...
1295 (set_parameters_target): ...instead of from here.
1296
12972015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1298
1299 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1300 Output_section_data instead of a Merge_map.
1301 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1302 (Eh_frame::read_cie): Use add_merge_mapping instead of
1303 Merge_map::add_mapping.
1304 (Eh_frame::read_fde): Ditto.
1305 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1306 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1307 merge_map_->get_output_offset.
1308 (Eh_frame::do_is_merge_section_for): Delete.
1309 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1310 instead of a Merge_map.
1311 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1312 Merge_map.
1313 (Eh_frame::do_is_merge_section_for): Delete.
1314 (Eh_frame::merge_map_): Delete.
1315 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1316 and use a Output_section_data instead of a Merge_map.
1317 (Object_merge_map::add_mapping): Ditto.
1318 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1319 (Object_merge_map::is_merge_section_for): Pass in and use a
1320 Output_section_data instead of a Merge_map.
1321 (Merge_map): Delete.
1322 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1323 of merge_map_.get_output_offset.
1324 (Output_merge_base::do_is_merge_section_for): Delete.
1325 (Output_merge_data::do_add_input_section): Use
1326 object->add_merge_mapping instead of add_mapping.
1327 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1328 * merge.h (Merge_map): Delete forward declaration.
1329 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1330 instead of a Merge_map.
1331 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1332 (Object_merge_map::is_merge_section_for): Pass in and use a
1333 Output_section_data instead of a Merge_map.
1334 (Input_merge_map::Object_merge_map::merge_map): Replace with
1335 output_data.
1336 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1337 Output_section_data instead of a Merge_map.
1338 (Merge_map): Delete.
1339 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1340 (Output_merge_base::do_is_merge_section_for): Delete.
1341 (Output_merge_base::add_mapping): Delete.
1342 (Output_merge_base::merge_map_): Delete.
1343 * object.cc (Relobj::initialize_input_to_output_map): New.
1344 (Relobj::initialize_input_to_output_map): New.
1345 (Relobj::merge_output_offset): New.
1346 (Relobj::is_merge_section_for): New.
1347 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1348 bits.
1349 * object.h (Relobj::merge_map): Delete.
1350 (initialize_input_to_output_map): New.
1351 (set_merge_map): Delete.
1352 (add_merge_mapping): New.
1353 (merge_output_offset): New.
1354 (is_merge_section_for): New.
1355 * output.cc (Output_section::Input_section::is_merge_section_for):
1356 Use object->is_merge_section_for.
1357 * output.h (Output_section_data::is_merge_section_for): Delete.
1358 (Output_section_data::do_is_merge_section_for): Delete.
1359 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1360 Use object->initialize_input_to_output_map.
1361 (Merged_symbol_value<size>::value_from_output_section): Use
1362 object->merge_output_offset.
1363
48c73428 13642015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1365 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1366
1367 * output.cc (Output_section::add_merge_input_section): Do not
1368 attempt to merge sections with an entsize of 0.
1369
48c73428 13702015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1371
1372 * attributes.h (class Output_attributes_section_data ): Add
1373 do_print_to_mapfile function.
1374
ec86f434
AM
13752015-02-24 Alan Modra <amodra@gmail.com>
1376
1377 PR 18010
1378 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1379 complain if value is not a multiple of four.
1380 (Target_powerpc::Relocate::relocate): Correct handling of
1381 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1382
be66981e
L
13832015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1384
1385 * configure.ac (default_size): Set to 32 for x32.
1386 * configure: Regenerated.
1387
e3ee8ed4
AM
13882015-02-18 Alan Modra <amodra@gmail.com>
1389
1390 PR 17954
1391 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1392 visibility.
1393
3a935c6c
RÁE
13942015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1395
1396 * gc.h (Garbage_collection::add_reference): Don't use find.
1397
e0a1e121
RÁE
13982015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1399
1400 * object.cc (write_local_symbols): avoid std::vector copy.
1401
45a4fb1a
RÁE
14022015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1403
1404 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1405
2d9afefe
MW
14062015-02-09 Mark Wielaard <mjw@redhat.com>
1407
1408 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1409 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1410
e9c1bdad
CC
14112015-02-16 Cary Coutant <ccoutant@google.com>
1412
1413 PR gold/13577
1414 PR gold/16992
1415 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1416 DF_SYMBOLIC if --dynamic-list option is used.
1417 * options.cc (General_options::finalize): --dynamic-list is not
1418 mutually exclusive with -Bsymbolic.
1419 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1420 listed in --dynamic-list.
1421 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1422 -Bsymbolic-functions.
1423 * testsuite/Makefile.in: Regenerate.
1424
0ed4b0bf
CC
14252015-02-16 Cary Coutant <ccoutant@google.com>
1426
1427 PR gold/17971
1428 * incremental.cc: Remove redundant include of "output.h".
1429
1a920511
JY
14302015-02-12 Jing Yu <jingyu@google.com>
1431
1432 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1433 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1434 New relocation.
1435 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1436 TLSLE_MOVW_* relocations.
1437 (Target_aarch64::Scan::global): Likewise.
1438 (Target_aarch64::Relocate::relocate): Likewise.
1439 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1440 for new TLSLE_MOVW_* relocations.
1441
07f107f3
WN
14422015-02-11 Will Newton <will.newton@linaro.org>
1443
1444 PR gold/13321
1445 * arm.cc (Target_arm::make_plt_section): Create an ARM
1446 state mapping symbol at the start of the PLT.
1447
e051a5b5
L
14482015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1449
1450 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1451 Replace two_file_shared_2.so with two_file_shared_1.so.
1452 * testsuite/Makefile.in: Regenerated.
1453
dddcc5b9
AM
14542015-02-09 Alan Modra <amodra@gmail.com>
1455
1456 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1457 plugin_test_thin.a and defsym_test.
1458 * testsuite/Makefile.in: Regenerate.
1459
b39b8b9d
RÁE
14602015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1461
1462 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1463 body.
1464
b66d1c52
CC
14652015-02-04 Peter Collingbourne <pcc@google.com>
1466
1467 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1468 forwarding symbols when computing symbol resolution info for plugins.
1469 * plugin.h (Plugin_manager::symtab): New method.
1470 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1471
23081de0
CC
14722015-02-03 Cary Coutant <ccoutant@google.com>
1473 Peter Collingbourne <pcc@google.com>
1474
1475 PR gold/15660
1476 * archive.cc (Thin_archive_object_unlocker): New class.
1477 (Archive::include_member): Unlock external members of thin archives.
1478 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1479 (plugin_test_2): Likewise.
1480 (plugin_test_3): Likewise.
1481 (plugin_test_4): Likewise.
1482 (plugin_test_5): Likewise.
1483 (plugin_test_6): Likewise.
1484 (plugin_test_7): Likewise.
1485 (plugin_test_8): Likewise.
1486 (plugin_test_9): Likewise.
1487 (plugin_test_10): Likewise.
1488 (plugin_test_11): New test case.
1489 * testsuite/Makefile.in: Regenerate.
1490 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1491 file to decide whether to claim file.
1492 (all_symbols_read_hook): Likewise.
1493 * testsuite/plugin_test_1.sh: Adjust expected output.
1494 * testsuite/plugin_test_2.sh: Likewise.
1495 * testsuite/plugin_test_3.sh: Likewise.
1496 * testsuite/plugin_test_6.sh: Likewise.
1497 * testsuite/plugin_test_tls.sh: Likewise.
1498 * testsuite/plugin_test_11.sh: New testcase.
1499
15002015-02-03 Cary Coutant <ccoutant@google.com>
1501
1502 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1503 file descriptors when debugging enabled. Add debug output.
1504 (Descriptors::release): Add debug output.
1505 (Descriptors::close_some_descriptor): Likewise.
1506 (Descriptors::close_all): Likewise.
1507 * fileread.cc (File_read::lock): Likewise.
1508 (File_read::unlock): Likewise.
1509
24dd5808
CC
15102015-02-02 Cary Coutant <ccoutant@google.com>
1511
1512 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1513 executable output file.
1514
fa89cc82
HS
15152015-01-22 Han Shen <shenhan@google.com>
1516
1517 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1518 (Target_arm::do_plt_address_for_global): New method.
1519 (Target_arm::do_plt_address_for_local): New method.
1520 (Target_arm::rel_irelative_section): New method.
1521 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1522 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1523 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1524 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1525 (Target_arm::Scan::check_non_pic): Add ifunc support.
1526 (Target_arm::Scan::local): Add ifunc support.
1527 (Target_arm::Scan::global): Add ifunc support.
1528 (Target_arm::make_plt_section): New method.
1529 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1530 (Target_arm::make_local_ifunc_plt_entry): New method.
1531 (Target_arm::got_irelative_): New member.
1532 (Target_arm::rel_irelative_): New member.
1533 (Target_arm::got_section): Add creation for got_irelative_.
1534 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1535 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1536 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1537 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1538 (Output_data_plt_arm::IRelative_data): New type.
1539 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1540 (Output_data_plt_arm::add_entry): Add more parameters.
1541 (Output_data_plt_arm::add_relocation): New method.
1542 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1543 (Output_data_plt_arm::rel_irelative): New method.
1544 (Output_data_plt_arm::entry_count): Modified.
1545 (Output_data_plt_arm::address_for_global): New method.
1546 (Output_data_plt_arm::address_for_local): New method.
23081de0 1547gold/
fa89cc82
HS
1548 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1549 (Output_data_plt_arm::insert_irelative_data): New method.
1550 (Output_data_plt_arm::irelative_rel_): New member.
1551 (Output_data_plt_arm::got_): New member.
1552 (Output_data_plt_arm::got_irelative_): New member.
1553 (Output_data_plt_arm::irelative_count_): New member.
1554 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1555 (Output_data_plt_arm::irelative_data_vec_): New member.
1556 (Output_data_plt_arm::do_write): Write out irelative entries.
1557 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1558 more parameters to ctor.
1559 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1560 more parameters to ctor.
1561 * output.h (Output_data_reloc::add_local_relative): New method.
1562 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1563
0f81d3f0
AM
15642015-01-29 Alan Modra <amodra@gmail.com>
1565
1566 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1567 and GOT_TLSGD to LE optimization.
1568
65d92137
CC
15692015-01-28 Cary Coutant <ccoutant@google.com>
1570
1571 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1572 for undef TLS symbols.
1573 (Target_x86_64::Relocate::relocate_tls): Likewise.
1574 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1575
5485698a
CC
15762015-01-25 Cary Coutant <ccoutant@google.com>
1577
1578 * output.cc (Output_segment::set_section_addresses): Fix calculation
1579 of size of relro segment.
1580
b01a4b04
AM
15812015-01-22 Alan Modra <amodra@gmail.com>
1582
1583 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1584 condition for need of ifunc plt entry.
1585 (Target_powerpc::Scan::global <got relocs>): Likewise.
1586
3d0064a9
CC
15872015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1588
1589 * mips.cc (reloc_high): Add r_sym.
1590 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1591 reloc_high constructor.
1592 (Mips_relocate_functions::relgot16_local): Likewise.
1593 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1594 r_type to decide whether LO16 matches HI16.
1595 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1596 rello16 and relgot16_local.
1597
a5cd8f05
CC
15982015-01-09 Cary Coutant <ccoutant@google.com>
1599
1600 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1601 unless alignment is larger than page size.
1602
4fc1b9d4
L
16032015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1604 Cary Coutant <ccoutant@google.com>
1605
1606 PR gold/17729
1607 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1608 (DEFAULT_TARGET_X32): Set for x32.
1609 * x86_64.cc (cmp_insn_32): New.
1610 (lea_r10_insn_32): Likewise.
1611 (lea_r11_insn_32): Likewise.
1612 (cmp_insn_64): Likewise.
1613 (lea_r10_insn_64): Likewise.
1614 (lea_r11_insn_64): Likewise.
1615 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1616 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1617 (check_DATA): Add split_x32 files.
1618 (split_x32_[1234n].o): New targets.
1619 (split_x32_[124]): New targets.
1620 (split_x32_[1234r].stdout): New targets.
1621 * testsuite/split_x32.sh: New file.
1622 * testsuite/split_x32_1.s: Likewise.
1623 * testsuite/split_x32_2.s: Likewise.
1624 * testsuite/split_x32_3.s: Likewise.
1625 * testsuite/split_x32_4.s: Likewise.
1626 * testsuite/split_x32_n.s: Likewise.
1627 * configure: Regenerated.
1628 * testsuite/Makefile.in: Likewise.
1629
e749cab8
L
16302015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1631
1632 PR gold/17809
1633 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1634 x32.
1635
af759df0
AM
16362015-01-02 Alan Modra <amodra@gmail.com>
1637
1638 * version.cc (print_version): Just print current year.
1639 * dwp.cc (print_version): Likewise.
1640
b90efa5b
AM
16412015-01-01 Alan Modra <amodra@gmail.com>
1642
1643 Update year range in copyright notice of all files.
1644
f12d1e8a
AM
16452014-12-25 Alan Modra <amodra@gmail.com>
1646
1647 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1648 new enums.
1649 (Target_arm::merge_object_attributes, ): Likewise.
1650
5c294fee
TG
16512014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1652
1653 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1654 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1655 AEABI_VFP_args_vfp to check that.
1656 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1657 value and replace hardcoded values by enum values.
1658
e30880c2
CC
16592014-12-22 Cary Coutant <ccoutant@google.com>
1660
1661 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1662
bd040da1
L
16632014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1664
1665 PR gold/14608
1666 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1667 to "return i * i * 3;".
1668
e02a4046
CC
16692014-12-16 Cary Coutant <ccoutant@google.com>
1670
1671 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1672 (Mapfile::print_output_data): Use current_data_size() to avoid
1673 assert for sections requiring postprocessing; if address is not valid,
1674 print 0.
1675 (Mapfile::print_output_section): Use current_data_size(); print note
1676 that addresses and sizes are before compression.
1677
add6016b
L
16782014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1679
1680 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1681 Cast current_group_size to unsigned long when reporting error.
1682
0bf32ea9
JY
16832014-12-10 Jing Yu <jingyu@google.com>
1684
1685 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1686 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1687 Update error message.
1688 (Target_aarch64::do_relax): Use absolute value of option
1689 stub_group_size. Replace local variable with class member
1690 stub_group_size_.
1691
cbcb23fa
AM
16922014-12-04 Alan Modra <amodra@gmail.com>
1693
1694 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1695 addend of PLTREL24 reloc when not generating a plt stub. Make
1696 max_branch_offset an "Address".
fbad6518 1697 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1698 (Target_powerpc::Relocate::relocate): Likewise.
1699
1611bc4a
AM
17002014-12-04 Alan Modra <amodra@gmail.com>
1701
1702 PR 17670
1703 * symtab.cc (Symbol::set_undefined): Remove assertion.
1704 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1705 on symbols defined in discarded sections, instead return false.
1706 Rearrange params, update all callers.
1707 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1708 branches to syms in discarded sections.
1709 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1710 undefined and flag as discarded.
1711 (Target_powerpc::Relocate::relocate): Localize variable.
1712
4759c34e
L
17132014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1714
1715 PR gold/17675
1716 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1717 * testsuite/Makefile.in: Regenerated.
1718
1f98a074
AM
17192014-12-03 Alan Modra <amodra@gmail.com>
1720
1721 PR 17566
1722 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1723 when adding dynamic relocations against section symbols.
1724
fb257835
DI
17252014-12-01 Dimitry Ivanov <dimitry@google.com>
1726
1727 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1728 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1729 * options.h (General_options): New -z option (global).
1730
d8e60314
CC
17312014-12-01 Cary Coutant <ccoutant@google.com>
1732
1733 PR gold/17578
1734 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1735 is given.
1736 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1737 given but some inputs require executable stack.
1738
982bbd97
CC
17392014-11-26 Cary Coutant <ccoutant@google.com>
1740
1741 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1742 .debug_str_offsets; strip .debug_gnu_pubnames and
1743 .debug_gnu_pubtypes.
1744 (lines_only_debug_sections): Strip all four new sections.
1745
bb779192
HS
17462014-11-26 Jing Yu <jingyu@google.com>
1747
1748 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1749 register to be x0 when to relax TLSDESC_LD64_LO12.
1750
a3e60ddb
AM
17512014-11-26 Alan Modra <amodra@gmail.com>
1752
1753 * powerpc.cc (struct Stub_table_owner): New.
1754 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1755 unsigned int vector. Update all references.
1756 (powerpc_relobj::set_stub_table): Take an unsigned int param
1757 rather than a Stub_table. Update callers.
1758 (Powerpc_relobj::clear_stub_table): New function.
1759 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1760 stub_group_size_ vars.
1761 (Target_powerpc::new_stub_table): Delete.
1762 (max_branch_delta): New function, extracted from..
1763 (Target_powerpc::Relocate::relocate): ..here..
1764 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1765 status on whether stub created successfully.
1766 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1767 default sizing to..
1768 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1769 reduce on relax failure.
1770 (Target_powerpc::group_sections): Add "no_size_errors" param.
1771 Use stub_group_size_. Set up group info in a temp vector,
1772 before building Stub_table vector. Account for input sections
1773 possibly already converted to relaxed sections.
1774 (Stub_table::init): Delete. Merge into..
1775 (Stub_table::Stub_table): ..here.
1776 (Stub_table::can_reach_stub): New function.
1777 (Stub_table::add_plt_call_entry): Add "from" parameter and
1778 return true iff stub could be reached.
1779 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1780 param too.
1781 (Stub_table::clear_stubs): Add "all" param.
1782
a20605cf
AM
17832014-11-26 Alan Modra <amodra@gmail.com>
1784
1785 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1786 (Target_powerpc::group_sections): Use it.
1787
43b64deb
CC
17882014-11-25 Cary Coutant <ccoutant@google.com>
1789
1790 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1791 (Binary_to_elf::write_symbol): Add st_size parameter.
1792 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1793
c924eb67
CC
17942014-11-25 Cary Coutant <ccoutant@google.com>
1795
1796 PR gold/17639
1797 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1798 (Sized_relobj_file::do_layout): Handle deferred sections properly
1799 during GC pass 1. Don't add reloc sections to deferred list twice.
1800 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1801 (Sized_relobj_file::is_deferred_layout_): New data member.
1802
9d585188
L
18032014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1804
1805 PR gold/17619
1806 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1807 Check PC-relative offset overflow in PLT entry.
1808
3ffaac20
AM
18092014-11-21 Alan Modra <amodra@gmail.com>
1810
1811 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1812 for undefined weaks.
1813
0cfb0717
AM
18142014-11-20 Alan Modra <amodra@gmail.com>
1815
1816 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1817 from --stub-group-size parameter divided by 1024.
1818 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1819 template parameter. Update all uses.
1820 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1821 has_stub_value. Set for long branches. Don't report overflow for
1822 branch to undefined weak symbols. Print info message on
1823 overflowing branch to stub.
1824
f9dffbf0
AM
18252014-11-20 Alan Modra <amodra@gmail.com>
1826
1827 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1828
e88ba8d5
L
18292014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1830
1831 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1832 entry for R_X86_64_GOTPLT64.
1833 (Target_x86_64<size>::Relocate::relocate): Update comments for
1834 R_X86_64_GOTPLT64.
1835
d37ffe25
ED
18362014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1837
1838 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1839 * plugin.h: add lock definition
1840
9726c3c1
HS
18412014-10-29 Han Shen <shenhan@google.com>
1842 Jing Yu <jingyu@google.com>
1843
1844 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1845 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1846 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1847 Symbol::TLS_REF.
1848 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1849 method.
1850 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1851 (Target_aarch64::tls_ld_to_le): New method.
1852 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1853 for 64bit targets.
1854 (Output_data_plt_aarch64::irelative_rel_): New data member.
1855 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1856 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1857 (Output_data_plt_aarch64::add_relocation): New method.
1858 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1859 offset. Add got_irelative size to got size.
1860 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1861 type string with the new typename.
1862 (AArch64_relocate_functions::update_adr): Replace parameter x with
1863 immed.
1864 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1865 (AArch64_relocate_functions::reloc_common): New method.
1866 (AArch64_relocate_funcsions::rela_general): Extract common part out
1867 into reloc_common method.
1868 (AArch64_relocate_functions::rela_general): Likewise.
1869 (AArch64_relocate_functions::pcrela_general): Likewise.
1870 (AArch64_relocate_functions::adr): New method.
1871 (AArch64_relocate_functions::adrp): Calculate immed before calling
1872 update_adr.
1873 (AArch64_relocate_functions::adrp): Likewise.
1874 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1875 comparing x to 0. Calculate immed from ~x when x < 0.
1876 (Target_aarch64::optimize_tls_reloc): Add new cases for
1877 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1878 TLSLD_MOVW_DTPREL_G0_NC.
1879 (Target_aarch64::possible_function_pointer_reloc): Implement this
1880 method.
1881 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1882 comment.
1883 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1884 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1885 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1886 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1887 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1888 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1889 (Target_aarch64::make_plt_entry): Call add_entry with two more
1890 parameters.
1891 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1892 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1893 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1894 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1895 (Target_aarch64::Relocate::relocate_tls): Add cases for
1896 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1897 TLSLD_MOVW_DTPREL_G0_NC.
1898 * testsuite/icf_safe_so_test.cc: Correct test comment.
1899 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1900
80272b8c
AM
19012014-10-22 Alan Modra <amodra@gmail.com>
1902
1903 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1904 thread_starter.
1905
998a69f4
AS
19062014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1907
1908 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1909
aed56ec5
CC
19102014-10-17 Cary Coutant <ccoutant@google.com>
1911
1912 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1913 Add "typename" keyword.
1914
bb779192 19152014-10-15 Han Shen <shenhan@google.com>
72f4393d 1916 Jing Yu <jingyu@google.com>
83a01957
HS
1917
1918 Patch for gold aarch64 backend to support relaxation.
1919 * aarch64-reloc.def: Change format.
1920 * aarch64.cc (class Reloc_stub): New class.
1921 (class Stub_table): New class.
1922 (class AArch64_relobj): New class.
1923 (class AArch64_input_section): New class.
1924 (class AArch64_output_section): New class.
1925 (Target_aarch64::new_stub_table): New method.
1926 (Target_aarch64::new_aarch64_input_section): New method.
1927 (Target_aarch64::find_aarch64_input_section): New method.
1928 (Target_aarch64::scan_section_for_stubs): New method.
1929 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1930 (Target_aarch64::relocate_stub): New method.
1931 (Target_aarch64::current_target): New method.
1932 (Target_aarch64::do_make_elf_object): New method.
1933 (Target_aarch64::do_may_relax): New method.
1934 (Target_aarch64::do_relax): New method.
1935 (Target_aarch64::group_sections): New method.
1936 (Target_aarch64::scan_reloc_for_stub): New method.
1937 (Target_aarch64::do_make_output_section): New method.
1938 (Target_aarch64::stub_tables_): New data member.
1939 (Target_aarch64::aarch64_input_section_map_): New data member.
1940 (AArch64_relocate_functions::maybe_apply_stub): New method.
1941
db4c9594
CC
19422014-09-30 Cary Coutant <ccoutant@google.com>
1943
1944 PR gold/17432
1945 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1946
cd6da036
KC
19472014-09-30 Kito Cheng <kito@0xlab.org>
1948
1949 PR gold/13597
1950 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1951 hash table before sysv-style hash table.
1952
5f772412
ST
19532014-09-29 Sriraman Tallam <tmsriram@google.com>
1954
1955 * options.h (--pic-executable): Add negative to alias to -no-pie.
1956
5efeedf6
CC
19572014-09-26 Cary Coutant <ccoutant@google.com>
1958
1959 PR gold/16773
1960 * object.cc (Sized_relobj_file): Compute value of section symbols
1961 for TLS sections the same as TLS symbols.
1962
1707f183
CC
19632014-09-25 Cary Coutant <ccoutant@google.com>
1964
1965 PR gold/17432
1966 * resolve.cc (Symbol_table::resolve): Override common placeholder
1967 symbols, but adjust sizes.
1968 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1969 symbols to common lists.
1970
00cac886
AM
19712014-09-24 Alan Modra <amodra@gmail.com>
1972
1973 * po/POTFILES.in: Regenerate.
1974
635aa30e 19752014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1976 Cary Coutant <ccoutant@google.com>
635aa30e 1977
71b9b91b 1978 PR gold/14860
635aa30e
CC
1979 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1980 on input_sections_blocker.
1981 * layout.cc (Write_sections_task::locks): Unblock
1982 input_sections_blocker_.
1983 * layout.h (Write_sections_task::Write_sections_task): Add
1984 input_sections_blocker.
1985 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1986 to DEPENDENCIES.
1987 * testsuite/Makefile.in: Regenerate.
1988
c0c71592
RÁE
19892014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1990
1991 * testsuite/Makefile.am (plugin_test_10): New test.
1992 * testsuite/Makefile.in: Regenerate
1993 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1994 * testsuite/plugin_test_10.sh: New file.
1995
6168c2a1
RÁE
19962014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1997
1998 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1999 * resolve.cc (Symbol_table::resolve): Don't override common symbols
2000 during the replacement phase.
2001
3a531937
JY
20022014-09-17 Han Shen <shenhan@google.com>
2003 Jing Yu <jingyu@google.com>
2004
2005 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
2006 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
2007 * aarch64.cc (Target_aarch64): Add data members
2008 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
2009 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
2010 constructor.
2011 (Target_aarch64::do_reloc_symbol_index): New method.
2012 (Target_aarch64::do_reloc_addend): New method.
2013 (Target_aarch64::add_tlsdesc_info): New method.
2014 (Target_aarch64::do_dynsym_value): New method.
2015 (Target_aarch64::do_make_data_plt): Add new parameters: got,
2016 got_irelative. Pass them to Output_data_plt_aarch64_standard.
2017 (Target_aarch64::make_data_plt): Add new parameters: got,
2018 got_irelative. Pass them to do_make_data_plt.
2019 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
2020 (Target_aarch64::Relocate:tls_gd_to_le): New method.
2021 (Target_aarch64::Relocate:tls_ie_to_le): New method.
2022 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
2023 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
2024 (Target_aarch64::got_tlsdesc_section): New method.
2025 (Target_aarch64::make_local_ifunc_plt_entry): New method.
2026 (Target_aarch64::define_tls_base_symbol): New method.
2027 (Target_aarch64::reserve_tlsdesc_entries): New method.
2028 (Target_aarch64::got_mod_index_entry): New method.
2029 (Target_aarch64::rela_tlsdesc_section): New method.
2030 (Target_aarch64::rela_irelative_section): New method.
2031 (Target_aarch64::Tlsdesc_info): New struct.
2032 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
2033 relocations and tlsdesc relocations.
2034 (Target_aarch64::optimize_tls_reloc): Implement method.
2035 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
2036 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
2037 in constructor.
2038 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
2039 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
2040 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
2041 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
2042 (Output_data_plt_aarch64::rela_tlsdesc): New method.
2043 (Output_data_plt_aarch64::rela_irelative): New method.
2044 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
2045 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
2046 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
2047 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
2048 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
2049 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
2050 (Output_data_plt_aarch64_standard): New member variables:
2051 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
2052 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
2053 New parameter: got, got_irelative.
2054 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
2055 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
2056 (Output_data_plt_aarch64::do_write): Replace got_address with
2057 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
2058 (AArch64_relocate_functions::update_movnz): New method.
2059 (AArch64_relocate_functions): Correct format.
2060 (AArch64_relocate_functions::movnz): New method.
2061 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
2062 before the switch. Add new cases to switch.
00cac886 2063 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
2064 tlsgd tlsdesc cases.
2065 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
2066 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
2067 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
2068 Call reloc_name_in_error_message to print unsupported reloc.
2069 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
2070 make_data_plt.
2071 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
2072 relocs. Fill in some more dynamic tags.
2073 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2074 Skip call tls_get_addr when tlsgd is relaxed.
2075 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2076 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2077 tlsdesc->ie relaxation.
2078
62661c93
SS
20792014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2080
2081 * mips.cc (Target_mips_nacl): New class.
2082 (Target_selector_mips_nacl): New class.
2083 (target_selector_mips32): Rename from target_selector_mips32be and use
2084 Target_selector_mips_nacl instead of Target_selector_mips.
2085 (target_selector_mips32el): Rename from target_selector_mips32 and use
2086 Target_selector_mips_nacl instead of Target_selector_mips.
2087 (target_selector_mips64): Rename from target_selector_mips64be and use
2088 Target_selector_mips_nacl instead of Target_selector_mips.
2089 (target_selector_mips64el): Rename from target_selector_mips64 and use
2090 Target_selector_mips_nacl instead of Target_selector_mips.
2091 (Target_mips::mips_info): Add const attribute.
2092
54674d38
CC
20932014-09-02 Cary Coutant <ccoutant@google.com>
2094
2095 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2096 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2097 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2098 (Sized_incr_dynobj::do_section_name): Likewise.
2099 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2100 (Sized_incr_dynobj::do_section_name): Likewise.
2101 * object.h (Object::section_name): Likewise.
2102 (Object::do_section_name): Likewise.
2103 (Sized_relobj_file::do_section_name): Likewise.
2104 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2105 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2106
9860cbcf
CC
21072014-09-02 Cary Coutant <ccoutant@google.com>
2108
2109 PR gold/17005
2110 * ehframe.cc (Fde::write): Add output_offset parameter.
2111 (Cie::write): Likewise.
2112 (Eh_frame::set_final_data_size): Account for offset within output
2113 section.
2114 (Eh_frame::do_sized_write): Likewise.
2115 * ehframe.h (Fde::write): Add output_offset parameter.
2116 (Cie::write): Likewise.
2117 * output.cc (Output_section::Input_section_sort_entry): Remove
2118 section_has_name_; add output_section_name parameter. Use
2119 output section name for non-input sections.
2120 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2121 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2122 (Output_section::Input_section_sort_compare): Remove logic for
2123 sections without names.
2124 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2125 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2126 Likewise.
2127 (Output_section::Input_section_sort_section_name_compare): Likewise.
2128
8e33481e
HS
21292014-08-29 Han Shen <shenhan@google.com>
2130 Jing Yu <jingyu@google.com>
2131
2132 * aarch64-reloc-property.cc
2133 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2134 reference reloc property in the table.
2135 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2136 3 other entries.
2137 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2138 2 new overloaded methods.
2139 (Output_data_got_aarch64::do_write): Add code to write out
2140 static relocs.
2141 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2142 static relocs.
2143 (Output_data_got_aarch64::static_relocs): New vector to
2144 hold static relocs.
2145 (Target_aarch64::TCB_SIZE): New const static memeber.
2146 (Target_aarch64::tcb_size): New method.
2147 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2148 (Target_aarch64::Relocate::relocate_tls): New method.
2149 (Target_aarch64::Scan::local): Add code handling new reloc types.
2150 (Target_aarch64::Scan::global): Add code handling new reloc types.
2151
81233653
ST
21522014-08-13 Sriraman Tallam <tmsriram@google.com>
2153
2154 * options.h (-no-pie): Add option.
2155
9363c7c3
JY
21562014-08-08 Jing Yu <jingyu@google.com>
2157 Han Shen <shenhan@google.com>
2158
2159 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2160 (DEFFILES): add aarch64-reloc.def.
2161 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2162 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2163 * Makefile.in: Regenerate.
2164 * aarch64-reloc-property.cc: New file.
2165 * aarch64-reloc-property.h: New file.
2166 * aarch64-reloc.def: New file.
2167 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2168 with tab to make the format consistent.
2169 (Output_data_got_aarch64::symbol_table_): New method.
2170 (Target_aarch64::do_plt_address_for_global): New method.
2171 (Target_aarch64::do_plt_address_for_local): New method.
2172 (Target_aarch64::do_select_as_default_target): New method.
2173 (Target_aarch64::do_make_data_plt): New method.
2174 (Target_aarch64::make_data_plt): New method.
2175 (Output_data_plt_aarch64::has_irelative_section): New method.
2176 (Output_data_plt_aarch64::address_for_global): New method.
2177 (Output_data_plt_aarch64::address_for_local): New method.
2178 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2179 (Output_data_plt_aarch64::add_entry): Implement contents.
2180 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2181 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2182 the got_pov entry to plt0.
2183 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2184 Implement contents.
2185 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2186 (AArch64_howto): New struct.
2187 (aarch64_howto[]): New static const array.
2188 (AArch64_relocate_functions): New class.
2189 (Target_aarch64::Scan::get_reference_flags): Remove method.
2190 (Target_aarch64::Scan::local): Implement to support a few relocations.
2191 (Target_aarch64::Scan::global): Implement to support a few relocations.
2192 (Target_aarch64::make_plt_section): Implement contents.
2193 (Target_aarch64::make_plt_entry): Implement contents.
2194 (Target_aarch64::do_finalize_sections): Implement contents.
2195 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2196 (Target_aarch64::relocate_section): Implement contents.
2197
ad9fe6c1
AM
21982014-08-06 Alan Modra <amodra@gmail.com>
2199
2200 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2201
7cd4e5b7
AM
22022014-08-06 Alan Modra <amodra@gmail.com>
2203
2204 PR 13227
2205 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2206
5ad9b0a7
ST
22072014-07-21 Sriraman Tallam <tmsriram@google.com>
2208
2209 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2210 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2211
e051745c
CC
22122014-07-08 Cary Coutant <ccoutant@google.com>
2213
2214 * expression.cc (struct Expression::Expression_eval_info): Add
2215 new fields type_pointer, vis_pointer, and nonvis_pointer.
2216 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2217 nonvis_pointer parameters. Adjust all calls.
2218 (Symbol_expression::value): Update type, visibility, and nonvis bits
2219 in caller.
2220 * script.cc (Symbol_assignment::sized_finalize): Update type,
2221 visibility, and remaining st_other bits for new symbol.
2222 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2223 vis_pointer, and nonvis_pointer parameters.
2224 * symtab.h (Symbol::set_type): New method.
2225
2226 * testsuite/Makefile.am (defsym_test): New test.
2227 * testsuite/Makefile.in: Regenerate.
2228 * testsuite/defsym_test.c: New file.
2229 * testsuite/defsym_test.sh: New file.
2230
f35c4853
CC
22312014-07-08 Cary Coutant <ccoutant@google.com>
2232
2233 PR gold/15639
2234 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2235 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2236 (Sized_dynobj::base_read_symbols): ...new method.
2237 * object.h (Sized_relobj_file::base_read_symbols): New method.
2238 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2239 (Sized_relobj_file::base_read_symbols): ...new method.
2240 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2241 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2242 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2243
2900af2d
AM
22442014-07-04 Alan Modra <amodra@gmail.com>
2245
2246 * po/POTFILES.in: Regenerate.
2247
053a4d68
JY
22482014-07-02 Jing Yu <jingyu@google.com>
2249
2250 * aarch64.cc: New file
2251 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2252 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2253 * Makefile.in: Regenerate.
2254 * configure.tgt: Add entries for aarch64*.
2255 * configure.ac: Likewise.
2256 * configure: Likewise.
2257
7b549045
AM
22582014-06-27 Alan Modra <amodra@gmail.com>
2259
2260 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2261
cb818dbf
CC
22622014-06-24 Cary Coutant <ccoutant@google.com>
2263
2264 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2265 sections.
2266 (Dwo_file::sized_read_unit_index): Likewise.
2267
9810d34d
SS
22682014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2269
2270 * mips.cc: New file.
2271 * Makefile.am (TARGETSOURCES): Add mips.cc
2272 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2273 * configure.tgt: Add entries for mips*.
2274 * configure.ac: Likewise.
2275 * Makefile.in: Regenerate.
2276 * configure: Likewise.
2277
9baa787b
CC
22782014-06-09 Cary Coutant <ccoutant@google.com>
2279
2280 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2281 unit_length is within section bounds.
2282
8f89af0a
CC
22832014-06-09 Cary Coutant <ccoutant@google.com>
2284
2285 PR gold/16980
2286 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2287 map.
2288
a47622ac
AM
22892014-06-07 Alan Modra <amodra@gmail.com>
2290
2291 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2292
4320c691
CC
22932014-06-06 Cary Coutant <ccoutant@google.com>
2294
2295 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2296 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2297 (Dwarf_pubnames_table::read_header): Likewise.
2298 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2299 .debug_gnu_pubtypes.
2300
270c9937
JB
23012014-06-05 Joel Brobecker <brobecker@adacore.com>
2302
2303 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2304 * Makefile.in, configure: Regenerate.
2305
397998fc
AM
23062014-06-03 Alan Modra <amodra@gmail.com>
2307
2308 * powerpc.cc (addis_12_2): Define.
2309 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2310
61f5c66f
AM
23112014-06-03 Alan Modra <amodra@gmail.com>
2312
2313 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2314 st_other output.
2315
f6971787
AM
23162014-06-02 Alan Modra <amodra@gmail.com>
2317
2318 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2319 Only ignore relocs on ELFv1.
2320 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2321
f6fb8322
CC
23222014-05-30 Cary Coutant <ccoutant@google.com>
2323
2324 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2325 * testsuite/Makefile.in: Regenerate.
2326 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2327
c23dd342
L
23282014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2329
2330 PR gold/16945
2331 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2332 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2333
5fe7ffdc
AM
23342014-05-15 Alan Modra <amodra@gmail.com>
2335
2336 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2337 Compare FDE contents with DW_CFA_nop rather than 0.
2338
a82bef93
ST
23392014-05-13 Sriraman Tallam <tmsriram@google.com>
2340
2341 * symtab.h (may_need_copy_reloc): Remove check for position independent
2342 code.
2343 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2344 position independence before pc absolute may_need_copy_reloc call.
2345 Add check for executable output befor pc relative may_need_copy_reloc
2346 call.
2347 * i386.cc: Ditto.
2348 * arm.cc: Ditto.
2349 * sparc.cc: Ditto.
2350 * tilegx.cc: Ditto.
2351 * powerpc.cc: Add check for no position independence before
2352 may_need_copy_reloc calls.
2353 * testsuite/pie_copyrelocs_test.cc: New file.
2354 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2355 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2356 * Makefile.in: Regenerate.
a82bef93 2357
53c66605
ML
23582014-05-08 Martin Liška <mliska@suse.cz>
2359
2360 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2361
57b2284c
CC
23622014-05-06 Cary Coutant <ccoutant@google.com>
2363
2364 PR gold/16900
2365 * i386.cc (Output_data_got_plt_i386): New class.
2366 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2367 parameter. Change all callers.
2368 (Output_data_plt_i386::layout_): Remove.
2369 (Output_data_plt_i386::got_plt_): Change type.
2370 (Target_i386::got_plt_): Change type. Change all references.
2371 (Target_i386::got_section): Create instance of new class.
2372 (Output_data_got_plt_i386::do_write): New function.
2373 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2374 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2375 parameter. Change all callers.
2376 (Output_data_plt_x86_64::layout_): Remove.
2377 (Output_data_plt_x86_64::got_plt_): Change type.
2378 (Target_x86_64::got_plt_): Change type. Change all references.
2379 (Target_x86_64::got_section): Create instance of new class.
2380 (Output_data_got_plt_x86_64::do_write): New function.
2381 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2382 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2383 class.
2384
6b97515d 23852014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2386
6b97515d
CC
2387 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2388 if we have pubnames/pubtypes.
2389
d1bddd3c
CC
23902014-05-02 Cary Coutant <ccoutant@google.com>
2391
5fe7ffdc
AM
2392 * defstd.cc (in_segment): Define __ehdr_start here...
2393 * layout.cc (Layout::finalize): ...Instead of here. Set the
2394 output segment when known.
2395 * resolve.cc (Symbol::override_base_with_special): Remember
2396 the original binding.
2397 * symtab.cc (Symbol::set_output_segment): New function.
2398 (Symbol::set_undefined): New function.
2399 * symtab.h (Symbol::is_weak_undefined): Check original undef
2400 binding.
2401 (Symbol::is_strong_undefined): New function.
2402 (Symbol::set_output_segment): New function.
2403 (Symbol::set_undefined): New function.
2404 * target-reloc.h (is_strong_undefined): Remove.
2405 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2406 Check for hidden undefs.
2407 (relocate_section): Call Symbol::is_strong_undefined.
2408
2409 * testsuite/Makefile.am (ehdr_start_test_1)
2410 (ehdr_start_test_2, ehdr_start_test_3)
2411 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2412 * testsuite/Makefile.in: Regenerate.
2413 * testsuite/ehdr_start_def.cc: New source file.
2414 * testsuite/ehdr_start_test.cc: New source file.
2415 * testsuite/ehdr_start_test.t: New linker script.
2416 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2417
7849f6d8
CC
24182014-04-23 Cary Coutant <ccoutant@google.com>
2419
bf2cc635 2420 PR gold/16870
7849f6d8
CC
2421 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2422
99fd8cff
CC
24232014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2424
2425 * layout.cc (Layout::include_section): Allow a target to decide
2426 whether to include a section.
2427 * target.h (Target::should_include_section): New function.
2428 (Target::do_should_include_section): New function.
2429
91f43acd
CC
24302014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2431
2432 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2433 inline into ...
2434 (Copy_relocs::emit): ... here.
2435 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2436 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2437 (Copy_reloc_entry::entries_): Change from private to protected.
2438
c4eb27e1
ST
24392014-04-02 Sriraman Tallam <tmsriram@google.com>
2440
2441 * icf.cc (get_section_contents): Replace copies of reloc
2442 vectors with const references.
2443
ae447ddd
CC
24442014-04-02 Cary Coutant <ccoutant@google.com>
2445
2446 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2447 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2448 * configure: Regenerate.
2449 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2450 -fno-use-linker-plugin.
2451 (LINK1, CXXLINK1): Add it to the link command.
2452 * testsuite/Makefile.in: Regenerate.
2453
fa47fa92
AM
24542014-03-12 Alan Modra <amodra@gmail.com>
2455
2456 * Makefile.in: Regenerate.
2457
9b12c500
CC
24582014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2459
2460 * symtab.h (Symbol::set_nonvis): New function.
2461
beacaa96
CC
24622014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2463
2464 * symtab.cc (Sized_symbol<32>::init_output_data):
2465 Instantiate the template.
2466 (Sized_symbol<64>::init_output_data): Likewise.
2467
800d9823
CC
24682014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2469
2470 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2471 adjust dynamic symbol value.
2472 * target.h (Target::adjust_dyn_symbol): New function.
2473 (Target::do_adjust_dyn_symbol): New function.
2474
918fc1f8 24752014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2476
918fc1f8
CC
2477 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2478 Get the value of DYNAMIC_CUSTOM dynamic entry.
2479 * output.h (Output_data_dynamic::add_custom): New function.
2480 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2481 dynamic entry.
2482 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2483 * target.h (Target::dynamic_tag_custom_value): New function.
2484 (Target::do_dynamic_tag_custom_value): New function.
2485
98ff9231
CC
24862014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2487
2488 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2489 dynsym indexes.
2490 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2491 (Target::do_has_custom_set_dynsym_indexes): New function.
2492 (Target::set_dynsym_indexes): New function.
2493 (Target::do_set_dynsym_indexes): New function.
2494
b80eed39
AM
24952014-03-07 Alan Modra <amodra@gmail.com>
2496
2497 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2498 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2499 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2500 (Powerpc_relocate_functions::has_overflow_bitfield,
2501 overflowed): Use the above.
2502 (Target_powerpc::Relocate::relocate): Correct overflow checking
2503 for a number of relocations. Modify overflow test for 16-bit
2504 fields in instructions to signed/unsigned according to whether
2505 the field takes a signed or unsigned value.
2506
4b95cf5c
AM
25072014-03-05 Alan Modra <amodra@gmail.com>
2508
2509 Update copyright years.
2510
45965137
AM
25112014-03-05 Alan Modra <amodra@gmail.com>
2512
2513 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2514 R_PPC64_ADDR64_LOCAL.
2515 (Target_powerpc::Relocate::relocate): Likewise.
2516
2c80b753
AM
25172014-03-03 Alan Modra <amodra@gmail.com>
2518
2519 * dwp.cc (print_version): Update copyright year to current.
2520
c1c69e83
AM
25212014-02-10 Alan Modra <amodra@gmail.com>
2522
2523 * po/gold.pot: Regenerate.
2524
dd0c4e70
CC
25252014-02-06 Cary Coutant <ccoutant@google.com>
2526
2527 Fix problem where -u is ignored when a weak undef is seen.
2528
2529 * archive.cc (Library_base::should_include_member): Reorder
2530 code to check for -u option if a weak undef has already been seen.
2531 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2532 * testsuite/Makefile.in: Regenerate.
2533 * testsuite/weak_undef_file3.cc: New file.
2534 * testsuite/weak_undef_file4.cc: New file.
2535 * testsuite/weak_undef_test_2.cc: New file.
2536
1a221d3d
CC
25372014-02-05 Cary Coutant <ccoutant@google.com>
2538
2539 Fix issues with gold undefined symbol diagnostics.
2540
2541 PR binutils/15435
2542 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2543 check to here.
2544 * target-reloc.h (is_strong_undefined): New function.
2545 (relocate_section): Move undef vtable symbol check from here.
2546 Check for is_strong_undefined.
2547
e889f0a4 25482014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2549
e889f0a4
CC
2550 Fix problems with the --dynamic-list option.
2551
2552 PR gold/13577
2553 * options.cc (General_options::parse_dynamic_list):
2554 Set have_dynamic_list_.
2555 (General_options::General_options): Initialize have_dynamic_list_.
2556 (General_options::finalize): Turn off -Bsymbolic and
2557 -Bsymbolic-functions if --dynamic-list provided.
2558 * options.h (General_options::have_dynamic_list): New function.
2559 (General_options::have_dynamic_list_): New data member.
2560 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2561 correctly.
5fe7ffdc 2562
e889f0a4
CC
2563 PR gold/16530
2564 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2565 in --dynamic-list, mark it.
5fe7ffdc 2566
e889f0a4
CC
2567 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2568 (dynamic_list_2): New test case.
2569 * testsuite/Makefile.in: Regenerate.
2570 * testsuite/dynamic_list_2.cc: New file.
2571 * testsuite/dynamic_list_2.t: New file.
2572 * testsuite/dynamic_list_lib1.cc: New file.
2573 * testsuite/dynamic_list_lib2.cc: New file.
2574 * testsuite/gc_dynamic_list_test.c: New file.
2575 * testsuite/gc_dynamic_list_test.sh: New file.
2576 * testsuite/gc_dynamic_list_test.t: New file.
2577
ec673e64
CC
25782014-01-28 Cary Coutant <ccoutant@google.com>
2579
2580 Add .gdb_index version 7 support.
2581
2582 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2583 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2584 debug sections.
2585 (Dwarf_ranges_table::read_ranges_table): Likewise.
2586 (Dwarf_pubnames_table::read_section): Check for GNU-style
2587 sections, and for compressed debug sections.
2588 (Dwarf_pubnames_table::read_header): Compute end address of table.
2589 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2590 for end of list by offset, not by offset == 0.
2591 (Dwarf_info_reader::do_read_string_table): Check for compressed
2592 debug sections.
2593 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2594 Initialize new data members.
2595 (Dwarf_pubnames_table::next_name): return flag_byte.
2596 (Dwarf_pubnames_table::end_of_table_): New data member.
2597 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2598 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2599 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2600 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2601 read skeleton type unit DIEs.
2602 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2603 (Gdb_index::do_write): Write flag_byte.
2604 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2605 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2606 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2607 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2608
221fd5d5
L
26092014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2610
2611 * version.cc (print_version): Update copyright year to 2014.
2612
6c09fb0b
ILT
26132013-12-19 Dimitry Andric <dimitry@andric.com>
2614
2615 * stringpool.cc (Stringpool_template::reserve): Add
2616 HAVE_UNORDERED_MAP case.
2617 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2618
8356f2d0
CC
26192013-12-18 Cary Coutant <ccoutant@google.com>
2620
2621 * configure.ac: Check for <unordered_set> and <unordered_map>.
2622 * config.in: Regenerate.
2623 * configure: Regenerate.
2624 * system.h: Use <unordered_set> and <unordered_map> if available.
2625
f2c7d7ee
RM
26262013-12-10 Roland McGrath <mcgrathr@google.com>
2627
2628 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2629 with $(INSTALL_PROGRAM_ENV).
2630 * Makefile.in: Regenerate.
2631
6632e8cc
CC
26322013-11-22 Cary Coutant <ccoutant@google.com>
2633
2634 * configure.ac: Add check for which library is needed for
2635 dlopen.
2636 * configure: Regenerate.
2637
0c075858
CC
26382013-11-22 Cary Coutant <ccoutant@google.com>
2639
2640 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2641 assembler.
2642 * testsuite/Makefile.in: Regenerate.
2643
f49fe902
L
26442013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2645
2646 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2647 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2648 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2649 (Target_x86_64<size>::Scan::local): Likewise.
2650 (Target_x86_64<size>::Scan::global): Likewise.
2651 (Target_x86_64<size>::Relocate::relocate): Likewise.
2652 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2653 Likewise.
2654 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2655 R_X86_64_PC32_BND.
2656
2657 * testsuite/Makefile.am (check_PROGRAMS): Add
2658 exception_x86_64_bnd_test.
2659 (exception_x86_64_bnd_test_SOURCES): New macro.
2660 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2661 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2662 (exception_x86_64_bnd_test_LDADD): Likewise.
2663 (exception_x86_64_bnd_1.o): New rule.
2664 (exception_x86_64_bnd_2.o): Likewise.
2665 * testsuite/Makefile.in: Regenerated.
2666
9055360d
AM
26672013-11-15 Alan Modra <amodra@gmail.com>
2668
2669 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2670 accessor.
2671 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2672 Only call ppc64_local_entry_offset for 64-bit. Restrict
2673 symval_for_branch lookup to ELFv1.
2674 (Stub_table::add_plt_call_entry): Use unsigned int off.
2675 (Output_data_glink::Address, invalid_address): New.
2676 (Output_data_glink::add_eh_frame): Move out of line. Add
2677 support for ELFv2.
2678 (Output_data_glink::add_global_entry, find_global_entry,
2679 global_entry_address): New functions.
2680 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2681 ge_size): New variables.
2682 (Output_data_glink::set_final_data_size): Add global entry
2683 stub sizing.
2684 (Output_data_glink::do_write): Write global entry stubs.
2685 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2686 parameter. Return true for ELFv2. Adjust callers.
2687 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2688 ELFv1. Similarly for ifunc and dynamic relocation processing
2689 specific to ELFv1. Recognize that symbols are defined on
2690 their plt entries for ELFv2.
2691 (Target_powerpc::symval_for_branch): Assert if called for
2692 ELFv2 or ppc32.
2693 (Target_powerpc::Relocate::relocate): Use global entry plt
2694 stub for symbol value if such exists on ELFv2.
2695 (Target_powerpc::Relocate::relocate): Don't call
2696 symval_for_branch when ELFv2. Do adjust for local entry
2697 offset when ELFv2.
2698 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2699 plt stub for ELFv2.
2700 (Target_powerpc::do_plt_address_for_global): Similarly.
2701
cafdd569
CC
27022013-11-14 Cary Coutant <ccoutant@google.com>
2703
2704 Revert patch -- this did not fix the problem, and there is
2705 no race there.
2706
2707 2013-11-14 Cary Coutant <ccoutant@google.com>
2708
2709 PR gold/14860
2710 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2711 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2712 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2713 updating fde_offsets_.
2714 (Eh_frame_hdr::lock_): New data member.
2715
94e49e16
CC
27162013-11-14 Cary Coutant <ccoutant@google.com>
2717
2718 * dwp.cc (Dwo_file_entry): New type.
2719 (File_list): Use Dwo_file_entry.
2720 (Dwo_file::verify): New function.
2721 (Dwo_file::verify_dwo_list): New function.
2722 (Dwo_file::sized_verify_dwo_list): New function.
2723 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2724 list.
2725 (Dwp_options): New enum type.
2726 (dwp_options): Add --verify-only.
2727 (usage): Likewise.
2728 (main): Likewise.
2729 * dwp.h (gold_info): Add declaration.
2730
7cdd7d57
CC
27312013-11-14 Cary Coutant <ccoutant@google.com>
2732
2733 PR gold/14860
2734 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2735 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2736 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2737 updating fde_offsets_.
2738 (Eh_frame_hdr::lock_): New data member.
2739
1d946cb3
CC
27402013-11-06 Cary Coutant <ccoutant@google.com>
2741
2742 PR gold/15758
2743 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2744 before reloc sections.
2745
4f65b40e
AM
27462013-11-04 Alan Modra <amodra@gmail.com>
2747
2748 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2749 (Symbol::needs_dynamic_reloc): Test new flag.
2750 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2751 (Target_powerpc::Scan::get_reference_flags): Add target param.
2752 Return FUNC_DESC_ABI for 64-bit ELFv1.
2753 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2754 call.
2755 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2756 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2757
908794a9
CC
27582013-10-31 Cary Coutant <ccoutant@google.com>
2759
2760 Restore support for dwp v2 DWARF package file format.
2761
2762 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2763 tu_length parameter. Adjust all callers.
2764 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2765 * dwp.cc: Include dwarf.h.
2766 (Section_bounds): New struct type.
2767 (Unit_set): New struct type.
2768 (Dwo_file::Dwo_file): Initialize new data member.
2769 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2770 Combine and rename to...
2771 (Dwo_file::read_unit_index): ...this.
2772 (Dwo_file::sized_read_compunit_index)
2773 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2774 (Dwo_file::sized_read_unit_index): ...this.
2775 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2776 parameters; add section_id parameter.
2777 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2778 (Dwo_file::add_unit_set): ...this.
2779 (Dwo_file::shndx_map_): Remove.
2780 (Dwo_file::sect_offsets_): New data member.
2781 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2782 (Dwp_output_file::add_section): Rename to...
2783 (Dwp_output_file::add_contribution): ...this.
2784 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2785 (Dwp_output_file::add_tu_set): Likewise.
2786 (Dwp_output_file::Contribution): New type.
2787 (Dwp_output_file::Section::contributions): New data member.
2788 (Dwp_output_file::Cu_or_tu_set): Remove.
2789 (Dwp_output_file::Section::Section): New ctor.
2790 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2791 (Dwp_output_file::Dwp_index::Section_table): New type.
2792 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2793 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2794 parameter.
2795 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2796 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2797 (Dwp_output_file::Dwp_index::section_table): New member function.
2798 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2799 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2800 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2801 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2802 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2803 (Dwp_output_file::Dwp_index::section_table_): New data member.
2804 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2805 (Dwp_output_file::add_output_section): New member function.
2806 (Dwp_output_file::write_new_section): New member function.
2807 (Dwp_output_file::write_contributions): New member function.
2808 (Dwp_output_file::section_id_map_): New data member.
2809 (class Dwo_id_info_reader): Remove.
2810 (class Unit_reader): New class.
2811 (get_dwarf_section_name): New function.
2812 (Dwo_file::read_executable): Adjust initializations of class data.
2813 (Dwo_file::read): Add support for v2 package file format.
2814 (Dwo_file::read_unit_index): Likewise.
2815 (Dwo_file::sized_read_unit_index): Likewise.
2816 (Dwo_file::copy_section): Likewise.
2817 (Dwo_file::add_unit_set): Likewise.
2818 (Dwp_output_file::add_output_section): Likewise.
2819 (Dwp_output_file::add_contribution): Likewise.
2820 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2821 for empty slot.
2822 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2823 file format.
2824 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2825 slot.
2826 (Dwp_output_file::initialize): Remove unused function.
2827 (Dwp_output_file::finalize): Add support for v2 package file format.
2828 (Dwp_output_file::write_index): Likewise.
2829 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2830 function prototype.
2831
2500c017
CC
28322013-10-31 Cary Coutant <ccoutant@google.com>
2833
2834 * configure.ac: Fix check for -fmerge-constants.
2835 * configure.ac: Regenerate.
2836
dd0845d7
RM
28372013-10-30 Roland McGrath <mcgrathr@google.com>
2838
2839 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2840 Correct 9-byte nop sequence to match what the assembler generates.
2841
b4f7960d
AM
28422013-10-30 Alan Modra <amodra@gmail.com>
2843
2844 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2845 ppc64_local_entry_offset, ppc64_local_entry_offset,
2846 do_read_symbols): New functions.
2847 (Powerpc_relobj::e_flags_, st_other_): New vars.
2848 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2849 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2850 (Powerpc_relobj::e_flags_): New var.
2851 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2852 and adjust for ELFv2.
2853 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2854 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2855 (Powerpc_dynobj::do_find_special_sections): Likewise.
2856 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2857 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2858 to ELFv2 local entry.
2859 (Target_powerpc::do_relax): No thread safe barriers needed for
2860 ELFv2.
2861 (Output_data_plt_powerpc::initial_plt_entry_size_,
2862 plt_entry_size): Delete. Replace all uses with
2863 first_plt_entry_offset() and plt_entry_size().
2864 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2865 reserved_size parm. Update callers.
2866 (Output_data_plt_powerpc::entry_count): Update.
2867 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2868 and use Target_powerpc::first_plt_entry_offset().
2869 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2870 rename to plt_entry_size.
2871 (Output_data_plt_powerpc::add_ifunc_entry,
2872 add_local_ifunc_entry): Adjust reloc for ELFv2.
2873 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2874 (glink_eh_frame_fde_64v2): New.
2875 (Stub_table::plt_call_size): Support ELFv2 sizing.
2876 (Output_data_glink::add_eh_frame): Use the new FDE.
2877 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2878 (Stub_table::do_write): Write ELFv2 stubs and glink.
2879 (Target_powerpc::Relocate::relocate): Replaces nop after call
2880 with ld 2,24(1) and adjust local offset destination for ELFv2.
2881
f9c6b907
AM
28822013-10-30 Alan Modra <amodra@gmail.com>
2883
2884 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2885 (Target_powerpc::Scan::global, local): Likewise.
2886 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2887 on all ppc64 @h and @ha relocs.
2888
e84fe78f
AM
28892013-10-14 Alan Modra <amodra@gmail.com>
2890
2891 * output.h (Output_data_got::add_constant): Tidy.
2892 (Output_data_got::add_constant_pair): New function.
2893 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2894 methods used so as to first call reserve_ent().
2895
679e4abf
RM
28962013-10-11 Roland McGrath <mcgrathr@google.com>
2897
44dcb735
RM
2898 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2899 add_got_entry and add_got_entry_pair.
2900
13323c49
RM
2901 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2902 (HAVE_PUBNAMES): Likewise.
2903 * configure: Regenerate.
2904
1496b446
RM
2905 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2906 * testsuite/Makefile.in: Regenerate.
2907
cc84c10b
RM
2908 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2909 Remove const from declaration.
2910 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2911 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2912 * output.h (Output_file_header): Remove const from member target_
2913 and corresponding constructor argument.
2914 * output.cc (Output_file_header::Output_file_header): Update prototype.
2915 (Output_file_header::do_sized_write): Use this->target_ in place
2916 of parameters()->target().
2917
52f66a2c
RM
2918 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2919
2b64b551
RM
2920 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2921 * configure: Regenerate.
2922 * Makefile.in: Regenerate.
2923 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2924 * testsuite/merge_string_literals_2.c: Likewise.
2925 * testsuite/Makefile.am
2926 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2927 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2928 literal -fmerge-constants.
2929 * testsuite/Makefile.in: Regenerate.
2930
43819297
RM
2931 * i386.cc (Target_i386): Remove unused member dynbss_.
2932 * arm.cc (Target_arm): Likewise.
2933 * powerpc.cc (Target_powerpc): Likewise.
2934 * sparc.cc (Target_sparc): Likewise.
2935 * tilegx.cc (Target_tilegx): Likewise.
2936 * x86_64.cc (Target_x86_64): Likewise.
2937 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2938 type_signature_, type_offset_.
2939 * plugin.h (Plugin_hook): Remove unused member layout_.
2940 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2941 mapfile_.
2942 (Read_member): Remove unused members input_objects_, symtab_,
2943 mapfile_, layout_.
2944 (Check_library): Remove unused member symtab_.
2945 * archive.h (Lib_group): Remove unused member lib_.
2946 * archive.cc (Lib_group::Lib_group): Update initializer.
2947 * incremental.h (Incremental_binary): Remove unused member target_.
2948 (Incremental_script_entry): Removed unused member script_.
2949 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2950 * icf.h (Icf): Remove unused member num_tracked_relocs.
2951
39d9ead7
RM
2952 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2953 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2954 its only use.
2955 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2956
679e4abf
RM
2957 * archive.h: Use struct rather than class for forward declaration
2958 of Read_symbols_data.
2959
54de2ea6
CC
29602013-10-07 Cary Coutant <ccoutant@google.com>
2961
2962 PR gold/16010
2963 * testsuite/Makefile.am (icf_test): Fix dependencies.
2964 (icf_safe_test): Likewise.
2965 (icf_safe_so_test): Likewise.
2966 (large_symbol_alignment): Add empty _LDADD rule.
2967 * testsuite/Makefile.in: Regenerate.
2968
b14016f0
L
29692013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2970
2971 PR gold/15927
2972 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2973 relocation for R_X86_64_32 on x32.
2974
eb426534
RM
29752013-08-27 Roland McGrath <mcgrathr@google.com>
2976
2977 * output.cc (Output_segment::set_section_addresses): Take new
2978 Target* argument. If target->isolate_execinstr() and the segment
2979 is executable and starts at a target->abi_pagesize() boundary,
2980 pad its end out to a target->abi_pagesize() boundary with code fill.
2981 * output.h (Output_segment::set_section_addresses): Update decl.
2982 * layout.h (Layout::check_output_data_for_reset_values): Take new
2983 argument RELAX_OUTPUTS.
2984 (Layout): New member relax_output_list_.
2985 (Layout::add_relax_output): New method.
2986 * layout.cc (Layout::Layout): Update constructor.
2987 (Layout::reset_relax_output): New method.
2988 (Layout::clean_up_after_relaxation): Call it.
2989 (Layout::prepare_for_relaxation): Update caller.
2990 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2991 Call reset_relax_output before re-processing segments for
2992 isolate_execinstr case.
2993 (Layout::write_data): Handle relax_output_list_.
2994 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2995 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2996
9aff4b7a
NC
29972013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2998
2999 PR binutils/15834
3000 * object.h: Fix typos.
3001
93f8221c
RM
30022013-08-16 Roland McGrath <mcgrathr@google.com>
3003
3004 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
3005 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
3006
e44c3715
CC
30072013-08-07 Cary Coutant <ccoutant@google.com>
3008
3009 Revert support for v2 DWP files:
3010
3011 2013-03-01 Cary Coutant <ccoutant@google.com>
3012
3013 Add dwp support for v2 DWARF package file format.
3014 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3015 tu_length parameter. Adjust all callers.
3016 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3017 * dwp.cc: Include dwarf.h.
3018 (Section_bounds): New struct type.
3019 (Unit_set): New struct type.
3020 (Dwo_file::Dwo_file): Initialize new data member.
3021 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3022 Combine and rename to...
3023 (Dwo_file::read_unit_index): ...this.
3024 (Dwo_file::sized_read_compunit_index)
3025 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3026 (Dwo_file::sized_read_unit_index): ...this.
3027 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3028 parameters; add section_id parameter.
3029 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3030 (Dwo_file::add_unit_set): ...this.
3031 (Dwo_file::shndx_map_): Remove.
3032 (Dwo_file::sect_offsets_): New data member.
3033 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3034 (Dwp_output_file::add_section): Rename to...
3035 (Dwp_output_file::add_contribution): ...this.
3036 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3037 (Dwp_output_file::add_tu_set): Likewise.
3038 (Dwp_output_file::Contribution): New type.
3039 (Dwp_output_file::Section::contributions): New data member.
3040 (Dwp_output_file::Cu_or_tu_set): Remove.
3041 (Dwp_output_file::Section::Section): New ctor.
3042 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3043 (Dwp_output_file::Dwp_index::Section_table): New type.
3044 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3045 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3046 parameter.
3047 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3048 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3049 (Dwp_output_file::Dwp_index::section_table): New member function.
3050 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3051 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3052 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3053 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3054 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3055 (Dwp_output_file::Dwp_index::section_table_): New data member.
3056 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3057 (Dwp_output_file::add_output_section): New member function.
3058 (Dwp_output_file::write_new_section): New member function.
3059 (Dwp_output_file::write_contributions): New member function.
3060 (Dwp_output_file::section_id_map_): New data member.
3061 (class Dwo_id_info_reader): Remove.
3062 (class Unit_reader): New class.
3063 (get_dwarf_section_name): New function.
3064 (Dwo_file::read_executable): Adjust initializations of class data.
3065 (Dwo_file::read): Add support for v2 package file format.
3066 (Dwo_file::read_unit_index): Likewise.
3067 (Dwo_file::sized_read_unit_index): Likewise.
3068 (Dwo_file::copy_section): Likewise.
3069 (Dwo_file::add_unit_set): Likewise.
3070 (Dwp_output_file::add_output_section): Likewise.
3071 (Dwp_output_file::add_contribution): Likewise.
3072 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3073 for empty slot.
3074 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3075 file format.
3076 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3077 slot.
3078 (Dwp_output_file::initialize): Remove unused function.
3079 (Dwp_output_file::finalize): Add support for v2 package file format.
3080 (Dwp_output_file::write_index): Likewise.
3081 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3082 function prototype.
3083
c6905c28
CC
30842013-07-31 Cary Coutant <ccoutant@google.com>
3085
3086 * object.cc (Sized_relobj::do_output_section_address): New function.
3087 (Sized_relobj): Instantiate explicitly.
3088 * object.h (Object::output_section_address): New function.
3089 (Object::do_output_section_address): New function.
3090 (Sized_relobj::do_output_section_address): New function.
3091 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3092
30932013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 3094 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
3095
3096 * parameters.cc (Parameters::entry): Return target-specific entry
3097 symbol name.
3098 * target.h (Target::entry_symbol_name): New function.
3099 (Target_info::entry_symbol_name): New data member.
3100
3101 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3102 * i386.cc (Target_i386::i386_info): Likewise.
3103 (Target_i386_nacl::i386_nacl_info): Likewise.
3104 * sparc.cc (Target_sparc::sparc_info): Likewise.
3105 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3106 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3107 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3108 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3109
234d4ab8
SA
31102013-07-22 Sterling Augustine <saugustine@google.com>
3111
3112 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3113 Convert parameter shndx to local variable. Add parameters symtab
3114 and symtab_size. Scan over section names. Find relocation
3115 section corresponding to current section. Create and initialize
3116 reloc_mapper_ and reloc_type_.
3117 (Dwarf_pubnames_table::read_header): Add assertion. Change
3118 unit_length to off_t. Initialize member unit_length_. Fill in field
3119 cu_offset_.
3120 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3121 Initialize new fields unit_length_ and cu_offset_.
3122 (Dwarf_pubnames_table::read_section): Update prototype.
3123 (Dwarf_pubnames_table::cu_offset): New member function.
3124 (Dwarf_pubnames_table::subsection_size): Likewise.
3125 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3126 New fields.
3127 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3128 member functions public.
3129 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3130 Update comment. Rework logic. Move repeated parts to...
3131 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3132 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3133 pubtypes_table_, and stmt_list_offset.
3134 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3135 Gdb_index::find_pubtype_offset,
3136 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3137 (Gdb_index::pubnames_read): Update prototype and rework logic.
3138 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3139 Forward declare.
3140 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3141 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3142 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3143 Gdb_index::map_pubtable_to_dies):
3144 Declare functions.
3145 (Gdb_index::pubnames_read): Update declaration.
3146 (Gdb_index::Pubname_offset_map): New type.
3147 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3148 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3149 Gdb_index::stmt_list_offset): Declare.
3150 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3151 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3152 Gdb_index::pubtypes_offset_): Remove.
3153
a3ed37d8
RM
31542013-07-19 Roland McGrath <mcgrathr@google.com>
3155
3156 * options.h (General_options): Add -Trodata-segment option.
3157 * parameters.cc (Parameters::check_rodata_segment): New function.
3158 (Parameters::set_target_once): Call it.
3159 * parameters.h (Parameters): Declare it (private member function).
3160 * layout.cc (load_seg_unusable_for_headers): New function, broken
3161 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3162 then validate rodata segment rather than text segment.
3163 (relaxation_loop_body): Call that.
3164 (is_text_segment): New function. Don't admit a non-executable
3165 segment if TARGET->isolate_execinstr().
3166 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3167
eb5b4ded
CC
31682013-07-15 Shawn Landden <shawnlandden@gmail.com>
3169
3170 PR gold/15070
3171 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3172 * nacl.h (Sniff_file::View::View): Request aligned view.
3173
4d5effb9
CC
31742013-07-11 Cary Coutant <ccoutant@google.com>
3175
3176 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3177 correct BRLT entry size.
3178
ba8ca3e7
AM
31792013-07-03 Alan Modra <amodra@gmail.com>
3180
3181 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3182 comment.
3183
267257d2
CC
31842013-07-01 Cary Coutant <ccoutant@google.com>
3185
3186 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3187 reloc_type_.
3188 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3189 (Dwarf_ranges_table::lookup_reloc): New function.
3190 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3191 reloc_type_.
3192 (Dwarf_ranges_table::lookup_reloc): New function.
3193 (Dwarf_ranges_table::reloc_type_): New data member.
3194
06f30c9d
CC
31952013-06-27 Jing Yu <jingyu@google.com>
3196
3197 PR gold/15662
3198 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3199 function.
3200 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3201 (Target_powerpc::do_relax): Call the above.
3202
a2d7bf59
AM
32032013-06-27 Cary Coutant <ccoutant@google.com>
3204
3205 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3206 on garbage collected .opd section.
3207
32082013-06-27 Alan Modra <amodra@gmail.com>
3209
3210 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3211 is non-zero.
3212 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3213 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3214
32364e50
CC
32152013-06-14 Cary Coutant <ccoutant@google.com>
3216
3217 * resolve.cc (Symbol::override_base): Don't override st_type
3218 from plugin placeholder symbols.
3219 (Symbol_table::resolve): Likewise.
3220 (Symbol_table::should_override): Don't complain about TLS mismatch
3221 if the TO symbol is a plugin placeholder.
3222 * testsuite/Makefile.am (plugin_test_tls): New test.
3223 * testsuite/Makefile.in: Regenerate.
3224 * testsuite/plugin_test_tls.sh: New test script.
3225 * testsuite/two_file_test_2_tls.cc: New test source.
3226 * testsuite/two_file_test_tls.cc: New test source.
3227
7fb47cc9
CC
32282013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3229
3230 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3231 the maximum segment alignment is larger than the page size.
3232 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3233 correctly aligns the symbols with large alignemnt.
3234 * testsuite/Makefile.in: Regenerate.
3235 * testsuite/large_symbol_alignment.cc: New file.
3236
6934001a
CC
32372013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3238 Sriraman Tallam <tmsriram@google.com>
3239
3240 * options.h (sort_section): New option.
3241 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3242 Rename from Input_section_sort_section_name_special_ordering_compare.
3243 (Input_section_sort_section_name_compare): New struct.
3244 * output.cc (Output_section::Input_section_sort_section_name_compare::
3245 operator()): New function.
3246 (Output_section::sort_attached_input_sections): Use new sort function
3247 for .text if --sort-section=name is specified.
3248 * layout.cc (Layout::make_output_section):
3249 Add sorting by name when --sort-section=name is specified.
3250 * testsuite/Makefile.am (text_section_grouping): Test option
3251 --sort-section=name.
3252 * testsuite/Makefile.in: Regenerate.
3253 * testsuite/section_sorting_name.cc: New file.
3254 * testsuite/section_sorting_name.sh: New file.
3255
93acabad
CC
32562013-05-21 Cary Coutant <ccoutant@google.com>
3257
3258 * symtab.h (Symbol::is_cxx_vtable): New function.
3259 * target-reloc.h (relocate_section): Check for vtable symbol.
3260 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3261 * testsuite/Makefile.in: Regenerate.
3262 * testsuite/missing_key_func.cc: New test source.
3263 * testsuite/missing_key_func.sh: New test script.
3264
60e8b3fc
CC
32652013-05-21 Cary Coutant <ccoutant@google.com>
3266
2b64b551
RM
3267 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3268 type of enclosing symbol.
3269 (Relocate_info::location): Check symbol type when describing symbol.
3270 * object.h (Symbol_location_info): Remove unused line_number;
3271 add enclosing_symbol_type.
3272 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3273
9df9de2c
CC
32742013-05-13 Cary Coutant <ccoutant@google.com>
3275
2b64b551
RM
3276 * configure.ac: Export DEFAULT_TARGET.
3277 * configure: Regenerate.
3278 * Makefile.in: Regenerate.
3279 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3280 * testsuite/Makefile.in: Regenerate.
3281 * testsuite/debug_msg.sh: Delete duplicate tests.
3282 Don't check undef_int error message match for powerpc where the
3283 source file and line number aren't available.
9df9de2c 3284
bbc5ae17
RM
32852013-05-10 Roland McGrath <mcgrathr@google.com>
3286
3287 * options.h (General_options): Add --rosegment-gap option.
3288 * options.cc (finalize): --rosegment-gap implies --rosegment.
3289 * layout.cc (set_segment_offsets): Let user option override
3290 target->rosegment_gap().
3291
0c6e6c39
RM
32922013-05-10 Roland McGrath <mcgrathr@google.com>
3293
3294 * options.h (General_options): Remove leading space from help
3295 messages for -nostdlib and --rosegment.
3296
cde7cb01
MR
32972013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3298
3299 PR ld/15365
3300 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3301
f31ae5b8
AM
33022013-05-03 Alan Modra <amodra@gmail.com>
3303
3304 * merge.cc (Output_merge_string::do_add_input_section): Correct
3305 scan for number of strings. Rename vars to avoid shadowing.
3306 Include missing terminator in input_size_.
3307
d3a7cd45
L
33082013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3309
3310 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3311 Restore empty string handling.
3312
6ad3daba
CC
33132013-05-01 Cary Coutant <ccoutant@google.com>
3314
3315 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3316 uninitialized warning.
3317
e31908b6
CC
33182013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3319
3320 * output.cc (Output_section::add_merge_input_section): Allow
3321 to merge sections if the alignment is more than character size.
3322 * merge.h (Output_merge_string::Output_merge_string): Remove
3323 assert.
3324 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3325 only not-null strings. Check the alignment of strings.
3326 * stringpool.h
3327 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3328 alignment as the argument.
3329 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3330 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3331 Align non-zero length strings according to the addralign_.
3332 (Stringpool_template<Stringpool_char>::set_string_offsets):
3333 Updating offsets according to the given alignment.
3334 * testsuite/Makefile.am (text_section_grouping): Test if string
3335 literals are getting merged.
3336 * testsuite/Makefile.in: Regenerate.
3337 * testsuite/merge_string_literals_1.c: New file.
3338 * testsuite/merge_string_literals_2.c: Ditto.
3339 * testsuite/merge_string_literals.sh: Ditto.
3340
0e804863
ILT
33412013-04-26 Ian Lance Taylor <iant@google.com>
3342
3343 * target-reloc.h (relocate_section): If the reloc offset is out of
3344 range, pass VIEW as NULL to relocate.relocate.
3345 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3346 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3347 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3348 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3349 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3350 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3351
e7c5ea40
CC
33522013-04-26 Geoff Pike <gpike@chromium.org>
3353
3354 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3355 * layout.cc (Hash_task): New class.
3356 (Layout::queue_build_id_tasks): New function.
3357 (Layout::write_build_id): Handle single-thread portion of build ID
3358 computation. (In some cases, all of it is single-threaded.) Replace
3359 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3360 functionality in fewer lines of code.
3361 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3362 * options.h (General_options): make "--build-id" default to tree
3363 rather than sha1. Add two new options related to --build-id=tree:
3364 --build-id-chunk-size-for-treehash and
3365 --build-id-min-file-size-for-treehash.
3366 * Makefile.am: add testing of --build-id=tree and related new options
3367 (these tests will be invoked by "make check").
3368 * Makefile.in: Regenerate.
3369
49926cd0
AM
33702013-04-25 Alan Modra <amodra@gmail.com>
3371
3372 * configure.tgt: Add powerpcle and powerpc64le.
3373
a4034750
AM
33742013-04-22 Alan Modra <amodra@gmail.com>
3375
3376 PR gold/15355
3377 * layout.cc (Layout::segment_precedes): Allow more than one
3378 segment with the same type and flags.
3379
e79c84aa
CC
33802013-04-15 Cary Coutant <ccoutant@google.com>
3381
3382 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3383 allocate space in file for BSS sections.
3384
2199fbe7
CC
33852013-04-15 Cary Coutant <ccoutant@google.com>
3386
3387 * script-sections.cc (Orphan_output_section): Reset address
3388 to zero after each orphaned section for relocatable links.
3389
502e8a84
CC
33902013-04-15 Cary Coutant <ccoutant@google.com>
3391
a4034750
AM
3392 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3393 section starting address for relocatable link.
3394 * testsuite/Makefile.am (script_test_11): New test.
3395 * testsuite/Makefile.in: Regenerate.
3396 * testsuite/script_test_11.c: New source file.
3397 * testsuite/script_test_11.t: New linker script.
502e8a84 3398
0cfdc767
AM
33992013-04-13 Alan Modra <amodra@gmail.com>
3400
3401 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3402 owner when sections are not adjacent and exceed group size.
3403 (Target_powerpc::group_sections): Handle corner case.
3404 (Target_powerpc::Branch_info::make_stub): Handle case where
3405 stub table doesn't exist due to branches in non-exec sections.
3406 (Target_powerpc::Relocate::relocate): Likewise.
3407
6830ee24
AM
34082013-04-11 Alan Modra <amodra@gmail.com>
3409
3410 PR gold/15354
3411 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3412 .branch_lt to match bfd ld. Adjust comments throughout file.
3413
54a3d865
ILT
34142013-04-04 Ian Lance Taylor <iant@google.com>
3415
3416 GCC PR c++/56840
3417 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3418 sections before checking whether they are included in the link.
3419
9993ba11
ST
34202013-03-29 Sriraman Tallam <tmsriram@google.com>
3421
3422 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3423 object before calling the plugin claim_file handler. Pass the elf
3424 object of the archive to the plugin. Delete the elf object if the
3425 plugin claims the file.
3426
ebacd51e
AM
34272013-03-21 Alan Modra <amodra@gmail.com>
3428
3429 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3430 segment when omagic.
3431
117be58f
AM
34322013-03-21 Alan Modra <amodra@gmail.com>
3433
3434 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3435 comparison warning.
3436 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3437 uninitialized" warning.
3438
32e2b61d
AM
34392013-03-20 Alan Modra <amodra@gmail.com>
3440
3441 * symtab.h (Symbol::clear_version): New function.
3442 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3443 is_needed by weak references. Clear version for symbols defined
3444 in as-needed objects that are not needed.
3445
b3ccdeb5
AM
34462013-03-15 Alan Modra <amodra@gmail.com>
3447
3448 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3449 static and public. Add report_err param. Return false for data refs.
3450 (Target_powerpc::rela_dyn_section): New overloaded function.
3451 (Target_powerpc::plt_, iplt_): Elucidate.
3452 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3453 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3454 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3455 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3456 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3457 push_branch and make_plt_entry for ifunc syms when
3458 reloc_needs_plt_for_ifunc.
3459 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3460 for ifunc unless reloc_needs_plt_for_ifunc.
3461
ad3d8a2f
AM
34622013-03-15 Alan Modra <amodra@gmail.com>
3463
3464 * gc.h (gc_process_relocs): Don't look through function descriptors.
3465 * icf.cc (get_section_contents): Do so here instead.
3466
4d9aa155
AM
34672013-03-13 Alan Modra <amodra@gmail.com>
3468
3469 * powerpc.cc (is_branch_reloc): Forward declare.
3470 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3471 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3472 false for 64-bit, true for 32-bit non-branch relocs.
3473 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3474 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3475 nm output.
3476 (icf_safe_test): Generate linker map file as well as nm output.
3477 (icf_safe_so_test): Likewise.
3478 * testsuite/Makefile.in: Regenerate.
3479 * testsuite/icf_test.sh: Parse linker map file to determine
3480 section folding.
3481 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3482 * testsuite/icf_safe_so_test.sh: Likewise.
3483 (X86_32_or_ARM_specific_safe_fold): Merge into..
3484 (arch_specific_safe_fold): ..this.
3485 (X86_64_specific_safe_fold): Delete unused function.
3486
57420c20
AM
34872013-03-12 Alan Modra <amodra@gmail.com>
3488
3489 * gc.h (gc_process_relocs): Look through function descriptors
3490 to determine shndx, symvalue and addend used by ICF. Tidy
3491 variable duplication.
3492
dc3714f3
AM
34932013-03-11 Alan Modra <amodra@gmail.com>
3494
3495 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3496 * layout.cc (Layout_task_runner::run): ..to here.
3497 * symtab.h (struct Symbol_location): Extract from..
3498 (class Symbol_table): ..here.
3499 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3500 * target.h (class Target): Add function_location and
3501 do_function_location functions.
3502 (class Sized_target): Add do_function_location.
3503 * object.h (class Sized_relobj_file): Move find_shdr..
3504 (class Object): ..to here.
3505 * object.cc: Likewise. Update to suit. Instantiate.
3506 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3507 * powerpc.cc (class Powerpc_dynobj): New.
3508 (Target_powerpc::do_function_location): New function.
3509 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3510 (Powerpc_dynobj::do_read_symbols): New function.
3511 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3512
956b03bb
ILT
35132013-03-08 Ian Lance Taylor <iant@google.com>
3514
3515 * options.cc (General_options::string_to_object_format): Accept
3516 "default".
3517
4bead2d5
AM
35182013-03-08 Alan Modra <amodra@gmail.com>
3519
3520 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3521 pointer to Post_fde.
3522 (struct Post_fde): Move definition to here..
3523 * ehframe.cc (struct Post_fde): ..from here.
3524 (Cie::write): Don't alloc Post_fde.
3525 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3526
02e60bf7
AM
35272013-03-07 Alan Modra <amodra@gmail.com>
3528
3529 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3530 relocation referencing .LC0.
3531 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3532
8343f03a
AM
35332013-03-07 Alan Modra <amodra@gmail.com>
3534
3535 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3536 always_inline. Add assembly for powerpc to avoid GOT.
3537
3366d57c
AM
35382013-03-07 Alan Modra <amodra@gmail.com>
3539
3540 * testsuite/script_test_10.sh: Don't test .bss section
3541 header number.
3542
6c77229c
AM
35432013-03-06 Alan Modra <amodra@gmail.com>
3544
3545 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3546 (Target_powerpc::symval_for_branch): Add symtab param. Update
3547 all callers. Handle folded sections.
3548 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3549 to Powerpc_relobj.
3550 (Global_symbol_visitor_opd::operator()): Likewise.
3551
a39e4af6
AM
35522013-03-04 Alan Modra <amodra@gmail.com>
3553
3554 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3555 * testsuite/Makefile.in: Regenerate.
3556
d5834edb
CC
35572013-03-01 Cary Coutant <ccoutant@google.com>
3558
3559 Add dwp support for v2 DWARF package file format.
3560 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3561 tu_length parameter. Adjust all callers.
3562 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3563 * dwp.cc: Include dwarf.h.
3564 (Section_bounds): New struct type.
3565 (Unit_set): New struct type.
3566 (Dwo_file::Dwo_file): Initialize new data member.
3567 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3568 Combine and rename to...
3569 (Dwo_file::read_unit_index): ...this.
3570 (Dwo_file::sized_read_compunit_index)
3571 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3572 (Dwo_file::sized_read_unit_index): ...this.
3573 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3574 parameters; add section_id parameter.
3575 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3576 (Dwo_file::add_unit_set): ...this.
3577 (Dwo_file::shndx_map_): Remove.
3578 (Dwo_file::sect_offsets_): New data member.
3579 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3580 (Dwp_output_file::add_section): Rename to...
3581 (Dwp_output_file::add_contribution): ...this.
3582 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3583 (Dwp_output_file::add_tu_set): Likewise.
3584 (Dwp_output_file::Contribution): New type.
3585 (Dwp_output_file::Section::contributions): New data member.
3586 (Dwp_output_file::Cu_or_tu_set): Remove.
3587 (Dwp_output_file::Section::Section): New ctor.
3588 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3589 (Dwp_output_file::Dwp_index::Section_table): New type.
3590 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3591 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3592 parameter.
3593 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3594 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3595 (Dwp_output_file::Dwp_index::section_table): New member function.
3596 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3597 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3598 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3599 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3600 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3601 (Dwp_output_file::Dwp_index::section_table_): New data member.
3602 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3603 (Dwp_output_file::add_output_section): New member function.
3604 (Dwp_output_file::write_new_section): New member function.
3605 (Dwp_output_file::write_contributions): New member function.
3606 (Dwp_output_file::section_id_map_): New data member.
3607 (class Dwo_id_info_reader): Remove.
3608 (class Unit_reader): New class.
3609 (get_dwarf_section_name): New function.
3610 (Dwo_file::read_executable): Adjust initializations of class data.
3611 (Dwo_file::read): Add support for v2 package file format.
3612 (Dwo_file::read_unit_index): Likewise.
3613 (Dwo_file::sized_read_unit_index): Likewise.
3614 (Dwo_file::copy_section): Likewise.
3615 (Dwo_file::add_unit_set): Likewise.
3616 (Dwp_output_file::add_output_section): Likewise.
3617 (Dwp_output_file::add_contribution): Likewise.
3618 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3619 for empty slot.
3620 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3621 file format.
3622 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3623 slot.
3624 (Dwp_output_file::initialize): Remove unused function.
3625 (Dwp_output_file::finalize): Add support for v2 package file format.
3626 (Dwp_output_file::write_index): Likewise.
3627 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3628 function prototype.
3629
a68a081d
CC
36302013-03-01 Cary Coutant <ccoutant@google.com>
3631
3632 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3633 function into class definition in header file.
3634 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3635 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3636 New function.
3637 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3638
9d5781f8
AM
36392013-02-28 Alan Modra <amodra@gmail.com>
3640
3641 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3642 * target.cc (Target::do_plt_fde_location): New function.
3643 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3644 accessor function, and constructor param.
3645 (struct Post_fde, Post_fdes): Declare.
3646 (Cie::write): Add post_fdes param.
3647 * ehframe.cc (Fde::write): Use plt_fde_location.
3648 (struct Post_fde): Define.
3649 (Cie::write): Stash FDEs added post merge mapping.
3650 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3651 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3652 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3653 other FDEs.
3654 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3655 (Target_powerpc::has_glink): New function.
3656 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3657 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3658 glink_eh_frame_fde_32, default_fde): New data.
3659 (Stub_table::eh_frame_added_): New var.
3660 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3661 Make const.
3662 (Stub_table::add_eh_frame): New function.
3663 (Output_data_glink::add_eh_frame): New function.
3664 (Target_powerpc::make_glink_section): Call add_eh_frame.
3665
214383dd
ILT
36662013-02-15 Ian Lance Taylor <iant@google.com>
3667
3668 * options.h (DEFINE_uint64_alias): Define.
3669 (class General_options): Add -Ttext-segment as an alias for
3670 -Ttext.
3671
91c2b899
AM
36722013-02-15 Alan Modra <amodra@gmail.com>
3673
3674 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3675 (Stub_table::do_write): ..here, two places.
3676 (Stub_table::plt_call_size): Use it here too.
3677
20e2a8aa
ILT
36782013-02-11 Ian Lance Taylor <iant@google.com>
3679
3680 * descriptors.cc (Descriptors::close_all): New function.
3681 * descriptors.h (class Descriptors): Declare close_all.
3682 (close_all_descriptors): New inline function.
3683 * plugin.cc: Include "descriptors.h".
3684 (Plugin_manager::cleanup): Call close_all_descriptors.
3685
8952bc69
AM
36862013-02-06 Alan Modra <amodra@gmail.com>
3687
3688 * README: Update coding style link.
3689
29bd8b6b
CC
36902013-01-28 Cary Coutant <ccoutant@google.com>
3691
a4034750
AM
3692 * dwp.cc (File_list): New typedef.
3693 (Dwo_name_info_reader): New class.
3694 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3695 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3696 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3697 (Dwo_file::read_executable): New function.
3698 (Dwo_file::read): Move common setup code to ...
3699 (Dwo_file::make_object): ... here.
3700 (dwp_options): Add --exec/-e.
3701 (usage): Likewise.
3702 (main): Likewise.
29bd8b6b 3703
c6ac678d
ST
37042013-01-24 Sriraman Tallam <tmsriram@google.com>
3705
3706 * layout.cc (Layout::layout): Check for option text_reorder.
3707 (Layout::make_output_section): Ditto.
3708 * options.h (text_reorder): New option.
3709 * output.cc (Input_section_sort_compare): Remove special ordering
3710 of section names.
3711 (Output_section::
3712 Input_section_sort_section_name_special_ordering_compare::
3713 operator()): New function.
3714 (Output_section::sort_attached_input_sections): Use new sort function
3715 for .text.
3716 * output.h (Input_section_sort_section_name_special_ordering_compare):
3717 New struct.
3718 * testsuite/Makefile.am (text_section_grouping): Test option
3719 --no-text-reorder
3720 * testsuite/Makefile.in: Regenerate.
3721 * testsuite/text_section_grouping.sh: Check order of functions without
3722 default text reordering.
3723
50701cc1
MF
37242013-01-18 Mike Frysinger <vapier@gentoo.org>
3725
3726 * options.h (General_options): Change default to true for new_dtags.
3727
b1b00fcc
MF
37282013-01-18 Mike Frysinger <vapier@gentoo.org>
3729
3730 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3731 when enable_new_dtags is false. Only add DT_RUNPATH when
3732 enable_new_dtags is true.
3733
ec5b8187
AM
37342013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3735
3736 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3737 used in declaration and definition consistent.
3738 (Target_powerpc::symval_for_branch): Ditto.
3739
a880d4c4
ST
37402013-01-16 Sriraman Tallam <tmsriram@google.com>
3741
3742 * testsuite/plugin_final_layout.cc: Fix comment.
3743
7c381248
ST
37442013-01-16 Sriraman Tallam <tmsriram@google.com>
3745
3746 * layout.cc (Layout::layout): Do not do default sorting for
3747 text sections when section ordering is specified.
3748 (make_output_section): Ditto.
3749 * testsuite/plugin_final_layout.cc: Name the function sections
3750 to catch reordering issues.
3751
e2458743
AM
37522013-01-15 Alan Modra <amodra@gmail.com>
3753
3754 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3755 plt-thread-safe.
3756
431ed302
AM
37572013-01-15 Alan Modra <amodra@gmail.com>
3758
3759 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3760 * testsuite/Makefile.in: Regenerate.
3761
0ec6429b
AM
37622013-01-14 Alan Modra <amodra@gmail.com>
3763
3764 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3765 * testsuite/Makefile.in: Regenerate.
3766
0bf402d5
ILT
37672013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3768
36af3926 3769 PR bfd/14430
0bf402d5
ILT
3770 Fix mingw gold build with plugins enabled
3771 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3772 * configure.ac: Export DLOPEN_LIBS and add headers check.
3773 * plugin.cc: Handle non-dlfcn case.
3774 * Makefile.in: Regenerate.
3775 * config.in: Regenerate.
3776 * configure: Regenerate.
3777 * testsuite/Makefile.in: Regenerate.
3778
9e9143bc
ST
37792013-01-09 Sriraman Tallam <tmsriram@google.com>
3780
3781 * output.h (sort_attached_input_sections): Change to be public.
3782 * script-sections.cc
3783 (Output_section_definition::set_section_addresses): Sort
3784 attached input sections according to section order before linker
3785 script assigns section addresses.
3786 (Orphan_output_section::set_section_addresses): Sort
3787 attached input sections according to section order before linker
3788 script assigns section addresses.
3789 * Makefile.am (final_layout.sh): Use a simple linker script to
3790 check if section ordering still works.
3791 * Makefile.in: Regenerate.
3792
679af368
ILT
37932013-01-09 Ben Cheng <bccheng@google.com>
3794
3795 * arm.cc (Target_arm::attributes_accept_div): New function.
3796 (Target_arm::attributes_forbid_div): New function.
3797 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3798 attribute using the same new functions as what bfd/elf32_arm.c
3799 does.
3800
3136a00e
CC
38012013-01-07 Cary Coutant <ccoutant@google.com>
3802
3803 PR gold/14993
3804 * output.cc (Output_section::add_input_section): For incremental
3805 updates, don't track input sections that are allocated from patch
3806 space.
3807
f2a6224b
L
38082013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3809 Ian Lance Taylor <iant@google.com>
3810
3811 PR gold/14897
3812 * configure.ac (--enable-ld): Removed.
3813 (install_as_default): Set to yes only for --enable-gold=default
3814 or --disable-ld.
3815 * configure: Regenerated.
3816
4f46f626
L
38172013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3818
3819 * options.h (General_options): Add -fuse-ld= for GCC linker
3820 option compatibility.
3821
26e4ef59
CC
38222013-01-04 Cary Coutant <ccoutant@google.com>
3823
3824 * configure.ac: Fix typo restoring CXXFLAGS.
3825 * configure: Regenerate.
3826
3d587466
CC
38272013-01-04 Cary Coutant <ccoutant@google.com>
3828
4f46f626
L
3829 * testsuite/Makefile.am (CXXLINK_S): New macro.
3830 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3831 * testsuite/Makefile.in: Regenerate.
3d587466 3832
44db6695
L
38332013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3834
3835 * version.cc (print_version): Update copyright year to 2013.
3836
edcac0c1
ILT
38372012-12-20 Ian Lance Taylor <iant@google.com>
3838
3839 * layout.cc (Layout::special_ordering_of_input_section): New
3840 function.
3841 (Layout::layout): If input section requires special ordering, must
3842 sort input sections.
3843 (Layout::make_output_section): May sort .text input sections.
3844 (Layout::is_section_name_prefix_grouped): Remove.
3845 * layout.h (class Layout): Declare
3846 special_ordering_of_input_section. Don't declare
3847 is_section_name_prefix_grouped.
3848 * output.cc (Output_section::add_input_section): Revert last
3849 change.
3850 (Output_section::Input_section_sort::match_file_name): Don't crash
3851 if called on output section data.
3852 (Output_section::Input_section_sort_compare): Sort based on
3853 special ordering.
3854 (Output_section::Input_section_sort_section_order_index_compare):
3855 Revert last patch.
3856 (Output_section::sort_attached_input_sections): Likewise.
3857
28f2a4ac
ST
38582012-12-18 Sriraman Tallam <tmsriram@google.com>
3859
edcac0c1 3860 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3861 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3862 * output.cc (Output_section::add_input_section): Check if section
3863 name contains special prefix. Keep input sections to sort such
3864 sections.
3865 (Output_section::Input_section_sort_section_order_index_compare
3866 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3867 (Output_section::sort_attached_input_sections): Add condition to
3868 Input_section_entry constructor call.
28f2a4ac
ST
3869 * testsuite/Makefile.am (text_section_grouping): New test.
3870 * testsuite/Makefile.in: Regenerate.
3871 * testsuite/text_section_grouping.cc: New file.
3872 * testsuite/text_section_grouping.sh: New file.
3873
5bf135a7
NC
38742012-12-17 Nick Clifton <nickc@redhat.com>
3875
3876 * Makefile.am: Add copyright notice.
3877 * NEWS: Likewise.
3878 * README: Likewise.
3879 * configure.ac: Likewise.
3880 * ftruncate.c: Likewise.
3881 * Makefile.in: Regenerate.
3882
59965708
CC
38832012-12-14 Cary Coutant <ccoutant@google.com>
3884
a4034750
AM
3885 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3886 --no-as-needed flag.
3887 (exception_separate_shared_12_test): Likewise.
3888 (incremental_copy_test): Likewise.
3889 * testsuite/Makefile.in: Regenerate.
59965708 3890
2a77e2ab
CC
38912012-12-14 Cary Coutant <ccoutant@google.com>
3892
3893 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3894 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3895
e3deeb9c
AM
38962012-12-12 Alan Modra <amodra@gmail.com>
3897
3898 * powerpc.cc (class Track_tls): New.
3899 (class Relocate, class Scan): Inherit Track_tls.
3900 (Target_powerpc::Scan::local, global): Track tls optimization
3901 and avoid creating plt entry for __tls_get_addr if all uses
3902 are optimized away.
3903 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3904
d8f5a274
AM
39052012-12-12 Alan Modra <amodra@gmail.com>
3906
3907 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3908 Replace no_toc_optimize with toc_optimize.
3909 * output.h (Output_section::input_sections): Provide non-const variant.
3910 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3911 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3912 accessors.
3913 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3914 (class Sort_toc_sections): New.
3915 (Target_powerpc::do_finalize_sections): Sort toc sections.
3916 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3917
4c8a1de1
RM
39182012-12-10 Roland McGrath <mcgrathr@google.com>
3919
3920 * testsuite/binary_unittest.cc (read_all): New function.
3921 (Sized_binary_test): Use it instead of ::read.
3922 * fileread.cc (do_read): Don't assume pread always reads the whole
3923 amount in a single call.
3924
edc27beb
AM
39252012-12-10 Alan Modra <amodra@gmail.com>
3926
3927 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3928 Set EM_PPC64 or EM_PPC here.
3929 (Target_selector_powerpc::do_recognize): Delete.
3930
906b9150
AM
39312012-12-10 Alan Modra <amodra@gmail.com>
3932
3933 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3934 stub_table_.
3935 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3936
418c15ae
RM
39372012-12-07 Roland McGrath <mcgrathr@google.com>
3938
3939 * testsuite/binary_unittest.cc (Sized_binary_test):
3940 Use open_descriptor rather than ::open.
3941
decdd3bc
AM
39422012-12-07 Alan Modra <amodra@gmail.com>
3943
3944 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3945 typedef and invalid_address constant.
3946 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3947 instantiate constants.
3948
db399005
ILT
39492012-12-06 Roland McGrath <mcgrathr@google.com>
3950
3951 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3952 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3953 * aclocal.m4: Regenerate.
3954 * configure: Regenerate.
3955 * Makefile.in: Regenerate.
3956 * testsuite/Makefile.in: Regenerate.
3957
aba6bc71
AM
39582012-12-07 Alan Modra <amodra@gmail.com>
3959
3960 * options.h (General_options): Add no_toc_optimize.
3961 * powerpc.cc (ok_lo_toc_insn): New function.
3962 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3963
9e69ed50
AM
39642012-12-06 Alan Modra <amodra@gmail.com>
3965
3966 * options.h (General_options): Add plt_align, plt_static_chain,
3967 plt_thread_safe. Update stub_group_size help text.
3968 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3969 for new plt_thread_safe_ var.
3970 (use_plt_offset): Correct comments.
3971 (Target_powerpc::do_relax): Look for thread creation symbols to
3972 determine default plt_thread_safe value. Clear plt call stubs
3973 as well as branch stubs each iteration.
3974 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3975 insn constants.
3976 (l, hi, ha, write_insn): Move earlier.
3977 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3978 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3979 plt stubs too.
3980 (Stub_table::update_size): Adjust.
3981 (Stub_table::prev_size, set_prev_size): Delete.
3982 (Stub_table::stub_align): Let --plt-align affect result.
3983 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3984 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3985 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3986 (Stub_table::do_write): Support more stub variants.
3987
f43ba157
AM
39882012-12-04 Alan Modra <amodra@gmail.com>
3989
3990 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3991 (Target_powerpc::do_define_standard_symbols): New function.
3992
34171bc5
AM
39932012-12-03 Alan Modra <amodra@gmail.com>
3994
3995 * output.h: Formatting, whitespace.
3996
dc9589e9 39972012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3998
3999 * layout.h (Layout::get_executable_sections): Declare.
4000 * layout.cc (Layout::get_executable_sections): New function.
4001 * arm.cc (Target_arm::group_sections): Use it.
4002 (Arm_output_section::group_sections): Delete now redundant test.
4003 * output.cc (Output_reloc::Output_reloc): Add is_relative.
4004 param to handle relative relocs.
4005 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
4006 (Output_data_reloc::add_absolute): Adjust.
4007 (Output_data_reloc::add_relative): New function.
4008 (Output_data::reset_data_size): New function.
4009 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
4010 (Output_section::set_addralign): New function.
4011 (Output_section::checkpoint_set_addralign): New function.
4012 (Output_section::clear_section_offsets_need_adjustment): New function.
4013 (Output_section::input_sections): Make public.
4014 * powerpc.cc (class Output_data_brlt_powerpc): New.
4015 (class Stub_table, class Stub_control): New.
4016 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
4017 stub_table_, set_stub_table, stub_table): New vectors and accessor
4018 functions.
4019 (Target_powerpc::do_may_relax, do_relax, push_branch,
4020 new_stub_table, stub_tables, brlt_section, group_sections,
4021 add_branch_lookup_table, find_branch_lookup_table,
4022 write_branch_lookup_table, make_brlt_section): New functions.
4023 (Target_powerpc::struct Sort_sections, class Branch_info): New.
4024 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
4025 branch_info_): New vars.
4026 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
4027 make call stubs here.
4028 (Output_data_glink): Remove all call stub handling from this class.
4029 (Target_powerpc::Scan::local, global): Save interesting branch
4030 relocs and relocs for ifunc. Adjust calls to plt entry functions.
4031 (Target_powerpc::do_finalize_sections): Only make reg save/restore
4032 functions on final link.
4033 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
4034 Handle long branch destinations too.
4035 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
4036 do_plt_address_for_local): Adjust lookup of plt call stubs.
4037
627b30b7
AM
40382012-11-30 Alan Modra <amodra@gmail.com>
4039
4040 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
4041 relocs against protected symbols when building 32-bit shared libs.
4042
40b469d7
AM
40432012-11-30 Alan Modra <amodra@gmail.com>
4044
4045 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
4046 param. Call got_section() to make .got. Update all callers
4047 and their callers and so on.
4048
bb66a627
AM
40492012-11-30 Alan Modra <amodra@gmail.com>
4050
4051 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
4052 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
4053 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
4054 value if it already exists.
4055
d2cf1c6c
L
40562012-11-19 H.J. Lu <hongjiu.lu@intel.com>
4057
4058 PR gold/14858
4059 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
4060
edccdf7c
RM
40612012-11-14 Roland McGrath <mcgrathr@google.com>
4062
4063 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
4064 than bfc instruction for data sandboxing.
4065
6febeb74
AM
40662012-11-08 Alan Modra <amodra@gmail.com>
4067
4068 * po/POTFILES.in: Regenerate.
4069
0a6f1bf2
AM
40702012-11-05 Alan Modra <amodra@gmail.com>
4071
4072 * configure.ac: Apply 2012-09-10 change to config.in here.
4073 * configure: Regenerate.
4074
26a4e9cb
AM
40752012-11-05 Alan Modra <amodra@gmail.com>
4076
4077 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4078 (struct Opd_ent): Use "Address" rather than "Offset".
4079 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4080 (Target_powerpc::got_section): Make public.
4081 (Target_powerpc::scan_relocs): Move code setting symbols..
4082 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4083 Create _SDA_BASE_ only when referenced.
4084
cc928013
RM
40852012-11-02 Roland McGrath <mcgrathr@google.com>
4086
4087 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4088 from last change.
4089
50ed5eb1
RM
40902012-11-01 Roland McGrath <mcgrathr@google.com>
4091
62fe925a
RM
4092 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4093 for offset_in_output_section parameter.
4094 (Sized_target::relocate_special_relocatable): Likewise.
4095 * arm.cc (Target_arm::relocate_relocs): Likewise.
4096 (Target_arm::relocate_special_relocatable): Likewise.
4097 * i386.cc (Target_i386::relocate_relocs): Likewise.
4098 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4099 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4100 * target-reloc.h (relocate_relocs): Likewise.
4101 * testsuite/testfile.cc (Target_test): Likewise.
4102 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4103 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4104
4105 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4106 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4107
4108 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4109 parameter, which is unused in the [!F_SETFD] case.
4110
50ed5eb1
RM
4111 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4112 SYMNDX to off_t before comparing it to this->data_size().
4113 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4114 * incremental.cc (Output_section_incremental_inputs::do_write):
4115 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4116
2cadc0bf
RM
4117 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4118
3bfcb652
NC
41192012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4120
4121 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4122 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4123 in EABI_VER5.
4124
c1a8d56e
CC
41252012-10-29 Cary Coutant <ccoutant@google.com>
4126
4127 * dwp.cc (usage): Add file and exit status parameters;
4128 add --help and --version options.
4129 (print_version): New function.
4130 (main): Add --help and --version options.
4131
b2490a7b
L
41322012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4133
4134 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4135 final_layout_sequence.txt.
4136 * testsuite/Makefile.in: Regenerated.
4137
aa543512
L
41382012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4139
4140 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4141 COMPILE generated by automake.
4142 (LINK1): Likewise.
4143 (CXXCOMPILE1): Likewise.
4144 (CXXLINK1): Likewise.
4145 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4146 (LINK): Likewise.
4147 (CXXCOMPILE): Likewise.
4148 (CXXLINK): Likewise.
4149 * testsuite/Makefile.in: Regenerated.
4150
d361fafb
L
41512012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4152
4153 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4154 on bad fwrite return.
4155
598c7410
L
41562012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4157
4158 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4159 on val.
4160
35c813e2
CC
41612012-10-23 Cary Coutant <ccoutant@google.com>
4162
4163 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4164 * testsuite/Makefile.in: Regenerate.
4165 * testsuite/dwp_test.h: New source file.
4166 * testsuite/dwp_test_1.cc: New source file.
4167 * testsuite/dwp_test_1.s: New source file.
4168 * testsuite/dwp_test_1.sh: New source file.
4169 * testsuite/dwp_test_1b.cc: New source file.
4170 * testsuite/dwp_test_1b.s: New source file.
4171 * testsuite/dwp_test_2.cc: New source file.
4172 * testsuite/dwp_test_2.s: New source file.
4173 * testsuite/dwp_test_2.sh: New source file.
4174 * testsuite/dwp_test_main.cc: New source file.
4175 * testsuite/dwp_test_main.s: New source file.
4176
77429909
CC
41772012-10-23 Cary Coutant <ccoutant@google.com>
4178
4179 * dwp.h: New header file.
4180 * dwp.cc: New source file.
4181 * gold.h: Move shared declarations to system.h.
4182 * system.h: New header file.
4183 * Makefile.am: Add dwp.
4184 * Makefile.in: Regenerate.
4185
ed5d6712
CC
41862012-10-23 Cary Coutant <ccoutant@google.com>
4187
4188 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4189 Dwarf_info_reader::read_from_pointer.
4190 (Dwarf_pubnames_table::read_header): Likewise.
4191 (Dwarf_pubnames_table::next_name): Likewise.
4192 (Dwarf_die::read_attributes): Likewise.
4193 (Dwarf_die::skip_attributes): Likewise.
4194 (Dwarf_info_reader::read_from_pointer): New function template.
4195 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4196 (Dwarf_pubnames_table): Likewise.
4197 (Dwarf_info_reader::read_from_pointer): New function template.
4198 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4199 Dwarf_pubnames_table ctor.
4200
8787852d
CC
42012012-10-23 Cary Coutant <ccoutant@google.com>
4202
4203 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4204 abbrev_shndx.
4205 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4206 abbrev_shndx_.
4207 (Dwarf_info_reader::set_abbrev_shndx): New method.
4208 (Dwarf_info_reader::abbrev_shndx_): New data member.
4209
9fc236f3
CC
42102012-10-23 Cary Coutant <ccoutant@google.com>
4211
4212 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4213 from object, not parameters.
4214 (Dwarf_info_reader::parse): Likewise.
4215 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4216 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4217 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4218 methods.
4219
effe8365
CC
42202012-10-23 Cary Coutant <ccoutant@google.com>
4221
4222 * fileread.cc (Input_file::Input_file): New constructor.
4223 * fileread.h (class Input_file): Add new constructor.
4224
1698990d
AM
42252012-10-18 Alan Modra <amodra@gmail.com>
4226
4227 PR gold/14727
4228 * object.cc (Relobj::is_section_name_included): Also match
4229 .sdata personality section.
4230
168a4726
AM
42312012-10-18 Alan Modra <amodra@gmail.com>
4232
4233 * target-reloc.h (class Default_comdat_behavior): New, package up..
4234 (get_comdat_behaviour): ..this.
4235 (relocate_section): Add Relocate_comdat_behavior template arg,
4236 adjust code to suit.
4237 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4238 (Target_arm::scan_reloc_section): Likewise.
4239 * i386.cc (Target_i386::relocate_section): Likewise.
4240 * sparc.cc (Target_sparc::relocate_section): Likewise.
4241 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4242 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4243 * powerpc.cc (class Relocate_comdat_behavior): New.
4244 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4245 gold::relocate_section with new template arg.
4246
acc276d8
AM
42472012-10-18 Alan Modra <amodra@gmail.com>
4248
4249 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4250 dynamic relocs for GOT_TPREL got entries, without symbol if
4251 resolving locally.
4252 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4253 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4254 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4255
e10f9870
AM
42562012-10-17 Alan Modra <amodra@gmail.com>
4257
4258 PR gold/14726
4259 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4260
ae034989
ST
42612012-10-16 Sriraman Tallam <tmsriram@google.com>
4262
4263 * layout.cc (Layout::include_section): Keep sections marked
4264 SHF_EXCLUDE when doing relocatable links.
4265
f3a0ed29
AM
42662012-10-16 Alan Modra <amodra@gmail.com>
4267
4268 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4269 (Target_powerpc::do_finalize_sections): Call it.
4270 (Output_data_save_res): New class and supporting functions.
4271 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4272 normal symbols defined in object files.
4273
c6de8ed4
AM
42742012-10-12 Alan Modra <amodra@gmail.com>
4275
4276 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4277 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4278 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4279 section if scan_opd_relocs not yet called.
4280 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4281
03e25981
AM
42822012-10-12 Alan Modra <amodra@gmail.com>
4283
4284 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4285 add_local_ifunc_entry): Revert last change.
4286 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4287
c9824451
AM
42882012-10-05 Alan Modra <amodra@gmail.com>
4289
4290 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4291 do_plt_address_for_global): New functions.
4292 (Output_data_got_powerpc::do_write): Don't segfault when linking
4293 statically.
4294 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4295 add_local_ifunc_entry): Return true on adding entry..
4296 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4297 glink->add_entry call. Remove unused symtab param. Adjust calls.
4298 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4299 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4300 set up symbols here.
4301 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4302 syms here. Do so even when no .iplt. Don't segfault when linking
4303 statically.
4304 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4305 new variants without reloc param.
4306 (Glink_sym_ent::Glink_sym_ent): Likewise.
4307 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4308 reloc when refs will resolve to plt call stub.
4309 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4310 R_PPC_PLTREL24 to resolve locally.
4311 (Target_powerpc::Scan::global): Correct ifunc handling.
4312 (Target_powerpc::Relocate::relocate): Correct local sym glink
4313 lookup. Don't destroy "value" when we have a plt call stub,
4314 and when checking plt call validity.
4315 (Target_powerpc::do_dynsym_value): Simplify.
4316
19fec8c1
AM
43172012-10-05 Alan Modra <amodra@gmail.com>
4318
4319 * i386.cc (Output_data_plt_i386::address_for_global,
4320 address_for_local): Add plt offset to returned value. Adjust uses.
4321 * sparc.cc (Output_data_plt_sparc::address_for_global,
4322 address_for_local): Likewise.
4323 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4324 address_for_local): Likewise.
4325 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4326 address_for_local): Likewise.
4327 * target.h (Target::plt_address_for_global, plt_address_for_local):
4328 Update comment.
4329 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4330 (Output_data_got::Got_entry::write): Nor here.
4331 * output.h: Comment fix.
4332
e867b647
WL
43332012-10-02 Jiong Wang <jiwang@tilera.com>
4334
4335 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4336 global_offset_table_ value for larget got.
4337 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4338
e5d5f5ed
AM
43392012-09-29 Alan Modra <amodra@gmail.com>
4340
4341 * powerpc.cc (Target_powerpc::iplt_): New output section.
4342 (Target_powerpc::iplt_section, make_iplt_section,
4343 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4344 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4345 Target_powerpc::plt_entry_count): Count iplt entries too.
4346 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4347 reloc section in constructor. New params.
4348 (Target_powerpc::make_plt_section): Create reloc section here instead.
4349 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4350 functions.
4351 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4352 (Output_data_glink::add_entry, find_entry): New functions to
4353 deal with local syms.
4354 (Glink_sym_ent): Add support for local syms.
4355 (Output_data_glink::do_write): Handle ifunc plt entries.
4356 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4357 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4358 (Target_powerpc::Relocate::relocate): Likewise.
4359 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4360
ec4dbad3
AM
43612012-09-25 Alan Modra <amodra@gmail.com>
4362
4363 * object.h (Sized_relobj_file::adjust_local_symbol,
4364 do_adjust_local_symbol): New functions.
4365 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4366 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4367 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4368 and irregular opd entry spacing.
4369 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4370 (Global_symbol_visitor_opd): New functor.
4371 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4372 on deleted opd entries.
4373
5c0b3823
WL
43742012-09-15 Jiong Wang <jiwang@tilera.com>
4375
4376 * tilegx.cc: New file.
4377 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4378 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4379 * configure.tgt: Add entries for tilegx*.
4380 * configure.ac: Likewise.
4381 * Makefile.in: Rebuild.
4382 * configure: Likewise.
4383 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4384 tilegx.
4385
bfdfa4cd
AM
43862012-09-13 Alan Modra <amodra@gmail.com>
4387
4388 * target-reloc.h (scan_relocs): Call scan.local for relocs
4389 against symbols in discarded sections. Pass is_discarded
4390 param.
4391 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4392 Add is_discarded param.
4393 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4394 is_discarded to flag opd entry as discarded. Don't emit dyn
4395 relocs on such entries.
4396 (Target_powerpc::Scan::global): Similarly detect and handle
4397 such opd entries.
4398 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4399 opd_ent_. Update all uses.
4400 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4401 (Target_powerpc::relocate_section): Zero out discarded opd
4402 entry relocs.
4403
d77a0555
ILT
44042012-09-12 Ian Lance Taylor <iant@google.com>
4405
4406 PR gold/14570
4407 * output.cc: Rename Output_data_got template parameter from size
4408 to got_size for all functions. Compile all variants of
4409 Output_data_got.
4410 (Output_data_got::Got_entry::write): Correct use of size for
4411 symbol value. Use local_is_tls rather than casting to
4412 Sized_relobj_file.
4413 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4414 (class Sized_relobj_file): Add do_local_is_tls.
4415 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4416
815a1205
AM
44172012-09-11 Alan Modra <amodra@gmail.com>
4418
4419 PR gold/14566
4420 * layout.cc (Layout::set_segment_offsets): When using
4421 common-page-size alignment, ensure we are on a new max-page-size
4422 page.
4423 * output.cc (Output_segment::set_section_addresses): Use
4424 abi_pagesize, not common_pagesize for relro boundary.
4425 (Output_segment::set_offset): Likewise.
4426
bd73a62d
AM
44272012-09-11 Alan Modra <amodra@gmail.com>
4428
4429 * output.h (Output_data_got::add_global_tls, add_local_tls,
4430 add_local_tls_pair): New functions.
4431 (Output_data_got::add_local_pair_with_rel): Remove second
4432 reloc param. Expand comment.
4433 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4434 use_plt_or_tls_offset_, similarly for constructor param.
4435 (Output_data_got::Got_entry::write): Add got_index param.
4436 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4437 add_local_tls_pair): New functions.
4438 (Output_data_got::Got_entry::write): Handle tls symbols
4439 with use_plt_or_tls_offset_ set specially.
4440 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4441 (Output_data_got::do_write): Replace iterator with index, pass
4442 index to entry write function.
4443 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4444 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4445 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4446 call.
4447 * i386.cc (Target_i386::Scan::local): Likewise.
4448 * sparc.cc (Target_sparc::Scan::local): Likewise.
4449 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4450 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4451 do_tls_offset_for_global): New functions.
4452 (Target_powerpc::Scan::local): Correct TLS relocations and got
4453 entry values.
4454 (Target_powerpc::Scan::global): Don't emit unnecessary
4455 dynamic relocations on TLS GOT entries.
4456
00716ab1
AM
44572012-09-10 Matthias Klose <doko@ubuntu.com>
4458
4459 * config.in: Disable sanity check for kfreebsd.
4460
c891b3f9
SA
44612012-09-10 Sterling Augustine <saugustine@google.com>
4462
4463 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4464 (Gdb_index::pubtypes_read): New parameter.
4465 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4466 to calls.
4467 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4468 pubtypes_object_.
4469
e81fea4d
AM
44702012-09-09 Alan Modra <amodra@gmail.com>
4471
4472 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4473 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4474 * gc.h (gc_process_relocs): Call target gc_add_reference.
4475 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4476 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4477 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4478 unnecessary cast.
4479 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4480 to cater for when we don't need code offset. Update use.
4481 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4482 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4483 set_opd_valid): New functions.
4484 (Target_powerpc::do_gc_add_reference): New function.
4485 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4486 stashed refs.
4487 (Target_powerpc::do_gc_mark_symbol): New function.
4488
d2d60eef
CC
44892012-09-06 Cary Coutant <ccoutant@google.com>
4490
4491 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4492 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4493 (Dwarf_die::skip_attributes): Likewise.
4494 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4495 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4496 (main): Call it.
4497 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4498
32ed4573
L
44992012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4500
4501 * testsuite/script_test_3.t: Add .got.plt output section
4502 statement.
4503 * testsuite/script_test_4.t: Likewise.
4504
f4baf0d4
AM
45052012-09-05 Alan Modra <amodra@gmail.com>
4506
4507 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4508 update all uses and lose "enum" when using type.
4509
864a1b56
AM
45102012-09-05 Alan Modra <amodra@gmail.com>
4511
4512 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4513 * configure: Regenerate.
4514 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4515 (plugin_final_layout.stdout): Likewise.
4516 (memory_test): Set page sizes to 0x1000.
4517 * testsuite/Makefile.in: Regenerate.
4518 * testsuite/discard_locals_test.sh: Add FIXME comment.
4519 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4520 * testsuite/pr14265.t: Add .got output section statement.
4521 * testsuite/script_test_2.t: Likewise.
4522 * testsuite/script_test_3.t: Likewise.
4523 * testsuite/script_test_4.t: Likewise.
4524 * testsuite/script_test_5.t: Likewise.
4525 * testsuite/script_test_6.t: Likewise.
4526 * testsuite/script_test_7.t: Likewise.
4527 * testsuite/script_test_9.t: Likewise.
4528
3ea0a085
AM
45292012-09-05 Alan Modra <amodra@gmail.com>
4530
4531 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4532 (Powerpc_relocate_functions::Status): New typedef.
4533 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4534 (Target_powerpc::Scan::local): Handle REL64.
4535 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4536 for REL32 and REL64.
4537 (Target_powerpc::symval_for_branch): New function, extracted from..
4538 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4539 checks. Report overflow errors.
4540
7404fe1b
AM
45412012-09-05 Alan Modra <amodra@gmail.com>
4542
4543 * object.h (Sized_relobj_file::emit_relocs): Delete.
4544 (Sized_relobj_file::emit_relocs_reltype): Delete.
4545 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4546 relocate_relocs for --emit-relocs.
4547 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4548 * output.h: Update comment.
4549 (Output_segment::first_section): New function.
4550 (Output_segment::first_section_load_address): Use first_section.
4551 * output.cc (Output_segment::first_section): New function extracted..
4552 (Output_segment::first_section_load_address): ..from here. Delete.
4553 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4554 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4555 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4556 adjust call to target.h function.
4557 * i386.cc (Target_i386): Likewise.
4558 * sparc.cc (Target_sparc): Likewise.
4559 * x86_64.cc (Target_x86_64): Likewise.
4560 * powerpc.cc (Target_powerpc): Likewise.
4561 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4562 first tls section has section symbol for optimised local dynamic
4563 output relocs.
4564 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4565 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4566 optimised tls code.
4567 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4568 Rename to relocate_relocs. Update error message.
4569
957564c9
AS
45702012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4571
4572 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4573 --just-symbols.
4574
dd93cd0a
AM
45752012-08-31 Alan Modra <amodra@gmail.com>
4576
4577 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4578 (Powerpc_relobj::toc_base_offset): New stub function.
4579 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4580 got_mod_index_offset to tlsld_got_offset. Update all refs.
4581 (Target_powerpc::Relocate::enum skip_tls): New.
4582 (Target_powerpc::call_tls_get_addr_): New var.
4583 (Target_powerpc::is_branch_reloc): Move to file scope.
4584 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4585 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4586 New functions.
4587 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4588 (powerpc_info): Correct common_pagesize for ppc64.
4589 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4590 (Powerpc_relocate_functions): Add overflow check enums and functions.
4591 Add non-shift version of rela, rela_ua. Delete all rel public
4592 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4593 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4594 addr16_ha3, addr14 functions.
4595 (Output_data_got_powerpc::add_constant_pair): New function.
4596 (Output_data_got_powerpc::got_base_offset): Likewise.
4597 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4598 (instruction constants): Sort, add some more.
4599 (Output_data_glink::do_write): Add and use Address typedef. Use
4600 object->toc_base_offset() stub for 64-bit.
4601 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4602 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4603 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4604 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4605 Always treat .opd relocs as against locally defined symbol.
4606 Correct condition for RELATIVE relocs.
4607 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4608 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4609 for 32-bit syms with a plt entry. Correct ppc64 toc base
4610 calculations. Handle TLS relocs, and more. Add overflow
4611 checking and adjust for Powerpc_relocate_functions changes.
4612 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4613 Reinstate --emit-relocs code with FIXME.
4614
a1373b60
AM
46152012-08-30 Alan Modra <amodra@gmail.com>
4616
4617 * layout.cc (Layout::set_segment_offsets): Set p_align to
4618 abi_pagesize, not common_pagesize.
4619 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4620 to determine whether file header can go in segment.
4621
703d02da
AM
46222012-08-30 Alan Modra <amodra@gmail.com>
4623
4624 * output.h (Output_reloc::Output_reloc <output section>): Add
4625 is_relative param. Adjust calls.
4626 (Output_reloc::add_output_section_relative): New functions.
4627 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4628 is_relative.
4629 (Output_reloc::symbol_value): Handle SECTION_CODE.
4630
16164a6b
ST
46312012-08-24 Sriraman Tallam <tmsriram@google.com>
4632
4633 * gold.cc (queue_middle_tasks): Call layout again when unique
4634 segments for sections is desired.
4635 * layout.cc (Layout::Layout): Initialize new members.
4636 (Layout::get_output_section_flags): New function.
4637 (Layout::choose_output_section): Call get_output_section_flags.
4638 (Layout::layout): Make output section for mapping to a unique segment.
4639 (Layout::insert_section_segment_map): New function.
4640 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4641 output sections marked so.
16164a6b
ST
4642 (Layout::segment_precedes): Check for unique segments when sorting.
4643 * layout.h (Layout::Unique_segment_info): New struct.
4644 (Layout::Section_segment_map): New typedef.
4645 (Layout::insert_section_segment_map): New function.
4646 (Layout::get_output_section_flags): New function.
4647 (Layout::is_unique_segment_for_sections_specified): New function.
4648 (Layout::set_unique_segment_for_sections_specified): New function.
4649 (Layout::unique_segment_for_sections_specified_): New member.
4650 (Layout::section_segment_map_): New member.
4651 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4652 Rename is_gc_pass_one to is_pass_one.
4653 Rename is_gc_pass_two to is_pass_two.
4654 Rename is_gc_or_icf to is_two_pass.
4655 Check for which pass based on whether symbols data is present.
4656 Make it two pass when unique segments for sections is desired.
4657 * output.cc (Output_section::Output_section): Initialize new
4658 members.
4659 * output.h (Output_section::is_unique_segment): New function.
4660 (Output_section::set_is_unique_segment): New function.
4661 (Output_section::is_unique_segment_): New member.
4662 (Output_section::extra_segment_flags): New function.
4663 (Output_section::set_extra_segment_flags): New function.
4664 (Output_section::extra_segment_flags_): New member.
4665 (Output_section::segment_alignment): New function.
4666 (Output_section::set_segment_alignment): New function.
4667 (Output_section::segment_alignment_): New member.
4668 (Output_segment::Output_segment): Initialize is_unique_segment_.
4669 (Output_segment::is_unique_segment): New function.
4670 (Output_segment::set_is_unique_segment): New function.
4671 (Output_segment::is_unique_segment_): New member.
4672 * plugin.cc (allow_unique_segment_for_sections): New function.
4673 (unique_segment_for_sections): New function.
4674 (Plugin::load): Add new functions to transfer vector.
4675 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4676 * Makefile.in: Regenerate.
4677 * testsuite/plugin_final_layout.sh: Check if unique segment
4678 functionality works.
4679 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4680 are available.
4681 (allow_unique_segment_for_sections): New global.
4682 (unique_segment_for_sections): New global.
4683 (claim_file_hook): Call allow_unique_segment_for_sections.
4684 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4685
1e2bee4f
CC
46862012-08-22 Cary Coutant <ccoutant@google.com>
4687
4688 * layout.cc (Layout::include_section): Don't assert on GROUP
4689 sections with --emit-relocs.
4690
1d5dfe78
CC
46912012-08-21 Cary Coutant <ccoutant@google.com>
4692
4693 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4694 if --export-dynamic-symbol names an undef symbol.
4695
c9269dff
AM
46962012-08-18 Alan Modra <amodra@gmail.com>
4697
4698 * powerpc.cc: Formatting and white space.
4699 (Powerpc_relobj): Rename got2_section_ to special_.
4700 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4701 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4702 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4703 (Target_powerpc): Add Address typedef and invalid_address. Use
4704 throughout.
4705 (Target_powerpc::is_branch_reloc): New function.
4706 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4707 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4708 for dst_mask, value and addend.
4709 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4710 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4711 (Output_data_glink::do_write): Correct toc base. Don't try to use
4712 uint16_t for 24-bit offset. Use get_output_section_offset and
4713 check return.
4714 (Target_powerpc::Scan::local): Handle more relocs.
4715 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4716 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4717 Plug in toc restoring insn after plt calls. Translate branches
4718 to function descriptor symbols to corresponding entry point.
4719 (Target_powerpc::relocate_for_relocatable): Check return from
4720 get_output_section_offset.
4721 * symtab.h: Comment typo.
4722
b1759dce
ILT
47232012-08-14 Ian Lance Taylor <iant@google.com>
4724
4725 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4726 unsupported_relocal_local to call unsupported_reloc_global.
4727
b9b2ae8b
NC
47282012-08-14 Nick Clifton <nickc@redhat.com>
4729
4730 PR ld/14265
4731 * script-sections.cc (Sections_element::output_section_name): Add
4732 keep return parameter.
4733 (Output_section_element::match_name): Add keep return parameter.
4734 Return the value of the keep_ member.
4735 * script-sections.h (class Output_section): Update
4736 output_section_name prototype.
4737 * layout.cc (Layout::keep_input_section): New public member
4738 function.
4739 (Layout::choose_output_section): Pass keep parameter to
4740 output_section_name.
4741 * layout.h (class Layout): Add keep_input_section.
4742 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4743 sections.
4744 * testsuite/Makefile.am: Add a test.
4745 * testsuite/Makefile.in: Regenerate.
4746 * testsuite/pr14265.c: Source file for the test.
4747 * testsuite/pr14265.t: Linker script for the test.
4748 * testsuite/pr14265.sh: Shell script for the test.
4749
921b5322
AM
47502012-08-14 Alan Modra <amodra@gmail.com>
4751
4752 * target.h (Target::output_section_name): New function.
4753 (Target::do_output_section_name): New function.
4754 * layout.cc (Layout::choose_output_section): Call the above.
4755 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4756
6ce78956
AM
47572012-08-14 Alan Modra <amodra@gmail.com>
4758
4759 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4760 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4761 for replace_constant call.
4762 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4763 (Output_data_glink::do_print_to_mapfile): New function.
4764 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4765 (Target_powerpc::Relocate::relocate): Likewise.
4766
d1a8cabd
AM
47672012-08-14 Alan Modra <amodra@gmail.com>
4768
4769 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4770 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4771 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4772 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4773 all references to shndx_. Handle special case for R_PPC_PLTREL24
4774 here.
4775 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4776 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4777 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4778 here.
4779 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4780 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4781
d83ce4e3
AM
47822012-08-12 Alan Modra <amodra@gmail.com>
4783
4784 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4785 (glink insn constants): Use uint32_t.
4786 (Output_data_glink::add_entry): Use insert, not [] operator.
4787
cf43a2fe
AM
47882012-08-11 Alan Modra <amodra@gmail.com>
4789
4790 * object.h (Sized_relobj_file::find_shdr): New function.
4791 (Sized_relobj_file::find_special_sections): New function.
4792 * object.cc (Sized_relobj_file::find_shdr): New function.
4793 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4794 (Sized_relobj_file::find_special_sections): New function, split out..
4795 (Sized_relobj_file::do_read_symbols): ..from here.
4796 * output.h (Output_data_got::replace_constant): New function.
4797 (Output_data_got::num_entries): New function.
4798 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4799 (Output_data_got::got_offset): Protected rather than private.
4800 (Output_data_got::replace_got_entry): New function.
4801 * output.cc (Output_data_got::replace_got_entry): New function.
4802 * powerpc.cc (class Powerpc_relobj): New.
4803 (class Powerpc_relocate_functions): Delete all psymval variants or
4804 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4805 Implement _ha functions using corresponding _hi function.
4806 (Powerpc_relobj::find_special_sections): New function.
4807 (Target_powerpc::do_make_elf_object): New function.
4808 (class Output_data_got_powerpc): New.
4809 (class Output_data_glink): New.
4810 (class Powerpc_scan_relocatable_reloc): New.
4811 Many more changes througout file.
4812
3c892704
NC
48132012-08-09 Nick Clifton <nickc@redhat.com>
4814
4815 * po/vi.po: Updated Vietnamese translation.
4816
82435b3b
ILT
48172012-08-07 Ian Lance Taylor <iant@google.com>
4818
4819 * layout.cc (Layout::add_target_dynamic_tags): If
4820 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4821 plt_rel.
4822
a6dc81d2
NC
48232012-07-30 Nick Clifton <nickc@redhat.com>
4824
4825 * po/gold.pot: Updated template.
4826 * po/es.po: Updated Spanish translation.
4827
f1415016
CC
48282012-07-18 Cary Coutant <ccoutant@google.com>
4829
4830 PR gold/14344
4831 * configure.ac: Add check for -gpubnames support.
4832 * configure: Regenerate.
4833 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4834 support; force -gno-pubnames.
4835 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4836 support.
4837 (gdb_index_test_4): New test.
4838 * testsuite/Makefile.in: Regenerate.
4839 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4840 * testsuite/gdb_index_test_2.sh: Likewise.
4841 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4842 * testsuite/gdb_index_test_4.sh: New script.
4843 * testsuite/gdb_index_test_comm.sh: New script with common code;
4844 don't look for space after colon.
4845
b7fd7c37
ST
48462012-07-16 Sriraman Tallam <tmsriram@google.com>
4847
4848 * gold.cc (queue_middle_tasks): Update function order only after
4849 deferred objects due to plugins are processed.
4850
1f3212db
ILT
48512012-07-11 Ian Lance Taylor <iant@google.com>
4852
4853 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4854 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4855 (Target_arm::scan_reloc_for_stub): Likewise.
4856 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4857 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4858 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4859 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4860 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4861
81c82a68
ILT
48622012-07-10 Dodji Seketeli <dodji@redhat.com>
4863 Ian Lance Taylor <iant@google.com>
4864
4865 PR gold/14309
4866 * configure.ac: Test whether std::tr1::hash<off_t> works.
4867 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4868 needed.
4869 * output.h (class Output_fill): Add virtual destructor.
4870 * configure, config.in: Rebuild.
4871
eabc84f4
RM
48722012-06-22 Roland McGrath <mcgrathr@google.com>
4873
4874 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4875
370e30b6
RÁE
48762012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4877
4878 * plugin.cc (Plugin::load): Handle position independent executables.
4879
fb1b895d
CC
48802012-06-06 Cary Coutant <ccoutant@google.com>
4881
4882 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4883 add .debug_macro.
4884 (lines_only_debug_sections): Likewise.
4885 (gdb_fast_lookup_sections): New static array.
4886 (is_gdb_debug_section): Rename formal parameter.
4887 (is_lines_only_debug_section): Likewise.
4888 (is_gdb_fast_lookup_section): New function.
4889 (Layout::include_section): Check for ".zdebug_" prefix; pass
4890 section name suffix to is_gdb_debug_section, et al.; check for
4891 fast-lookup sections when building .gdb_index.
4892 * options.h (--strip-debug-gdb): Update GDB version number.
4893
7c0640fa
CC
48942012-06-06 Cary Coutant <ccoutant@google.com>
4895
4896 * configure.ac: Add check for fallocate.
4897 * configure: Regenerate.
4898 * config.in: Regenerate.
4899
4900 * options.h (class General_options): Add --mmap-output-file and
4901 --posix-fallocate options.
4902 * output.cc: (posix_fallocate): Remove; replace with...
4903 (gold_fallocate): New function.
4904 (Output_file::map_no_anonymous): Call gold_fallocate.
4905 (Output_file::map): Check --mmap-output-file option.
4906
2a49eb69
DK
49072012-06-05 Jing Yu <jingyu@google.com>
4908
4909 * gold.h (textdomain): Add do {} to empty while(0).
4910 (bindtextdomain): Likewise.
4911
fad072ac
CC
49122012-06-04 Cary Coutant <ccoutant@google.com>
4913
4914 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4915 has_dynsym_index.
4916
8cc69fb6
ST
49172012-05-25 Sriraman Tallam <tmsriram@google.com>
4918
4919 * symtab.cc (Symbol_table::define_special_symbol):
4920 Initialize *poldsym to prevent uninitialized variable errors.
4921
1be75daa
CC
49222012-05-23 Cary Coutant <ccoutant@google.com>
4923
4924 * layout.cc (Layout::section_name_mapping): Add rules to handle
4925 exact match on .data.rel.ro.local or .data.rel.ro.
4926 (Layout::output_section_name): Check for exact matches.
4927
9b689de0
CC
49282012-05-23 Cary Coutant <ccoutant@google.com>
4929
4930 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4931 more carefully.
4932
b24fdbf5
CC
49332012-05-22 Cary Coutant <ccoutant@google.com>
4934
4935 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4936 object before exporting symbol.
4937
e550e1a2
L
49382012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4939
4940 * testsuite/tls_test.cc: Include "config.h" first.
4941 * testsuite/tls_test_c.c: Likewise.
4942
df7b86aa
NC
49432012-05-17 Daniel Richard G. <skunk@iskunk.org>
4944 Nick Clifton <nickc@redhat.com>
4945
4946 PR 14072
4947 * configure.in: Add check that sysdep.h has been included before
4948 any system header files.
4949 * configure: Regenerate.
4950 * config.in: Regenerate.
4951
1007b503
CC
49522012-05-14 Cary Coutant <ccoutant@google.com>
4953
4954 * layout.cc (Layout::make_output_section): Mark .tdata section
4955 as RELRO.
4956 * testsuite/relro_test.cc: Add a TLS variable.
4957
fd885f3a
L
49582012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4959
4960 PR gold/14091
4961 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4962 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4963 R_X86_64_64.
4964
80f5885c
CC
49652012-05-08 Cary Coutant <ccoutant@google.com>
4966
4967 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4968 (lines_only_debug_sections): Likewise.
4969
2e702c99
RM
49702012-05-02 Roland McGrath <mcgrathr@google.com>
4971
4972 * nacl.cc: New file.
4973 * nacl.h: New file.
4974 * Makefile.am (CCFILES, HFILES): Add them.
4975 * Makefile.in: Regenerate.
4976 * i386.cc (Output_data_plt_i386_nacl): New class.
4977 (Output_data_plt_i386_nacl_exec): New class.
4978 (Output_data_plt_i386_nacl_dyn): New class.
4979 (Target_i386_nacl): New class.
4980 (Target_selector_i386_nacl): New class.
4981 (target_selector_i386): Use it instead of Target_selector_i386.
4982 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4983 (Target_x86_64_nacl): New class.
4984 (Target_selector_x86_64_nacl): New class.
4985 (target_selector_x86_64, target_selector_x32): Use it instead of
4986 Target_selector_x86_64.
4987 * arm.cc (Output_data_plt_arm_nacl): New class.
4988 (Target_arm_nacl): New class.
4989 (Target_selector_arm_nacl): New class.
4990 (target_selector_arm, target_selector_armbe): Use it instead of
4991 Target_selector_arm.
4992
4993 * target-select.cc (select_target): Take new Input_file* and off_t
4994 arguments, pass them on to recognize method of selector.
4995 * object.cc (make_elf_sized_object): Update caller.
4996 * parameters.cc (parameters_force_valid_target): Likewise.
4997 * incremental.cc (make_sized_incremental_binary): Likewise.
4998 * target-select.h: Update decl.
4999 (Target_selector::recognize): Take new Input_file* argument,
5000 pass it on to do_recognize.
5001 (Target_selector::do_recognize): Take new Input_file* argument.
5002 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
5003 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
5004 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
5005 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
5006
5007 * target.h (Target::Target_info): New members isolate_execinstr
5008 and rosegment_gap.
5009 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
5010 * arm.cc (Target_arm::arm_info): Update initializer.
5011 * i386.cc (Target_i386::i386_info): Likewise.
5012 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
5013 * sparc.cc (Target_sparc::sparc_info): Likewise.
5014 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5015 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
5016 * layout.cc (Layout::attach_allocated_section_to_segment):
5017 Take new const Target* argument. If target->isolate_execinstr(), act
5018 like --rosegment.
5019 (Layout::find_first_load_seg): Take new const Target* argument;
5020 if target->isolate_execinstr(), reject PF_X segments.
5021 (Layout::relaxation_loop_body): Update caller.
5022 (Layout::set_segment_offsets): If target->isolate_execinstr(),
5023 reset file offset to zero when we hit LOAD_SEG, and then do a second
5024 loop over the segments before LOAD_SEG to reassign offsets after
5025 addresses have been determined. Handle target->rosegment_gap().
5026 (Layout::attach_section_to_segment): Take new const Target* argument;
5027 pass it to attach_allocated_section_to_segment.
5028 (Layout::make_output_section): Update caller.
5029 (Layout::attach_sections_to_segments): Take new const Target* argument;
5030 pass it to attach_section_to_segment.
5031 * gold.cc (queue_middle_tasks): Update caller.
5032 * layout.h (Layout): Update method decls with new arguments.
5033
5034 * arm.cc (Target_arm::Target_arm): Take optional argument for the
5035 Target_info pointer to use.
5036 (Target_arm::do_make_data_plt): New virtual method.
5037 (Target_arm::make_data_plt): New method that calls it.
5038 (Target_arm::make_plt_entry): Use it.
5039 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
5040 for the section alignment.
5041 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
5042 method.
5043 (Output_data_plt_arm::first_plt_entry_offset): Call it.
5044 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
5045 method.
5046 (Output_data_plt_arm::get_plt_entry_size): Call it.
5047 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
5048 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
5049 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
5050 method.
5051 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
5052 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
5053 method instead of sizeof(plt_entry).
5054 (Output_data_plt_arm::add_entry): Likewise.
5055 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
5056 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
5057 than static method.
5058 (Target_arm::plt_entry_size): Likewise.
5059 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
5060 Move to ...
5061 (Output_data_plt_arm_standard): ... here, new class.
5062 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
5063 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
5064 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
5065
5066 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5067 Take additional argument for the PLT entry size.
5068 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
5069 Use get_plt_entry_size method rather than plt_entry_size variable.
5070 (Output_data_plt_x86_64::reserve_slot): Likewise.
5071 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
5072 (Output_data_plt_x86_64::add_entry): Likewise.
5073 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5074 (Output_data_plt_x86_64::address_for_global): Likewise.
5075 (Output_data_plt_x86_64::address_for_local): Likewise.
5076 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5077 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5078 Make method non-static.
5079 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5080 method.
5081 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5082 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5083 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5084 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5085 virtual method.
5086 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5087 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5088 virtual method.
5089 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5090 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5091 virtual method.
5092 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5093 (Output_data_plt_x86_64::plt_entry_size)
5094 (Output_data_plt_x86_64::first_plt_entry)
5095 (Output_data_plt_x86_64::plt_entry)
5096 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5097 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5098 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5099 (Output_data_plt_x86_64_standard): ... here, new class.
5100 (Target_x86_64::Target_x86_64): Take optional argument for the
5101 Target_info pointer to use.
5102 (Target_x86_64::do_make_data_plt): New virtual method.
5103 (Target_x86_64::make_data_plt): New method to call it.
5104 (Target_x86_64::init_got_plt_for_update): Use that.
5105 Call this->plt_->add_eh_frame method here.
5106 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5107 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5108 rather than static method.
5109 (Target_x86_64::plt_entry_size): Likewise.
5110 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5111 rather than plt_entry_size variable. Move guts of PLT filling to...
5112 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5113 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5114 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5115
5116 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5117 additional argument for the section alignment.
5118 Don't do add_eh_frame_for_plt here.
5119 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5120 non-static. Use get_plt_entry_size method rather than plt_entry_size
5121 variable.
5122 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5123 method.
5124 (Output_data_plt_i386::get_plt_entry_size): Call it.
5125 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5126 (Output_data_plt_i386::add_eh_frame): New method to call it.
5127 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5128 method.
5129 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5130 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5131 method.
5132 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5133 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5134 method instead of plt_entry_size.
5135 (Output_data_plt_i386::plt_entry_size)
5136 (Output_data_plt_i386::plt_eh_frame_fde_size)
5137 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5138 (Output_data_plt_i386_standard): ... here, new class.
5139 (Output_data_plt_i386_exec): New class.
5140 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5141 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5142 (Output_data_plt_i386::exec_plt_entry): Move to ...
5143 (Output_data_plt_i386_exec::plt_entry): ... here.
5144 (Output_data_plt_i386_dyn): New class.
5145 (Output_data_plt_i386::first_plt_entry): Move to ...
5146 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5147 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5148 (Output_data_plt_i386_dyn::plt_entry): ... here.
5149 (Target_i386::Target_i386): Take optional argument for the Target_info
5150 pointer to use.
5151 (Target_i386::do_make_data_plt): New virtual method.
5152 (Target_i386::make_data_plt): New method to call it.
5153 (Target_i386::make_plt_section): Use that.
5154 Call this->plt_->add_eh_frame method here.
5155 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5156 rather than plt_entry_size variable.
5157 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5158 (Output_data_plt_i386::address_for_local): Likewise.
5159 (Output_data_plt_i386::do_write): Likewise.
5160 Move guts of PLT filling to...
5161 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5162 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5163 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5164 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5165
b9b9f2ee
CC
51662012-05-01 Cary Coutant <ccoutant@google.com>
5167
5168 * dwarf_reader.cc (Dwarf_die::read_attributes)
5169 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5170 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5171 * reduced_debug_output.cc
5172 (Output_reduced_debug_info_section::get_die_end): Remove
5173 DW_FORM_GNU_ref_index. Add default case.
5174
57923f48
MW
51752012-04-26 Mark Wielaard <mjw@redhat.com>
5176
5177 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5178 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5179 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5180 DW_AT_high_pc as offset from DW_AT_low_pc.
5181
5182 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5183 * testsuite/Makefile.in: Regenerate.
5184 * testsuite/gdb_index_test_3.c: New test source file.
5185 * testsuite/gdb_index_test_3.sh: New test source file.
5186
2c54b4f4
ILT
51872012-04-25 Ian Lance Taylor <iant@google.com>
5188
5189 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5190 pointer.
5191 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5192 as a class, not a struct.
5193 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5194 (Target_arm::apply_cortex_a8_workaround): Likewise.
5195 * gc.h: Declare Reloc_types as a struct, not a class.
5196 * object.h: Declare Symbols_data as a struct.
5197 * reloc.h: Declare Read_relocs_data as a struct.
5198 * target.h: Declare Relocate_info as a struct.
5199
a5a5f7a3
DM
52002012-04-24 David S. Miller <davem@davemloft.net>
5201
5202 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5203 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5204 and R_SPARC_WPLT30.
5205
f038d496
CC
52062012-04-24 Cary Coutant <ccoutant@google.com>
5207
5208 * incremental-dump.cc (find_input_containing_global): Replace
5209 magic number with symbolic constant.
5210 (dump_incremental_inputs): Update version number.
5211 * incremental.cc (Output_section_incremental_inputs): Update version
5212 number; import symbolic constants from Incremental_inputs_reader.
5213 (Incremental_inputs::create_data_sections): Align relocations
5214 section correctly for 64-bit targets.
5215 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5216 constants; add padding.
5217 (Output_section_incremental_inputs::write_header): Add assert for
5218 header_size.
5219 (Output_section_incremental_inputs::write_input_files): Add assert
5220 for input_entry_size.
5221 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5222 add assert for object_info_size, input_section_entry_size,
5223 global_sym_entry_size.
5224 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5225 for data structure sizes; use them.
5226 (Incremental_input_entry_reader): Import symbolic constants from
5227 Incremental_inputs_reader; use them.
5228
a4d85145
DM
52292012-04-23 David S. Miller <davem@davemloft.net>
5230
5231 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5232 and elf_flags_set_.
5233 (Target_sparc::Target_sparc): Initialize new fields.
5234 (Target_sparc::do_make_elf_object): New function.
5235 (Target_sparc::do_adjust_elf_header): New function.
5236
1d509098
CC
52372012-04-23 Cary Coutant <ccoutant@google.com>
5238
5239 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5240 CU range table of gdb index.
5241
7ebeff7f
DM
52422012-04-20 David S. Miller <davem@davemloft.net>
5243
5244 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5245 instead of false.
5246
13cf9988
DM
52472012-04-16 David S. Miller <davem@davemloft.net>
5248
2a1079e8
DM
5249 * sparc.cc (Target_sparc::got_address): New function.
5250 (Sparc_relocate_functions::gdop_hix22): New function.
5251 (Sparc_relocate_functions::gdop_lox10): New function.
5252 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5253 relocs.
5254 (Target_sparc::Scan::local): Likewise if the global symbol is not
5255 preemptible and is not IFUNC.
5256 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5257 transformations for local and non-preemptible non-IFUNC global
5258 symbols.
5259
0bc964fc
DM
5260 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5261 writing out 64-bit part of ranges.
5262
661d7a80
DM
5263 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5264 -fpic and -fpie respectively.
5265 * Makefile.in: Regenerate.
5266
8c2bf391
DM
5267 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5268 (Target_sparc::Target_sparc): Initialize new field.
5269 (Target_sparc::do_plt_section_for_global): New function.
5270 (Target_sparc::do_plt_section_for_local): New function.
5271 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5272 (Target_sparc::make_plt_section): New function, broken out of
5273 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5274 (Target_sparc::make_plt_entry): Call make_plt_section.
5275 (Target_sparc::make_local_ifunc_plt_entry): New function.
5276 (Target_sparc::rela_ifunc_section): New function.
5277 (Target_sparc::plt_section): Remove const.
5278 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5279 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5280 and ifunc_count_ fields.
5281 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5282 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5283 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5284 (Output_data_plt_sparc::rela_ifunc): New function.
5285 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5286 (Output_data_plt_sparc::has_ifunc_section): New function.
5287 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5288 (Output_data_plt_sparc::address_for_global): New function.
5289 (Output_data_plt_sparc::address_for_local): New function.
5290 (Output_data_plt_sparc::plt_index_to_offset): New function.
5291 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5292 and entry_count.
5293 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5294 entry_count.
5295 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5296 R_SPARC_JMP_IREL to switch.
5297 (Target_sparc::Scan::check_non_pic): Likewise.
5298 (Target_sparc::Scan::local): Handle IFUNC symbols.
5299 (Target_sparc::Scan::local): Likewise.
5300 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5301 and plt_address_for_local.
5302 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5303 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5304
13cf9988
DM
5305 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5306 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5307 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5308 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5309 global relocs too.
5310 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5311 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5312 calls.
5313 * sparc.cc (Target_sparc::Scan::global): Likewise.
5314 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5315
31821be0
CC
53162012-04-16 Cary Coutant <ccoutant@google.com>
5317
5318 * archive.cc (Library_base::should_include_member): Check for
5319 --export-dynamic-symbol.
5320 * options.h (class General_options): Add --export-dynamic-symbol.
5321 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5322 --export-dynamic-symbol.
5323 (Symbol_table::gc_mark_undef_symbols): Likewise.
5324 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5325
2615994e
DM
53262012-04-12 David S. Miller <davem@davemloft.net>
5327
5328 * sparc.cc (Reloc::wdisp10): New relocation method.
5329 (Reloc::h34): Likewise.
5330 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5331 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5332 R_SPARC_WDISP10.
5333 (Target_sparc::Scan::local): Likewise.
5334 (Target_sparc::Scan::global): Likewise.
5335 (Target_sparc::Relocate::relocate): Likewise.
5336
6782735d
CC
53372012-04-09 Cary Coutant <ccoutant@google.com>
5338
5339 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5340 low_pc == 0.
5341
8c7a0b00
ILT
53422012-04-06 Ian Lance Taylor <iant@google.com>
5343
5344 * timer.cc: #include <unistd.h>.
5345
58797674
RM
53462012-04-06 Roland McGrath <mcgrathr@google.com>
5347
5348 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5349 * config.in: Regenerate.
5350 * configure: Regenerate.
5351
44350750
NC
53522012-04-05 Nick Clifton <nickc@redhat.com>
5353
5354 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5355 (AM_LC_MESSAGES): Add.
5356 * aclocal.m4: Regenerate.
5357 * config.in: Regenerate.
5358 * configure: Regenerate.
5359
c1027032
CC
53602012-03-21 Cary Coutant <ccoutant@google.com>
5361
5362 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5363 * Makefile.in: Regenerate.
5364 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5365 (Sized_elf_reloc_mapper::symbol_section): New function.
5366 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5367 (make_elf_reloc_mapper): New function.
5368 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5369 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5370 (Dwarf_abbrev_table::do_get_abbrev): New function.
5371 (Dwarf_ranges_table::read_ranges_table): New function.
5372 (Dwarf_ranges_table::read_range_list): New function.
5373 (Dwarf_pubnames_table::read_section): New function.
5374 (Dwarf_pubnames_table::read_header): New function.
5375 (Dwarf_pubnames_table::next_name): New function.
5376 (Dwarf_die::Dwarf_die): New function.
5377 (Dwarf_die::read_attributes): New function.
5378 (Dwarf_die::skip_attributes): New function.
5379 (Dwarf_die::set_name): New function.
5380 (Dwarf_die::set_linkage_name): New function.
5381 (Dwarf_die::attribute): New function.
5382 (Dwarf_die::string_attribute): New function.
5383 (Dwarf_die::int_attribute): New function.
5384 (Dwarf_die::uint_attribute): New function.
5385 (Dwarf_die::ref_attribute): New function.
5386 (Dwarf_die::child_offset): New function.
5387 (Dwarf_die::sibling_offset): New function.
5388 (Dwarf_info_reader::check_buffer): New function.
5389 (Dwarf_info_reader::parse): New function.
5390 (Dwarf_info_reader::do_parse): New function.
5391 (Dwarf_info_reader::do_read_string_table): New function.
5392 (Dwarf_info_reader::lookup_reloc): New function.
5393 (Dwarf_info_reader::get_string): New function.
5394 (Dwarf_info_reader::visit_compilation_unit): New function.
5395 (Dwarf_info_reader::visit_type_unit): New function.
5396 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5397 Sized_elf_reloc_mapper.
5398 (Sized_dwarf_line_info::symbol_section): Remove function.
5399 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5400 (Sized_dwarf_line_info::read_line_mappings): Remove object
5401 parameter, adjust callers.
5402 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5403 * dwarf_reader.h: Include <sys/types.h>.
5404 (class Track_relocs): Remove forward declaration.
5405 (class Elf_reloc_mapper): New class.
5406 (class Sized_elf_reloc_mapper): New class.
5407 (class Dwarf_abbrev_table): New class.
5408 (class Dwarf_range_list): New class.
5409 (class Dwarf_ranges_table): New class.
5410 (class Dwarf_pubnames_table): New class.
5411 (class Dwarf_die): New class.
5412 (class Dwarf_info_reader): New class.
5413 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5414 (Sized_dwarf_line_info::symbol_section): Remove member function.
5415 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5416 base class.
5417 * gdb-index.cc: New source file.
5418 * gdb-index.h: New source file.
5419 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5420 and .debug_types sections, call Layout::add_to_gdb_index.
5421 (Sized_relobj_incr::do_section_name): Implement.
5422 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5423 return type; Implement.
5424 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5425 return type.
5426 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5427 parameter list and return type.
5428 (Sized_incr_dynobj::do_section_contents): Likewise.
5429 * layout.cc: Include gdb-index.h.
5430 (Layout::Layout): Initialize gdb_index_data_.
5431 (Layout::init_fixed_output_section): Check for .gdb_index section.
5432 (Layout::add_to_gdb_index): New function. Instantiate.
5433 * layout.h: Add forward declaration for class Gdb_index.
5434 (Layout::add_to_gdb_index): New member function.
5435 (Layout::gdb_index_data_): New data member.
5436 * main.cc: Include gdb-index.h.
5437 (main): Print statistics for gdb index.
5438 * object.cc (Object::section_contents): Move code into
5439 do_section_contents.
5440 (need_decompressed_section): Check for sections needed when building
5441 gdb index.
5442 (build_compressed_section_map): Likewise.
5443 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5444 gdb index.
5445 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5446 sections; call Layout::add_to_gdb_index.
5447 (Sized_relobj_file::do_decompressed_section_contents): Call
5448 do_section_contents directly.
5449 * object.h (Object::do_section_contents): Adjust parameter list and
5450 return type.
5451 (Object::do_decompressed_section_contents): Call do_section_contents
5452 directly.
5453 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5454 return type.
5455 * options.h (class General_options): Add --gdb-index option.
5456 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5457 list and return type.
5458 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5459 * reloc.h (Track_relocs::checkpoint): New function.
5460 (Track_relocs::reset): New function.
5461
5462 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5463 New test cases.
5464 * testsuite/Makefile.in: Regenerate.
5465 * testsuite/gdb_index_test.cc: New test source file.
5466 * testsuite/gdb_index_test_1.sh: New test source file.
5467 * testsuite/gdb_index_test_2.sh: New test source file.
5468
647f1574
DK
54692012-03-19 Doug Kwan <dougkwan@google.com>
5470
5471 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5472 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5473 __exidx_start and __exidx_end. Make symbol table parameter
5474 anonymous as it is not used.
5475 * gold.cc (queue_middle_tasks): Call target hook to define any
5476 target-specific symbols.
5477 * target.h (Target::define_standard_symbols): New method.
5478 (Target::do_define_standard_symbols): Same.
5479 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5480 * testsuite/Makefile.in: Regenerate.
5481 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5482 and __exidx_end.
5483 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5484 relocations are generated for __exidx_start and __exidx_end.
5485
7c6109da
DK
54862012-03-16 Doug Kwan <dougkwan@google.com>
5487
5488 * testsuite/Makefile.am: Disable test initpri3b.
5489 * testsuite/Makefile.in: Regenerate.
5490
7b8957f8
DK
54912012-03-15 Doug Kwan <dougkwan@google.com>
5492
5493 * arm.cc (Target_arm::got_section): Make .got section read-only
5494 if -z now is given.
5495
14dc9ef7
ILT
54962012-03-15 Ian Lance Taylor <iant@google.com>
5497
5498 PR gold/13850
5499 * layout.cc (Layout::make_output_section): Correctly mark
5500 SHT_INIT_ARRAY, et. al., as relro.
5501
fa40b62a
DK
55022012-03-14 Doug Kwan <dougkwan@google.com>
5503
5504 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5505 dynamic relocations for protected symbols in shared objects.
5506
fd325007
ILT
55072012-03-13 Ian Lance Taylor <iant@google.com>
5508
5509 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5510 keep the larger alignment.
5511
e8dd54e1
CC
55122012-03-12 Cary Coutant <ccoutant@google.com>
5513
5514 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5515 handling of DW_LNE_define_file.
5516
feb5f3b0
CC
55172012-03-12 Cary Coutant <ccoutant@google.com>
5518
5519 * reduced_debug_output.cc
5520 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5521 codes to switch.
5522
a1fb4256
CC
55232012-02-29 Cary Coutant <ccoutant@google.com>
5524
5525 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5526
5dd8762a
CC
55272012-02-29 Cary Coutant <ccoutant@google.com>
5528
5529 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5530 Call Object::decompressed_section_contents.
5531 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5532 New dtor.
5533 (Sized_dwarf_line_info::buffer_start_): New data member.
5534 * merge.cc (Output_merge_data::do_add_input_section): Call
5535 Object::decompressed_section_contents.
5536 (Output_merge_string::do_add_input_section): Likewise.
5537 * object.cc (need_decompressed_section): New function.
5538 (build_compressed_section_map): Decompress sections needed later.
5539 (Sized_relobj_file::do_decompressed_section_contents): New function.
5540 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5541 * object.h (Object::decompressed_section_contents): New function.
5542 (Object::discard_decompressed_sections): New function.
5543 (Object::do_decompressed_section_contents): New function.
5544 (Object::do_discard_decompressed_sections): New function.
5545 (Compressed_section_info): New type.
5546 (Compressed_section_map): Include decompressed section contents.
5547 (Sized_relobj_file::do_decompressed_section_contents): New function.
5548 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5549
7b5de7ee
CC
55502012-02-16 Cary Coutant <ccoutant@google.com>
5551
5552 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5553 * testsuite/Makefile.in: Regenerate.
5554
f9fa4a63
CC
55552012-02-14 Cary Coutant <ccoutant@google.com>
5556
5557 * options.cc (General_options::finalize): Disallow -pie and -static.
5558
2c175ebc
DK
55592012-02-03 Doug Kwan <dougkwan@google.com>
5560
5561 * arm.cc (Arm_relocate_functions::abs8,
5562 Arm_relocate_functions::abs16): Use
5563 Bits::has_signed_unsigned_overflow32.
5564 (Arm_relocate_functions::thm_abs8): Correct range of
5565 overflow check.
5566 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5567 in assertions.
5568
90cff06f
DK
55692012-02-02 Doug Kwan <dougkwan@google.com>
5570
5571 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5572 position independent outputs, not just shared objects.
5573
63887f3d
L
55742012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5575
5576 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5577 * configure: Regenerated.
5578
bef2b434
ILT
55792012-01-27 Ian Lance Taylor <iant@google.com>
5580
5581 * reloc.h (Bits): New class with static functions, copied from
5582 namespace utils in arm.cc.
5583 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5584 instead.
5585
c335b55d
L
55862012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5587
5588 * incremental.cc (write_info_blocks): Correct relocation offset.
5589
41194d9f
L
55902012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5591
5592 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5593 (Relocate::tls_gd_to_le): Likewise.
5594
1bae613c
L
55952012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5596
5597 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5598
24482ca0
L
55992012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5600
5601 * configure.ac: Check if -mcmodel=medium works.
5602 * configure: Regenerated.
5603
c2c7840a
CC
56042012-01-24 Cary Coutant <ccoutant@google.com>
5605
5606 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5607 definition and ...
5608 (read_unsigned_LEB_128_x): ... this new function.
5609 (read_signed_LEB_128): Replaced with inline definition and ...
5610 (read_signed_LEB_128_x): ... this new function.
5611 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5612 (read_unsigned_LEB_128): Add inline definition.
5613 (read_signed_LEB_128_x): New function.
5614 (read_signed_LEB_128): Add inline definition.
5615 * testsuite/Makefile.am (leb128_unittest): New unit test.
5616 * testsuite/Makefile.in: Regenerate.
5617 * testsuite/leb128_unittest.cc: New unit test.
5618
833de760 56192012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5620
5621 PR gold/13617
5622 * i386.cc (Target_i386::do_code_fill): When using a jmp
5623 instruction, pad with nop instructions.
5624 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5625
618d6666
L
56262012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5627
5628 * x86_64.cc (gc_process_relocs): Add typename on types used in
5629 template.
5630 (scan_relocs): Likewise.
5631 (relocate_section): Likewise.
5632 (apply_relocation): Likewise.
5633
3660ff06
L
56342012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5635
5636 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5637 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5638 under x32.
5639
fc51264f
L
56402012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5641
5642 * x86_64.cc: Initial support for x32.
5643
dd74ae06
CC
56442012-01-03 Cary Coutant <ccoutant@google.com>
5645
5646 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5647 Use abstract base class for GOT.
5648 * gold/output.h (class Output_data_got_base): New abstract base class.
5649 (class Output_data_got): Derive from new base class, adjust ctors.
5650 (Output_data_got::reserve_slot): Make virtual; rename to
5651 do_reserve_slot; Adjust callers.
5652 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5653 pointer to abstract base class.
5654 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5655
83896202
ILT
56562011-12-18 Ian Lance Taylor <iant@google.com>
5657
5658 * object.h (Relobj::local_symbol_value): New function.
5659 (Relobj::local_plt_offset): New function.
5660 (Relobj::local_has_got_offset): New function.
5661 (Relobj::local_got_offset): New function.
5662 (Relobj::set_local_got_offset): New function.
5663 (Relobj::do_local_symbol_value): New pure virtual function.
5664 (Relobj::do_local_plt_offset): Likewise.
5665 (Relobj::do_local_has_got_offset): Likewise.
5666 (Relobj::do_local_got_offset): Likewise.
5667 (Relobj::do_set_local_got_offset): Likewise.
5668 (Sized_relobj::do_local_has_got_offset): Rename from
5669 local_has_got_offset.
5670 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5671 (Sized_relobj::do_set_local_got_offset): Rename from
5672 set_local_got_offset.
5673 (Sized_relobj_file::do_local_plt_offset): Rename from
5674 local_plt_offset.
5675 (Sized_relobj_file::do_local_symbol_value): New function.
5676 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5677 local_plt_offset.
5678 * output.cc (Output_data_got::Got_entry::write): Change object to
5679 Relobj. Use local_symbol_value.
5680 (Output_data_got::add_global_with_rel): Change rel_dyn to
5681 Output_data_reloc_generic*. Use add_global_generic.
5682 (Output_data_got::add_global_with_rela): Remove. Change all
5683 callers to use add_global_with_rel.
5684 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5685 Output_data_reloc_generic*. Use add_global_generic.
5686 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5687 callers to use add_global_pair_with_rel.
5688 (Output_data_got::add_local): Change object to Relobj*.
5689 (Output_data_got::add_local_plt): Likewise.
5690 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5691 change rel_dyn to Output_data_reloc_generic*. Use
5692 add_local_generic.
5693 (Output_data_got::add_local_with_rela): Remove. Change all
5694 callers to use all_local_with_rel.
5695 (Output_data_got::add_local_pair_with_rel): Change object to
5696 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5697 add_output_section_generic.
5698 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5699 callers to use add_local_pair_with_rel.
5700 (Output_data_got::reserve_local): Change object to Relobj*.
5701 * output.h: (class Output_data_reloc_generic): Add pure virtual
5702 declarations for add_global_generic, add_local_generic,
5703 add_output_section_generic.
5704 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5705 functions for Output_data_reloc_generic. Update declarations for
5706 changes listed in output.cc.
5707 (class Output_data_got): Change template parameter to got_size.
5708 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5709 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5710 function.
5711 (Sized_relobj_incr::do_local_plt_offset): New function.
5712 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5713 add_global_generic.
5714
76677ad0
CC
57152011-12-17 Cary Coutant <ccoutant@google.com>
5716
5717 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5718 * resolve.cc (Symbol_table::resolve): Likewise.
5719 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5720 arrays.
5721 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5722
8b8dd8d5
ILT
57232011-12-16 Ian Lance Taylor <iant@google.com>
5724
5725 * output.h (Output_data_reloc_generic::add): Only call
5726 add_dynamic_reloc if this is a dynamic reloc section.
5727
d55525b9
L
57282011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5729
5730 PR gold/13505
5731 * target-reloc.h (apply_relocation): Replace <64, false> with
5732 <size, big_endian>.
5733
ff81c7c1
NC
57342011-11-25 Nick Clifton <nickc@redhat.com>
5735
5736 * po/it.po: New Italian translation.
5737
628f39be
SA
57382011-11-17 Sterling Augustine <saugustine@google.com>
5739
5740 * script.cc (script_include_directive): Implement.
5741 (read_script_file): New local variables name and search_path. Update
5742 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5743 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5744 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5745
98ef3ea4
SA
57462011-11-11 Sterling Augustine <saugustine@google.com>
5747
5748 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5749 (file_or_sections_cmd): Likewise.
5750
f4a8b6d7
DK
57512011-11-11 Doug Kwan <dougkwan@google.com>
5752
5753 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5754 if --just-symbols is given.
5755
29ab395d
DK
57562011-11-10 Doug Kwan <dougkwan@google.com>
5757
5758 PR gold/13362
5759 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5760 when processing data relocs.
5761 * reloc.h (Relocate_functions::rel_unaligned): New method.
5762 (Relocate_functions::pcrel_unaligned): Ditto.
5763 (Relocate_functions::rel32_unaligned): Ditto.
5764 (Relocate_functions::pcrel32_unaligned): Ditto.
5765
2c339f71
DK
57662011-11-09 Doug Kwan <dougkwan@google.com>
5767
5768 PR gold/13362
5769 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5770 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5771 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5772 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5773 (Relocate_functions::rel_unaligned): New.
5774 (Relocate_functions::rel32_unaligned): New.
5775 * target-reloc.h (relocate_for_relocatable): Add code to handle
5776 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5777 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5778 arm_unaligned_reloc_r): New targets.
5779 * testsuite/Makefile.in: Regenerate.
5780 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5781 linking.
5782
3f3cddf1
ILT
57832011-11-02 Ian Lance Taylor <iant@google.com>
5784
5785 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5786 NATIVE_LINKER.
5787 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5788 * options.cc (General_options::finalize): Use library search path
5789 from configure script if specified. If not native and no sysroot,
5790 only search TOOLLIBDIR.
5791 * options.h (Search_directory::Search_directory): Change name to
5792 const std::string&.
5793 (General_options::add_to_library_path_with_sysroot): Change arg to
5794 const std::string&.
5795 * configure, Makefile.in, config.in: Rebuild.
5796
a8e2273b
ILT
57972011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5798
5799 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5800 we are working around the ARM1176 Erratum.
5801 * options.h (General_options::fix_arm1176): Add option.
5802 * testsuite/Makefile.am: Add testcases, and keep current ones
5803 working.
5804 * testsuite/Makefile.in: Regenerate.
5805 * testsuite/arm_fix_1176.s: New file.
5806 * testsuite/arm_fix_1176.sh: Likewise.
5807
cd6eab1c
ILT
58082011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5809
5810 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5811 may_use_blx_.
5812 (Target_arm::may_use_blx): Remove method.
5813 (Target_arm::set_may_use_blx): Likewise.
5814 (Target_arm::may_use_v4t_interworking): New method.
5815 (Target_arm::may_use_v5t_interworking): Likewise.
5816 (Target_arm::may_use_blx_): Remove member variable.
5817 (Arm_relocate_functions::arm_branch_common): Check for v5T
5818 interworking.
5819 (Arm_relocate_functions::thumb_branch_common): Likewise.
5820 (Reloc_stub::stub_type_for_reloc): Likewise.
5821 (Target_arm::do_finalize_sections): Correct interworking checks.
5822 * testsuite/Makefile.am: Add new tests.
5823 * testsuite/Makefile.in: Regenerate.
5824 * testsuite/arm_farcall_arm_arm.s: New test.
5825 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5826 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5827 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5828 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5829 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5830 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5831 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5832
286adcf4
CC
58332011-10-31 Cary Coutant <ccoutant@google.com>
5834
5835 PR gold/13023
5836 * expression.cc (Expression::eval_with_dot): Add
5837 is_section_dot_assignment parameter.
5838 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5839 absolute and assigning to dot within a section.
5840 * script-sections.cc
5841 (Output_section_element_assignment::set_section_addresses): Pass
5842 dot_section to set_if_absolute.
5843 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5844 as is_section_dot_assignment flag to eval_with_dot.
5845 (Output_section_element_dot_assignment::set_section_addresses):
5846 Likewise.
5847 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5848 parameter. Also set value if relative to dot_section; set the
5849 symbol's output_section.
5850 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5851 parameter. Adjust all callers.
5852 (Expression::eval_maybe_dot): Likewise.
5853 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5854 Adjust all callers.
5855 * testsuite/script_test_2.t: Test assignment of an absolute value
5856 to dot within an output section element.
5857
9634ed06
CC
58582011-10-31 Cary Coutant <ccoutant@google.com>
5859
5860 * options.h (class General_options): Add --[no-]gnu-unique options.
5861 * symtab.cc (Symbol_table::sized_write_globals): Convert
5862 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5863
de4101c7
CC
58642011-10-31 Cary Coutant <ccoutant@google.com>
5865
5866 PR gold/13359
5867 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5868 unnecessary assertion.
5869 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5870
7257cc92
ST
58712011-10-31 Sriraman Tallam <tmsriram@google.com>
5872
5873 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5874 gc_mark_symbol.
5875 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5876 gc_mark_symbol.
5877 Change to just keep the section associated with symbol.
5878 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5879 they are externally visible and --export-dynamic is turned on.
5880 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5881
bfc34b3f
ILT
58822011-10-19 Ian Lance Taylor <iant@google.com>
5883
5884 PR gold/13163
5885 * script-sections.cc
5886 (Output_section_element_dot_assignment::needs_output_section): New
5887 function.
5888
ea0d8c47
ILT
58892011-10-19 Ian Lance Taylor <iant@google.com>
5890
5891 PR gold/13204
5892 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5893 --section-start option was seen.
5894 * options.h (General_options::any_section_start): New function.
5895
abd242a9
DM
58962011-10-18 David S. Miller <davem@davemloft.net>
5897
5898 PR binutils/13301
5899 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5900 member to track relocation locations that have moved during TLS
5901 reloc optimizations.
5902 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5903 (Target_sparc::Relocate::relocate): Adjust view down by 4
5904 bytes if it matches reloc_adjust_addr_.
5905 (Target_sparc::Relocate::relocate_tls): Always move the
5906 __tls_get_addr call delay slot instruction forward 4 bytes when
5907 performing relaxation.
5908
bab9090f
CC
59092011-10-18 Cary Coutant <ccoutant@google.com>
5910
5911 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5912 (Output_file::map_no_anonymous): Check for non-zero
5913 return code from posix_fallocate.
5914
f7c5b166
CC
59152011-10-17 Cary Coutant <ccoutant@google.com>
5916
5917 PR gold/13245
5918 * plugin.cc (is_visible_from_outside): Check for symbols
5919 referenced from dynamic objects.
5920 * resolve.cc (Symbol_table::resolve): Don't count references
5921 from dynamic objects as references from real ELF files.
5922 * testsuite/plugin_test_2.sh: Adjust expected result.
5923
b490c0bb
CC
59242011-10-17 Cary Coutant <ccoutant@google.com>
5925
5926 * gold.cc: Include timer.h.
5927 (queue_middle_tasks): Stamp time.
5928 (queue_final_tasks): Likewise.
5929 * main.cc (main): Store timer in parameters. Print timers
5930 for each pass.
5931 * parameters.cc (Parameters::Parameters): Initialize timer_.
5932 (Parameters::set_timer): New function.
5933 (set_parameters_timer): New function.
5934 * parameters.h (Parameters::set_timer): New function.
5935 (Parameters::timer): New function.
5936 (Parameters::timer_): New data member.
5937 (set_parameters_timer): New function.
5938 * timer.cc (Timer::stamp): New function.
5939 (Timer::get_pass_time): New function.
5940 * timer.h (Timer::stamp): New function.
5941 (Timer::get_pass_time): New function.
5942 (Timer::pass_times_): New data member.
5943
f475cf7b
CC
59442011-10-17 Cary Coutant <ccoutant@google.com>
5945
5946 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5947 task for members of lib groups.
5948
cdd7e244
CC
59492011-10-17 Cary Coutant <ccoutant@google.com>
5950
5951 PR gold/13288
4f95c8b4 5952 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5953 (File_read::make_view): Move bounds check (replace with assert)...
5954 (File_read::find_or_make_view): ... to here.
5955
dfb45471
CC
59562011-10-12 Cary Coutant <ccoutant@google.com>
5957
4f95c8b4 5958 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5959 ::read returns less than requested size.
5960
53bbcc1b
CC
59612011-10-10 Cary Coutant <ccoutant@google.com>
5962
4f95c8b4 5963 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5964 Initialize defined_count_.
5965 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5966 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5967 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5968 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5969 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5970 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5971 member.
5972 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5973 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5974 Return zeroes instead of internal error.
5975
397b129b
CC
59762011-10-10 Cary Coutant <ccoutant@google.com>
5977
5978 PR gold/13249
4f95c8b4 5979 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5980 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5981 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5982 (Output_reloc::type_): Adjust size of bit field.
5983 (Output_reloc::use_plt_offset_): New bit field.
5984 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5985 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5986 flag. Adjust all callers.
4f95c8b4 5987 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5988 creating RELATIVE relocations.
5989
d5698657
NC
59902011-10-10 Nick Clifton <nickc@redhat.com>
5991
5992 * po/es.po: Updated Spanish translation.
5993 * po/fi.po: Updated Finnish translation.
5994
6a59a5c2
DN
59952011-10-03 Diego Novillo <dnovillo@google.com>
5996
5997 * options.cc (parse_uint): Fix dereference of RETVAL.
5998
f0558624
ST
59992011-09-29 Sriraman Tallam <tmsriram@google.com>
6000
6001 * layout.h (section_order_map_): New member.
6002 (get_section_order_map): New member function.
6003 * output.cc (Output_section::add_input_section): Check for patterns
6004 only when --section-ordering-file is specified.
6005 * gold.cc (queue_middle_tasks): Delay updating order of sections till
6006 output_sections have been formed.
6007 * layout.cc (Layout_Layout): Initialize section_order_map_.
6008 * plugin.cc (update_section_order): Store order in order_map. Do not
6009 update the order.
6010 * testsuite/Makefile.am: Add test case for plugin_final_layout.
6011 * testsuite/Makefile.in: Regenerate.
6012 * testsuite/plugin_section_order.c: New file.
6013 * testsuite/plugin_final_layout.cc: New file.
6014 * testsuite/plugin_final_layout.sh: New file.
6015
a7dac153
CC
60162011-09-29 Cary Coutant <ccoutant@google.com>
6017
4f95c8b4 6018 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 6019 Check for NULL.
4f95c8b4 6020 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
6021 symbols during incremental update.
6022 (Symbol_table::add_from_dynobj): Likewise.
6023
eebd87a5
ILT
60242011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6025 Ian Lance Taylor <iant@google.com>
6026
6027 * symtab.cc (Symbol_table::define_special_symbol): Always
6028 canonicalize version string.
6029
403a3331
CC
60302011-09-26 Cary Coutant <ccoutant@google.com>
6031
4f95c8b4
CC
6032 * gold.cc (queue_initial_tasks): Move option checks ...
6033 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
6034 some options; make others fatal.
6035
235061c2
CC
60362011-09-26 Cary Coutant <ccoutant@google.com>
6037
6038 gcc PR lto/47247
6039 * plugin.cc (get_symbols_v2): New function.
6040 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
6041 (is_referenced_from_outside): New function.
6042 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
6043 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
6044 (get_symbols): Pass version parameter.
6045 (get_symbols_v2): New function.
6046 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
6047 parameter.
6048 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
6049 (onload): Add LDPT_GET_SYMBOLS_V2.
6050 (all_symbols_read_hook): Use get_symbols_v2; check for
6051 LDPR_PREVAILING_DEF_IRONLY_EXP.
6052 * testsuite/plugin_test_3.sh: Update expected results.
6053
dc87f620
ILT
60542011-09-23 Simon Baldwin <simonb@google.com>
6055
6056 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
6057 configuration options.
6058 * configure: Regenerate.
6059 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
6060 * Makefile.in: Regenerate.
6061 * testsuite/Makefile.in: Regenerate.
6062
a8279f82
ST
60632011-09-19 Sriraman Tallam <tmsriram@google.com>
6064
6065 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
6066
0c9350c8
CC
60672011-09-19 Cary Coutant <ccoutant@google.com>
6068
6069 * incremental.cc (can_incremental_update): Fix typo in comment.
6070 * incremental.h (can_incremental_update): Likewise.
6071
aa06ae28
CC
60722011-09-18 Cary Coutant <ccoutant@google.com>
6073
6074 * incremental.cc (can_incremental_update): New function.
6075 * incremental.h (can_incremental_update): New function.
6076 * layout.cc (Layout::init_fixed_output_section): Call it.
6077 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6078 * object.cc (Sized_relobj_file::do_layout): Call
6079 can_incremental_update.
6080
ebb300b2
CC
60812011-09-13 Cary Coutant <ccoutant@google.com>
6082
6083 * configure.ac: Check for glibc support for gnu_indirect_function
6084 support with static linking, setting automake conditional
6085 IFUNC_STATIC.
6086 * Makefile.in: Regenerate.
6087 * configure: Regenerate.
6088
6089 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6090 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6091 for IFUNC_STATIC.
6092 * testsuite/Makefile.in: Regenerate.
6093
1206d0d5
CC
60942011-09-13 Cary Coutant <ccoutant@google.com>
6095
6096 * incremental.cc (Sized_relobj_incr::do_layout): Call
6097 report_comdat_group for kept comdat sections.
6098 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6099 * testsuite/Makefile.in: Regenerate.
6100 * testsuite/incr_comdat_test_1.cc: New source file.
6101 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6102 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6103 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6104
40b29874
ILT
61052011-09-13 Ian Lance Taylor <iant@google.com>
6106
6107 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6108 variable external_symbols_offset.
6109
1b045aac
ILT
61102011-09-12 Ian Lance Taylor <iant@google.com>
6111
6112 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6113 triggered if object has no symbols.
6114
24c6c55a
DM
61152011-09-09 David S. Miller <davem@davemloft.net>
6116
6117 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6118 (Output_fill_debug_line::do_write): Likewise.
6119
66570254
CC
61202011-08-29 Cary Coutant <ccoutant@google.com>
6121
6122 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6123 casts to match formatting specs.
6124 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6125
8ea8cd50
CC
61262011-08-26 Cary Coutant <ccoutant@google.com>
6127
6128 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6129 remaining hole size when allocating.
6130 (Layout::make_output_section): Set fill methods for debug sections.
6131 * layout.h (Free_list::Free_list_node): Move from private to
6132 public.
6133 (Free_list::set_min_hole_size): New function.
6134 (Free_list::begin, Free_list::end): New functions.
6135 (Free_list::min_hole_): New data member.
6136 * output.cc: Include dwarf.h.
6137 (Output_fill_debug_info::do_minimum_hole_size): New function.
6138 (Output_fill_debug_info::do_write): New function.
6139 (Output_fill_debug_line::do_minimum_hole_size): New function.
6140 (Output_fill_debug_line::do_write): New function.
6141 (Output_section::Output_section): Initialize new data member.
6142 (Output_section::set_final_data_size): Ensure patch space is larger
6143 than minimum hole size.
6144 (Output_section::do_write): Fill holes in debug sections.
6145 * output.h (Output_fill): New class.
6146 (Output_fill_debug_info): New class.
6147 (Output_fill_debug_line): New class.
6148 (Output_section::set_free_space_fill): New function.
6149 (Output_section::free_space_fill_): New data member.
6150 * testsuite/Makefile.am (incremental_test_3): Add
6151 --incremental-patch option.
6152 (incremental_test_4): Likewise.
6153 (incremental_test_5): Likewise.
6154 (incremental_test_6): Likewise.
6155 (incremental_copy_test): Likewise.
6156 (incremental_common_test_1): Likewise.
6157 * testsuite/Makefile.in: Regenerate.
6158
7cf80422
NC
61592011-08-26 Nick Clifton <nickc@redhat.com>
6160
6161 * po/es.po: Updated Spanish translation.
6162
c3f7b0e5
CC
61632011-08-01 Cary Coutant <ccoutant@google.com>
6164
6165 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6166 * gold/testsuite/Makefile.in: Regenerate.
6167 * gold/testsuite/justsyms_exec.c: New source file.
6168 * gold/testsuite/justsyms_lib.c: New source file.
6169
9590bf25
CC
61702011-08-01 Cary Coutant <ccoutant@google.com>
6171
6172 * layout.cc (Layout::set_segment_offsets): Don't realign text
6173 segment if -Ttext was specified.
6174 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6175 file type.
6176 * object.h (Sized_relobj_file::e_type): New function.
6177 (Sized_relobj_file::e_type_): New data member.
6178 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6179 base address for ET_EXEC files.
6180 * target.cc (Target::do_make_elf_object_implementation): Allow
6181 ET_EXEC files with --just-symbols option.
6182
dcd8d12e
CC
61832011-07-28 Cary Coutant <ccoutant@google.com>
6184
6185 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6186 Add thread_number parameter.
6187 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6188 * workqueue-threads.cc
6189 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6190 current thread if its thread number is greater than desired thread
6191 count.
6192 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6193 Add thread_number parameter.
6194 (Workqueue::should_cancel_thread): Likewise.
6195 (Workqueue::find_runnable_or_wait): Pass thread_number to
6196 should_cancel_thread.
6197 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6198 parameter.
6199
804eb480
ST
62002011-07-22 Sriraman Tallam <tmsriram@google.com>
6201
6202 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6203 only after checking if it cannot be forced local.
6204 * symtab.h (is_externally_visible): Check if the symbol is not forced
6205 local.
6206
f1ddb600
ILT
62072011-07-15 Ian Lance Taylor <iant@google.com>
6208
6209 * options.h (class General_options): Add --print-output-format.
6210 Move -EL next to -EB, for better --help output.
6211 * target-select.cc: Include <cstdio>, "options.h", and
6212 "parameters.h".
6213 (Target_selector::do_target_bfd_name): New function.
6214 (print_output_format): New function.
6215 * target-select.h (class Target_selector): Update declarations.
6216 (Target_selector::target_bfd_name): New function.
6217 (print_output_format): Declare.
6218 * main.cc: Include "target-select.h".
6219 (main): Handle --print-output-format.
6220 * gold.cc: Include "target-select.h".
6221 (queue_initial_tasks): Handle --print-output-format when there are
6222 no input files.
6223 * parameters.cc (parameters_force_valid_target): Give a better
6224 error message if -EB/-EL does not match target.
6225 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6226 function.
6227
7d172687
ILT
62282011-07-15 Ian Lance Taylor <iant@google.com>
6229
6230 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6231 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6232 (Output_data_plt_i386::do_write): Write address of .dynamic
6233 section to first entry in .got.plt section.
6234 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6235 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6236 Initialize layout_.
6237 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6238 section to first entry in .got.plt section.
6239 * layout.h (Layout::dynamic_section): New function.
6240
e9552f7e
ST
62412011-07-13 Sriraman Tallam <tmsriram@google.com>
6242
6243 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6244 to claim_file call.
6245 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6246 input_section_position_, and input_section_glob_.
6247 (read_layout_from_file): Call function section_ordering_specified.
6248 * layout.h (is_section_ordering_specified): New function.
6249 (section_ordering_specified): New function.
6250 (section_ordering_specified_): New boolean member.
6251 * main.cc(main): Call load_plugins after layout object is defined.
6252 * output.cc (Output_section::add_input_section): Use
6253 function section_ordering_specified to check if section ordering is
6254 needed.
6255 * output.cc (Output_section::add_relaxed_input_section): Use
6256 function section_ordering_specified to check if section ordering is
6257 needed.
6258 (Output_section::update_section_layout): New function.
6259 (Output_section::sort_attached_input_sections): Check if input section
6260 must be reordered.
6261 * output.h (Output_section::update_section_layout): New function.
6262 * plugin.cc (get_section_count): New function.
6263 (get_section_type): New function.
6264 (get_section_name): New function.
6265 (get_section_contents): New function.
6266 (update_section_order): New function.
58797674 6267 (allow_section_ordering): New function.
e9552f7e
ST
6268 (Plugin::load): Add the new interfaces to the transfer vector.
6269 (Plugin_manager::load_plugins): New parameter.
6270 (Plugin_manager::all_symbols_read): New parameter.
6271 (Plugin_manager::claim_file): New parameter. Save the elf object for
6272 unclaimed objects.
6273 (Plugin_manager::get_elf_object): New function.
6274 (Plugin_manager::get_view): Change to directly use the bool to check
6275 if get_view is called from claim_file_hook.
6276 * plugin.h (input_objects): New function
6277 (Plugin__manager::load_plugins): New parameter.
6278 (Plugin_manager::claim_file): New parameter.
6279 (Plugin_manager::get_elf_object): New function.
6280 (Plugin_manager::in_claim_file_handler): New function.
6281 (Plugin_manager::in_claim_file_handler_): New member.
6282 (layout): New function.
6283 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6284 handler with an extra parameter. Make the elf object before calling
6285 claim_file handler.
6286 * testsuite/plugin_test.c (get_section_count): New function pointer.
6287 (get_section_type): New function pointer.
6288 (get_section_name): New function pointer.
6289 (get_section_contents): New function pointer.
6290 (update_section_order): New function pointer.
6291 (allow_section_ordering): New function pointer.
6292 (onload): Check if the new interfaces exist.
6293
9446efde
ILT
62942011-07-13 Ian Lance Taylor <iant@google.com>
6295
6296 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6297 relro section.
6298 * x86_64.cc (Target_x86_64::got_section): Likewise.
6299 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6300 (relro_now_test_SOURCES): New variable.
6301 (relro_now_test_DEPENDENCIES): New variable.
6302 (relro_now_test_LDFLAGS): New variable.
6303 (relro_now_test_LDADD): New variable.
6304 (relro_now_test.so): New target.
6305 * testsuite/Makefile.in: Rebuild.
6306
07aa62f2
ILT
63072011-07-12 Ian Lance Taylor <iant@google.com>
6308
6309 PR gold/12980
6310 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6311 GLOB_DAT relocation rather than a RELATIVE relocation for a
6312 protected symbol when creating a shared library.
6313 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6314 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6315 * testsuite/protected_main_1.cc (main): Test that protected
6316 function has same address.
6317
e2153196
ILT
63182011-07-11 Ian Lance Taylor <iant@google.com>
6319
6320 PR gold/12979
6321 * options.h (class General_options): Add -Bgroup.
6322 * options.cc (General_options::finalize): If -Bgroup is set,
6323 default to --unresolved-symbols=report-all.
6324 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6325 * target-reloc.h (issue_undefined_symbol_error): Handle
6326 --unresolved-symbols=report-all.
6327
6daf5215
ILT
63282011-07-08 Ian Lance Taylor <iant@google.com>
6329
6330 PR gold/11985
6331 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6332 if linker script discards key sections.
6333 (Layout::create_dynamic_symtab): Likewise.
6334 (Layout::assign_local_dynsym_offsets): Likewise.
6335 (Layout::sized_create_version_sections): Likewise.
6336 (Layout::create_interp): Likewise.
6337 (Layout::finish_dynamic_section): Likewise.
6338 (Layout::set_dynamic_symbol_size): Likewise.
6339
beabb2c6
ILT
63402011-07-08 Ian Lance Taylor <iant@google.com>
6341
6342 PR gold/12386
6343 * options.h (class General_options): Add --unresolved-symbols.
6344 * target-reloc.h (issue_undefined_symbol_error): Check
6345 --unresolved-symbols. Add comments.
6346
9c16daf1
ILT
63472011-07-08 Ian Lance Taylor <iant@google.com>
6348
6349 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6350 expression more complex.
6351
191f1a2d
ILT
63522011-07-08 Ian Lance Taylor <iant@google.com>
6353
6354 PR gold/11317
6355 * target-reloc.h (issue_undefined_symbol_error): New inline
6356 function, broken out of relocate_section.
6357 (relocate_section): Call issue_undefined_symbol_error.
6358 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6359 there is no TLS segment if we are about to issue an undefined
6360 symbol error.
6361 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6362
62855347
ILT
63632011-07-08 Ian Lance Taylor <iant@google.com>
6364
6365 PR gold/12279
6366 * resolve.cc (Symbol_table::should_override): Add fromtype
6367 parameter. Change all callers. Give error when linking together
6368 TLS and non-TLS symbol.
6369 (Symbol_table::should_override_with_special): Add fromtype
6370 parameter. Change all callers.
6371 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6372 there is no TLS segment if we have reported some errors.
6373 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6374
67181c72
ILT
63752011-07-08 Ian Lance Taylor <iant@google.com>
6376
6377 PR gold/12372
6378 * target.h (Target::plt_address_for_global): New function.
6379 (Target::plt_address_for_local): New function.
6380 (Target::plt_section_for_global): Remove.
6381 (Target::plt_section_for_local): Remove.
6382 (Target::do_plt_address_for_global): New virtual function.
6383 (Target::do_plt_address_for_local): New virtual function.
6384 (Target::do_plt_section_for_global): Remove.
6385 (Target::do_plt_section_for_local): Remove.
6386 (Target::register_global_plt_entry): Add Symbol_table and Layout
6387 parameters.
6388 * output.cc (Output_data_got::Got_entry::write): Use
6389 plt_address_for_global and plt_address_for_local.
6390 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6391 address of output section.
6392 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6393 got_irelative_, and irelative_count_ fields. Update
6394 declarations.
6395 (Output_data_plt_i386::has_irelative_section): New function.
6396 (Output_data_plt_i386::entry_count): Add irelative_count_.
6397 (Output_data_plt_i386::set_final_data_size): Likewise.
6398 (class Target_i386): Add got_irelative_ and rel_irelative_
6399 fields. Update declarations.
6400 (Target_i386::Target_i386): Initialize new fields.
6401 (Target_i386::do_plt_address_for_global): New function replacing
6402 do_plt_section_for_global.
6403 (Target_i386::do_plt_address_for_local): New function replacing
6404 do_plt_section_for_local.
6405 (Target_i386::got_section): Create got_irelative_.
6406 (Target_i386::rel_irelative_section): New function.
6407 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6408 fields. Don't define __rel_iplt_{start,end}.
6409 (Output_data_plt_i386::add_entry): Add symtab and layout
6410 parameters. Change all callers. Use different PLT and GOT for
6411 IFUNC symbols.
6412 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6413 layout parameters. Change all callers. Use different PLT and
6414 GOT.
6415 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6416 (Output_data_plt_i386::rel_irelative): New function.
6417 (Output_data_plt_i386::address_for_global): New function.
6418 (Output_data_plt_i386::address_for_local): New function.
6419 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6420 IRELATIVE GOT when changing IFUNC GOT entries.
6421 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6422 reloc.
6423 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6424 if we didn't create an IRELATIVE GOT.
6425 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6426 plt_address_for_local.
6427 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6428 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6429 got_irelative_, and irelative_count_ fields. Update
6430 declarations.
6431 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6432 Initialize new fields. Remove symtab parameter. Change all
6433 callers.
6434 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6435 irelative_count_.
6436 (Output_data_plt_x86_64::has_irelative_section): New function.
6437 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6438 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6439 fields. Update declarations.
6440 (Target_x86_64::Target_x86_64): Initialize new fields.
6441 (Target_x86_64::do_plt_address_for_global): New function replacing
6442 do_plt_section_for_global.
6443 (Target_x86_64::do_plt_address_for_local): New function replacing
6444 do_plt_section_for_local.
6445 (Target_x86_64::got_section): Create got_irelative_.
6446 (Target_x86_64::rela_irelative_section): New function.
6447 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6448 all callers. Don't create __rel_iplt_{start,end}.
6449 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6450 parameters. Change all callers. Use different PLT and GOT for
6451 IFUNC symbols.
6452 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6453 layout parameters. Change all callers. Use different PLT and
6454 GOT.
6455 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6456 parameters. Change all callers. Use different PLT and GOT for
6457 IFUNC symbols.
6458 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6459 (Output_data_plt_x86_64::rela_irelative): New function.
6460 (Output_data_plt_x86_64::address_for_global): New function.
6461 (Output_data_plt_x86_64::address_for_local): New function.
6462 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6463 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6464 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6465 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6466 parameters.
6467 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6468 reloc.
6469 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6470 symbols if we didn't create an IRELATIVE GOT.
6471 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6472 plt_address_for_local.
6473 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6474 * testsuite/ifuncvar1.c: New test file.
6475 * testsuite/ifuncvar2.c: New test file.
6476 * testsuite/ifuncvar3.c: New test file.
6477 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6478 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6479 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6480 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6481 * testsuite/Makefile.in: Rebuild.
6482
33c15b45
CC
64832011-07-07 Cary Coutant <ccoutant@google.com>
6484
6485 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6486 (two_file_test_1_ndebug.o): Likewise.
6487 (two_file_test_1b_ndebug.o): Likewise.
6488 (two_file_test_2_ndebug.o): Likewise.
6489 (two_file_test_main_ndebug.o): Likewise.
6490 (incremental_test_2): Link with no-debug versions.
6491
f48b5fb7
CC
64922011-07-06 Cary Coutant <ccoutant@google.com>
6493
6494 * gold/incremental.cc
6495 (Output_section_incremental_inputs::write_info_blocks): Check for
6496 hidden and internal symbols.
6497
221597a5
CC
64982011-07-06 Cary Coutant <ccoutant@google.com>
6499
6500 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6501 Check disposition for startup file.
6502 (Incremental_inputs::report_command_line): Ignore
6503 --incremental-startup-unchanged option.
6504 * options.cc (General_options::parse_incremental_startup_unchanged):
6505 New function.
6506 (General_options::General_options): Initialize new data member.
6507 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6508 (General_options): Add --incremental-startup-unchanged option.
6509 (General_options::incremental_startup_disposition): New function.
6510 (General_options::incremental_startup_disposition_): New data member.
6511
e24719f6
CC
65122011-07-06 Cary Coutant <ccoutant@google.com>
6513
6514 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6515 input file index to Script_info ctor.
6516 (Sized_incremental_binary::do_file_has_changed): Find the
6517 command-line argument for files named in scripts.
6518 * incremental.h (Script_info::Script_info): New ctor
6519 with input file index.
6520 (Script_info::input_file_index): New function.
6521 (Script_info::input_file_index_): New data member.
6522 (Incremental_binary::get_library): Add const.
6523 (Incremental_binary::get_script_info): Add const.
6524 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6525 * testsuite/Makefile.am (incremental_test_5): New test case.
6526 (incremental_test_6): New test case.
6527 * testsuite/Makefile.in: Regenerate.
6528
8f7c81e8
CC
65292011-07-06 Cary Coutant <ccoutant@google.com>
6530
6531 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6532 debug output when command lines differ.
6533
9fbd3822
CC
65342011-07-06 Cary Coutant <ccoutant@google.com>
6535
6536 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6537 --incremental-patch option.
6538 * layout.cc (Free_list::allocate): Extend allocation beyond original
6539 end if enabled.
6540 (Layout::make_output_section): Mark sections that should get
6541 patch space.
6542 * options.cc (parse_percent): New function.
6543 * options.h (parse_percent): New function.
6544 (DEFINE_percent): New macro.
6545 (General_options): Add --incremental-patch option.
6546 * output.cc (Output_section::Output_section): Initialize new data
6547 members.
6548 (Output_section::add_input_section): Print section name when out
6549 of patch space.
6550 (Output_section::add_output_section_data): Likewise.
6551 (Output_section::set_final_data_size): Add patch space when
6552 doing --incremental-full.
6553 (Output_section::do_reset_address_and_file_offset): Remove patch
6554 space.
6555 (Output_segment::set_section_list_addresses): Print debug output
6556 only if --incremental-update.
6557 * output.h (Output_section::set_is_patch_space_allowed): New function.
6558 (Output_section::is_patch_space_allowed_): New data member.
6559 (Output_section::patch_space_): New data member.
6560 * parameters.cc (Parameters::incremental_full): New function.
6561 * parameters.h (Parameters::incremental_full): New function
6562 * testsuite/Makefile.am (incremental_test_2): Add test for
6563 --incremental-patch option.
6564 * testsuite/Makefile.in: Regenerate.
6565 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6566 (t18): Remove function body.
6567
f6cccc2c
DK
65682011-07-05 Doug Kwan <dougkwan@google.com>
6569
6570 PR gold/12771
6571 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6572 Arm_Address type for relocation result.
6573 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6574 overflow check.
6575 (Arm_relocate_functions::abs32): Use unaligned access.
6576 (Arm_relocate_functions::rel32): Ditto.
6577 (Arm_relocate_functions::prel31): Ditto.
6578 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6579 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6580 static data relocations.
6581 * testsuite/Makefile.in: Regnerate.
6582 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6583
28a13fec
ILT
65842011-07-05 Ian Lance Taylor <iant@google.com>
6585
6586 PR gold/12392
6587 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6588 symbols if necessary.
6589 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6590
24d47b34
ILT
65912011-07-05 Ian Lance Taylor <iant@google.com>
6592
6593 PR gold/12952
6594 * resolve.cc (Symbol::override_base_with_special): Simply override
6595 version with special symbol version, ignoring previous version.
6596
41f9cbbe
ILT
65972011-07-05 Ian Lance Taylor <iant@google.com>
6598
6599 * object.cc (Sized_relobj_file::include_section_group): Add
6600 information to comment about signature location.
6601
886288f1
ILT
66022011-07-02 Ian Lance Taylor <iant@google.com>
6603
6604 PR gold/12957
6605 * options.h (class General_options): Add -f and -F.
6606 * options.cc (General_options::finalize): Fatal error if -f/-F
6607 are used without -shared.
6608 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6609
ae3a6d4f
ILT
66102011-07-02 Ian Lance Taylor <iant@google.com>
6611
6612 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6613
21131061
ILT
66142011-07-01 Ian Lance Taylor <iant@google.com>
6615
6616 PR gold/12525
6617 PR gold/12952
6618 * resolve.cc (Symbol::override_base_with_special): Don't override
6619 the version if the overriding symbol has a different name.
6620 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6621 all callers. If we give an error about an undefined version,
6622 define the base version if necessary.
6623 * dynobj.h (class Versions): Update declaration.
6624 * testsuite/weak_alias_test_5.cc: New file.
6625 * testsuite/weak_alias_test.script: New file.
6626 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6627 and versioned_alias have the right value, and call t2.
6628 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6629 weak_alias_test_5.so.
6630 (weak_alias_test_LDADD): Likewise.
6631 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6632 * testsuite/Makefile.in: Rebuild.
6633
611062c0
ILT
66342011-07-01 Ian Lance Taylor <iant@google.com>
6635
6636 PR gold/12525
6637 * options.h (class General_options): Support -z notext.
6638 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6639 -Wl,-z,notext.
6640 (two_file_shared_nonpic.so): Likewise.
6641 (two_file_shared_mixed.so): Likewise.
6642 (two_file_shared_mixed_1.so): Likewise.
6643 (weak_undef_lib_nonpic.so): Likewise.
6644 (alt/weak_undef_lib_nonpic.so): Likewise.
6645 (tls_test_shared_nonpic.so): Likewise.
6646 * testsuite/Makefile.in: Rebuild.
6647
328c7c2f
ILT
66482011-07-01 Ian Lance Taylor <iant@google.com>
6649
6650 PR gold/12525
6651 * configure.ac: Test whether static linking works, setting
6652 the automake conditional HAVE_STATIC.
6653 * testsuite/Makefile.am: Disable tests using -static if
6654 HAVE_STATIC is not true.
6655 * configure, testsuite/Makefile.in: Rebuild.
6656
02d7cd44
ILT
66572011-07-01 Ian Lance Taylor <iant@google.com>
6658
6659 PR gold/12525
6660 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6661 Assert if we see DW_EH_PE_indirect.
6662 * target.h (Target::ehframe_datarel_base): New function.
6663 (Target::do_ehframe_datarel_base): New target function.
6664 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6665 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6666 function.
6667
07a60597
ILT
66682011-07-01 Ian Lance Taylor <iant@google.com>
6669
6670 PR gold/12571
6671 * options.h (class General_options): Add
6672 --ld-generated-unwind-info.
6673 * ehframe.cc (Fde::write): Add address parameter. Change all
6674 callers. If associated with PLT, fill in address and size.
6675 (Cie::set_output_offset): Only add merge mapping if there is an
6676 object.
6677 (Cie::write): Add address parameter. Change all callers.
6678 (Eh_frame::add_ehframe_for_plt): New function.
6679 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6680 input_offset_ fields into union u_, with new plt field.
6681 (Fde::Fde): Adjust for new union field.
6682 (Fde::Fde) [Output_data version]: New constructor.
6683 (Fde::add_mapping): Only add merge mapping if there is an object.
6684 (class Cie): Update declarations.
6685 (class Eh_frame): Declare add_ehframe_for_plt.
6686 * layout.cc (Layout::layout_eh_frame): Break out code into
6687 make_eh_frame_section, and call it.
6688 (Layout::make_eh_frame_section): New function.
6689 (Layout::add_eh_frame_for_plt): New function.
6690 * layout.h (class Layout): Update declarations.
6691 * merge.cc (Merge_map::add_mapping): Add assertion.
6692 * i386.cc: Include "dwarf.h".
6693 (class Output_data_plt_i386): Make first_plt_entry,
6694 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6695 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6696 and plt_eh_frame_fde.
6697 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6698 boundary. Call add_eh_frame_for_plt if appropriate.
6699 * x86_64.cc: Include "dwarf.h".
6700 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6701 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6702 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6703 and plt_eh_frame_fde.
6704 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6705 appropriate.
6706
14788a3f
ILT
67072011-06-29 Ian Lance Taylor <iant@google.com>
6708
6709 PR gold/12629
6710 * object.cc (Sized_relobj_file::layout_section): Change shdr
6711 parameter to be const.
6712 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6713 out of do_layout.
6714 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6715 appropriate. Call layout_eh_frame_section.
6716 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6717 sections.
6718 * object.h (class Sized_relobj_file): Update declarations.
6719
6c21fce1
ILT
67202011-06-29 Ian Lance Taylor <iant@google.com>
6721
37e41b03 6722 PR gold/12652
6c21fce1
ILT
6723 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6724 modifier.
6725 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6726
4d5e4e62
ILT
67272011-06-29 Ian Lance Taylor <iant@google.com>
6728
6729 PR gold/12675
6730 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6731 SHT_X86_64_UNWIND.
6732 * layout.cc (Layout::layout_eh_frame): Likewise.
6733
886f533a
ILT
67342011-06-29 Ian Lance Taylor <iant@google.com>
6735
6736 PR gold/12695
6737 * layout.cc (Layout::symtab_section_shndx): New function.
6738 * layout.h (class Layout): Declare symtab_section_shndx.
6739 * output.cc (Output_section::write_header): Call it.
6740
f3ae1b28
ILT
67412011-06-29 Ian Lance Taylor <iant@google.com>
6742
6743 PR gold/12818
6744 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6745 symbols which are not used in a relocation.
6746
aecf301f
ILT
67472011-06-28 Ian Lance Taylor <iant@google.com>
6748
6749 PR gold/12898
6750 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6751 script create indistinguishable segments.
6752 (Layout::set_segment_offsets): Use stable_sort when sorting
6753 segments. Pass this to Compare_segments constructor.
6754 * layout.h (class Layout): Make segment_precedes non-static.
6755 (class Compare_segments): Change from struct to class. Add
6756 layout_ field. Add constructor.
6757 * script-sections.cc
6758 (Script_sections::attach_sections_using_phdrs_clause): Rename
6759 local orphan to is_orphan. Don't report failure to put empty
6760 section in segment. On attachment failure, report name of
6761 section, and attach to first PT_LOAD segment.
6762
03ef7571
ILT
67632011-06-28 Ian Lance Taylor <iant@google.com>
6764
6765 PR gold/12934
6766 * target-select.cc (Target_selector::Target_selector): Add
6767 emulation parameter. Change all callers.
6768 (select_target_by_bfd_name): Rename from select_target_by_name.
6769 Change all callers.
6770 (select_target_by_emulation): New function.
6771 (supported_emulation_names): New function.
6772 * target-select.h (class Target_selector): Add emulation_ field.
6773 Update declarations.
6774 (Target_selector::recognize_by_bfd_name): Rename from
6775 recognize_by_name. Change all callers.
6776 (Target_selector::supported_bfd_names): Rename from
6777 supported_names. Change all callers.
6778 (Target_selector::recognize_by_emulation): New function.
6779 (Target_selector::supported_emulations): New function.
6780 (Target_selector::emulation): New function.
6781 (Target_selector::do_recognize_by_bfd_name): Rename from
6782 do_recognize_by_name. Change all callers.
6783 (Target_selector::do_supported_bfd_names): Rename from
6784 do_supported_names. Change all callers.
6785 (Target_selector::do_recognize_by_emulation): New function.
6786 (Target_selector::do_supported_emulations): New function.
6787 (select_target_by_bfd_name): Change name in declaration.
6788 (select_target_by_emulation): Declare.
6789 (supported_emulation_names): Declare.
6790 * parameters.cc (parameters_force_valid_target): Try to find
6791 target based on emulation from -m option.
6792 * options.h (class General_options): Change doc string for -m.
6793 * options.cc (help): Print emulations.
6794 (General_options::parse_V): Likewise.
6795 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6796 Add emulation parameter. Change all callers.
6797
200b2bb9
ILT
67982011-06-28 Ian Lance Taylor <iant@google.com>
6799
6800 * target.h (class Target): Add osabi_ field.
6801 (Target::osabi): New function.
6802 (Target::set_osabi): New function.
6803 (Target::Target): Initialize osabi_.
6804 (Target::do_adjust_elf_header): Make pure virtual.
6805 (Sized_target::do_adjust_elf_header): Declare.
6806 * target.cc (Sized_target::do_adjust_elf_header): New function.
6807 (class Sized_target): Instantiate all versions.
6808 * freebsd.h (class Target_freebsd): Remove.
6809 (Target_selector_freebsd::do_recognize): Call set_osabi on
6810 Target.
6811 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6812 (Target_selector_freebsd::set_osabi): Remove.
6813 * i386.cc (class Target_i386): Inherit from Sized_target rather
6814 than Target_freebsd.
6815 * x86_64.cc (class Target_x86_64): Likewise.
6816
b3ce541e
ILT
68172011-06-28 Ian Lance Taylor <iant@google.com>
6818
6819 * target.h (Target::can_check_for_function_pointers): Rewrite.
6820 Make non-virtual.
6821 (Target::can_icf_inline_merge_sections): Likewise.
6822 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6823 (Target::Target_info): Add can_icf_inline_merge_sections field.
6824 (Target::do_can_check_for_function_pointers): New virtual
6825 function.
6826 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6827 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6828 from can_check_for_function_pointers, move in file.
6829 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6830 section_may_have_icf_unsafe_poineters, move in file.
6831 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6832 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6833 Rename from can_check_for_function_pointers, move in file.
6834 (Target_i386::can_icf_inline_merge_sections): Remove.
6835 (Target_i386::i386_info): Initialize
6836 can_icf_inline_merge_sections.
6837 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6838 Initialize can_icf_inline_merge_sections.
6839 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6840 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6841 Rename from can_check_for_function_pointers, move in file.
6842 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6843 (Target_x86_64::x86_64_info): Initialize
6844 can_icf_inline_merge_sections.
6845 * testsuite/testfile.cc (Target_test::test_target_info):
6846 Likewise.
6847 * icf.cc (get_section_contents): Correct formatting.
6848
6d1c4efb
ILT
68492011-06-27 Ian Lance Taylor <iant@google.com>
6850
6851 * symtab.cc (Symbol::versioned_name): New function.
6852 (Symbol_table::add_to_final_symtab): Use versioned_name when
6853 appropriate.
6854 (Symbol_table::sized_write_symbol): Likewise.
6855 * symtab.h (class Symbol): Declare versioned_name.
6856 * stringpool.h (class Stringpool_template): Add variant of add
6857 which takes a std::basic_string.
6858 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6859 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6860 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6861 (ver_test_12.o): New target.
6862 * testsuite/Makefile.in: Rebuild.
6863
57eb9b50
DK
68642011-06-27 Doug Kwan <dougkwan@google.com>
6865
6866 * arm.cc (Arm_relocate_functions::thm_jump8,
6867 Arm_relocate_functions::thm_jump11): Use a wider signed
6868 type to compute offset.
6869 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6870 arm_thm_jump8.
6871 * testsuite/Makefile.in: Regenerate.
6872 * testsuite/arm_branch_in_range.sh: Check test results of
6873 arm_thm_jump11 and arm_thm_jump8.
6874 * testsuite/arm_thm_jump11.s: New test source file.
6875 * testsuite/arm_thm_jump11.t: New linker script.
6876 * testsuite/arm_thm_jump8.s: New test source file.
6877 * testsuite/arm_thm_jump8.t: New linker script.
6878
487b39df
ILT
68792011-06-24 Ian Lance Taylor <iant@google.com>
6880
6881 * layout.cc: Include "object.h".
6882 (ctors_sections_in_init_array): New static variable.
6883 (Layout::is_ctors_in_init_array): New function.
6884 (Layout::layout): Add entry to ctors_sections_in_init_array if
6885 appropriate.
6886 * layout.h (class Layout): Declare is_ctors_in_init_array.
6887 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6888 is_ctors_reverse_view is set.
6889 (Sized_relobj_file::write_sections): Add layout parameter. Change
6890 all callers. Set is_ctors_reverse_view field of View_size.
6891 (Sized_relobj_file::reverse_words): New function.
6892 * object.h (Sized_relobj_file::View_size): Add
6893 is_ctors_reverse_view field.
6894 (class Sized_relobj_file): Update declarations.
6895 * testsuite/initpri3.c: New test.
6896 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6897 initpri3b.
6898 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6899 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6900 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6901 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6902 * testsuite/Makefile.in: Rebuild.
6903
472076e4
CC
69042011-06-24 Cary Coutant <ccoutant@google.com>
6905
6906 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6907 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6908 (debug_msg_cdebug.err): New targets.
6909 * testsuite/Makefile.in: Regenerate.
6910 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6911 Fix checks for link with shared library.
6912
a60af0db
DK
69132011-06-24 Doug Kwan <dougkwan@google.com>
6914
6915 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6916 skip empty text sections.
6917 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6918
5393d741
ILT
69192011-06-22 Ian Lance Taylor <iant@google.com>
6920
6921 PR gold/12910
6922 * options.h (class General_options): Add --ctors-in-init-array.
6923 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6924 friends as SHT_PROGBITS for merging sections.
6925 (Layout::layout): Remove special handling of .init_array and
6926 friends. Don't sort if doing relocatable link. Sort for .ctors
6927 and .dtors if ctors_in_init_array.
6928 (Layout::make_output_section): Force correct section types for
6929 .init_array and friends. Don't sort if doing relocatable link,
6930 Don't sort .ctors and .dtors if ctors_in_init_array.
6931 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6932 (Layout::output_section_name): Add relobj parameter. Change all
6933 callers. Handle .ctors. and .dtors. in code rather than table.
6934 Handle .ctors and .dtors if ctors_in_init_array.
6935 (Layout::match_file_name): New function, moved from output.cc.
6936 * layout.h (class Layout): Update declarations.
6937 * output.cc: Include "layout.h".
6938 (Input_section_sort_entry::get_priority): New function.
6939 (Input_section_sort_entry::match_file_name): Just call
6940 Layout::match_file_name.
6941 (Output_section::Input_section_sort_init_fini_compare::operator()):
6942 Handle .ctors and .dtors. Sort by explicit priority rather than
6943 by name.
6944 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6945 * testsuite/initpri2.c: New test.
6946 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6947 (check_PROGRAMS): Add initpri2.
6948 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6949 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6950 * configure, testsuite/Makefile.in: Rebuild.
6951
e1f74f98
ILT
69522011-06-19 Ian Lance Taylor <iant@google.com>
6953
6954 PR gold/12880
6955 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6956 .interp section to a PT_INTERP segment even if we have seen a
6957 --dynamic-linker option. Don't do it if we have seen a PHDRS
6958 clause in a linker script.
6959 (Layout::finalize): Don't create a .interp section if we've
6960 already create a PT_INTERP segment.
6961 (Layout::create_interp): Always call choose_output_section (revert
6962 patch of 2011-06-17). Don't create PT_INTERP segment.
6963 * script-sections.cc
6964 (Script_sections::create_note_and_tls_segments): Add a .interp
6965 section to a PT_INTERP segment even if we have seen a
6966 --dynamic-linker option.
6967
766f91bb
ILT
69682011-06-18 Ian Lance Taylor <iant@google.com>
6969
6970 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6971 merely because a non-PT_LOAD segment has a dynamic reloc.
6972
0d212c3a
ILT
69732011-06-18 Ian Lance Taylor <iant@google.com>
6974
6975 * layout.cc (Layout::finish_dynamic_section): Don't create
6976 DT_FLAGS entry if not needed.
6977
911a5072
ILT
69782011-06-18 Ian Lance Taylor <iant@google.com>
6979
6980 PR gold/12745
6981 * layout.cc (Layout::layout_eh_frame): Correct handling of
6982 writable .eh_frame section.
6983
534b4e5f
ILT
69842011-06-17 Ian Lance Taylor <iant@google.com>
6985
6986 PR gold/12893
6987 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6988 symbol is redefined with the exact same object and value.
6989
10b4f102
ILT
69902011-06-17 Ian Lance Taylor <iant@google.com>
6991
6992 PR gold/12880
6993 * layout.h (class Layout): Add interp_segment_ field.
6994 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6995 (Layout::attach_allocated_section_to_segment): If making shared
6996 library, put .interp section in PT_INTERP segment.
6997 (Layout::finalize): Also call create_interp if -dynamic-linker
6998 option was used.
6999 (Layout::create_interp): Assert that there is no PT_INTERP
7000 segment. If not using a SECTIONS clause, use make_output_section.
7001 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
7002 * script-sections.cc
7003 (Script_sections::create_note_and_tls_segments): If making shared
7004 library, put .interp section in PT_INTERP segment.
7005
a29b0dad
ILT
70062011-06-17 Ian Lance Taylor <iant@google.com>
7007
e588ea8d
ILT
7008 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
7009 when making a shared library.
7010
70112011-06-17 Ian Lance Taylor <iant@google.com>
7012
7013 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
7014 parameter. Change all callers. Don't issue warning about PC32
7015 against locally defined symbol.
a29b0dad 7016
9d3b0698
ILT
70172011-06-16 Ian Lance Taylor <iant@google.com>
7018
7019 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
7020 occurs in same object.
7021
85b0f90c
AM
70222011-06-14 Alan Modra <amodra@gmail.com>
7023
7024 * po/POTFILES.in: Regenerate.
7025
a94907d9
ILT
70262011-06-09 Ian Lance Taylor <iant@google.com>
7027
7028 * script-sections.cc
7029 (Orphan_output_section::set_section_addresses): For a relocatable
7030 link set address to 0.
7031
4fb3a1c3
CC
70322011-06-09 Cary Coutant <ccoutant@google.com>
7033
7034 PR gold/12804
7035 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
7036 used with --compress-debug-sections.
7037 * gold/object.cc (Sized_relobj_file::do_layout): Report
7038 uncompressed size of compressed input sections.
7039
61220854
CC
70402011-06-08 Cary Coutant <ccoutant@google.com>
7041
7042 PR gold/12804
7043 * testsuite/two_file_test_2_v1.cc: Change initialization of
7044 v2 to keep it in .data.
7045
e6455dfb
CC
70462011-06-07 Cary Coutant <ccoutant@google.com>
7047
7048 * common.cc (Symbol_table::do_allocate_commons_list): Call
7049 gold_fallback.
7050 * errors.cc (Errors::fatal): Adjust call to gold_exit.
7051 (Errors::fallback): New function.
7052 (gold_fallback): New function.
7053 * errors.h (Errors::fallback): New function.
7054 * gold.cc (gold_exit): Change status parameter to enum; adjust
7055 all callers.
7056 (queue_initial_tasks): Call gold_fallback.
7057 * gold.h: Include cstdlib.
7058 (Exit_status): New enum type.
7059 (gold_exit): Change status parameter to enum.
7060 (gold_fallback): New function.
7061 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
7062 (Layout::create_symtab_sections): Likewise.
7063 (Layout::create_shdrs): Likewise.
7064 * main.cc (main): Adjust call to gold_exit.
7065 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
7066 (Output_data_got::add_got_entry_pair): Likewise.
7067 (Output_section::add_input_section): Likewise.
7068 (Output_section::add_output_section_data): Likewise.
7069 (Output_segment::set_section_list_addresses): Likewise.
7070 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
7071
fb0e076f
CC
70722011-06-07 Cary Coutant <ccoutant@google.com>
7073
7074 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7075 for incremental links.
7076 * output.cc (Output_segment::set_section_list_addresses): Remove
7077 FIXME and test for TLS or BSS.
7078
a5ee4d5d
CC
70792011-06-07 Cary Coutant <ccoutant@google.com>
7080
7081 * testsuite/Makefile.am: Add incremental_copy_test,
7082 incremental_common_test_1.
7083 * testsuite/Makefile.in: Regenerate.
7084 * testsuite/common_test_1_v1.c: New source file.
7085 * testsuite/common_test_1_v2.c: New source file.
7086 * testsuite/copy_test_v1.cc: New source file.
7087
5146f448
CC
70882011-06-07 Cary Coutant <ccoutant@google.com>
7089
7090 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7091 update, allocate common from bss section's free list.
7092 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7093 linker-defined symbols.
7094 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7095 Skip GOT and PLT entries that are no longer referenced.
7096 (Output_section_incremental_inputs::write_info_blocks): Mark
7097 linker-defined symbols.
7098 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7099 * output.cc (Output_section::allocate): New function.
7100 * output.h (Output_section::allocate): New function.
7101 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7102 linker-defined symbols.
7103 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7104 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7105 (Symbol::init_base_output_data): Likewise.
7106 (Symbol::init_base_output_segment): Likewise.
7107 (Symbol::init_base_constant): Likewise.
7108 (Sized_symbol::init_output_data): Likewise.
7109 (Sized_symbol::init_output_segment): Likewise.
7110 (Sized_symbol::init_constant): Likewise.
7111 (Symbol_table::do_define_in_output_data): Likewise.
7112 (Symbol_table::do_define_in_output_segment): Likewise.
7113 (Symbol_table::do_define_as_constant): Likewise.
7114 * symtab.h (Symbol::is_predefined): New function.
7115 (Symbol::init_base_output_data): Add is_predefined parameter.
7116 (Symbol::init_base_output_segment): Likewise.
7117 (Symbol::init_base_constant): Likewise.
7118 (Symbol::is_predefined_): New data member.
7119 (Sized_symbol::init_output_data): Add is_predefined parameter.
7120 (Sized_symbol::init_output_segment): Likewise.
7121 (Sized_symbol::init_constant): Likewise.
7122 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7123
26d3c67d
CC
71242011-06-07 Cary Coutant <ccoutant@google.com>
7125
7126 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7127 instead of emit_copy_reloc.
7128 (Copy_relocs::emit_copy_reloc): Refactor.
7129 (Copy_relocs::make_copy_reloc): New function.
7130 (Copy_relocs::add_copy_reloc): Remove.
7131 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7132 section.
7133 (Copy_relocs::make_copy_reloc): New function.
7134 (Copy_relocs::add_copy_reloc): Remove.
7135 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7136 unchanged input files.
7137 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7138 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7139 Reserve BSS space for COPY relocations.
7140 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7141 (Output_section_incremental_inputs::write_info_blocks): Record
7142 whether a symbol is copied from a shared object.
7143 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7144 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7145 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7146 (Incremental_input_entry_reader::get_output_symbol_index): Add
7147 is_copy parameter.
7148 (Incremental_binary::emit_copy_relocs): New function.
7149 (Incremental_binary::do_emit_copy_relocs): New function.
7150 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7151 new data member.
7152 (Sized_incremental_binary::add_copy_reloc): New function.
7153 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7154 (Sized_incremental_binary::Copy_reloc): New struct.
7155 (Sized_incremental_binary::Copy_relocs): New typedef.
7156 (Sized_incremental_binary::copy_relocs_): New data member.
7157 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7158 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7159 * target.h (Sized_target::emit_copy_reloc): New function.
7160 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7161
7cdb37d9
CC
71622011-06-02 Cary Coutant <ccoutant@google.com>
7163
7164 PR gold/12163
7165 * gold/archive.cc (Archive::Archive): Initialize new data member.
7166 (Archive::include_all_members): Return if archive has already been
7167 included.
7168 * gold/archive.h (Archive::include_all_members_): New data member.
7169
cc643b88
NC
71702011-06-02 Nick Clifton <nickc@redhat.com>
7171
7172 * dynobj.h: Fix spelling mistake in comment.
7173 * output.cc: Likewise.
7174
f62a3ca7 71752011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7176 Asier Llano
f62a3ca7
DK
7177
7178 PR gold/12826
cc643b88 7179 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7180 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7181 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7182 redundant arm_exidx_test.so.
7183 * testsuite/Makefile.in: Regenerate.
7184 (check_SCRIPTS): Add pr12826.sh
7185 (check_DATA): Add pr12826.stdout
7186 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7187 * testsuite/pr12826.sh: New file.
7188 * testsuite/pr12826_1.s: Ditto.
7189 * testsuite/pr12826_1.s: Ditto.
7190
8dbe1edc
ILT
71912011-05-30 Ian Lance Taylor <iant@google.com>
7192
7193 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7194 sections.
7195
c49875be
ILT
71962011-05-29 Ian Lance Taylor <iant@google.com>
7197
7198 PR gold/12804
7199 * testsuite/Makefile.am: Use different file name for two_file_test
7200 temporary file for each incremental test.
7201 * testsuite/Makefile.in: Rebuild.
7202
69d53f7a
ILT
72032011-05-29 Ian Lance Taylor <iant@google.com>
7204
7205 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7206 binary input file is empty.
7207
41d0ab5f
ILT
72082011-05-27 Ian Lance Taylor <iant@google.com>
7209
7210 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7211 (ver_test_9.so): Likewise.
7212 * testsuite/Makefile.in: Rebuild.
7213
89d8a36b
CC
72142011-05-26 Cary Coutant <ccoutant@google.com>
7215
7216 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7217 * incremental.cc (Incremental_inputs::report_input_section): Fix
7218 comment, indentation.
7219 (Incremental_inputs::report_comdat_group): New function.
7220 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7221 of data for incremental input file entry.
7222 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7223 group count, COMDAT group signatures.
7224 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7225 an unchanged input file.
7226 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7227 Initialize new data member.
7228 (Incremental_object_entry::add_comdat_group): New function.
7229 (Incremental_object_entry::get_comdat_group_count): New function.
7230 (Incremental_object_entry::get_comdat_signature_key): New function.
7231 (Incremental_object_entry::groups_): New data member.
7232 (Incremental_inputs::report_comdat_group): New function.
7233 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7234 data for incremental input file entry.
7235 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7236 (Incremental_input_entry_reader::get_input_section): Adjust size of
7237 data for incremental input file entry.
7238 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7239 (Incremental_input_entry_reader::get_comdat_group_signature): New
7240 function.
7241 * object.cc (Sized_relobj::include_section_group): Report kept
7242 COMDAT groups for incremental links.
7243
1706a06f
ILT
72442011-05-24 David Meyer <pdox@google.com>
7245
7246 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7247 with name parameter. Add found_name parameter.
7248 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7249 * dirsearch.h (class Dirsearch): Update declaration.
7250
a10ae760
ILT
72512011-05-24 Ian Lance Taylor <iant@google.com>
7252
7253 * archive.cc (Library_base::should_include_member): Pull in object
7254 from archive if it defines the entry symbol.
7255 * parameters.cc (Parameters::entry): New function.
7256 * parameters.h (class Parameters): Declare entry.
7257 * output.h (class Output_file_header): Remove entry_ field.
7258 * output.cc (Output_file_header::Output_file_header): Remove entry
7259 parameter. Change all callers.
7260 (Output_file_header::entry): Use parameters->entry.
7261 * gold.cc (queue_middle_tasks): Likewise.
7262 * plugin.cc (Plugin_hook::run): Likewise.
7263
aa92d6ed
CC
72642011-05-24 Cary Coutant <ccoutant@google.com>
7265
7266 * gold.cc (queue_initial_tasks): Pass incremental base filename
7267 to Output_file::open_base_file; don't print error message.
7268 * incremental-dump.cc (main): Adjust call to
7269 Output_file::open_for_modification.
7270 * incremental-dump.cc (main): Likewise.
7271 * incremental.cc (Incremental_inputs::report_command_line):
7272 Ignore --incremental-base option when comparing command lines.
7273 Ignore parameter when given as separate argument.
7274 * options.h (class General_options): Add --incremental-base.
7275 * output.cc (Output_file::Output_file):
7276 (Output_file::open_base_file): Add base_name and writable parameters;
7277 read base file into new file; print error message here.
7278 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7279 callers.
7280 * output.h (Output_file::open_for_modification): Rename to...
7281 (Output_file::open_base_file): ...this; add base_name and
7282 writable parameters; adjust all callers.
7283 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7284 callers.
7285 * testsuite/Makefile.am (incremental_test_4): Test
7286 --incremental-base.
7287 * testsuite/Makefile.in: Regenerate.
7288
2eedd706
CC
72892011-05-24 Cary Coutant <ccoutant@google.com>
7290
7291 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7292 incremental_test_4.
7293 * testsuite/Makefile.in: Regenerate.
7294 * testsuite/two_file_test_1_v1.cc: New test source file.
7295 * testsuite/two_file_test_1b_v1.cc: New test source file.
7296 * testsuite/two_file_test_2_v1.cc: New test source file.
7297
0f1c85a6
CC
72982011-05-24 Cary Coutant <ccoutant@google.com>
7299
7300 * dynobj.h (Dynobj::do_dynobj): New function.
7301 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7302 flag and soname for shared objects.
7303 * incremental.cc (Incremental_inputs::report_object): Make
7304 either Incremental_object_entry or Incremental_dynobj_entry; add
7305 soname to string table.
7306 (Incremental_inputs::report_input_section): Add assertion.
7307 (Output_section_incremental_inputs::set_final_data_size): Adjust
7308 type of input file entry for shared libraries; adjust size of
7309 shared library info entry.
7310 (Output_section_incremental_inputs::write_input_files): Write
7311 as_needed flag for shared libraries.
7312 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7313 of input file entry for shared libraries; write soname.
7314 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7315 soname from incremental info.
7316 * incremental.h (enum Incremental_input_flags): Add
7317 INCREMENTAL_INPUT_AS_NEEDED.
7318 (Incremental_input_entry::Incremental_input_entry): Initialize new
7319 data member.
7320 (Incremental_input_entry::set_as_needed): New function.
7321 (Incremental_input_entry::as_needed): New function.
7322 (Incremental_input_entry::do_dynobj_entry): New function.
7323 (Incremental_input_entry::as_needed_): New data member.
7324 (Incremental_object_entry::Incremental_object_entry): Don't check
7325 for shared library.
7326 (Incremental_object_entry::do_type): Likewise.
7327 (class Incremental_dynobj_entry): New class.
7328 (Incremental_input_entry_reader::as_needed): New function.
7329 (Incremental_input_entry_reader::get_soname): New function.
7330 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7331 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7332 size of shared library info entry.
58797674 7333 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7334 incremental link when adding DT_NEEDED entries.
7335 * object.h (Object::Object): Initialize new data member.
7336 (Object::dynobj): New function.
7337 (Object::set_as_needed): New function.
7338 (Object::as_needed): New function.
7339 (Object::do_dynobj): New function.
7340 (Object::as_needed_): New data member.
7341
6fa2a40b
CC
73422011-05-24 Cary Coutant <ccoutant@google.com>
7343
7344 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7345 info; adjust display of GOT entries.
7346 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7347 vector of input objects; remove file_status_.
7348 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7349 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7350 got_plt reader; call target hooks to reserve GOT entries.
7351 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7352 of input file info header and GOT info entry.
7353 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7354 relocation info.
7355 (Got_plt_view_info::got_descriptor): Remove.
7356 (Got_plt_view_info::sym_index): New data member.
7357 (Got_plt_view_info::input_index): New data member.
7358 (Local_got_offset_visitor::visit): Write input file index.
7359 (Global_got_offset_visitor::visit): Write 0 for input file index.
7360 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7361 with sym_index and input_index.
7362 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7363 incremental info GOT entry; replace got_descriptor with input_index.
7364 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7365 map from input file index to object.
7366 (Sized_relobj_incr::do_layout): Replace direct data member reference
7367 with accessor function.
7368 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7369 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7370 Adjust size of input file info header.
7371 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7372 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7373 (Incremental_input_entry_reader::get_input_section): Adjust size of
7374 input file info header.
7375 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7376 of incremental info GOT entry.
7377 (Incremental_got_plt_reader::get_got_desc): Remove.
7378 (Incremental_got_plt_reader::get_got_symndx): New function.
7379 (Incremental_got_plt_reader::get_got_input_index): New function.
7380 (Sized_incremental_binary::Sized_incremental_binary): Remove
7381 file_status_; add input_objects_.
7382 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7383 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7384 (Sized_incremental_binary::file_is_unchanged): Remove.
7385 (Sized_incremental_binary::set_input_object): New function.
7386 (Sized_incremental_binary::input_object): New function.
7387 (Sized_incremental_binary::file_status_): Remove.
7388 (Sized_incremental_binary::input_objects_): New data member.
7389 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7390 references.
7391 (Sized_relobj_incr::invalid_address): Move to base class.
7392 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7393 class.
7394 (Sized_relobj_incr::do_output_section_offset): Likewise.
7395 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7396 (Sized_relobj_incr::section_offsets_): Likewise.
7397 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7398 function.
7399 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7400 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7401 with accessor function.
7402 (Sized_relobj_file::do_layout): Likewise.
7403 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7404 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7405 (Sized_relobj_file::compute_final_local_value): Replace refs to
7406 section_offsets_ with accessor function.
7407 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7408 * object.h (Relobj::Relobj): Initialize new data members.
7409 (Relobj::add_dyn_reloc): New function.
7410 (Relobj::first_dyn_reloc): New function.
7411 (Relobj::dyn_reloc_count): New function.
7412 (Relobj::first_dyn_reloc_): New data member.
7413 (Relobj::dyn_reloc_count_): New data member.
7414 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7415 references.
7416 (Sized_relobj::Address): New typedef.
7417 (Sized_relobj::invalid_address): Move here from child class.
7418 (Sized_relobj::Sized_relobj): Initialize new data members.
7419 (Sized_relobj::sized_relobj): New function.
7420 (Sized_relobj::is_output_section_offset_invalid): Move here from
7421 child class.
7422 (Sized_relobj::get_output_section_offset): Likewise.
7423 (Sized_relobj::local_has_got_offset): Likewise.
7424 (Sized_relobj::local_got_offset): Likewise.
7425 (Sized_relobj::set_local_got_offset): Likewise.
7426 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7427 (Sized_relobj::clear_got_offsets): New function.
7428 (Sized_relobj::section_offsets): Move here from child class.
7429 (Sized_relobj::do_output_section_offset): Likewise.
7430 (Sized_relobj::do_set_section_offset): Likewise.
7431 (Sized_relobj::Local_got_offsets): Likewise.
7432 (Sized_relobj::local_got_offsets_): Likewise.
7433 (Sized_relobj::section_offsets_): Likewise.
7434 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7435 references.
7436 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7437 class.
7438 (Sized_relobj_file::sized_relobj): New function
7439 (Sized_relobj_file::local_has_got_offset): Move to base class.
7440 (Sized_relobj_file::local_got_offset): Likewise.
7441 (Sized_relobj_file::set_local_got_offset): Likewise.
7442 (Sized_relobj_file::get_output_section_offset): Likewise.
7443 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7444 (Sized_relobj_file::do_output_section_offset): Likewise.
7445 (Sized_relobj_file::do_set_section_offset): Likewise.
7446 (Sized_relobj_file::Local_got_offsets): Likewise.
7447 (Sized_relobj_file::local_got_offsets_): Likewise.
7448 (Sized_relobj_file::section_offsets_): Likewise.
7449 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7450 (all constructors).
7451 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7452 (Output_reloc::get_symbol_index): Likewise.
7453 (Output_reloc::local_section_offset): Likewise.
7454 (Output_reloc::get_address): Likewise.
7455 (Output_reloc::symbol_value): Likewise.
7456 (Output_data_got::reserve_slot): Move to class definition.
7457 (Output_data_got::reserve_local): New function.
7458 (Output_data_got::reserve_slot_for_global): Remove.
7459 (Output_data_got::reserve_global): New function.
7460 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7461 (all constructors, two instantiations).
7462 (Output_reloc::get_relobj): New function (two instantiations).
7463 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7464 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7465 (Output_data_reloc::add_global): Adjust type of relobj.
7466 (Output_data_reloc::add_global_relative): Likewise.
7467 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7468 (Output_data_reloc::add_local): Likewise.
7469 (Output_data_reloc::add_local_relative): Likewise.
7470 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7471 (Output_data_reloc::add_local_section): Likewise.
7472 (Output_data_reloc::add_output_section): Likewise.
7473 (Output_data_reloc::add_absolute): Likewise.
7474 (Output_data_reloc::add_target_specific): Likewise.
7475 (Output_data_got::reserve_slot): Move definition here.
7476 (Output_data_got::reserve_local): New function.
7477 (Output_data_got::reserve_global): New function.
7478 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7479 section_offsets_ with accessor function.
7480 (Sized_relobj_file::write_sections): Likewise.
7481 (Sized_relobj_file::do_relocate_sections): Likewise.
7482 * target.h (Sized_target::reserve_local_got_entry): New function.
7483 (Sized_target::reserve_global_got_entry): New function.
7484 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7485 (Target_x86_64::reserve_global_got_entry): New function.
7486 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7487
4829d394
CC
74882011-05-23 Cary Coutant <ccoutant@google.com>
7489
7490 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7491 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7492 bit when checking got_type.
7493 * incremental.cc (Sized_incremental_binary::setup_readers):
7494 Store symbol table and string table locations; initialize bit vector
7495 of file status flags.
7496 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7497 unchanged files.
7498 (Sized_incremental_binary::do_process_got_plt): New function.
7499 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7500 (Output_section_incremental_inputs::set_final_data_size): Record
7501 file index for each input file.
7502 (Output_section_incremental_inputs::write_got_plt): Store file index
7503 instead of input entry offset for each GOT entry.
7504 * incremental.h
7505 (Incremental_input_entry::Incremental_input_entry): Initialize new
7506 data member.
7507 (Incremental_input_entry::set_offset): Store file index.
7508 (Incremental_input_entry::get_file_index): New function.
7509 (Incremental_input_entry::file_index_): New data member.
7510 (Incremental_binary::process_got_plt): New function.
7511 (Incremental_binary::do_process_got_plt): New function.
7512 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7513 data members.
7514 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7515 (Sized_incremental_binary::set_file_is_unchanged): New function.
7516 (Sized_incremental_binary::file_is_unchanged): New function.
7517 (Sized_incremental_binary::do_process_got_plt): New function.
7518 (Sized_incremental_binary::file_status_): New data member.
7519 (Sized_incremental_binary::main_symtab_loc_): New data member.
7520 (Sized_incremental_binary::main_strtab_loc_): New data member.
7521 * output.cc (Output_data_got::Got_entry::write): Add case
7522 RESERVED_CODE.
7523 (Output_data_got::add_global): Call add_got_entry.
7524 (Output_data_got::add_global_plt): Likewise.
7525 (Output_data_got::add_global_with_rel): Likewise.
7526 (Output_data_got::add_global_with_rela): Likewise.
7527 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7528 (Output_data_got::add_global_pair_with_rela): Likewise.
7529 (Output_data_got::add_local): Call add_got_entry.
7530 (Output_data_got::add_local_plt): Likewise.
7531 (Output_data_got::add_local_with_rel): Likewise.
7532 (Output_data_got::add_local_with_rela): Likewise.
7533 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7534 (Output_data_got::add_local_pair_with_rela): Likewise.
7535 (Output_data_got::reserve_slot): New function.
7536 (Output_data_got::reserve_slot_for_global): New function.
7537 (Output_data_got::add_got_entry): New function.
7538 (Output_data_got::add_got_entry_pair): New function.
7539 (Output_section::add_output_section_data): Edit FIXME.
7540 * output.h
7541 (Output_section_data_build::Output_section_data_build): New
7542 constructor with size parameter.
7543 (Output_data_space::Output_data_space): Likewise.
7544 (Output_data_got::Output_data_got): Initialize new data member; new
7545 constructor with size parameter.
7546 (Output_data_got::add_constant): Call add_got_entry.
7547 (Output_data_got::reserve_slot): New function.
7548 (Output_data_got::reserve_slot_for_global): New function.
7549 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7550 (Output_data_got::add_got_entry): New function.
7551 (Output_data_got::add_got_entry_pair): New function.
7552 (Output_data_got::free_list_): New data member.
7553 * target.h (Sized_target::init_got_plt_for_update): New function.
7554 (Sized_target::register_global_plt_entry): New function.
7555 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7556 Initialize new data member; call init; add constructor with PLT count.
7557 (Output_data_plt_x86_64::init): New function.
7558 (Output_data_plt_x86_64::add_relocation): New function.
7559 (Output_data_plt_x86_64::reserve_slot): New function.
7560 (Output_data_plt_x86_64::free_list_): New data member.
7561 (Target_x86_64::init_got_plt_for_update): New function.
7562 (Target_x86_64::register_global_plt_entry): New function.
7563 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7564 incremental updates.
7565 (Output_data_plt_x86_64::add_relocation): New function.
7566 * testsuite/object_unittest.cc (Object_test): Set default options.
7567
ec69d6da
ILT
75682011-05-16 Ian Lance Taylor <iant@google.com>
7569
7570 * options.h (class General_options): Make -i a synonym for -r.
7571
732e31de
ILT
75722011-05-16 Ian Lance Taylor <iant@google.com>
7573
7574 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7575
403676b5
CC
75762011-05-10 Cary Coutant <ccoutant@google.com>
7577
7578 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7579 strip_all (-s).
7580
5b7b7d6e
ILT
75812011-05-06 Ian Lance Taylor <iant@google.com>
7582
7583 * layout.cc (Layout::layout): If the output section flags change,
7584 update the ordering.
7585
f0f9babf
CC
75862011-04-25 Cary Coutant <ccoutant@google.com>
7587
7588 * incremental-dump.cc (dump_incremental_inputs): Print local
7589 symbol info for each input file.
7590 * incremental.cc
7591 (Output_section_incremental_inputs::set_final_data_size): Add local
7592 symbol info to input file entries in incremental info.
7593 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7594 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7595 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7596 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7597 implementation.
7598 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7599 (Sized_incr_relobj::do_relocate): Write the local symbols.
7600 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7601 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7602 Adjust size of input file header.
7603 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7604 (Incremental_inputs_reader::get_local_symbol_count): New function.
7605 (Incremental_inputs_reader::get_input_section): Adjust size of input
7606 file header.
7607 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7608 (Sized_incr_relobj::This): New typedef.
7609 (Sized_incr_relobj::sym_size): New const data member.
7610 (Sized_incr_relobj::Local_symbol): New struct.
7611 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7612 (Sized_incr_relobj::do_local_symbol_offset): New function.
7613 (Sized_incr_relobj::local_symbol_count_): New data member.
7614 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7615 (Sized_incr_relobj::local_symbol_index_): New data member.
7616 (Sized_incr_relobj::local_symbol_offset_): New data member.
7617 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7618 (Sized_incr_relobj::local_symbols_): New data member.
7619 * object.h (Relobj::output_local_symbol_count): New function.
7620 (Relobj::local_symbol_offset): New function.
7621 (Relobj::do_output_local_symbol_count): New function.
7622 (Relobj::do_local_symbol_offset): New function.
7623 (Sized_relobj::do_output_local_symbol_count): New function.
7624 (Sized_relobj::do_local_symbol_offset): New function.
7625
d0a9ace3
ILT
76262011-04-22 Vladimir Simonov <sv@sw.ru>
7627
7628 * descriptors.cc (set_close_on_exec): New function.
7629 (Descriptors::open): Use set_close_on_exec.
7630 * output.cc (S_ISLNK): Define if not defined.
7631
94a3fc8b
CC
76322011-04-22 Cary Coutant <ccoutant@google.com>
7633
7634 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7635 global symbol map.
7636 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7637 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7638 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7639 relocations.
7640 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7641 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7642 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7643 * incremental.h
7644 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7645 function.
7646 (Incremental_binary::apply_incremental_relocs): New function.
7647 (Incremental_binary::do_apply_incremental_relocs): New function.
7648 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7649 data member.
7650 (Sized_incremental_binary::add_global_symbol): New function.
7651 (Sized_incremental_binary::global_symbol): New function.
7652 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7653 (Sized_incremental_binary::symbol_map_): New data member.
7654 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7655 * target.h (Sized_target::apply_relocation): New function.
7656 * target-reloc.h (apply_relocation): New function.
7657 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7658
c87e4302
DK
76592011-04-22 Doug Kwan <dougkwan@google.com>
7660
7661 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7662 flag of a SHT_ARM_EXIDX section.
2e702c99 7663 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7664 * testsuite/Makefile.in: Regenerate.
7665 * testsuite/arm_exidx_test.s: New file.
7666 * testsuite/arm_exidx_test.sh: Same.
7667
e7782cf6
CC
76682011-04-20 Cary Coutant <ccoutant@google.com>
7669
7670 PR gold/12689
7671 * archive.h (Incremental_archive_entry::Archive_member):
7672 Initialize arg_serial_ (second constructor).
7673
308ecdc7
ILT
76742011-04-17 Ian Lance Taylor <iant@google.com>
7675
7676 * object.cc (Relocate_info::location): Simplify location string.
7677 * errors.cc (Errors::error_at_location): Don't print program
7678 name.
7679 (Errors::warning_at_location): Likewise.
7680 (Errors::undefined_symbol): Likewise.
7681 * testsuite/debug_msg.sh: Update accordingly.
7682
bec5b579
CC
76832011-04-14 Cary Coutant <ccoutant@google.com>
7684
7685 * gold/layout.cc (Layout::symtab_section_offset): New function.
7686 * gold/layout.h (Layout::symtab_section_offset): New function.
7687 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7688
88597d34
ILT
76892011-04-12 Ian Lance Taylor <iant@google.com>
7690
7691 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7692 with MREMAP_MAYMOVE.
7693 * output.h (class Output_file): Add map_is_allocated_ field.
7694 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7695 not available, provide stubs. If mremap is not available, #define
7696 it to gold_mremap.
7697 (MREMAP_MAYMOVE): Define if not defined.
7698 (Output_file::Output_file): Initialize map_is_allocated_.
7699 (Output_file::resize): Check map_is_allocated_.
7700 (Output_file::map_anonymous): If mmap fails, use malloc.
7701 (Output_file::unmap): Don't do anything for an anonymous map.
7702 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7703 is not available, provide stubs.
7704 (File_read::View::~View): Use free rather than delete[].
7705 (File_read::make_view): Use malloc rather than new[]. If mmap
7706 fails, use malloc.
7707 (File_read::find_or_make_view): Use malloc rather than new[].
7708 * gold.h: Remove HAVE_REMAP code.
7709 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7710 exists. Rename mremap to gold_mremap. If mmap is not available
7711 don't do anything.
7712 * configure, config.in: Rebuild.
7713
11e361bc
ILT
77142011-04-11 Ian Lance Taylor <iant@google.com>
7715
7716 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7717 initialize local variable v.
7718
cdc29364
CC
77192011-04-11 Cary Coutant <ccoutant@google.com>
7720
7721 * archive.cc (Archive::include_member): Adjust call to
7722 report_object.
7723 (Add_archive_symbols::run): Track argument serial numbers.
7724 (Lib_group::include_member): Likewise.
7725 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7726 * archive.h (Incremental_archive_entry::Archive_member):
7727 Initialize arg_serial_.
7728 (Archive_member::arg_serial_): New data member.
7729 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7730 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7731 incremental link.
7732 (Sized_dynobj::do_for_all_local_got_entries): New function.
7733 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7734 function.
7735 * fileread.cc (get_mtime): New function.
7736 * fileread.h (get_mtime): New function.
7737 * gold.cc (queue_initial_tasks): Check for incremental update.
7738 (process_incremental_input): New function.
7739 (queue_middle_tasks): Don't force valid target for incremental
7740 update.
7741 * incremental-dump.cc (find_input_containing_global): Adjust
7742 size of symbol info entry.
7743 (dump_incremental_inputs): Dump argument serial number and
7744 in_system_directory flag; bias shndx by 1; print symbol names
7745 when dumping per-file symbol lists; use new symbol info readers.
7746 * incremental.cc
7747 (Output_section_incremental_inputs:update_data_size): New function.
7748 (Sized_incremental_binary::setup_readers): Setup input readers
7749 for each input file; build maps for files added from libraries
7750 and scripts.
7751 (Sized_incremental_binary::check_input_args): New function.
7752 (Sized_incremental_binary::do_check_inputs): Build map of argument
7753 serial numbers to input arguments.
7754 (Sized_incremental_binary::do_file_has_changed): Rename
7755 do_file_is_unchanged to this; compare file modification times.
7756 (Sized_incremental_binary::do_init_layout): New function.
7757 (Sized_incremental_binary::do_reserve_layout): New function.
7758 (Sized_incremental_binary::do_get_input_reader): Remove.
7759 (Sized_incremental_binary::get_symtab_view): New function.
7760 (Incremental_checker::can_incrementally_link_output_file): Remove.
7761 (Incremental_inputs::report_command_line): Exclude --debug options.
7762 (Incremental_inputs::report_archive_begin): Add parameter; track
7763 argument serial numbers; don't put input file entry for archive
7764 before archive members.
7765 (Incremental_inputs::report_archive_end): Put input file entry
7766 for archive after archive members.
7767 (Incremental_inputs::report_object): Add parameter; track argument
7768 serial numbers and in_system_directory flag.
7769 (Incremental_inputs::report_script): Add parameter; track argument
7770 serial numbers.
7771 (Output_section_incremental_inputs::set_final_data_size): Adjust
7772 size of symbol info entry; check for forwarding symbols.
7773 (Output_section_incremental_inputs::write_input_files): Write
7774 in_system_directory flag and argument serial number.
7775 (Output_section_incremental_inputs::write_info_blocks): Map section
7776 indices between incremental info and original input file; store
7777 input section index for each symbol.
7778 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7779 change operator() to visit().
7780 (class Global_got_offset_visitor): Likewise.
7781 (class Global_symbol_visitor_got_plt):
7782 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7783 classes.
7784 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7785 (Sized_incr_relobj::do_read_symbols): New function.
7786 (Sized_incr_relobj::do_layout): New function.
7787 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7788 (Sized_incr_relobj::do_add_symbols): New function.
7789 (Sized_incr_relobj::do_should_include_member): New function.
7790 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7791 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7792 (Sized_incr_relobj::do_section_size): New function.
7793 (Sized_incr_relobj::do_section_name): New function.
7794 (Sized_incr_relobj::do_section_contents): New function.
7795 (Sized_incr_relobj::do_section_flags): New function.
7796 (Sized_incr_relobj::do_section_entsize): New function.
7797 (Sized_incr_relobj::do_section_address): New function.
7798 (Sized_incr_relobj::do_section_type): New function.
7799 (Sized_incr_relobj::do_section_link): New function.
7800 (Sized_incr_relobj::do_section_info): New function.
7801 (Sized_incr_relobj::do_section_addralign): New function.
7802 (Sized_incr_relobj::do_initialize_xindex): New function.
7803 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7804 (Sized_incr_relobj::do_read_relocs): New function.
7805 (Sized_incr_relobj::do_gc_process_relocs): New function.
7806 (Sized_incr_relobj::do_scan_relocs): New function.
7807 (Sized_incr_relobj::do_count_local_symbols): New function.
7808 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7809 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7810 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7811 (Sized_incr_relobj::do_relocate): New function.
7812 (Sized_incr_relobj::do_set_section_offset): New function.
7813 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7814 (Sized_incr_dynobj::do_read_symbols): New function.
7815 (Sized_incr_dynobj::do_layout): New function.
7816 (Sized_incr_dynobj::do_add_symbols): New function.
7817 (Sized_incr_dynobj::do_should_include_member): New function.
7818 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7819 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7820 (Sized_incr_dynobj::do_section_size): New function.
7821 (Sized_incr_dynobj::do_section_name): New function.
7822 (Sized_incr_dynobj::do_section_contents): New function.
7823 (Sized_incr_dynobj::do_section_flags): New function.
7824 (Sized_incr_dynobj::do_section_entsize): New function.
7825 (Sized_incr_dynobj::do_section_address): New function.
7826 (Sized_incr_dynobj::do_section_type): New function.
7827 (Sized_incr_dynobj::do_section_link): New function.
7828 (Sized_incr_dynobj::do_section_info): New function.
7829 (Sized_incr_dynobj::do_section_addralign): New function.
7830 (Sized_incr_dynobj::do_initialize_xindex): New function.
7831 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7832 (make_sized_incremental_object): New function.
7833 (Incremental_library::copy_unused_symbols): New function.
7834 (Incremental_library::do_for_all_unused_symbols): New function.
7835 * incremental.h (enum Incremental_input_flags): New type.
7836 (class Incremental_checker): Remove.
7837 (Incremental_input_entry::Incremental_input_entry): Add argument
7838 serial number.
7839 (Incremental_input_entry::arg_serial): New function.
7840 (Incremental_input_entry::set_is_in_system_directory): New function.
7841 (Incremental_input_entry::is_in_system_directory): New function.
7842 (Incremental_input_entry::arg_serial_): New data member.
7843 (Incremental_input_entry::is_in_system_directory_): New data member.
7844 (class Script_info): Move here from script.h.
7845 (Script_info::Script_info): Add filename parameter.
7846 (Script_info::filename): New function.
7847 (Script_info::filename_): New data member.
7848 (Incremental_script_entry::Incremental_script_entry): Add argument
7849 serial number.
7850 (Incremental_object_entry::Incremental_object_entry): Likewise.
7851 (Incremental_object_entry::add_input_section): Build list of input
7852 sections with map to original shndx.
7853 (Incremental_object_entry::get_input_section_index): New function.
7854 (Incremental_object_entry::shndx_): New data member.
7855 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7856 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7857 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7858 serial number.
7859 (Incremental_inputs::report_archive_begin): Likewise.
7860 (Incremental_inputs::report_object): Likewise.
7861 (Incremental_inputs::report_script): Likewise.
7862 (class Incremental_global_symbol_reader): New class.
7863 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7864 and store flags and input file type.
7865 (Incremental_input_entry_reader::arg_serial): New function.
7866 (Incremental_input_entry_reader::type): Extract type from flags.
7867 (Incremental_input_entry_reader::is_in_system_directory): New function.
7868 (Incremental_input_entry_reader::get_input_section_count): Call
7869 accessor function for type.
7870 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7871 function for type; adjust size of global symbol entry.
7872 (Incremental_input_entry_reader::get_global_symbol_count): Call
7873 accessor function for type.
7874 (Incremental_input_entry_reader::get_object_count): Likewise.
7875 (Incremental_input_entry_reader::get_object_offset): Likewise.
7876 (Incremental_input_entry_reader::get_member_count): Likewise.
7877 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7878 (Incremental_input_entry_reader::get_member_offset): Likewise.
7879 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7880 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7881 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7882 (Incremental_input_entry_reader::get_global_symbol_reader): New
7883 function.
7884 (Incremental_input_entry_reader::get_output_symbol_index): New
7885 function.
7886 (Incremental_input_entry_reader::type_): Remove.
7887 (Incremental_input_entry_reader::flags_): New data member.
7888 (Incremental_inputs_reader::input_file_offset): New function.
7889 (Incremental_inputs_reader::input_file_index): New function.
7890 (Incremental_inputs_reader::input_file): Call input_file_offset.
7891 (Incremental_inputs_reader::input_file_at_offset): New function.
7892 (Incremental_relocs_reader::get_r_type): Reformat.
7893 (Incremental_relocs_reader::get_r_shndx): Reformat.
7894 (Incremental_relocs_reader::get_r_offset): Reformat.
7895 (Incremental_relocs_reader::data): New function.
7896 (Incremental_binary::Incremental_binary): Initialize new data members.
7897 (Incremental_binary::check_inputs): Add cmdline parameter.
7898 (Incremental_binary::file_is_unchanged): Remove.
7899 (Input_reader::arg_serial): New function.
7900 (Input_reader::get_unused_symbol_count): New function.
7901 (Input_reader::get_unused_symbol): New function.
7902 (Input_reader::do_arg_serial): New function.
7903 (Input_reader::do_get_unused_symbol_count): New function.
7904 (Input_reader::do_get_unused_symbol): New function.
7905 (Incremental_binary::input_file_count): New function.
7906 (Incremental_binary::get_input_reader): Change signature to use
7907 index instead of filename.
7908 (Incremental_binary::file_has_changed): New function.
7909 (Incremental_binary::get_input_argument): New function.
7910 (Incremental_binary::get_library): New function.
7911 (Incremental_binary::get_script_info): New function.
7912 (Incremental_binary::init_layout): New function.
7913 (Incremental_binary::reserve_layout): New function.
7914 (Incremental_binary::output_file): New function.
7915 (Incremental_binary::do_check_inputs): New function.
7916 (Incremental_binary::do_file_is_unchanged): Remove.
7917 (Incremental_binary::do_file_has_changed): New function.
7918 (Incremental_binary::do_init_layout): New function.
7919 (Incremental_binary::do_reserve_layout): New function.
7920 (Incremental_binary::do_input_file_count): New function.
7921 (Incremental_binary::do_get_input_reader): Change signature.
7922 (Incremental_binary::input_args_map_): New data member.
7923 (Incremental_binary::library_map_): New data member.
7924 (Incremental_binary::script_map_): New data member.
7925 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7926 new data members.
7927 (Sized_incremental_binary::output_section): New function.
7928 (Sized_incremental_binary::inputs_reader): Add const.
7929 (Sized_incremental_binary::symtab_reader): Add const.
7930 (Sized_incremental_binary::relocs_reader): Add const.
7931 (Sized_incremental_binary::got_plt_reader): Add const.
7932 (Sized_incremental_binary::get_symtab_view): New function.
7933 (Sized_incremental_binary::Inputs_reader): New typedef.
7934 (Sized_incremental_binary::Input_entry_reader): New typedef.
7935 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7936 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7937 (Sized_incremental_binary::do_file_has_changed): New function.
7938 (Sized_incremental_binary::do_init_layout): New function.
7939 (Sized_incremental_binary::do_reserve_layout): New function.
7940 (Sized_input_reader::Inputs_reader): Remove.
7941 (Sized_input_reader::Input_entry_reader): Remove.
7942 (Sized_input_reader::do_arg_serial): New function.
7943 (Sized_input_reader::do_get_unused_symbol_count): New function.
7944 (Sized_input_reader::do_get_unused_symbol): New function.
7945 (Sized_incremental_binary::do_input_file_count): New function.
7946 (Sized_incremental_binary::do_get_input_reader): Change signature;
7947 use index instead of filename.
7948 (Sized_incremental_binary::section_map_): New data member.
7949 (Sized_incremental_binary::input_entry_readers_): New data member.
7950 (class Sized_incr_relobj): New class.
7951 (class Sized_incr_dynobj): New class.
7952 (make_sized_incremental_object): New function.
7953 (class Incremental_library): New class.
7954 * layout.cc (Free_list::num_lists): New static data member.
7955 (Free_list::num_nodes): New static data member.
7956 (Free_list::num_removes): New static data member.
7957 (Free_list::num_remove_visits): New static data member.
7958 (Free_list::num_allocates): New static data member.
7959 (Free_list::num_allocate_visits): New static data member.
7960 (Free_list::init): New function.
7961 (Free_list::remove): New function.
7962 (Free_list::allocate): New function.
7963 (Free_list::dump): New function.
7964 (Free_list::print_stats): New function.
7965 (Layout_task_runner::run): Resize output file for incremental updates.
7966 (Layout::Layout): Initialize new data members.
7967 (Layout::set_incremental_base): New function.
7968 (Layout::init_fixed_output_section): New function.
7969 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7970 incremental updates.
7971 (Layout::create_gold_note): Do not create gold note section for
7972 incremental updates.
7973 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7974 for incremental updates.
7975 (Layout::set_section_offsets): For incremental updates, allocate space
7976 from free list.
7977 (Layout::create_symtab_sections): Layout with offsets relative to
7978 start of section; for incremental updates, allocate space from free
7979 list.
7980 (Layout::create_shdrs): For incremental updates, allocate space from
7981 free list.
7982 (Layout::finish_dynamic_section): For incremental updates, do not
7983 check --as-needed (fixed in subsequent patch).
7984 * layout.h (class Free_list): New class.
7985 (Layout::set_incremental_base): New function.
7986 (Layout::incremental_base): New function.
7987 (Layout::init_fixed_output_section): New function.
7988 (Layout::allocate): New function.
7989 (Layout::incremental_base_): New data member.
7990 (Layout::free_list_): New data member.
7991 * main.cc (main): Print Free_list statistics.
7992 * object.cc (Relobj::finalize_incremental_relocs): Add
7993 clear_counts parameter; clear counts only when clear_counts is set.
7994 (Sized_relobj::Sized_relobj): Initialize new base class.
7995 (Sized_relobj::do_layout): Don't report special sections.
7996 (Sized_relobj::do_for_all_local_got_entries): New function.
7997 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7998 symtab_off to all symbol table offsets.
7999 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
8000 * object.h (class Got_offset_list): Move to top of file.
8001 (Object::Object): Allow case where input_file == NULL.
8002 (Object::~Object): Likewise.
8003 (Object::input_file): Assert that input_file != NULL.
8004 (Object::lock): Allow case where input_file == NULL.
8005 (Object::unlock): Likewise.
8006 (Object::is_locked): Likewise.
8007 (Object::token): Likewise.
8008 (Object::release): Likewise.
8009 (Object::is_incremental): New function.
8010 (Object::get_mtime): New function.
8011 (Object::for_all_local_got_entries): New function.
8012 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
8013 (Object::set_is_in_system_directory): New function.
8014 (Object::is_in_system_directory): New function.
8015 (Object::do_is_incremental): New function.
8016 (Object::do_get_mtime): New function.
8017 (Object::do_for_all_local_got_entries): New function.
8018 (Object::is_in_system_directory_): New data member.
8019 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
8020 (class Sized_relobj_base): New class.
8021 (class Sized_relobj): Derive from Sized_relobj_base.
8022 (class Sized_relobj::Symbols): Redeclare from base class.
8023 (class Sized_relobj::local_got_offset_list): Remove.
8024 (class Sized_relobj::Output_sections): Redeclare from base class.
8025 (class Sized_relobj::do_for_all_local_got_entries): New function.
8026 (class Sized_relobj::write_local_symbols): Add offset parameter.
8027 (class Sized_relobj::local_symbol_offset_): Update comment.
8028 (class Sized_relobj::local_dynsym_offset_): Update comment.
8029 * options.cc (Input_arguments::add_file): Remove const.
8030 * options.h (Input_file_argument::Input_file_argument):
8031 Initialize arg_serial_ (all constructors).
8032 (Input_file_argument::set_arg_serial): New function.
8033 (Input_file_argument::arg_serial): New function.
8034 (Input_file_argument::arg_serial_): New data member.
8035 (Input_arguments::Input_arguments): Initialize file_count_.
8036 (Input_arguments::add_file): Remove const.
8037 (Input_arguments::number_of_input_files): New function.
8038 (Input_arguments::file_count_): New data member.
8039 (Command_line::number_of_input_files): Call
8040 Input_arguments::number_of_input_files.
8041 * output.cc (Output_segment_headers::Output_segment_headers):
8042 Set current size.
8043 (Output_section::Input_section::current_data_size): New function.
8044 (Output_section::Output_section): Initialize new data members.
8045 (Output_section::add_input_section): Don't do merge sections for
8046 an incremental link; allocate space from free list for an
8047 incremental update.
8048 (Output_section::add_output_section_data): Allocate space from
8049 free list for an incremental update.
8050 (Output_section::update_data_size): New function.
8051 (Output_section::set_fixed_layout): New function.
8052 (Output_section::reserve): New function.
8053 (Output_segment::set_section_addresses): Remove const.
8054 (Output_segment::set_section_list_addresses): Remove const; allocate
8055 space from free list for an incremental update.
8056 (Output_segment::set_offset): Adjust size of RELRO segment for an
8057 incremental update.
8058 * output.h (Output_data::current_data_size): Move here from
8059 child classes.
8060 (Output_data::pre_finalize_data_size): New function.
8061 (Output_data::update_data_size): New function.
8062 (Output_section_headers::update_data_size): new function.
8063 (Output_section_data_build::current_data_size): Move to Output_data.
8064 (Output_data_strtab::update_data_size): New function.
8065 (Output_section::current_data_size): Move to Output_data.
8066 (Output_section::set_fixed_layout): New function.
8067 (Output_section::has_fixed_layout): New function.
8068 (Output_section::reserve): New function.
8069 (Output_section::update_data_size): New function.
8070 (Output_section::has_fixed_layout_): New data member.
8071 (Output_section::free_list_): New data member.
8072 (Output_segment::set_section_addresses): Remove const.
8073 (Output_segment::set_section_list_addresses): Remove const.
8074 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8075 New function.
8076 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8077 New function.
8078 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8079 parameter when calling Add_symbols constructor; store argument
8080 serial number for members of a lib group.
8081 (Add_symbols::locks): Allow case where token == NULL.
8082 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8083 (Read_member::~Read_member): New function.
8084 (Read_member::is_runnable): New function.
8085 (Read_member::locks): New function.
8086 (Read_member::run): New function.
8087 (Check_script::~Check_script): New function.
8088 (Check_script::is_runnable): New function.
8089 (Check_script::locks): New function.
8090 (Check_script::run): New function.
8091 (Check_library::~Check_library): New function.
8092 (Check_library::is_runnable): New function.
8093 (Check_library::locks): New function.
8094 (Check_library::run): New function.
8095 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8096 (Add_symbols::library_): New data member.
8097 (class Read_member): New class.
8098 (class Check_script): New class.
8099 (class Check_library): New class.
8100 * reloc.cc (Read_relocs::is_runnable): Allow case where
8101 token == NULL.
8102 (Read_relocs::locks): Likewise.
8103 (Scan_relocs::locks): Likewise.
8104 (Relocate_task::locks): Likewise.
8105 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8106 to clear counters.
8107 (Sized_relobj::incremental_relocs_scan): Fix comment.
8108 (Sized_relobj::do_relocate): Pass output file offset to
8109 write_local_symbols.
8110 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8111 from class declaration.
8112 * script.cc (read_input_script): Allocate Script_info; pass
8113 argument serial number to report_script.
8114 * script.h (class Script_info): Move to incremental.h.
8115 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8116 * symtab.h (Symbol_table::add_from_incrobj): New function.
8117 (Symbol_table::set_file_offset): New function.
8118
b961d0d7
CC
81192011-04-05 Cary Coutant <ccoutant@google.com>
8120
8121 * incremental-dump.cc (dump_incremental_inputs): Change signature
8122 to take a Sized_incremental_binary; change caller. Use readers
8123 in Sized_incremental_binary.
8124 * incremental.cc
8125 (Sized_incremental_binary::find_incremental_inputs_sections):
8126 Rename do_find_incremental_inputs_sections to this.
8127 (Sized_incremental_binary::setup_readers): New function.
8128 (Sized_incremental_binary::do_check_inputs): Check
8129 has_incremental_info_ flag; move setup code to setup_readers;
8130 use input readers.
8131 (Sized_incremental_binary::do_file_is_unchanged): New function.
8132 (Sized_incremental_binary::do_get_input_reader): New function.
8133 * incremental.h (class Incremental_binary): Move to end of file.
8134 (Incremental_binary::file_is_unchanged): New function.
8135 (Incremental_binary::do_file_is_unchanged): New function.
8136 (Incremental_binary::Input_reader): New class.
8137 (Incremental_binary::get_input_reader): New function.
8138 (class Sized_incremental_binary): Move to end of file.
8139 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8140 input section reader classes.
8141 (Sized_incremental_binary::has_incremental_info): New function.
8142 (Sized_incremental_binary::inputs_reader): New function.
8143 (Sized_incremental_binary::symtab_reader): New function.
8144 (Sized_incremental_binary::relocs_reader): New function.
8145 (Sized_incremental_binary::got_plt_reader): New function.
8146 (Sized_incremental_binary::do_file_is_unchanged): New function.
8147 (Sized_incremental_binary::Sized_input_reader): New class.
8148 (Sized_incremental_binary::get_input_reader): New function.
8149 (Sized_incremental_binary::find_incremental_inputs_sections):
8150 Rename do_find_incremental_inputs_sections to this.
8151 (Sized_incremental_binary::setup_readers): New function.
8152 (Sized_incremental_binary::has_incremental_info_): New data member.
8153 (Sized_incremental_binary::inputs_reader_): New data member.
8154 (Sized_incremental_binary::symtab_reader_): New data member.
8155 (Sized_incremental_binary::relocs_reader_): New data member.
8156 (Sized_incremental_binary::got_plt_reader_): New data member.
8157 (Sized_incremental_binary::current_input_file_): New data member.
8158
a869183f
PP
81592011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8160
8161 PR gold/12640
8162 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8163 violation.
8164
81652011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8166
8167 * archive.cc (Archive::include_member): Adjust call to report_object.
8168 (Add_archive_symbols::run): Add script_info to call to
8169 report_archive_begin.
8170 (Lib_group::include_member): Adjust call to report_object.
8171 (Add_lib_group_symbols::run): Adjust call to report_object.
8172 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8173 blocks. Add object count for script input files.
8174 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8175 script_info parameter; change all callers.
8176 (Incremental_inputs::report_object): Add script_info parameter;
8177 change all callers.
8178 (Incremental_inputs::report_script): Store backpointer to
8179 incremental info entry.
8180 (Output_section_incremental_inputs::set_final_data_size): Record
8181 additional information for scripts.
8182 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8183 * incremental.h (Incremental_script_entry::add_object): New function.
8184 (Incremental_script_entry::get_object_count): New function.
8185 (Incremental_script_entry::get_object): New function.
8186 (Incremental_script_entry::objects_): New data member; adjust
8187 constructor.
8188 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8189 (Incremental_inputs::report_object): Add script_info parameter.
8190 (Incremental_inputs_reader::get_object_count): New function.
8191 (Incremental_inputs_reader::get_object_offset): New function.
8192 * options.cc (Input_arguments::add_file): Return reference to
8193 new input argument.
8194 * options.h (Input_argument::set_script_info): New function.
8195 (Input_argument::script_info): New function.
8196 (Input_argument::script_info_): New data member; adjust all
8197 constructors.
8198 (Input_file_group::add_file): Return reference to new input argument.
8199 (Input_file_lib::add_file): Likewise.
8200 (Input_arguments::add_file): Likewise.
8201 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8202 * script.cc (Parser_closure::Parser_closure): Add script_info
8203 parameter; adjust all callers.
8204 (Parser_closure::script_info): New function.
8205 (Parser_closure::script_info_): New data member.
8206 (read_input_script): Report scripts earlier to incremental info.
8207 (script_add_file): Set script_info in Input_argument.
8208 (script_add_library): Likewise.
8209 * script.h (Script_options::Script_info): Rewrite class.
8210
a869183f 82112011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8212
8213 * archive.cc (Library_base::should_include_member): Move
8214 method here from class Archive.
8215 (Archive::Archive): Initialize base class.
8216 (Archive::should_include_member): Move to base class.
8217 (Archive::do_for_all_unused_symbols): New function.
8218 (Add_archive_symbols::run): Remove redundant access to
8219 incremental_inputs.
8220 (Lib_group::Lib_group): Initialize base class.
8221 (Lib_group::do_filename): New function.
8222 (Lib_group::include_member): Pass pointer to Lib_group to
8223 report_object.
8224 (Lib_group::do_for_all_unused_symbols): New function.
8225 (Add_lib_group_symbols::run): Report archive information for
8226 incremental links.
8227 * archive.h (class Library_base): New base class.
8228 (class Archive): Derive from Library_base.
8229 (Archive::filename): Move to base class.
8230 (Archive::set_incremental_info): Likewise.
8231 (Archive::incremental_info): Likewise.
8232 (Archive::Should_include): Likewise.
8233 (Archive::should_include_member): Likewise.
8234 (Archive::Armap_entry): Remove.
8235 (Archive::Unused_symbol_iterator): Remove.
8236 (Archive::unused_symbols_begin): Remove.
8237 (Archive::unused_symbols_end): Remove.
8238 (Archive::do_filename): New function.
8239 (Archive::do_get_mtime): New function.
8240 (Archive::do_for_all_unused_symbols): New function.
8241 (Archive::task_): Move to base class.
8242 (Archive::incremental_info_): Likewise.
8243 (class Lib_group): Derive from Library_base.
8244 (Lib_group::do_filename): New function.
8245 (Lib_group::do_get_mtime): New function.
8246 (Lib_group::do_for_all_unused_symbols): New function.
8247 (Lib_group::task_): Move to base class.
8248 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8249 function.
8250 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8251 function.
8252 * incremental.cc (Incremental_inputs::report_archive_begin):
8253 Use Library_base; call library's get_mtime; add incremental inputs
8254 entry before members.
8255 (class Unused_symbol_visitor): New class.
8256 (Incremental_inputs::report_archive_end): Use Library_base; use
8257 visitor class to record unused symbols; don't add incremental inputs
8258 entry after members.
8259 (Incremental_inputs::report_object): Use Library_base.
8260 * incremental.h
8261 (Incremental_archive_entry::Incremental_archive_entry): Remove
8262 unused Archive parameter.
8263 (Incremental_inputs::report_archive_begin): Use Library_base.
8264 (Incremental_inputs::report_archive_end): Likewise.
8265 (Incremental_inputs::report_object): Likewise.
8266 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8267 function.
8268 * object.h (Object::for_all_global_symbols): New function.
8269 (Object::do_for_all_global_symbols): New function.
8270 (Sized_relobj::do_for_all_global_symbols): New function.
8271 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8272 function.
8273 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8274 function.
8275
61ab3e40
ILT
82762011-03-27 Ian Lance Taylor <iant@google.com>
8277
8278 * archive.cc (Archive::interpret_header): Return -1 if something
8279 goes wrong. Change callers accordingly.
8280
30e1f9e6
CC
82812011-03-25 Cary Coutant <ccoutant@google.com>
8282
8283 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8284 * testsuite/Makefile.in: Regenerate.
8285
9370ce59 82862011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8287
8288 * plugin.cc (get_view): New.
8289 (Plugin::load): Pass get_view to the plugin.
8290 (Plugin_manager::get_view): New.
8291
9312bb0a
ILT
82922011-03-21 Ian Lance Taylor <iant@google.com>
8293
8294 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8295 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8296
7e12ba9e
ST
82972011-03-21 Sriraman Tallam <tmsriram@google.com>
8298
8299 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8300 Change == to -eq.
8301 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8302 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8303 Change == to -eq.
8304 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8305 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8306
fd7a005d
ILT
83072011-03-14 Ian Lance Taylor <iant@google.com>
8308
8309 * script-sections.cc (Sort_output_sections::script_compare):
8310 Rename from is_before, change return type.
8311 (Sort_output_sections::operator()): Adjust accordingly.
8312
ed16fd1b
ILT
83132011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8314
8315 PR gold/12572
8316 * testsuite/odr_violation2.cc: Add comment to make all error line
8317 numbers double digits.
8318 * testsuite/debug_msg.sh: Adjust expected errors.
8319
71ff8986
ILT
83202011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8321
8322 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8323 but mark earlier ones as non-canonical
8324 (offset_to_iterator): Update search target and example
8325 (do_addr2line): Return extra lines in a vector*
8326 (format_file_lineno): Extract from do_addr2line
8327 (one_addr2line): Add vector* out-param
8328 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8329 when a lineno entry appeared last for its instruction
8330 (Dwarf_line_info): Add vector* out-param
8331 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8332 * symtab.cc (Odr_violation_compare): Include the lineno in the
8333 comparison again.
8334 (linenos_from_loc): New. Combine the canonical line for an
8335 address with its other lines.
8336 (True_if_intersect): New. Helper functor to make
8337 std::set_intersection a query.
8338 (detect_odr_violations): Compare sets of lines instead of just
8339 one line for each function. This became less deterministic, but
8340 has fewer false positives.
8341 * symtab.h: Declarations.
8342 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8343 mix an optimized and non-optimized object in the same binary
8344 (odr_violation2.so): Same.
8345 * testsuite/Makefile.in: Regenerate from Makefile.am.
8346 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8347 * testsuite/debug_msg.sh: Update line numbers and add
8348 assertions.
8349 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8350 non-optimized context.
8351 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8352 isn't inlined, and use OdrDerived in an optimized context.
8353 * testsuite/odr_header1.h: Defines OdrDerived, where
8354 optimization will change the
8355 first-instruction-in-the-destructor's file and line number.
8356 * testsuite/odr_header2.h: Defines OdrBase.
8357
a19fefdc
ILT
83582011-03-09 Ian Lance Taylor <iant@google.com>
8359
8360 * fileread.cc (File_read::clear_views): Don't delete the whole
8361 file view.
8362
ecb351e9
ILT
83632011-03-08 Ian Lance Taylor <iant@google.com>
8364
8365 PR gold/12525
8366 * fileread.cc: #include <climits>.
8367 (GOLD_IOV_MAX): Define.
8368 (File_read::read_multiple): Limit number of entries by iov_max.
8369 * fileread.h (class File_read): Always set max_readv_entries to
8370 128.
8371
b821d13c
ILT
83722011-03-07 Ian Lance Taylor <iant@google.com>
8373
8374 PR gold/12525
8375 * options.h (class General_options): Add -dy and -dn.
8376
89243142
CC
83772011-03-02 Cary Coutant <ccoutant@google.com>
8378
8379 * testsuite/script_test_9.t: Add TLS segment.
8380
d0773f31
ILT
83812011-03-02 Simon Baldwin <simonb@google.com>
8382
8383 * configure.ac: Add check for gnu_indirect_function support in
8384 the toolchain building binutils.
8385 * configure: Rebuild.
8386
9370ce59 83872011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8388
8389 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8390 plugin only symbols.
8391 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8392 in plugin files as not needed in the symbol table.
8393
4cf7a849
ST
83942011-02-11 Sriraman Tallam <tmsriram@google.com>
8395
8396 * output.cc (Output_section::add_input_section): Delay fill
8397 generation for section ordering.
8398
b578bd7d
ILT
83992011-02-09 Ian Lance Taylor <iant@google.com>
8400
8401 PR gold/12316
8402 * object.h (class Sized_relobj): Remove clear_local_symbols.
8403 * reloc.cc (Sized_relobj::do_relocate): Don't call
8404 clear_local_symbols.
8405
9370ce59 84062011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8407
8408 * plugin.cc (is_visible_from_outside): Return true for symbols
8409 in the -u option.
8410
55382fb7
ILT
84112011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8412
8413 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8414 filename.
8415
4e271fff
ST
84162011-02-02 Sriraman Tallam <tmsriram@google.com>
8417
8418 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8419 to std::string.
4e271fff 8420 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8421 section_name to be std::string.
4e271fff
ST
8422 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8423
d433c3ac
ILT
84242011-01-25 Ian Lance Taylor <iant@google.com>
8425
8426 * script.cc (script_add_extern): Rewrite to use
8427 add_symbol_reference.
8428
880473a6
DK
84292011-01-25 Doug Kwan <dougkwan@google.com>
8430
d433c3ac 8431 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8432
f30f86fa
ILT
84332011-01-24 Ian Lance Taylor <iant@google.com>
8434
8435 * options.h (class General_options): Accept
8436 --no-detect-odr-violations.
8437
8e51a0b9
ILT
84382011-01-24 Ian Lance Taylor <iant@google.com>
8439
8440 * version.cc (version_string): Bump to 1.11.
8441
0f3b89d8
ILT
84422011-01-24 Ian Lance Taylor <iant@google.com>
8443
8444 * plugin.cc (class Plugin_rescan): Define new class.
8445 (Plugin_manager::claim_file): Set any_claimed_.
8446 (Plugin_manager::save_archive): New function.
8447 (Plugin_manager::save_input_group): New function.
8448 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8449 necessary.
8450 (Plugin_manager::new_undefined_symbol): New function.
8451 (Plugin_manager::rescan): New function.
8452 (Plugin_manager::rescannable_defines): New function.
8453 (Plugin_manager::add_input_file): Set any_added_.
8454 * plugin.h (class Plugin_manager): define new fields rescannable_,
8455 undefined_symbols_, any_claimed_, and any_added_. Declare
8456 Plugin_rescan as friend. Declare new functions.
8457 (Plugin_manager::Rescannable): Define type.
8458 (Plugin_manager::Rescannable_list): Define type.
8459 (Plugin_manager::Undefined_symbol_list): Define type.
8460 (Plugin_manager::Plugin_manager): Initialize new fields.
8461 * archive.cc (Archive::defines_symbol): New function.
8462 (Add_archive_symbols::run): Pass archive to plugins if any.
8463 * archive.h (class Archive): Declare defines_symbol.
8464 * readsyms.cc (Input_group::~Input_group): New function.
8465 (Finish_group::run): Pass input_group to plugins if any.
8466 * readsyms.h (class Input_group): Declare destructor.
8467 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8468 any.
8469
3bb951e5
ILT
84702011-01-10 Ian Lance Taylor <iant@google.com>
8471
8472 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8473 section as relro.
8474 (Layout::set_segment_offsets): Reset increase_relro before calling
8475 set_section_addresses a second time.
8476
0aa45fac
CC
84772011-01-04 Cary Coutant <ccoutant@google.com>
8478
8479 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8480 sections before NOBITS sections.
8481
0db46eb4
L
84822011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8483
8484 * version.cc (print_version): Update copyright to 2011.
8485
829c9745
CC
84862010-12-23 Cary Coutant <ccoutant@google.com>
8487
8488 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8489 of OS to this->add. Add OD parameter to second form of the function.
8490
7500420b
ILT
84912010-12-20 Ian Lance Taylor <iant@google.com>
8492
8493 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8494 second of two consecutive entries with same offset.
8495
f8e9a930
RW
84962010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8497
8498 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8499 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8500 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8501 to avoid unneeded links against $(LDADD).
8502 * testsuite/Makefile.in: Regenerate.
8503
2fbb4320
ILT
85042010-12-15 Ian Lance Taylor <iant@google.com>
8505
8506 PR gold/12324
8507 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8508 for R_X86_64_32 and R_X86_64_PC32.
8509 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8510 ver_matching_def_pic.o.
8511 (ver_matching_def_pic.o): New target.
8512
fedb228d
RW
85132010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8514
8515 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8516 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8517 Move definition before File_read::View member definitions.
8518 (File_read::View::~View): Initialize and hold lock before
8519 updating current_mapped_bytes.
8520
9b547ce6
RW
85212010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8522
8523 * dwarf_reader.cc: Remove outdated comment.
8524 * gold-threads.cc: Fix typo in error message.
8525 * archive.cc: Fix typos in comments.
8526 * archive.h: Likewise.
8527 * arm-reloc-property.cc: Likewise.
8528 * arm-reloc-property.h: Likewise.
8529 * arm-reloc.def: Likewise.
8530 * arm.cc: Likewise.
8531 * attributes.h: Likewise.
8532 * cref.cc: Likewise.
8533 * ehframe.cc: Likewise.
8534 * fileread.h: Likewise.
8535 * gold.h: Likewise.
8536 * i386.cc: Likewise.
8537 * icf.cc: Likewise.
8538 * incremental.h: Likewise.
8539 * int_encoding.cc: Likewise.
8540 * layout.h: Likewise.
8541 * main.cc: Likewise.
8542 * merge.h: Likewise.
8543 * object.cc: Likewise.
8544 * object.h: Likewise.
8545 * options.cc: Likewise.
8546 * readsyms.cc: Likewise.
8547 * reduced_debug_output.cc: Likewise.
8548 * reloc.cc: Likewise.
8549 * script-sections.cc: Likewise.
8550 * sparc.cc: Likewise.
8551 * symtab.h: Likewise.
8552 * target-reloc.h: Likewise.
8553 * target.cc: Likewise.
8554 * target.h: Likewise.
8555 * timer.cc: Likewise.
8556 * timer.h: Likewise.
8557 * x86_64.cc: Likewise.
8558
83e17bd5
CC
85592010-12-09 Cary Coutant <ccoutant@google.com>
8560
8561 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8562 stack.
8563 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8564 parameter; change all callers.
8565 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8566 * options.h (warn_execstack): New option.
8567
017257f8
DK
85682010-12-07 Doug Kwan <dougkwan@google.com>
8569
8570 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8571 like function call relocations.
8572
c20cbc06
ILT
85732010-12-07 Ian Lance Taylor <iant@google.com>
8574
8575 * archive.cc (Archive::get_elf_object_for_member): Permit
8576 punconfigured to be NULL.
8577 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8578 (Archive::include_member): Pass NULL to get_elf_object_for_member
8579 if we searched for the archive and this is the first included
8580 object.
8581
4dbfafcc
ILT
85822010-12-01 Ian Lance Taylor <iant@google.com>
8583
8584 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8585 track_relocs_type_ field.
8586 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8587 Set track_relocs_type_.
8588 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8589 contents when using RELA relocs.
8590 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8591 reloc_map_.
8592 * reloc.cc (Track_relocs::next_addend): New function.
8593 * reloc.h (class Track_relocs): Declare next_addend.
8594
e5e19edd
ILT
85952010-12-01 Ian Lance Taylor <iant@google.com>
8596
8597 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8598 virtual destructor.
8599
9a5ce24c
ILT
86002010-12-01 Ian Lance Taylor <iant@google.com>
8601
8602 * README: Update compilers known to work and fail.
8603
c7791212
NC
86042010-11-23 Matthias Klose <doko@ubuntu.com>
8605
8606 * configure.in: For --enable-gold, handle value `default' instead of
8607 `both*'. Always install ld as ld.bfd, install as ld if gold is
8608 not the default.
8609 * configure: Regenerate.
8610
0ad220c9
DK
86112010-11-18 Doug Kwan <dougkwan@google.com>
8612
8613 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8614 and right_alignment to be zero. Store result alignment only if it is
8615 greater than existing alignment.
8616
ab8056e0
CC
86172010-11-16 Cary Coutant <ccoutant@google.com>
8618
8619 PR gold/12220
8620 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8621 Check for ".zdebug_line".
8622
fd064a5b
CC
86232010-11-16 Doug Kwan <dougkwan@google.com>
8624 Cary Coutant <ccoutant@google.com>
8625
8626 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8627 by reference; adjust all callers.
8628 * output.cc (Output_segment::set_section_addresses): Adjust references
8629 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8630 list is empty.
8631 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8632 end at page boundary.
8633
6fc6ea19
CC
86342010-11-16 Cary Coutant <ccoutant@google.com>
8635
8636 PR gold/12220
8637 * layout.cc (Layout::choose_output_section): Transform names of
8638 compressed sections even when using a script with a SECTIONS clause.
8639 (Layout::output_section_name): Remove code to transform
8640 compressed debug section names.
8641 * output.cc (Output_section::add_input_section): Use uncompressed
8642 section size when tracking input sections.
8643
95a2c8d6
RS
86442010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8645
8646 * symtab.h (Symbol::NON_PIC_REF): Remove.
8647 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8648 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8649 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8650 (Symbol::use_plt_offset): Take a flags argument and pass it
8651 directly to needs_dynamic_reloc. Restrict check for undefined
8652 weak symbols to function calls.
8653 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8654 (Target_arm::Scan::global): Use it.
8655 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8656 (Target_arm::Relocate::relocate): Likewise.
8657 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8658 parameter with an r_type parameter. Use get_reference_flags
8659 to get the flags.
8660 (Target_arm::Relocate::relocate): Update accordingly.
8661 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8662 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8663 (Target_i386::Scan::global): Likewise.
8664 (Target_i386::Relocate::relocate): Likewise.
8665 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8666 parameter with an r_type parameter. Use get_reference_flags
8667 to get the flags.
8668 (Target_i386::Relocate::relocate): Update accordingly.
8669 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8670 (Target_powerpc::Scan::global): Use it.
8671 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8672 (Target_powerpc::Relocate::relocate): Likewise.
8673 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8674 (Target_sparc::Scan::global): Use it.
8675 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8676 (Target_sparc::Relocate::relocate): Likewise.
8677 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8678 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8679 (Target_x86_64::Scan::global): Likewise.
8680 (Target_x86_64::Relocate::relocate): Likewise.
8681
f625ae50
DK
86822010-11-08 Doug Kwan <dougkwan@google.com>
8683 Cary Coutant <ccoutant@google.com>
8684
8685 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8686 (Arm_exidx_merge_section::section_contents_): New data member.
8687 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8688 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8689 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8690 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8691 in parameters instead of calling Object::section_contents without
8692 locking.
8693 (Arm_output_section::group_section): New parameter TASK. Pass it
8694 to callees that need locking objects.
8695 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8696 to lock EXIDX input sections. Fix a formatting issue. Call
8697 Arm_exidx_merged_section::build_contents to create merged section
8698 contents.
8699 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8700 to lock object of stub table owner.
8701 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8702 TEXT_SIZE to initialize data member TEXT_SIZE_.
8703 (Arm_exidx_input_section::addralign): Fix typo in comment.
8704 (Arm_exidx_input_section::text_size): New method.
8705 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8706 that require locking objects. Lock objects before scanning for stubs
8707 and updating local symbols.
8708 (Arm_input_section<big_endian>::init): Copy contents of original
8709 input section.
2e702c99 8710 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8711 original input section instead of calling Object::section_contents
8712 without locking.
8713 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8714 size without calling Object::section_size().
8715 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8716 for size. Allocate a buffer for merged EXIDX entries.
8717 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8718 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8719 building code to Arm_exidx_merged_section::build_contetns. Write
8720 out contetns in buffer instead of building it on the fly.
8721 (Arm_relobj::make_exidx_input_section): Also pass text section size
8722 to Arm_exidx_input_section constructor.
8723 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8724 (Arm_dynobj::do_read_symbols): Fix memory leak.
8725 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8726 * target.h: (class Task): Add forward declaration.
8727 (Target::relax): Add new parameter TASK and pass it to
8728 Target::do_relax().
8729 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8730
5f9bcf58
CC
87312010-11-05 Cary Coutant <ccoutant@google.com>
8732
8733 PR gold/10708
8734 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8735 object when reading from the file.
8736 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8737 second layout pass.
8738 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8739 when reading section contents.
8740 (get_section_contents): Likewise.
8741 (icf::find_identical_sections): Likewise.
8742 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8743 object when reading from the file.
8744 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8745 the object when doing deferred section layout.
8746
e597fa08
NC
87472010-11-03 Nick Clifton <nickc@redhat.com>
8748
8749 PR gold/12001
8750 * script.h (class Symbol_assignment: name): New member. Returns
8751 the name of the symbol.
8752 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8753 Returns true if the given symbol name is on the list of
8754 assignments wating to be processed.
8755 * archive.cc (should_incldue_member): If the symbol is undefined,
8756 check to see if it is on the list of symbols pending assignment.
8757
3f9a3278
ILT
87582010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8759
8760 * script-sections.cc (Script_sections::find_memory_region): Check
8761 for a NULL output section pointer.
8762
d06fb4d1
DK
87632010-10-29 Doug Kwan <dougkwan@google.com>
8764
8765 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8766 Output_section::add_relaxed_input_section.
8767 * output.cc (Output_section::add_relaxed_input_section): Add new
8768 arguments LAYOUT and NAME. Set section order index.
8769 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8770 Copy section order index.
8771 * output.h (Output_section::add_relaxed_input_section): Add new
8772 arguments LAYOUT and NAME.
8773
90e24de5
ILT
87742010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8775
8776 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8777 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8778 * testsuite/Makefile.in: Regenerate.
8779
c9484ea5
DK
87802010-10-20 Doug Kwan <dougkwan@google.com>
8781
8782 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8783 without SHF_LINK_ORDER flags.
8784 * layout.cc (Layout::choose_output_section): Do not filter
8785 SHF_LINK_ORDER flag in a relocatable link.
8786
5bc2f5be
CC
87872010-10-17 Cary Coutant <ccoutant@google.com>
8788
8789 * output.h (Output_segment::set_section_addresses): Change function
8790 signature. Update all callers.
8791 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8792 sections.
8793 (Output_segment::set_section_addresses): Align after last TLS
8794 section. Add padding before last relro section instead of after.
8795
0c91cf04
DK
87962010-10-17 Doug Kwan <dougkwan@google.com>
8797
8798 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8799 GOT output section to be writable.
8800
8c21d9d3
CC
88012010-10-14 Cary Coutant <ccoutant@google.com>
8802
8803 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8804 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8805 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8806 mode.
8807 * incremental.cc (report_command_line): Ignore all forms of
8808 --incremental.
8809 * layout.cc (Layout::Layout): Check parameters for incremental link
8810 mode.
8811 * options.cc (General_options::parse_incremental): New function.
8812 (General_options::parse_no_incremental): New function.
8813 (General_options::parse_incremental_full): New function.
8814 (General_options::parse_incremental_update): New function.
8815 (General_options::incremental_mode_): New data member.
8816 (General_options::finalize): Check incremental_mode_.
8817 * options.h (General_options): Update help text for --incremental.
8818 Add --no-incremental, --incremental-full, --incremental-update.
8819 (General_options::Incremental_mode): New enum type.
8820 (General_options::incremental_mode): New function.
8821 (General_options::incremental_mode_): New data member.
8822 * parameters.cc (Parameters::incremental_mode_): New data member.
8823 (Parameters::set_options): Set incremental_mode_.
8824 (Parameters::set_incremental_full): New function.
8825 (Parameters::incremental): New function.
8826 (Parameters::incremental_update): New function.
8827 (set_parameters_incremental_full): New function.
8828 * parameters.h (Parameters::set_incremental_full): New function.
8829 (Parameters::incremental): New function.
8830 (Parameters::incremental_update): New function.
8831 (Parameters::incremental_mode_): New data member.
8832 (set_parameters_incremental_full): New function.
8833 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8834 incremental link mode.
8835 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8836 (Sized_relobj::do_relocate_sections): Likewise.
8837 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8838 option.
8839 * testsuite/Makefile.in: Regenerate.
8840 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8841
bb32aa18 88422010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8843
8844 * script-sections.h (class Script_sections): Make
8845 Sections_elements typedef public.
8846 * script-sections.cc (class Sort_output_sections): Add elements_
8847 field. Add constructor which sets it; change all callers.
8848 (Sort_output_sections::is_before): New function.
8849 (Sort_output_sections::operator()): Call is_before.
8850 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8851 conditional.
8852 * testsuite/script_test_10.sh: New test. Test script section
8853 order.
8854 * testsuite/script_test_10.t: Likewise.
8855 * testsuite/script_test_10.s: Likewise.
8856 * testsuite/Makefile.am: Wrap the cross linker tests and the
8857 common tests into NATIVE_OR_CROSS_LINKER.
8858 (check_SCRIPTS): Add script_test_10.sh.
8859 (check_DATA): Add script_test_10.stdout.
8860 (script_test_10.o, script_test_10): New targets.
8861 (script_test_10.stdout): New target.
8862 * configure, testsuite/Makefile.in: Regenerate.
8863
3cef7179
ILT
88642010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8865
8866 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8867 error for the deprecated relocations.
8868 (Target_arm::Scan::global): Likewise.
8869 (Target_arm::Relocate::relocate): Likewise.
8870
7411e9a8
RS
88712010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8872
8873 * fileread.cc (Input_file::find_file): Initialize *found_name
8874 and *namep when using the fallback search for case 4.
8875
6a9da32a
CC
88762010-10-11 Cary Coutant <ccoutant@google.com>
8877
8878 * options.h (class General_options): Redefine -z lazy as an alias for
8879 the negation of -z now.
8880
ac897c20
ILT
88812010-10-11 Ian Lance Taylor <iant@google.com>
8882
8883 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8884 binding.
8885
ea5cae92
NC
88862010-10-06 Nick Clifton <nickc@redhat.com>
8887
8888 * script-sections.cc(class Memory_region): Remove
8889 current_lma_offset_ field. Rename current_vma_offset_ to
8890 current_offset_. Add last_section_ field.
8891 (Memory_region::get_current_vma_address): Rename to
8892 get_current_address.
8893 (Memory_region::get_current_lma_address): Delete.
8894 (Memory_region::increment_vma_offset): Rename to
8895 increment_offset.
8896 (Memory_region::increment_lma_offset): Delete.
8897 (Memory_region::attributes_compatible): New method. Returns
8898 true if the provided section is compatible with the region.
8899 (Memory_region::get_last_section): New method. Returns the last
8900 section to use the region.
8901 (Memory_region::set_last_section): New method. Stores the last
8902 section to use the region.
8903 (Script_sections::block_in_region): New method. Returns true if
8904 a block of memory is contained within a region.
8905 (Script_sections::find_memory_region): New method. Locates a
8906 memory region to be used to set a VMA or LMA address.
8907 (Output_section_definition::set_section_addresses): Add code to
8908 check for addresses set by memory regions.
8909 (Output_segment::set_section_addresses): Remove memory region
8910 walking code.
8911 (Script_sections::create_segment): Add a warning if a header
8912 segment is created outside of any region.
8913 * script-sections.h (class Script_sections): Add prototypes for
8914 find_memory_region and block_in_region methods.
8915 * testsuite/memory_test.s: Use .long instead of .word.
8916 * testsuite/memory_test.t: Add some more output sections.
8917 * testsuite/memory_test.sh: Update expected output.
8918
a9bfd952
DK
89192010-10-02 Doug Kwan <dougkwan@google.com>
8920
8921 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8922 defintion to symtab.h
8923 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8924 declaration to defintion.
8925
bacff3ab
NC
89262010-10-01 Nick Clifton <nickc@redhat.com>
8927
8928 * expression.cc (eval): Replace dummy argument with NULL.
8929 (eval_maybe_dot): Check for a NULL result section pointer.
8930 (Symbol_expression::value): Likewise.
8931 (Dot_expression::value): Likewise.
8932 (BINARY_EXPRESSION): Likewise.
8933 (Max_expression::value): Likewise.
8934 (Min_expression::value): Likewise.
8935 (Absolute_expression::value): Likewise.
8936 (Addr_expression::value_from_output_section): Likewise.
8937 (Loaddddr_expression::value_from_output_section): Likewise.
8938 (Segment_start_expression::value): Likewise.
8939 * script-sections.cc
8940 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8941 argument with NULL.
8942 (Sections_elememt_dot_assignment::set_section_addresses):
8943 Likewise.
8944 (Output_data_expression::do_write_to_buffer): Likewise.
8945 (Output_section_definition::finalize_symbols): Likewise.
8946 (Output_section_definition::set_section_addresses): Likewise.
8947
f81bc8b5
DK
89482010-09-30 Doug Kwan <dougkwan@google.com>
8949
8950 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8951
c95e9f27
ST
89522010-09-28 Sriraman Tallam <tmsriram@google.com>
8953
8954 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8955 function.
c95e9f27
ST
8956 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8957 virtual function.
8958 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8959 virtual function.
8960 * icf.cc (get_section_contents): Inline merge sections only when
8961 target allows it.
8962
3cac54d2
RW
89632010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8964
8965 * configure: Regenerate.
8966
2904037a
ILT
89672010-09-17 Ian Lance Taylor <iant@google.com>
8968
8969 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8970 * testsuite/Makefile.am (memory_test.o): New target.
8971 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8972 memory_test.t.
8973 * testsuite/Makefile.in: Rebuild.
2904037a 8974
bca7fb63
DK
89752010-09-17 Doug Kwan <dougkwan@google.com>
8976
8977 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8978 defintion if relocation uses GOT entries of the symbol.
8979 * testsuite/icf_safe_test.sh: Fix test.
8980 * testsuite/icf_safe_so_test.sh: Fix test.
8981
4ef28648
CC
89822010-09-16 Cary Coutant <ccoutant@google.com>
8983
8984 * script_sections.cc (class Memory_region): Remove "NULL" from
8985 vector initializations.
8986
793990de
CC
89872010-09-15 Cary Coutant <ccoutant@google.com>
8988
8989 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8990 Resolve forwarding symbols.
8991
81e015e2
DK
89922010-09-15 Doug Kwan <dougkwan@google.com>
8993
8994 * gold/testsuite/script_test_3.t: Add ARM special sections.
8995 * gold/testsuite/script_test_4.t: Same.
8996 * gold/testsuite/script_test_5.t: Same.
8997 * gold/testsuite/script_test_6.t: Same.
8998 * gold/testsuite/script_test_7.t: Same.
8999 * gold/testsuite/script_test_7.t: Same.
9000 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
9001
36171d64
CC
90022010-09-14 Cary Coutant <ccoutant@google.com>
9003
9004 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
9005 (Target_x86_64::Relocate::relocate_tls): Replace check for
9006 saw_tls_block_reloc_ with test for executable section.
9007
d89051bd
CC
90082010-09-12 Cary Coutant <ccoutant@google.com>
9009
9010 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
9011 position-independent executables to shared libraries need dynamic
9012 relocations.
9013 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
9014 position-independent executables.
9015 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
9016 * testsuite/Makefile.in: Regenerate.
9017
fca41f0f
NC
90182010-09-10 Nick Clifton <nickc@redhat.com>
9019
9020 PR gold/11997
9021 * testsuite/memory_test.t: Discard any sections that are not
9022 needed.
9023
6695e4b3
L
90242010-09-09 H.J. Lu <hongjiu.lu@intel.com>
9025
9026 PR gold/11996
9027 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
9028 "This::" to work around a bug in gcc 4.2.
9029
9030 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
9031
0f72bf6f
RÁE
90322010-09-09 Rafael Espindola <espindola@google.com>
9033
9034 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
9035 sections with different PF_X flags in the same segment.
9036 (Layout::find_first_load_seg): Search all segments to find the first
9037 one.
9038 * options.h (rosegment): New.
9039
90402010-09-08 Rafael Espindola <espindola@google.com>
a6577478 9041
05a79166 9042 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 9043
aa98ff75
DK
90442010-09-08 Doug Kwan <dougkwan@google.com>
9045
9046 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
9047 (Arm_relobj::do_relocate_sections): Add new parameter for output
9048 file to match the parent.
9049 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
9050 of local symbols instead of input values. Update code to track
9051 changes in gold::relocate_section.
9052 * object.cc (Sized_relobj::compute_final_local_value): New methods.
9053 (Sized_relobj::compute_final_local_value_internal): New methods.
9054 (Sized_relobj::do_finalize_local_symbols): Move code from loop
9055 body into private version of Sized_relobj::compute_final_local_value.
9056 Call the inline method.
9057 * object.h (Symbol_value::Symbol_value): Define destructor. Free
9058 merged symbol value if there is one.
9059 (Symbol_value::has_output_value): New method defintiion.
9060 (Sized_relobj::Compute_final_local_value_status): New enum type.
9061 (Sized_relobj::compute_final_local_value): New methods.
9062 (Sized_relobj::compute_final_local_value_internal): New methods.
9063 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
9064 and arm_cortex_a8.sh.
9065 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
9066 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
9067 New tests.
9068 * Makefile.in: Regenerate.
9069 * testsuite/arm_bl_out_of_range.s: Update test.
9070 * testsuite/thumb_bl_out_of_range.s: Ditto.
9071 * testsuite/thumb_blx_out_of_range.s: Ditto.
9072 * testsuite/arm_branch_out_of_range.sh: New file.
9073 * testsuite/arm_cortex_a8.sh: Ditto.
9074 * testsuite/arm_cortex_a8_b.s: Ditto.
9075 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9076 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9077 * testsuite/arm_cortex_a8_bl.s: Ditto.
9078 * testsuite/arm_cortex_a8_blx.s: Ditto.
9079 * testsuite/arm_cortex_a8_local.s: Ditto.
9080 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9081 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9082
05a79166
L
90832010-09-08 Rafael Espindola <espindola@google.com>
9084
9085 * Makefile.am (memory_test.stdout): Run readelf with -W.
9086 * Makefile.in: Regenerate.
9087 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9088 64 bit output.
9089
33dbc701
RÁE
90902010-09-08 Rafael Espindola <espindola@google.com>
9091
9092 * script-sections.cc (Script_sections::add_memory_region): Convert
9093 field precision to int.
9094 * script.cc (script_set_section_region, script_set_section_region):
9095 Convert field precision to int.
9096
731ca54a
RÁE
90972010-09-08 Rafael Espindola <espindola@google.com>
9098
9099 * arm.cc (do_finalize_sections): Create the __exidx_start and
9100 __exdix_end symbols even when the section is missing.
9101
7f8cd844
NC
91022010-09-08 Nick Clifton <nickc@redhat.com>
9103
9104 * README: Remove claim that MEMORY is not supported.
9105 * expression.cc (script_exp_function_origin)
9106 (script_exp_function_length): Move from here to ...
9107 * script.cc: ... here.
9108 (script_set_section_region, script_add_memory)
9109 (script_parse_memory_attr, script_include_directive): New
9110 functions.
9111 * script-sections.cc
9112 (class Memory_region): New class.
9113 (class Output_section_definition): Add set_memory_region,
9114 set_section_vma, set_section_lma and get_section_name methods.
9115 (class Script_Sections): Add add_memory_region,
9116 find_memory_region, find_memory_region_origin,
9117 find_memory_region_length and set_memory_region methods.
9118 Have set_section_addresses method walk the list of set memory
9119 regions.
9120 Extend the print methos to display memory regions.
9121 * script-sections.h: Add prototypes for new methods.
9122 Add enum for MEMORY region attributes.
9123 * yyscript.y: Add support for parsing MEMORY regions.
9124 * script-c.h: Add prototypes for new functions.
9125 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9126 * testsuite/Makefile.in: Regenerate.
9127 * testsuite/memory_test.sh: New script.
9128 * testsuite/memory_test.s: New assembler source file.
9129 * testsuite/memory_test.t: New linker script.
9130
a4649286
DK
91312010-08-27 Doug Kwan <dougkwan@google.com>
9132
9133 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9134 reference override an existing dynamic weak reference.
9135 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9136 * testsuite/Makefile.in: Regenerate.
9137 * testsuite/dyn_weak_ref.sh: New file.
9138 * testsuite/dyn_weak_ref_1.c: Ditto.
9139 * testsuite/dyn_weak_ref_2.c: Ditto.
9140
b56648ad
ILT
91412010-08-27 Ian Lance Taylor <iant@google.com>
9142
9143 * incremental.h (class Incremental_input_entry): Add virtual
9144 destructor.
9145
809313cb
ILT
91462010-08-27 Ian Lance Taylor <iant@google.com>
9147
9148 * testsuite/start_lib_test_3.c: Mark t3 as used.
9149
11e32464
NC
91502010-08-27 Nick Clifton <nickc@redhat.com>
9151
9152 * options.cc (version_script): Fix small typo in previous
9153 whitespace tidyup.
9154
ca09d69a
NC
91552010-08-25 Nick Clifton <nickc@redhat.com>
9156
9157 * archive.cc: Formatting fixes: Remove whitespace between
9158 typename and following asterisk. Remove whitespace between
9159 function name and opening parenthesis.
9160 * archive.h: Likewise.
9161 * arm.cc: Likewise.
9162 * attributes.cc: Likewise.
9163 * attributes.h: Likewise.
9164 * common.cc: Likewise.
9165 * copy-relocs.cc: Likewise.
9166 * dirsearch.h: Likewise.
9167 * dynobj.cc: Likewise.
9168 * ehframe.cc: Likewise.
9169 * ehframe.h: Likewise.
9170 * expression.cc: Likewise.
9171 * fileread.cc: Likewise.
9172 * fileread.h: Likewise.
9173 * gc.h: Likewise.
9174 * gold-threads.cc: Likewise.
9175 * gold.cc: Likewise.
9176 * i386.cc: Likewise.
9177 * icf.h: Likewise.
9178 * incremental-dump.cc: Likewise.
9179 * incremental.cc: Likewise.
9180 * layout.cc: Likewise.
9181 * layout.h: Likewise.
9182 * main.cc: Likewise.
9183 * merge.cc: Likewise.
9184 * merge.h: Likewise.
9185 * object.cc: Likewise.
9186 * object.h: Likewise.
9187 * options.cc: Likewise.
9188 * options.h: Likewise.
9189 * output.cc: Likewise.
9190 * output.h: Likewise.
9191 * plugin.cc: Likewise.
9192 * plugin.h: Likewise.
9193 * powerpc.cc: Likewise.
9194 * reloc.cc: Likewise.
9195 * script-c.h: Likewise.
9196 * script-sections.cc: Likewise.
9197 * script.cc: Likewise.
9198 * stringpool.cc: Likewise.
9199 * symtab.cc: Likewise.
9200 * symtab.h: Likewise.
9201 * target.cc: Likewise.
9202 * timer.cc: Likewise.
9203 * timer.h: Likewise.
9204 * version.cc: Likewise.
9205 * x86_64.cc: Likewise.
9206
b8fa8750
NC
92072010-08-24 Nick Clifton <nickc@redhat.com>
9208
9209 PR 11899
9210 * layout.cc (segment_precedes): Sort segments by their physical
9211 addresses, if they have been set.
9212
9919d93b
CC
92132010-08-23 Cary Coutant <ccoutant@google.com>
9214
9215 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9216 symbols data.
9217 (Lib_group::include_member): Unlock object after deleting its
9218 symbols data.
9219 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9220 the bug fixed here.
9221
97b4be1c
CC
92222010-08-19 Neil Vachharajani <nvachhar@google.com>
9223 Cary Coutant <ccoutant@google.com>
9224
9225 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9226 constructor, and set_blocker.
9227 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9228 readsyms_blocker_.
9229 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9230 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9231 * testsuite/Makefile.am (start_lib_test): New test case.
9232 * testsuite/Makefile.in: Regenerate.
9233 * testsuite/start_lib_test_main.c: New file.
9234 * testsuite/start_lib_test_1.c: New file.
9235 * testsuite/start_lib_test_2.c: New file.
9236 * testsuite/start_lib_test_3.c: New file.
9237
dd0b1884
ILT
92382010-08-19 Ian Lance Taylor <iant@google.com>
9239
9240 * Makefile.in: Rebuild with automake 1.11.1.
9241 * aclocal.m4: Likewise.
9242 * testsuite/Makefile.in: Likewise.
9243
7223e9ca
ILT
92442010-08-19 Ian Lance Taylor <iant@google.com>
9245
9246 PR 10893
9247 * i386.cc (class Output_data_plt_i386): Update declarations.
9248 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9249 local_ifuncs_ fields.
9250 (Target_i386::do_plt_section_for_global): New function.
9251 (Target_i386::do_plt_section_for_local): New function.
9252 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9253 parameter; change all callers. Initialize global_ifuncs_ and
9254 local_ifuncs_. If doing a static link define __rel_iplt_start and
9255 __rel_iplt_end.
9256 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9257 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9258 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9259 symbols.
9260 (Target_i386::make_plt_section): New function, broken out of
9261 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9262 (Target_i386::make_plt_entry): Call make_plt_section.
9263 (Target_i386::make_local_ifunc_plt_entry): New function.
9264 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9265 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9266 R_386_IRELATIVE to switch.
9267 (Target_i386::Scan::global): Likewise.
9268 (Target_i386::Relocate::relocate): Likewise.
9269 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9270 switch.
9271 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9272 (Target_x86_64::do_plt_section_for_global): New function.
9273 (Target_x86_64::do_plt_section_for_local): New function.
9274 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9275 parameter; change all callers. If doing a static link define
9276 __rela_iplt_start and __rela_iplt_end.
9277 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9278 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9279 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9280 to point to .plt.
9281 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9282 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9283 switch.
9284 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9285 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9286 R_X86_64_IRELATIVE to switch.
9287 (Target_x86_64::Scan::global): Likewise.
9288 (Target_x86_64::Relocate::relocate): Likewise.
9289 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9290 switch.
9291 * target.h (class Target): Add plt_section_for_global and
9292 plt_section_for_local functions. Add do_plt_section_for_global
9293 and do_plt_section_for_local virtual functions.
9294 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9295 clarifying comments.
9296 (Symbol::use_plt_offset): Handle IFUNC symbol.
9297 * object.cc (Sized_relobj::Sized_relobj): Initialize
9298 local_plt_offsets_.
9299 (Sized_relobj::local_has_plt_offset): New function.
9300 (Sized_relobj::local_plt_offset): New function.
9301 (Sized_relobj::set_local_plt_offset): New function.
9302 (Sized_relobj::do_count): Handle IFUNC symbol.
9303 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9304 a bit away from input_shndx_ field. Add set_is_func_symbol and
9305 is_ifunc_symbol functions.
9306 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9307 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9308 local_plt_offsets_ field.
9309 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9310 * output.h (class Output_section_data): Add non-const
9311 output_section function.
9312 (class Output_data_got): Update declarations.
9313 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9314 Add use_plt_offset parameter to global and local constructors.
9315 Change all callers. Change local_sym_index_ field to 31 bits.
9316 Change GSYM_CODE and CONSTANT_CODE accordingly.
9317 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9318 doing a static link don't set sh_link field.
9319 (Output_data_got::Got_entry::write): Use PLT offset if
9320 appropriate.
9321 (Output_data_got::add_global_plt): New function.
9322 (Output_data_got::add_local_plt): New function.
9323 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9324 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9325 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9326 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9327 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9328 IFUNC conditional.
9329 * testsuite/ifunc-sel.h: New file.
9330 * testsuite/ifuncmain1.c: New file.
9331 * testsuite/ifuncmain1vis.c: New file.
9332 * testsuite/ifuncmod1.c: New file.
9333 * testsuite/ifuncdep2.c: New file.
9334 * testsuite/ifuncmain2.c: New file.
9335 * testsuite/ifuncmain3.c: New file.
9336 * testsuite/ifuncmod3.c: New file.
9337 * testsuite/ifuncmain4.c: New file.
9338 * testsuite/ifuncmain5.c: New file.
9339 * testsuite/ifuncmod5.c: New file.
9340 * testsuite/ifuncmain6pie.c: New file.
9341 * testsuite/ifuncmod6.c: New file.
9342 * testsuite/ifuncmain7.c: New file.
9343 * configure, testsuite/Makefile.in: Rebuild.
9344
56f75c03
ILT
93452010-08-18 Ian Lance Taylor <iant@google.com>
9346
9347 * incremental.cc
9348 (Output_section_incremental_inputs::write_input_files): Add cast
9349 to avoid signed/unsigned comparison warning.
9350 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9351
55455f89
CC
93522010-08-12 Cary Coutant <ccoutant@google.com>
9353
9354 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9355
e2054bcb
ILT
93562010-08-13 Ian Lance Taylor <iant@google.com>
9357
9358 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9359
74f67560
DK
93602010-08-12 Cary Coutant <ccoutant@google.com>
9361 Doug Kwan <dougkwan@google.com>
9362
9363 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9364 defintion overrides non-weak undef, remember that the original undef
9365 is not weak.
9366 * symtab.cc (Symbol_table::sized_write_global): For undef without
9367 an original weak binding, set binding to global in output.
9368 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9369 * testsuite/Makefile.in: Regenerate.
9370 * testsuite/strong_ref_weak_def.sh: New file.
9371 * testsuite/strong_ref_weak_def_1.c: Ditto.
9372 * testsuite/strong_ref_weak_def_2.c: Ditto.
9373
d1238d12
CC
93742010-08-12 Cary Coutant <ccoutant@google.com>
9375
9376 * testsuite/incremental_test.sh: Rewrite.
9377 * testsuite/incremental_test_1.c: Rewrite.
9378 * testsuite/incremental_test_2.c: Rewrite.
9379
0e70b911
CC
93802010-08-12 Cary Coutant <ccoutant@google.com>
9381
9382 * arm.cc (Target_arm::got_size): Add const.
9383 (Target_arm::got_entry_count): New function.
9384 (Target_arm::plt_entry_count): New function.
9385 (Target_arm::first_plt_entry_offset): New function.
9386 (Target_arm::plt_entry_size): New function.
9387 (Output_data_plt_arm::entry_count): New function.
9388 (Output_data_plt_arm::first_plt_entry_offset): New function.
9389 (Output_data_plt_arm::get_plt_entry_size): New function.
9390 * i386.cc (Target_i386::got_size): Add const.
9391 (Target_i386::got_entry_count): New function.
9392 (Target_i386::plt_entry_count): New function.
9393 (Target_i386::first_plt_entry_offset): New function.
9394 (Target_i386::plt_entry_size): New function.
9395 (Output_data_plt_i386::entry_count): New function.
9396 (Output_data_plt_i386::first_plt_entry_offset): New function.
9397 (Output_data_plt_i386::get_plt_entry_size): New function.
9398 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9399 find_incremental_inputs_sections. Dump incremental_got_plt section.
9400 * incremental.cc: Include target.h.
9401 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9402 parameter. Adjust all callers. Find incremental_got_plt section.
9403 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9404 section.
9405 (Output_section_incremental_inputs::set_final_data_size): Calculate
9406 size of incremental_got_plt section.
9407 (Output_section_incremental_inputs::do_write): Write the
9408 incremental_got_plt section.
9409 (Got_plt_view_info): New struct.
9410 (Local_got_offset_visitor): New class.
9411 (Global_got_offset_visitor): New class.
9412 (Global_symbol_visitor_got_plt): New class.
9413 (Output_section_incremental_inputs::write_got_plt): New function.
9414 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9415 Add parameter. Adjust all callers.
9416 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9417 (Incremental_inputs::got_plt_section): New function.
9418 (Incremental_inputs::got_plt_section_): New data member.
9419 (Incremental_got_plt_reader): New class.
9420 * layout.cc (Layout::create_incremental_info_sections): Add the
9421 incremental_got_plt section.
9422 * object.h (Got_offset_list::get_list): New function.
9423 (Got offset_list::for_all_got_offsets): New function.
9424 (Sized_relobj::local_got_offset_list): New function.
9425 * powerpc.cc (Target_powerpc::got_size): Add const.
9426 (Target_powerpc::got_entry_count): New function.
9427 (Target_powerpc::plt_entry_count): New function.
9428 (Target_powerpc::first_plt_entry_offset): New function.
9429 (Target_powerpc::plt_entry_size): New function.
9430 (Output_data_plt_powerpc::entry_count): New function.
9431 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9432 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9433 * sparc.cc (Target_sparc::got_size): Add const.
9434 (Target_sparc::got_entry_count): New function.
9435 (Target_sparc::plt_entry_count): New function.
9436 (Target_sparc::first_plt_entry_offset): New function.
9437 (Target_sparc::plt_entry_size): New function.
9438 (Output_data_plt_sparc::entry_count): New function.
9439 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9440 (Output_data_plt_sparc::get_plt_entry_size): New function.
9441 * symtab.h (Symbol::got_offset_list): New function.
9442 (Symbol_table::for_all_symbols): New function.
9443 * target.h (Sized_target::got_entry_count): New function.
9444 (Sized_target::plt_entry_count): New function.
9445 (Sized_target::plt_entry_size): New function.
9446 * x86_64.cc (Target_x86_64::got_size): Add const.
9447 (Target_x86_64::got_entry_count): New function.
9448 (Target_x86_64::plt_entry_count): New function.
9449 (Target_x86_64::first_plt_entry_offset): New function.
9450 (Target_x86_64::plt_entry_size): New function.
9451 (Output_data_plt_x86_64::entry_count): New function.
9452 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9453 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9454
09ec0418
CC
94552010-08-12 Cary Coutant <ccoutant@google.com>
9456
9457 * archive.cc: Include incremental.h.
9458 (Archive::Archive): Initialize incremental_info_.
9459 (Archive::include_member): Record archive members in incremental info.
9460 (Add_archive_symbols::run): Record begin and end of an archive in
9461 incremental info.
9462 (Lib_group::include_member): Record objects in incremental info.
9463 * archive.h (Incremental_archive_entry): Forward declaration.
9464 (Archive::set_incremental_info): New member function.
9465 (Archive::incremental_info): New member function.
9466 (Archive::Unused_symbol_iterator): New class.
9467 (Archive::unused_symbols_begin): New member function.
9468 (Archive::unused_symbols_end): New member function.
9469 (Archive::incremental_info_): New data member.
9470 * incremental-dump.cc (find_input_containing_global): New function.
9471 (dump_incremental_inputs): Dump new incremental info sections.
9472 * incremental.cc: Include symtab.h.
9473 (Output_section_incremental_inputs): New class.
9474 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9475 new incremental info sections.
9476 (Sized_incremental_binary::do_check_inputs): Likewise.
9477 (Incremental_inputs::report_archive): Remove.
9478 (Incremental_inputs::report_archive_begin): New function.
9479 (Incremental_inputs::report_archive_end): New function.
9480 (Incremental_inputs::report_object): New function.
9481 (Incremental_inputs::finalize_inputs): Remove.
9482 (Incremental_inputs::report_input_section): New function.
9483 (Incremental_inputs::report_script): Rewrite.
9484 (Incremental_inputs::finalize): Do nothing but finalize string table.
9485 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9486 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9487 (Incremental_inputs::create_data_sections): New function.
9488 (Incremental_inputs::relocs_entsize): New function.
9489 (Output_section_incremental_inputs::set_final_data_size): New function.
9490 (Output_section_incremental_inputs::do_write): New function.
9491 (Output_section_incremental_inputs::write_header): New function.
9492 (Output_section_incremental_inputs::write_input_files): New function.
9493 (Output_section_incremental_inputs::write_info_blocks): New function.
9494 (Output_section_incremental_inputs::write_symtab): New function.
9495 * incremental.h (Incremental_script_entry): Forward declaration.
9496 (Incremental_object_entry): Forward declaration.
9497 (Incremental_archive_entry): Forward declaration.
9498 (Incremental_inputs): Forward declaration.
9499 (Incremental_inputs_header_data): Remove.
9500 (Incremental_inputs_header): Remove.
9501 (Incremental_inputs_header_write): Remove.
9502 (Incremental_inputs_entry_data): Remove.
9503 (Incremental_inputs_entry): Remove.
9504 (Incremental_inputs_entry_write): Remove.
9505 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9506 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9507 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9508 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9509 Likewise.
9510 (Incremental_input_entry): New class.
9511 (Incremental_script_entry): New class.
9512 (Incremental_object_entry): New class.
9513 (Incremental_archive_entry): New class.
9514 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9515 (Incremental_inputs::report_inputs): Remove.
9516 (Incremental_inputs::report_archive): Remove.
9517 (Incremental_inputs::report_archive_begin): New function.
9518 (Incremental_inputs::report_archive_end): New function.
9519 (Incremental_inputs::report_object): Change prototype.
9520 (Incremental_inputs::report_input_section): New function.
9521 (Incremental_inputs::report_script): Change prototype.
9522 (Incremental_inputs::get_reloc_count): New function.
9523 (Incremental_inputs::set_reloc_count): New function.
9524 (Incremental_inputs::create_data_sections): New function.
9525 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9526 (Incremental_inputs::inputs_section): New function.
9527 (Incremental_inputs::symtab_section): New function.
9528 (Incremental_inputs::relocs_section): New function.
9529 (Incremental_inputs::get_stringpool): Add const.
9530 (Incremental_inputs::command_line): Add const.
9531 (Incremental_inputs::inputs): Remove.
9532 (Incremental_inputs::command_line_key): New function.
9533 (Incremental_inputs::input_file_count): New function.
9534 (Incremental_inputs::input_files): New function.
9535 (Incremental_inputs::relocs_entsize): New function.
9536 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9537 (Incremental_inputs::finalize_inputs): Remove.
9538 (Incremental_inputs::Input_info): Remove.
9539 (Incremental_inputs::lock_): Remove.
9540 (Incremental_inputs::inputs_): Change type.
9541 (Incremental_inputs::inputs_map_): Remove.
9542 (Incremental_inputs::current_object_entry_): New data member.
9543 (Incremental_inputs::inputs_section_): New data member.
9544 (Incremental_inputs::symtab_section_): New data member.
9545 (Incremental_inputs::relocs_section_): New data member.
9546 (Incremental_inputs::reloc_count_): New data member.
9547 (Incremental_inputs_reader): New class.
9548 (Incremental_symtab_reader): New class.
9549 (Incremental_relocs_reader): New class.
9550 * layout.cc (Layout::finalize): Move finalization of incremental info
9551 and creation of incremental info sections to follow finalization of
9552 symbol table. Set offsets for postprocessing sections.
9553 (Layout::create_incremental_info_sections): Call
9554 Incremental_inputs::create_data_sections. Add incremental symtab
9555 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9556 sections to layout after input sections.
9557 * layout.h (struct Timespec): Forward declaration.
9558 (Layout::incremental_inputs): Add const.
9559 (Layout::create_incremental_info_sections): Add parameter.
9560 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9561 * object.cc: Include incremental.h.
9562 (Relobj::finalize_incremental_relocs): New function.
9563 (Sized_relobj::do_layout): Record input sections in incremental info.
9564 * object.h (Object::output_section): New function.
9565 (Object::output_section_offset): Moved from Relobj.
9566 (Object::get_incremental_reloc_base): New function.
9567 (Object::get_incremental_reloc_count): New function.
9568 (Object::do_output_section): New function.
9569 (Object::do_output_section_offset): Moved from Relobj.
9570 (Object::do_get_incremental_reloc_base): New function.
9571 (Object::do_get_incremental_reloc_count): New function.
9572 (Object::Object): Initialize new data members.
9573 (Relobj::output_section): Renamed do_output_section and moved to
9574 protected.
9575 (Relobj::output_section_offset): Moved to Object.
9576 (Relobj::do_get_incremental_reloc_base): New function.
9577 (Relobj::do_get_incremental_reloc_count): New function.
9578 (Relobj::allocate_incremental_reloc_counts): New function.
9579 (Relobj::count_incremental_reloc): New function.
9580 (Relobj::finalize_incremental_relocs): New function.
9581 (Relobj::next_incremental_reloc_index): New function.
9582 (Relobj::reloc_counts_): New data member.
9583 (Relobj::reloc_bases_): New data member.
9584 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9585 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9586 (Sized_relobj::incremental_relocs_scan): New function.
9587 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9588 (Sized_relobj::incremental_relocs_write): New function.
9589 (Sized_relobj::incremental_relocs_write_reltype): New function.
9590 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9591 incremental link.
9592 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9593 archives and object files elsewhere.
9594 (Add_symbols::run): Report object files here.
9595 (Finish_group::run): Report end of archive at end of group.
9596 * reloc.cc: Include layout.h, incremental.h.
9597 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9598 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9599 (Sized_relobj::incremental_relocs_scan): New function.
9600 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9601 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9602 (Sized_relobj::incremental_relocs_write): New function.
9603 (Sized_relobj::incremental_relocs_write_reltype): New function.
9604 * script.cc (read_input_script): Rewrite test for incremental link.
9605 Change call to Incremental_inputs::report_script.
9606 * symtab.h (Symbol_table::first_global_index): New function.
9607 (Symbol_table::output_count): New function.
9608
ce0d1972
DK
96092010-08-12 Doug Kwan <dougkwan@google.com>
9610
9611 * arm.cc (Target_arm::merge_object_attributes): Check command line
9612 options --no-wchar-size-warning and --no-enum-size-warning.
9613 * options.h (General_options): Add ld-compatible options
9614 --no-enum-size-warning and --no-wchar-size-warning.
9615
6e5710ce
ILT
96162010-08-04 Ian Lance Taylor <iant@google.com>
9617
9618 * x86_64.cc (Target_x86_64::Scan::local): Use
9619 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9620 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9621 (Target_x86_64::Scan::global): Likewise.
9622 (Target_x86_64::Relocate::relocate): Likewise.
9623 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9624 Likewise.
9625
fef830db
CC
96262010-08-03 Cary Coutant <ccoutant@google.com>
9627
9628 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9629 to reserve space in merged_strings vector. Keep total input size
9630 for stats.
9631 (Output_merge_string::do_print_merge_stats): Print total input size.
9632 * merge.h (Output_merge_string): Add input_size_ field.
9633 * stringpool.cc (Stringpool_template::string_length): Move
9634 implementations out of Stringpool_template class and place in
9635 stringpool.h.
9636 * stringpool.h (string_length): Move out of Stringpool_template.
9637
1e3811b0
ILT
96382010-08-03 Ian Lance Taylor <iant@google.com>
9639
9640 PR 11712
9641 * layout.cc (relaxation_loop_body): If address of load segment is
9642 set, adjust address to include headers if possible.
9643
7af0c620
ILT
96442010-08-03 Ian Lance Taylor <iant@google.com>
9645
9646 * version.cc (version_string): Bump to 1.10.
9647
22f0da72
ILT
96482010-08-03 Ian Lance Taylor <iant@google.com>
9649
9650 PR 11805
9651 * layout.h (enum Output_section_order): Define.
9652 (class Layout): Update declarations.
9653 * layout.cc (Layout::get_output_section): Add order parameter.
9654 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9655 is_first_non_relro parameters. Change all callers.
9656 (Layout::choose_output_section): Likewise.
9657 (Layout::add_output_section_data): Likewise.
9658 (Layout::make_output_section): Likewise. Set order.
9659 (Layout::default_section_order): New function.
9660 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9661 * output.cc (Output_section::Output_section): Initialize order_.
9662 Don't initialize deleted fields.
9663 (Output_segment::Output_segment): Don't initialize deleted
9664 fields.
9665 (Output_segment::add_output_section_to_load): New function
9666 replacing add_output_section. Change all callers to call this or
9667 add_output_section_to_nonload.
9668 (Output_segment::add_output_section_to_nonload): New function.
9669 (Output_segment::remove_output_section): Rewrite.
9670 (Output_segment::add_initial_output_data): Likewise.
9671 (Output_segment::has_any_data_sections): Likewise.
9672 (Output_segment::is_first_section_relro): Likewise.
9673 (Output_segment::maximum_alignment): Likewise.
9674 (Output_segment::has_dynamic_reloc): New function replacing
9675 dynamic_reloc_count. Change all callers.
9676 (Output_segment::has_dynamic_reloc_list): New function replacing
9677 dynamic_reloc_count_list. Change all callers.
9678 (Output_segment::set_section_addresses): Rewrite.
9679 (Output_segment::set_offset): Rewrite.
9680 (Output_segment::find_first_and_last_list): Remove.
9681 (Output_segment::set_tls_offsets): Rewrite.
9682 (Output_segment::first_section_load_address): Likewise.
9683 (Output_segment::output_section_count): Likewise.
9684 (Output_segment::section_with_lowest_load_address): Likewise.
9685 (Output_segment::write_section_headers): Likewise.
9686 (Output_segment::print_sections_to_map): Likewise.
9687 * output.h (class Output_data): Remove dynamic_reloc_count_
9688 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9689 (Output_data::add_dynamic_reloc): Rewrite.
9690 (Output_data::has_dynamic_reloc): New function.
9691 (Output_data::dynamic_reloc_count): Remove.
9692 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9693 is_last_relro_, is_first_non_relro_, is_interp_,
9694 is_dynamic_linker_section_ fields. Add order and set_order
9695 functions. Remove is_relro_local, set_is_relro_local,
9696 is_last_relro, set_is_last_relro, is_first_non_relro,
9697 set_is_first_non_relro functions, is_interp, set_is_interp,
9698 is_dynamic_linker_section, and set_is_dynamic_linker_section
9699 functions.
9700 (class Output_segment): Change Output_data_list from std::list to
9701 std:;vector. Add output_lists_ field. Remove output_data_ and
9702 output_bss_ fields. Update declarations.
9703
3ff2ccb0
ILT
97042010-08-02 Ian Lance Taylor <iant@google.com>
9705
9706 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9707 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9708 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9709
88a4108b
ILT
97102010-08-02 Ian Lance Taylor <iant@google.com>
9711
9712 PR 11855
9713 * script.cc (Script_options::Script_options): Initialize
9714 symbol_definitions_ and symbol_references_.
9715 (Script_options::add_symbol_assignment): Update
9716 symbol_definitions_ and symbol_references_.
9717 (Script_options::add_symbol_reference): New function.
9718 (script_symbol): New function.
9719 * script.h (class Script_options): Add symbol_definitions_ and
9720 symbol_references_ fields.
9721 (Script_options::referenced_const_iterator): New type.
9722 (Script_options::referenced_begin): New function.
9723 (Script_options::referenced_end): New function.
9724 (Script_options::is_referenced): New function.
9725 (Script_options::any_unreferenced): New function.
9726 * script-c.h (script_symbol): Declare.
9727 * yyscript.y (exp): Call script_symbol.
9728 * symtab.cc: Include "script.h".
9729 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9730 Change all callers. Check symbols referenced by scripts.
9731 (Symbol_table::add_undefined_symbols_from_command_line): Add
9732 layout parameter. Change all callers.
9733 (Symbol_table::do_add_undefined_symbols_from_command_line):
9734 Likewise. Break out loop body. Check symbols referenced by
9735 scripts.
9736 (Symbol_table::add_undefined_symbol_from_command_line): New
9737 function broken out of
9738 do_add_undefined_symbols_from_command_line.
9739 * symtab.h (class Symbol_table): Update declarations.
9740 * archive.cc: Include "layout.h".
9741 (Archive::should_include_member): Add layout parameter. Change
9742 all callers. Check for symbol mentioned in expression.
9743 * archive.h (class Archive): Update declaration.
9744 * object.cc (Sized_relobj::do_should_include_member): Add layout
9745 parameter.
9746 * object.h (Object::should_include_member): Add layout parameter.
9747 Change all callers.
9748 (Object::do_should_include_member): Add layout parameter.
9749 (class Sized_relobj): Update declaration.
9750 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9751 parameter.
9752 * dynobj.h (class Sized_dynobj): Update declaration.
9753 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9754 layout parameter.
9755 * plugin.h (class Sized_pluginobj): Update declaration.
9756
5f1ab67a
ILT
97572010-08-02 Ian Lance Taylor <iant@google.com>
9758
9759 PR 11866
9760 * output.cc (Output_segment::set_offset): Search for the first and
9761 last sections rather than assuming that the list is in order.
9762 (Output_segment::find_first_and_last_list): New function.
9763 * output.h (class Output_segment): Update declarations.
9764 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9765 (relro_strip_test_SOURCES): New variable.
9766 (relro_strip_test_DEPENDENCIES): New variable.
9767 (relro_strip_test_LDFLAGS): New variable.
9768 (relro_strip_test_LDADD): New variable.
9769 (relro_strip_test.so): New target.
9770
a8df5856
ILT
97712010-08-02 Ian Lance Taylor <iant@google.com>
9772
9773 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9774 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9775 (Target_i386::got_tlsdesc_section): New function.
9776 (Target_i386::got_section): Create space for GOT entries for
9777 TLSDESC relocations.
9778 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9779 R_386_TLS_GOTDESC.
9780 (Target_i386::Scan::global): Likewise.
9781 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9782 using TLSDESC GOT.
9783 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9784 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9785 (Target_x86_64::got_tlsdesc_section): New function.
9786 (Target_x86_64::got_section): Create space for GOT entries for
9787 TLSDESC relocations.
9788 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9789 R_386_TLS_GOTDESC.
9790 (Target_x86_64::Scan::global): Likewise.
9791 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9792 using TLSDESC GOT.
9793
0c10a0a6
ILT
97942010-08-02 Ian Lance Taylor <iant@google.com>
9795
9796 * testsuite/final_layout.sh: Use dc to convert from hex to
9797 decimal.
9798
41cbeecc
ST
97992010-07-29 Sriraman Tallam <tmsriram@google.com>
9800
9801 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9802 paramter to the call to gold::gc_process_relocs.
9803 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9804 paramter to the call to gold::gc_process_relocs.
9805 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9806 parameter to the call to gold::gc_process_relocs.
9807 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9808 template parameter to the call to gold::gc_process_relocs.
9809 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9810 paramter to the call to gold::gc_process_relocs.
9811 * gc.h (get_embedded_addend_size): New function.
9812 (gc_process_relocs): Save the size of the reloc for use by ICF.
9813 * icf.cc (get_section_contents): Get the addend from the text section
9814 for SHT_REL relocation sections.
9815 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9816 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9817 * int_encoding.h (read_from_pointer): New overloaded function.
9818 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9819 * testsuite/icf_sht_rel_addend_test.sh: New file.
9820 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9821 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9822
6ea55b82
RW
98232010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9824
9825 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9826 * Makefile.in: Regenerate.
9827 * testsuite/Makefile.in: Regenerate.
9828
9691462b
ILT
98292010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9830
9831 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9832 * gold/testsuite/debug_msg.cc: Likewise.
9833 * gold/testsuite/odr_violation1.cc
9834 * gold/testsuite/odr_violation2.cc
9835
76897331
CC
98362010-07-21 Cary Coutant <ccoutant@google.com>
9837
9838 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9839 string, and length fields.
9840 (Output_merge_string::Merged_strings_list): New type.
9841 (Output_merge_string::Merged_strings_lists): New typedef.
9842 (Output_merge_string): Replace merged_strings_ with
9843 merged_strings_lists_.
9844 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9845 Merged_strings_list per input object and section. Don't store pointer
9846 to the string. Don't store length with each merged string entry.
9847 (Output_merge_string::finalize_merged_data): Loop over list of merged
9848 strings lists. Recompute length of each merged string.
9849
78384e8f
CC
98502010-07-15 Cary Coutant <ccoutant@google.com>
9851
9852 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9853 here.
9854
783659f9
ILT
98552010-07-14 Ian Lance Taylor <iant@google.com>
9856
9857 * descriptors.cc (Descriptors::open): Report correct name in error
9858 message.
9859
131687b4
DK
98602010-07-13 Doug Kwan <dougkwan@google.com>
9861
9862 * arm.cc (Arm_input_section::Arm_input_section): For a
9863 SHT_ARM_EXIDX section, always keeps the input sections.
9864 (Arm_input_section::set_exidx_section_link): New method.
9865 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9866 has_errors_ to false.
9867 (Arm_exidx_input_section::has_errors,
9868 Arm_exidx_input_section::set_has_errors): New methods.
9869 (Arm_exidx_input_section::has_errors_): New data member.
9870 (Arm_relobj::get_exidx_shndx_list): New method.
9871 (Arm_output_section::append_text_sections_to_list): Do not skip
9872 section without SHF_EXECINSTR.
9873 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9874 errors.
2e702c99 9875 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9876 section header. Make error messages more verbose. Check for
9877 a non-executable section linked to an EXIDX section.
9878 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9879 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9880 check that there is no deferred EXIDX section if we exit early.
9881 Instead of not making an EXIDX section in case of an error, make one
9882 and set the has_errors flag of it.
9883 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9884 in a relocatable link.
9885 (Target_arm::do_relax): Look for the EXIDX output section instead of
9886 assuming that it is called .ARM.exidx.
2e702c99 9887 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9888 section list. Do not check for SHF_EXECINSTR section flags but
9889 skip any input section with errors.
9890 * output.cc (Output_section::Output_section): Initialize
9891 always_keeps_input_sections_ to false.
9892 (Output_section::add_input_section): Check for
9893 always_keeps_input_sections_.
9894 * output.h (Output_section::always_keeps_input_sections,
9895 Output_section::set_always_keeps_input_sections): New methods.
9896 (Output_section::always_keeps_input_sections): New data member.
9897
69517287
RÁE
98982010-07-13 Rafael Espindola <espindola@google.com>
9899
9900 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9901 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9902
82742395
ILT
99032010-07-13 Philip Herron <herron.philip@googlemail.com>
9904 Ian Lance Taylor <iant@google.com>
9905
9906 * output.h (Output_section_lookup_maps::add_merge_section):
9907 Correct check of whether value was inserted.
9908 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9909 (Output_section_lookup_maps::add_relaxed_input_section):
9910 Likewise.
9911 * arm.cc (Target_arm::got_section): Remove used local os.
9912 * i386.cc (Target_i386::got_section): Likewise.
9913 * x86_64.cc (Target_x86_64::got_section): Likewise.
9914 * sparc.cc (Target_sparc::got_section): Likewise.
9915 (Target_sparc::relocate): Remove unused local have_got_offset.
9916 * powerpc.cc (Target_powerpc::relocate): Likewise.
9917
f2d707b5
ILT
99182010-07-13 Ian Lance Taylor <iant@google.com>
9919
241531d6
ILT
9920 * compressed_output.cc (zlib_decompress): Fix signature in
9921 !HAVE_ZLIB_H case.
9922
f2d707b5
ILT
9923 * archive.cc (Archive::include_member): Unlock an external member
9924 of a thin archive. Don't bother to delete an object we know is
9925 NULL.
9926
a2e47362
CC
99272010-07-12 Cary Coutant <ccoutant@google.com>
9928
9929 * compressed_output.cc (zlib_decompress): New function.
9930 (get_uncompressed_size): New function.
9931 (decompress_input_section): New function.
9932 * compressed_output.h (get_uncompressed_size): New function.
9933 (decompress_input_section): New function.
9934 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9935 Handle compressed debug sections.
9936 * layout.cc (is_compressed_debug_section): New function.
9937 (Layout::output_section_name): Map compressed section names to
9938 canonical names.
9939 * layout.h (is_compressed_debug_section): New function.
9940 (is_debug_info_section): Recognize compressed debug sections.
9941 * merge.cc: Include compressed_output.h.
9942 (Output_merge_data::do_add_input_section): Handle compressed
9943 debug sections.
9944 (Output_merge_string::do_add_input_section): Handle compressed
9945 debug sections.
9946 * object.cc: Include compressed_output.h.
9947 (Sized_relobj::Sized_relobj): Initialize new data members.
9948 (build_compressed_section_map): New function.
9949 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9950 * object.h (Object::section_is_compressed): New method.
9951 (Object::do_section_is_compressed): New method.
9952 (Sized_relobj::Compressed_section_map): New type.
9953 (Sized_relobj::do_section_is_compressed): New method.
9954 (Sized_relobj::compressed_sections_): New data member.
9955 * output.cc (Output_section::add_input_section): Handle compressed
9956 debug sections.
9957 * reloc.cc: Include compressed_output.h.
9958 (Sized_relobj::write_sections): Handle compressed debug sections.
9959
ce279a62
CC
99602010-07-08 Cary Coutant <ccoutant@google.com>
9961
9962 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9963 weak when resolving to a dynamic def.
9964 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9965 for weak undef/dynamic def cases. Adjust callers.
9966 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9967 undef_binding_weak_.
9968 (Symbol_table::sized_write_globals): Adjust symbol binding.
9969 (Symbol_table::sized_write_symbol): Add binding parameter.
9970 * symtab.h (Symbol::set_undef_binding): New method.
9971 (Symbol::is_undef_binding_weak): New method.
9972 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9973 (Symbol_table::should_override): Add new parameter.
9974 (Symbol_table::sized_write_symbol): Add new parameter.
9975
9976 * testsuite/weak_undef_file1.cc: Add new test case.
9977 * testsuite/weak_undef_file2.cc: Fix header comment.
9978 * testsuite/weak_undef_test.cc: Add new test case.
9979
b2286c10
DK
99802010-06-29 Doug Kwan <dougkwan@google.com>
9981
9982 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9983 Initialize USE_SYMBOL_.
9984 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9985 definition.
9986 (Arm_reloc_property::uses_symbol_): New data member declaration.
9987 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9988 uses symbol value and symbol is undefined but not weakly undefined.
9989
4802450a
RÁE
99902010-06-28 Rafael Espindola <espindola@google.com>
9991
9992 * plugin.cc (Plugin::load): Use dlerror.
9993
e5ca47ba
ILT
99942010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9995
9996 * symtab.cc (detect_odr_violations): When reporting an ODR
9997 violation, report an object where the symbol is defined.
9998
8a75a161
DK
99992010-06-25 Doug Kwan <dougkwan@google.com>
10000
10001 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
10002 (Target_arm::section_may_have_icf_unsafe_pointers): New method
10003 definition.
10004 (Target_arm::Scan::local_reloc_may_be_function_pointer,
10005 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
10006 target hook to detect function points.
10007 (Target_arm::Scan::possible_function_pointer_reloc): New method.
10008 * icf.h (Icf::check_section_for_function_pointers): Change type of
10009 parameter SECTION_NAME to const reference to std::string. Use
10010 target hook to determine if section may have unsafe pointers.
10011 * target.h (Target::section_may_have_icf_unsafe_pointers): New
10012 method definition.
10013
42218b9f
RÁE
100142010-06-21 Rafael Espindola <espindola@google.com>
10015
10016 * fileread.cc (Input_file::find_fie): New
10017 (Input_file::open): Use Input_file::find_fie.
10018 * fileread.h (Input_file::find_fie): New
10019 * plugin.cc (set_extra_library_path): New.
10020 (Plugin::load): Add set_extra_library_path to the transfer vector.
10021 (Plugin_manager::set_extra_library_path): New.
10022 (Plugin_manager::add_input_file): Use the extra search path if set.
10023 (set_extra_library_path(): New.
10024 * plugin.h (Plugin_manager): Add set_extra_library_path and
10025 extra_search_path_.
10026
a0506cca
CC
100272010-06-19 Cary Coutant <ccoutant@google.com>
10028
10029 * layout.cc (gdb_sections): Add .debug_types.
10030 (lines_only_debug_sections): Likewise.
10031
6508b958
RÁE
100322010-06-18 Rafael Espindola <espindola@google.com>
10033
10034 * plugin.cc (add_input_file,add_input_library)
10035 (Plugin_manager::add_input_file): Make filename arguments const.
10036 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
10037 const.
10038
3e235302
DK
100392010-06-16 Doug Kwan <dougkwan@google.com>
10040
10041 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
10042 .ARM.attributes section if we have not merged any input
10043 attributes sections.
10044
106e8a6c
DK
100452010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10046
10047 * arm.cc: Allow combining objects with no EABI version
10048 information.
10049
91ff43fe
RÁE
100502010-06-15 Rafael Espindola <espindola@google.com>
10051
10052 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
10053
68ed838c
ILT
100542010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10055
10056 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
10057 (struct iovec): Correct !HAVE_READV definition.
10058
f3a2388f
CC
100592010-06-10 Cary Coutant <ccoutant@google.com>
10060
10061 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
10062 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
10063 reloc sections.
10064 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
10065
10066 PR 11683
10067 * symtab.h (Symbol::is_placeholder): New member function.
10068 * target-reloc.h (relocate_section): Check for placeholder symbols.
10069
10070 * testsuite/Makefile.am (plugin_test_8): New test.
10071 (plugin_test_9): New test.
10072 * testsuite/Makefile.in: Regenerate.
10073
e1df38aa
NC
100742010-06-09 Nick Clifton <nickc@redhat.com>
10075
10076 * yyscript.y (input_list_element): Allow strings prefixed with
10077 the '-' character. Treat these as libraries.
10078 * script.cc (script_add_library): New function. Adds a library
10079 specified by "-l<name>" found in an input script.
10080 * script-c.h: Add prototype for script_add_library.
10081
25bbe950
DK
100822010-06-07 Doug Kwan <dougkwan@google.com>
10083
10084 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10085 Restrict stub-group size to be within long conditional branch
10086 range when working around cortex-A8 erratum.
10087
0f32ea4c
ILT
100882010-06-07 Damien Diederen <dd@crosstwine.com>
10089
10090 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10091 #ifdef typo.
10092
8fe2a369
ST
100932010-06-03 Sriraman Tallam <tmsriram@google.com>
10094
10095 PR gold/11658
10096 * output.cc
10097 (Output_section::Input_section_sort_entry::compare_section_ordering):
10098 Change to return non-zero correctly.
10099 (Output_section::Input_section_sort_section_order_index_compare
10100 ::operator()): Change to fix ambiguity in comparisons.
10101
6e9ba2ca
ST
101022010-06-01 Sriraman Tallam <tmsriram@google.com>
10103
10104 * gold.h (is_wildcard_string): New function.
10105 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10106 (Layout::layout_eh_frame): Ditto.
10107 (Layout::find_section_order_index): New method.
10108 (Layout::read_layout_from_file): New method.
10109 * layout.h (Layout::find_section_order_index): New method.
10110 (Layout::read_layout_from_file): New method.
10111 (Layout::input_section_position_): New private member.
10112 (Layout::input_section_glob_): New private member.
10113 * main.cc (main): Call read_layout_from_file here.
10114 * options.h (--section-ordering-file): New option.
10115 * output.cc (Output_section::input_section_order_specified_): New
10116 member.
10117 (Output_section::Output_section): Initialize new member.
10118 (Output_section::add_input_section): Add new parameter.
10119 Keep input sections when --section-ordering-file is used.
10120 (Output_section::set_final_data_size): Sort input sections when
10121 section ordering file is specified.
10122 (Output_section::Input_section_sort_entry): Add new parameter.
10123 Check sorting type.
10124 (Output_section::Input_section_sort_entry::compare_section_ordering):
10125 New method.
10126 (Output_section::Input_section_sort_compare::operator()): Change to
10127 consider section_order_index.
10128 (Output_section::Input_section_sort_init_fini_compare::operator()):
10129 Change to consider section_order_index.
10130 (Output_section::Input_section_sort_section_order_index_compare
10131 ::operator()): New method.
10132 (Output_section::sort_attached_input_sections): Change to sort
10133 according to section order when specified.
e1df38aa
NC
10134 (Output_section::add_input_section<32, true>): Add new parameter.
10135 (Output_section::add_input_section<64, true>): Add new parameter.
10136 (Output_section::add_input_section<32, false>): Add new parameter.
10137 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
10138 * output.h (Output_section::add_input_section): Add new parameter.
10139 (Output_section::input_section_order_specified): New
10140 method.
10141 (Output_section::set_input_section_order_specified): New method.
10142 (Input_section::Input_section): Initialize section_order_index_.
10143 (Input_section::section_order_index): New method.
10144 (Input_section::set_section_order_index): New method.
10145 (Input_section::section_order_index_): New member.
10146 (Input_section::Input_section_sort_section_order_index_compare): New
10147 struct.
10148 (Output_section::input_section_order_specified_): New member.
10149 * script-sections.cc (is_wildcard_string): Delete and move modified
10150 method to gold.h.
10151 (Output_section_element_input::Output_section_element_input): Modify
10152 call to is_wildcard_string.
10153 (Output_section_element_input::Input_section_pattern
10154 ::Input_section_pattern): Ditto.
10155 (Output_section_element_input::Output_section_element_input): Ditto.
10156 * testsuite/Makefile.am (final_layout): New test case.
10157 * testsuite/Makefile.in: Regenerate.
10158 * testsuite/final_layout.cc: New file.
10159 * testsuite/final_layout.sh: New file.
10160
3537c84b
RÁE
101612010-06-01 Rafael Espindola <espindola@google.com>
10162
10163 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10164
105b6afd
RÁE
101652010-06-01 Rafael Espindola <espindola@google.com>
10166
10167 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10168 visibility of symbols.
10169
29e11421
DK
101702010-05-27 Doug Kwan <dougkwan@google.com>
10171
10172 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10173 from start of output section instead of address for a local symbol
10174 in a merged or relaxed section when doing a relocatable link.
10175
5e0f337e
RÁE
101762010-05-26 Rafael Espindola <espindola@google.com>
10177
703d02da 10178 PR 11604
5e0f337e
RÁE
10179 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10180 adding sections the garbage collector removed.
10181 * gold/testsuite/Makefile.am: Add test.
10182 * gold/testsuite/Makefile.in: Regenerate.
10183 * gold/testsuite/plugin_test_7.sh: New.
10184 * gold/testsuite/plugin_test_7_1.c: New.
10185 * gold/testsuite/plugin_test_7_2.c: New.
10186
f4187277
RÁE
101872010-05-26 Rafael Espindola <espindola@google.com>
10188
10189 * script-sections.cc (Output_section_definition::set_section_addresses):
10190 Check for --section-start.
10191
5c388529
DK
101922010-05-26 Doug Kwan <dougkwan@google.com>
10193
10194 * arm.cc (Arm_scan_relocatable_relocs): New class.
10195 (Target_arm::relocate_special_relocatable): New method.
10196 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10197 (Arm_relocate_functions::thumb_branch_common): Same.
10198 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10199 instead of Default_scan_relocatable_relocs.
10200 * target-reloc.h (relocate_for_relocatable): Let target handle
10201 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10202 * target.h (Sized_target::relocate_special_relocatable): New method.
10203
bca1c3ae
ILT
102042010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10205
10206 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10207
0439c796
DK
102082010-05-23 Doug Kwan <dougkwan@google.com>
10209
10210 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10211 instead of a cast.
10212 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10213 with a direct branch, not a conditional branch, to a stub.
10214 * merge.cc (Output_merge_base::record_input_section): New method
10215 defintion.
10216 (Output_merge_data::do_add_input_section): Record input section if
10217 keeps-input-sections flag is set.
10218 (Output_merge_string::do_add_input_section): Ditto.
10219 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10220 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10221 INPUT_SECTIONS_.
10222 (Output_merge_base::keeps_input_sections,
10223 Output_merge_base::set_keeps_input_sections,
10224 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10225 method definitions.
10226 (Output_merge_base::Input_sections): New type declaration.
10227 (Output_merge_base::input_sections_begin,
10228 Output_merge_base::input_sections_end,
10229 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10230 (Output_merge_base::bool keeps_input_sections_,
10231 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10232 Output_merge_base::input_sections_): New data members.
10233 (Output_merge_data::do_set_keeps_input_sections): New method
10234 defintion.
10235 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10236 * output.cc (Output_section::Input_section::relobj): Move method
10237 defintion from class declaration to here and handle merge sections.
10238 (Output_section::Input_section::shndx): Ditto.
10239 (Output_section::Output_section): Remove initializations of removed
10240 data members and initialize new data member LOOKUP_MAPS_.
10241 (Output_section::add_input_section): Set keeps-input-sections flag
10242 for a newly created merge output section as appropriate. Adjust code
10243 to use Output_section_lookup_maps class.
10244 (Output_section::add_relaxed_input_section): Adjst code for lookup
10245 maps code refactoring.
2e702c99 10246 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10247 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10248 class. If adding input section to a newly created merge output
10249 section fails, remove the new merge section.
10250 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10251 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10252 (Output_section::find_merge_section): Ditto.
0439c796 10253 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10254 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10255 Output_section_lookup_maps class.
10256 (Output_section::get_input_sections): Export merge sections. Adjust
10257 code to use Output_section_lookup_maps class.
10258 (Output_section:::add_script_input_section): Adjust code to use
10259 Output_section_lookup_maps class. Update lookup maps for merge
10260 sections also.
10261 (Output_section::discard_states): Use Output_section_lookup_maps.
10262 (Output_section::restore_states): Same.
10263 * output.h (Merge_section_properties): Move class defintion out of
10264 Output_section.
10265 (Output_section_lookup_maps): New class.
10266 (Output_section::Input_section::is_merge_section): New method
10267 defintion.
10268 (Output_section::Input_section::relobj): Move defintion out of class
10269 defintion. Declare method only.
10270 (Output_section::Input_section::shndx): Ditto.
10271 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10272 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10273 (Output_section::Merge_section_by_properties_map,
10274 Output_section::Output_section_data_by_input_section_map,
10275 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10276 Remove types.
2e702c99 10277 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10278 KEEPS_INPUT_SECTIONS.
10279 (Output_section::build_lookup_maps): New method declaration.
10280 (Output_section::merge_section_map_,
10281 Output_section::merge_section_by_properties_map_,
10282 Output_section::relaxed_input_section_map_,
10283 Output_section::is_relaxed_input_section_map_valid_): Remove data
10284 members.
10285 (Output_section::lookup_maps_): New data member.
10286
76295588
L
102872010-05-21 Doug Kwan <dougkwan@google.com>
10288
10289 PR gold/11619
10290 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10291 avoid a compilation error.
10292
d103a984
RÁE
102932010-05-19 Rafael Espindola <espindola@google.com>
10294
10295 * script-sections.cc (Output_section_definition::allocate_to_segment):
10296 Update the phdrs_list even when the output section is NULL.
10297 * testsuite/Makefile.am: Add test.
10298 * testsuite/Makefile.in: Regenerate.
10299 * testsuite/script_test_9.cc: New.
10300 * testsuite/script_test_9.sh: New.
10301 * testsuite/script_test_9.t: New.
10302
6625d24e
DK
103032010-05-19 Doug Kwan <dougkwan@google.com>
10304
10305 * arm.cc (Arm_input_section::original_size): New method.
10306 (Arm_input_section::do_addralign): Add a cast.
10307 (Arm_input_section::do_output_offset): Remove static cast.
10308 (Arm_input_section::original_addralign,
10309 Arm_input_section::original_size_): Change type to uint32_t.
10310 (Arm_input_section::init): Add safe casts for section alignment
10311 and size.
10312 (Arm_input_section::set_final_data_size): Do not set address and
10313 offset of stub table.
10314 (Arm_output_section::fix_exidx_coverage): Change use of of
10315 Output_section::Simple_input_section to that of
10316 Output_section::Input_section.
10317 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10318 except for the first pass.
10319 * output.cc (Output_section::get_input_sections): Change type of
10320 input_sections to std::list<Input_section>.
10321 (Output_section::add_script_input_section): Rename from
10322 Output_section::add_simple_input_section. Change type of SIS
10323 parameter from Simple_input_section to Input_section.
10324 * output.h (Output_section::Simple_input_section): Remove class.
10325 (Output_section::Input_section): Change class visibility to public.
10326 (Output_section::Input_section::addralign): Use stored alignments
10327 for special input sections if set.
10328 (Output_section::Input_section::set_addralign): New method.
10329 (Output_section::get_input_sections): Change parameter type from
10330 list of Simple_input_section to list of Input_section.
10331 (Output_section::add_script_input_section): Rename from
10332 Output_section::add_simple_input_section. Change first parameter's
10333 type from Simple_input_section to Input_section and remove the
10334 second and third parameters.
10335 * script-sections.cc (Input_section::Input_section_list): Change
10336 type to list of Output_section::Input_section/
10337 (Input_section_info::Input_section_info): Change parameter type of
10338 INPUT_SECTION to Output_section::Input_section.
10339 (Input_section_info::input_section): Change return type.
10340 (Input_section_info::input_section_): Change type to
10341 Output_section::Input_section.
10342 (Output_section_element_input::set_section_addresses): Adjust code
10343 to use Output_section::Input_section instead of
10344 Output_section::Simple_input_section. Adjust code for renaming
10345 of Output_section::add_simple_input_section.
10346 (Orphan_output_section::set_section_addresses): Ditto.
10347
e1e82ea4
RW
103482010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10349
10350 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10351 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10352
91e75c8a
RÁE
103532010-05-18 Rafael Espindola <espindola@google.com>
10354
10355 * options.cc (General_options::finalize): Handle -nostdlib.
10356 * options.h (nostdlib): New option.
10357 * script.cc (script_add_search_dir): Handle -nostdlib.
10358
da59ad79
DK
103592010-05-12 Doug Kwan <dougkwan@google.com>
10360
10361 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10362 attributes section only if there no attributes section after merging.
10363 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10364 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10365 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10366 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10367 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10368 and arm_attr_merge_7.stdout.
10369 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10370 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10371 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10372 arm_attr_merge_7b.o): New rules.
10373 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10374 arm_attr_merge_7
10375 * testsuite/Makefile.in: Regenerate.
10376 * testsuite/arm_attr_merge.sh: New file.
10377 * testsuite/arm_attr_merge_[67][ab].s: Same.
10378
3e01a7fd
NC
103792010-05-05 Nick Clifton <nickc@redhat.com>
10380
10381 * po/es.po: Updated Spanish translation.
10382
7ad2014a
L
103832010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10384
10385 * Makefile.am (install-exec-local): Properly install gold as
10386 default cross linker.
10387 * Makefile.in: Regenerated.
10388
4fda8867
NC
103892010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10390 Nick Clifton <nickc@redhat.com>
10391
10392 * configure.ac (install_as_default): Define and set to false
10393 unless --enable-gold or --enable-gold=both/gold has been
10394 specified.
10395 * configure: Regenerate.
10396
10397 * Makefile.am (install-exec-local): Install the executable as
10398 'ld.gold'. If install_as_default is true then also install it as
10399 'ld'.
10400 * Makefile.in: Regenerated.
10401
bd288ea2
ILT
104022010-04-24 Ian Lance Taylor <iant@google.com>
10403
10404 * layout.cc (Layout::layout_reloc): In relocatable link don't
10405 combine reloc sections for grouped sections.
10406
ef38fd8a
ST
104072010-04-23 Sriraman Tallam <tmsriram@google.com>
10408
10409 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10410 sections that are not ordinary to icf.
10411 * icf.cc (get_section_contents): Handle relocation pointing to section
10412 with no object or shndx information.
10413 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10414 * testsuite/Makefile.in: Regenerate.
10415 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10416 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10417
f6973bdc
ILT
104182010-04-22 Ian Lance Taylor <iant@google.com>
10419
10420 * expression.cc (Expression::Expression_eval_info): Add
10421 result_alignment_pointer field.
10422 (Expression::eval_with_dot): Add result_alignment_pointer
10423 parameter. Change all callers.
10424 (Expression::eval_maybe_dot): Likewise.
10425 (class Binary_expression): Add alignment_pointer parameter to
10426 left_value and right_value. Change all callers.
10427 (BINARY_EXPRESSION): Set result alignment.
10428 (class Trinary_expression): Add alignment_pointer parameter to
10429 arg2_value and arg3_value. Change all callers.
10430 (Trinary_cond::value): Set result alignment.
10431 (Max_expression::value, Min_expression::value): Likewise.
10432 (Align_expression::value): Likewise.
10433 * script-sections.cc (class Sections_element): Add dot_alignment
10434 parameter to set_section_addresses virtual function. Update
10435 instantiations.
10436 (class Output_section_element): Likewise.
10437 (Script_sections::create_segments): Add dot_alignment parameter.
10438 Change all callers.
10439 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10440 (Script_sections::set_phdrs_clause_addresses): Likewise.
10441 * script-sections.h: Update declarations.
10442 * script.h: Update declarations.
10443 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10444 min_p_align.
10445 * testsuite/script_test_3.t: Set large alignment.
10446 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10447 segment has expected alignment.
10448
9c9c98a5
NC
104492010-04-22 Nick Clifton <nickc@redhat.com>
10450
10451 * po/gold.pot: Updated by the Translation project.
10452 * po/vi.po: Updated Vietnamese translation.
10453
2253bfba
L
104542010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10455
10456 * testsuite/Makefile.am (check_PROGRAMS): Add
10457 icf_virtual_function_folding_test.
10458 * testsuite/Makefile.in: Regenerated.
10459
85fdf906
AH
104602010-04-15 Andrew Haley <aph@redhat.com>
10461
10462 * options.h (merge_exidx_entries): New option.
10463 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10464 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10465 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10466 (Target_arm::merge_exidx_entries): New function.
10467 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10468 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10469 to Arm_exidx_fixup constructor.
10470 Add new arg, merge_exidx_entries.
10471 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10472 Arm_output_section::fix_exidx_coverage.
10473
ce97fa81
ST
104742010-04-18 Sriraman Tallam <tmsriram@google.com>
10475
10476 * icf.cc (get_section_contents): Check for preemptible functions.
10477 Ignore addend when appropriate.
10478 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10479 section folded.
10480 (add_from_relobj): Check for section folded.
10481 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10482 * symtab.h (should_add_dynsym_entry): Add new parameter.
10483 * target-reloc.h (scan_relocs): Check for section folded.
10484 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10485 Check reloc types for function pointers in shared objects.
10486 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10487 case.
10488 (icf_preemptible_functions_test): New test case.
10489 (icf_string_merge_test): New test case.
10490 * testsuite.Makefile.in: Regenerate.
10491 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10492 bar_glob. Refactor code.
10493 * testsuite/icf_preemptible_functions_test.cc: New file.
10494 * testsuite/icf_preemptible_functions_test.sh: New file.
10495 * testsuite/icf_string_merge_test.cc: New file.
10496 * testsuite/icf_string_merge_test.sh: New file.
10497 * testsuite/icf_virtual_function_folding_test.cc: New file.
10498 * testsuite/icf_virtual_function_folding_test.sh: New file.
10499
04ceb17c
DK
105002010-04-14 Doug Kwan <dougkwan@google.com>
10501
10502 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10503 for local symbol recounting if we remove a section due to ICF.
10504 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10505 there are no regular objects in input.
10506
153e7da4
DK
105072010-04-13 Doug Kwan <dougkwan@google.com>
10508
10509 * arm.cc (Arm_input_section::set_final_data_size): Compute
10510 accurate final data size instead of using current data size.
10511
4dbd9faf
DK
105122010-04-09 Doug Kwan <dougkwan@google.com>
10513
10514 * layout.cc (Layout::choose_output_section): Handle script section
10515 types.
10516 (Layout::make_output_section_for_script): Add section type parameter.
10517 Handle script section types.
10518 * layout.h (Layout::make_output_section_for_script): Add section
10519 type parameter.
10520 * output.cc (Output_section::Output_section): Initialize data member
10521 is_noload_.
10522 (Output_section::do_reset_address_and_file_offset): Do not set address
10523 to 0 if section is a NOLOAD section.
10524 * output.h (Output_section::is_noload): New method.
10525 (Output_section::set_is_noload): Ditto.
10526 (Output_section::is_noload_): New data member.
10527 * script-c.h (Script_section_type): New enum type.
10528 (struct Parser_output_section_header): Add new file section_type.
10529 * script-sections.cc (Sections_element::output_section_name): Add
10530 parameter for returning script section type.
10531 (Output_section_definition::output_section_name): Ditto.
10532 (Output_section_definition::section_type)P; New method.
10533 (Output_section_definiton::script_section_type_name): Ditto.
10534 (Output_section_definition::script_section_type_): New data member.
10535 (Output_section_definition::Output_section_definition): Initialize
10536 data member Output_section_definition::script_section_type_.
10537 (Output_section_definition::create_sections): Pass script section type
10538 to Layout::make_output_section_for_script.
10539 (Output_section_definition::output_section_name): Return script
10540 section type to caller.
10541 (Output_section_definition::set_section_address): Do not advance
10542 dot value and load address if section type is NOLOAD. Set address
10543 of NOLOAD sections regardless of section flags.
10544 (Output_section_definition::print): Print section type if it is
10545 not SCRIPT_SECTION_TYPE_NONE.
10546 (Output_section_definition::section_type): New method.
10547 (Output_section_definition::script_section_type_name): Ditto.
10548 (Script_sections::output_section_name): Add new parameter
10549 PSECTION_TYPE for returning script section type. Pass it to
10550 section elements. Handle discard sections.
10551 (Sort_output_sections::operator()): Handle NOLOAD sections.
10552 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10553 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10554 returning script section type.
10555 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10556 INFO and NOLOAD.
10557 * yyscript.y (union): Add new field SECTION_TYPE.
10558 (COPY, DSECT, INFO, NOLOAD): New tokens.
10559 (opt_address_and_section_type): Change type to output_section_header.
10560 (section_type): New non-terminal
10561 (section_header): Handle section type.
2253bfba 10562 (opt_address_and_section_type): Return section type value.
4dbd9faf 10563
721ea635
L
105642010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10565
10566 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10567 * testsuite/plugin_common_test_2.c (foo): Likewise.
10568
6bf924b0
DK
105692010-04-08 Doug Kwan <dougkwan@google.com>
10570
10571 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10572 Output_merge_data.
10573 * output.cc (Output_section::add_merge_input_section): Simplify
10574 code and return status of Output_merge_base::add_input_section.
e1df38aa 10575 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10576 returns true.
10577
24af6f92
DK
105782010-04-07 Doug Kwan <dougkwan@google.com>
10579
10580 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10581 if section is marked as containing instructions but has no mapping
10582 symbols.
10583 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10584 correct section index.
10585 (Arm_relobj::find_linked_text_section): Ditto.
10586
00698fc5
CC
105872010-04-07 Cary Coutant <ccoutant@google.com>
10588
10589 * archive.cc (include_member): Destroy Read_symbols_data object before
10590 releasing file.
10591 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10592 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10593 (Read_symbols_data::~Read_symbols_data) New destructor.
10594 (Section_relocs::Section_relocs) New constructor.
10595 (Section_relocs::~Section_relocs) New destructor.
10596 (Read_relocs_data::Read_relocs_data) New constructor.
10597 (Read_relocs_data::~Read_relocs_data) New destructor.
10598 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10599 pointers to NULL after deleting.
10600
7296d933
DK
106012010-04-07 Doug Kwan <dougkwan@google.com>
10602
10603 * arm.cc: Replace "endianity" with "endianness" in comments.
10604 (Arm_exidx_cantunwind): Ditto.
10605 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10606 (Arm_relobj::merge_flags_and_attributes): New method.
10607 (Arm_relobj::merge_flags_and_attributes_): New data member.
10608 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10609 (Arm_relobj::scan_sections_for_stubs): Ditto.
10610 (Arm_relobj::do_read_symbols): Check to see if we really want to
10611 merge processor-specific flags and attributes. Exit early if
10612 an object is empty except for section names and the undefined symbol.
10613 (Target_arm::do_finalize_sections): Move check for ELF format to
10614 Arm_relobj::do_read_symbols. Merge processor specific flags and
10615 attributes from a regular object only when we have determined that
10616 it is aapropriate. Do not create an .ARM.attributes section in
10617 output if there is no regular input object.
10618 (Target_arm::merge_processor_specific_flags): Check
10619 --warn-mismatch before printing any error.
10620 (Target_arm::merge_object_attributes): Ditto.
10621 * gold.cc (queue_middle_tasks): Handle the case in which there is
10622 no regular object in input.
10623 * options.cc (General_options::parse_EB): New method.
10624 (General_options::parse_EL): Same.
10625 (General_options::General_options): Initialize endianness_.
10626 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10627 New options.
10628 (General_options::Endianness): New enum.
10629 (General_options::endianness): New method.
10630 (General_options::endianness_): New data member.
10631 * parameters.cc (Parameters::set_options): Check target endianness.
10632 (Parameters::set_target_once): Ditto.
10633 (Parameters::check_target_endianness): New method.
10634 (parameters_force_valid_target): If either -EL or -EB is specified,
10635 use it to define endianness of default target.
10636 * parameters.h (Parameters::check_target_endianness): New method
10637 declaration.
10638 * target.h (class Target): Change "endianity" to "endianness"
10639 in comments.
10640
efc8d4f2
RW
106412010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10642
10643 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10644 * configure: Regenerate.
10645 * Makefile.in: Regenerate.
10646 * testsuite/Makefile.in: Regenerate.
10647
be234d88
CC
106482010-04-06 Cary Coutant <ccoutant@google.com>
10649
10650 gcc PR lto/42757
10651 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10652 prevailing definitions of common symbols.
10653 * testsuite/plugin_test_6.sh: New test case.
10654 * testsuite/plugin_common_test_1.c: New test case.
10655 * testsuite/plugin_common_test_2.c: New test case.
10656 * testsuite/Makefile.am (plugin_test_6): New test case.
10657 * testsuite/Makefile.in: Regenerate.
10658
bd32c6bd
NC
106592010-04-06 Nick Clifton <nickc@redhat.com>
10660
10661 * po/vi.po: New Vietnamese translation.
10662
323c532f
DK
106632010-03-30 Doug Kwan <dougkwan@google.com>
10664
10665 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10666
4fcd97eb
DK
106672010-03-25 Doug Kwan <dougkwan@google.com>
10668
10669 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10670 to avoid a conversion warning on a 32-bit host.
10671
4ebf39db
ILT
106722010-03-24 Ian Lance Taylor <iant@google.com>
10673
10674 * testsuite/script_test_3.t: Add a TLS segment.
10675 * testsuite/Makefile.am (check_PROGRAMS): Add
10676 tls_phdrs_script_test.
10677 (tls_phdrs_script_test_SOURCES): Define.
10678 (tls_phdrs_script_test_DEPENDENCIES): Define.
10679 (tls_phdrs_script_test_LDFLAGS): Define.
10680 (tls_phdrs_script_test_LDADD): Define.
10681 * testsuite/Makefile.in: Rebuild.
10682
4a599bdd
CC
106832010-03-23 Cary Coutant <ccoutant@google.com>
10684
10685 * fileread.cc (find_or_make_view): Fix comment.
10686
6c93b22c
ILT
106872010-03-23 Ian Lance Taylor <iant@google.com>
10688
10689 * script-sections.cc (class Orphan_section_placement): Define
10690 PLACE_TLS and PLACE_TLS_BSS.
10691 (Orphan_section_placement::Orphan_section_placement): Initialize
10692 new places.
10693 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10694 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10695 (tls_script_test_SOURCES): Define.
10696 (tls_script_test_DEPENDENCIES): Define.
10697 (tls_script_test_LDFLAGS): Define.
10698 (tls_script_test_LDADD): Define.
10699 * testsuite/Makefile.in: Rebuild.
10700
a2c7281b
DK
107012010-03-22 Doug Kwan <dougkwan@google.com>
10702
10703 * arm.cc (Arm_relocate_functions::abs8,
10704 Arm_relocate_functions::abs16): Use correct check for overflow
10705 specified in the ARM ELF specs.
10706 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10707 target of a BLX instruction specially.
10708 (Reloc_stub::stub_type_for_reloc): Ditto.
10709 (Relocate::relocate): Use symbolic names instead of numeric relocation
10710 codes to report error.
10711 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10712 workaround.
10713 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10714 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10715 thumb2_blx_out_of_range.stdout
10716 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10717 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10718 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10719 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10720 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10721 thumb2_blx_in_range, thumb2_blx_in_range.o,
10722 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10723 thumb2_blx_out_of_range.o): New rules.
2e702c99 10724 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10725 thumb2_blx_in_range and thumb2_blx_out_of_range.
10726 * testsuite/Makefile.in: Regenerate.
10727 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10728 * testsuite/thumb_blx_in_range.s: New file.
10729 * testsuite/thumb_blx_out_of_range.s: New file.
10730
b0193076
RÁE
107312010-03-22 Rafael Espindola <espindola@google.com>
10732
10733 * archive.cc (Should_include): Move to archive.h.
10734 (should_include_member): Make it a member of Archive.
10735 (Lib_group): New.
10736 (Add_lib_group_symbols): New.
10737 * archive.h: Include options.h.
10738 (Archive_member): Moved from Archive.
10739 (Should_include): Moved from archive.cc.
10740 (Lib_group): New.
10741 (Add_lib_group_symbols): New.
10742 * dynobj.cc (do_should_include_member): New.
10743 * dynobj.h (do_should_include_member): New.
10744 * gold.cc (queue_initial_tasks): Update call to queue.
10745 * main.cc (main): Print lib group stats.
10746 * object.cc (do_should_include_member): New.
10747 * object.h: Include archive.h.
10748 (Object::should_include_member): New.
10749 (Object::do_should_include_member): New.
10750 (Sized_relobj::do_should_include_member): New.
10751 * options.cc (General_options::parse_start_lib): New.
10752 (General_options::parse_end_lib): New.
10753 (Input_arguments::add_file): Handle lib groups.
10754 (Input_arguments::start_group): Check we are not in a lib.
10755 (Input_arguments::start_lib): New.
10756 (Input_arguments::end_lib): New.
10757 * options.h (General_options): Add start_lib and end_lib.
10758 (Input_argument::lib_): New.
10759 (Input_argument::lib): New.
10760 (Input_argument::is_lib): New.
10761 (Input_file_lib): New.
10762 (Input_arguments::in_lib_): New.
10763 (Input_arguments::in_lib): New.
10764 (Input_arguments::start_lib): New.
10765 (Input_arguments::end_lib_): New.
10766 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10767 in unused members as preempted.
10768 (Sized_pluginobj::do_should_include_member): New.
10769 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10770 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10771 return the blocker.
10772 (Read_symbols::do_whole_lib_group): New.
10773 (Read_symbols::do_lib_group): New.
10774 (Read_symbols::do_read_symbols): Handle lib groups.
10775 (Read_symbols::get_name): Handle lib groups.
10776 * readsyms.h (Read_symbols): Add an archive member pointer.
10777 (Read_symbols::do_whole_lib_group): New.
10778 (Read_symbols::do_lib_group): New.
10779 (Read_symbols::member_): New.
10780 * script.cc (read_input_script): Update call to queue_soon.
10781
d099120c
DK
107822010-03-19 Doug Kwan <dougkwan@google.com>
10783
10784 * arm.cc (Stub_table::Stub_table): Initialize new data members
10785 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10786 (Stub_table::add_reloc_stub): Assign stub offset and update
10787 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10788 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10789 New data members.
2e702c99 10790 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10791 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10792 instead of going over all reloc stubs.
2e702c99 10793 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10794 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10795 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10796 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10797 Stringpool_template::offset_.
10798 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10799 Stringpool_template::offset_ to zero.
10800
1aa37384
DK
108012010-03-15 Doug Kwan <dougkwan@google.com>
10802
10803 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10804 offset_.
10805 (Stringpool_template::new_key_offset): New method.
10806 (Stringpool_template::add_string): Assign offsets when adding new
10807 strings.
10808 (Stringpool_template::set_string_offsets): Do not set string offsets
10809 when not optimizing.
10810 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10811 member size_.
2e702c99
RM
10812 (Chunked_vector::clear): Clear size_.
10813 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10814 (Chunked_vector::size): Return size_.
10815 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10816 (Chunked_vector::size_): New data member.
1aa37384
DK
10817 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10818 (Stringpool_template::new_key_offset): New method declaration.
10819 (Stringpool_template::offset_): New data member.
10820
b672b057
RÁE
108212010-03-15 Rafael Espindola <espindola@google.com>
10822
10823 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10824 Add_symbols' constructor.
10825 * readsyms.h (Add_symbols): Remove the input_group member.
10826
b6848d3c
ILT
108272010-03-10 Ian Lance Taylor <iant@google.com>
10828
10829 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10830 target to ask whether a reference to a symbol requires a stack
10831 split.
10832 * target.h (Target::is_call_to_non_split): New function.
10833 (Target::do_is_call_to_non_split): Declare virtual function.
10834 * target.cc: Include "symtab.h".
10835 (Target::do_is_call_to_non_split): New function.
10836 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10837
a2a5469e
CC
108382010-03-10 Cary Coutant <ccoutant@google.com>
10839
10840 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10841 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10842 (File_read::open[2]): Add whole_file_view_ to list of views.
10843 (File_read::make_view): Remove test of whole_file_view_.
10844 (File_read::find_or_make_view): Create whole_file_view_ if
10845 necessary.
10846 (File_read::clear_views): Replace bool parameter with enum;
10847 adjust all callers. Don't delete views with permanent data;
10848 do delete cached views and views from archives if
10849 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10850 if clearing the corresponding view.
10851 * fileread.h (File_read::Clear_views_mode): New enum.
10852 (File_read::View::is_permanent_view): New method.
10853 (File_read::clear_views): Replace bool parameter
10854 with enum; adjust all callers.
10855 * options.h (General_options): Change keep_files_mapped option;
10856 add map_whole_files.
10857 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10858 releasing the file.
10859 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10860 the file.
10861
8861f32b
DM
108622010-03-10 David S. Miller <davem@davemloft.net>
10863
10864 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10865
d62d0f5f
ST
108662010-03-09 Sriraman Tallam <tmsriram@google.com>
10867
10868 * icf.cc (get_section_contents): Add '@' marker after processing the
10869 merge reloc.
10870
9177756d
DK
108712010-03-08 Doug Kwan <dougkwan@google.com>
10872
10873 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10874 due to a conversion warning.
10875 (Arm_relobj::update_output_local_symbol_count): Check for local
10876 symbol with unset output index.
10877
9e9e071b
ILT
108782010-03-05 Ian Lance Taylor <iant@google.com>
10879
10880 * options.h (class General_options): Add --spare-dynamic-tags.
10881 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10882 --spare-dynamic-tags.
10883
a81ee015
ILT
108842010-03-05 Ian Lance Taylor <iant@google.com>
10885
10886 * incremental.cc: Include "libiberty.h".
10887
44ec90b9
RO
108882010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10889
10890 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10891 function, is_info_ member.
10892 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10893 (Versions::Versions): Update caller.
10894 (Versions::define_base_version): Likewise.
10895 (Versions::add_def): Likewise.
10896
0897ed3b
ST
108972010-03-03 Sriraman Tallam <tmsriram@google.com>
10898
10899 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10900 (Scan::possible_function_pointer_reloc): New function.
10901 (Scan::local_reloc_may_be_function_pointer): Change to call
10902 possible_function_pointer_reloc.
10903 (Scan::global_reloc_may_be_function_pointer): Ditto.
10904 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10905 relocations in ".data.rel.ro._ZTV" section.
10906 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10907 * testsuite/icf_safe_so_test.cc: Ditto.
10908 * testsuite/icf_safe_test.cc: Ditto.
10909 * testsuite/icf_safe_test.sh: Ditto.
10910
d3bbad62
ILT
109112010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10912 Ian Lance Taylor <iant@google.com>
10913
10914 * target-reloc.h (relocate_section): Check the symbol table index
10915 for -1U before setting the local symbol index.
10916 (scan_relocatable_relocs): If copying the relocation, record that
10917 the local symbol is required.
10918 * object.h (Symbol_value::is_output_symtab_index_set): New
10919 function.
10920 (Symbol_value::may_be_discarded_from_output_symtab): New
10921 function.
10922 (Symbol_value::has_output_symtab_entry): New function.
10923 (Symbol_value::needs_output_symtab_entry): Remove.
10924 (Symbol_value::output_symtab_index): Make sure the symbol index is
10925 set.
10926 (Symbol_value::set_output_symtab_index): Make sure the symbol
10927 index is not set. Make sure the new index is valid.
10928 (Symbol_value::set_must_have_output_symtab_entry): New function.
10929 (Symbol_value::has_output_dynsym_entry): New function.
10930 (Symbol_value::set_output_dynsym_index): Make sure the new index
10931 is valid.
10932 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10933 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10934 local symbol if permitted.
10935 (Sized_relobj::do_finalize_local_symbols): Call
10936 is_output_symtab_index_set rather than needs_output_symtab_entry.
10937 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10938 rather than needs_output_symtab_entry. Call
10939 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10940 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10941 is_output_symtab_index_set rather than needs_output_symtab_entry.
10942 * testsuite/discard_locals_relocatable_test.c: New file.
10943 * testsuite/discard_locals_test.sh: Test -r.
10944 * testsuite/Makefile.am (check_DATA): Add
10945 discard_locals_relocatable_test1.syms,
10946 discard_local_relocatable_test2.syms.
10947 (MOSTLYCLEANFILES): Likewise. Also add
10948 discard_locals_relocatable_test1.lout and
10949 discard_locals_relocatable_test2.out.
10950 (discard_locals_relocatable_test1.syms): New target.
10951 (discard_locals_relocatable_test.o): New target.
10952 (discard_locals_relocatable_test1.out): New target.
10953 (discard_locals_relocatable_test2.syms): New target.
10954 (discard_locals_relocatable_test2.out): New target.
10955 (various): Add missing ../ld-new dependencies.
10956 * testsuite/Makefile.in: Rebuild.
10957
7e8ccf26
NC
109582010-03-03 Nick Clifton <nickc@redhat.com>
10959
10960 * po/fi.po: New Finnish translation.
10961
2a0ff005
DK
109622010-03-01 Doug Kwan <dougkwan@google.com>
10963
10964 * layout.cc (Layout::Layout): Force section types of .init_array*,
10965 .preinit_array* and .fini_array* sections.
10966 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10967 Fix check of return value of std::string::find.().
10968 (Output_section::Input_section_sort_compare::operator()): Remove
10969 comment about .init_array.
10970 (Output_section::Input_section_sort_init_fini_compare::operator()):
10971 New method.
10972 (Output_section::sort_attached_input_sections): Handle .init_array
10973 and .fini_array specially.
10974 * output.h (Output_section::Inut_section_sort_compare): Update
10975 comment.
10976 (Output_section::Input_section_sort_init_fini_compare): New struct.
10977
c3e4ae29
DK
109782010-02-26 Doug Kwan <dougkwan@google.com>
10979
10980 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10981 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10982 * testsuite/debug_msg.sh: Avoid matching source line number for
10983 use of global variable undef_int.
10984
2fd9ae7a
DK
109852010-02-26 Doug Kwan <dougkwan@google.com>
10986
10987 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10988 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10989 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10990 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10991 * options.cc (General_options::General_options): Initialize member
10992 fix_v4bx_.
10993 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10994 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10995 and rm_no_fix_v4bx.stdout
10996 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10997 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10998 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10999 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
11000 and arm_no_fix_v4bx.
11001 * Makefile.in: Regenerate.
11002 * testsuite/arm_fix_v4bx.s: New file.
11003 * testsuite/arm_fix_v4bx.sh: Ditto.
11004
67ec7d0b
DK
110052010-02-24 Doug Kwan <dougkwan@google.com>
11006
11007 * arm.cc (Target_arm::got_section): Make the .got section the first
11008 non RELRO section in the data segment.
11009 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
11010 suffixes of section names.
11011
10165461
DK
110122010-02-24 Doug Kwan <dougkwan@google.com>
11013
11014 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
11015 flags and attributes merging if an input file is a binary file.
11016 * fileread.cc (Input_file::open): Record format of original file.
11017 * fileread.h (Input_file::Format): New enum type.
2e702c99 11018 (Input_file::Input_file): Initialize data member format_.
10165461
DK
11019 (Input_file::format): New method definition.
11020 (Input_file::format_):: New data member.
11021
4a54abbb
DK
110222010-02-24 Doug Kwan <dougkwan@google.com>
11023
11024 * arm.cc (Arm_output_data_got): New class.
11025 (ARM_TCB_SIZE): New constant
11026 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
11027 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
11028 If user uses a script with a SECTIONS clause, issue only a warning
11029 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 11030 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
11031 garbage collection.
11032 (Target_arm::got_mode_index_entry): Handle static linking.
11033 (Target_arm::Scan::local): Ditto.
11034 (Target_arm::Scan::global): Ditto.
11035 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
11036 all incorrectly implemented relocations.
e1df38aa 11037 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
11038 Arm_output_section::fix_exidx_coverage.
11039 * layout.cc (Layout::section_name_mapping): Remove trailing dots
11040 from ".ARM.exidx." and ".ARM.extab.".
11041
ca419a6f
ILT
110422010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11043
11044 * arm.cc (Target_arm::do_finalize_sections): Create attribute
11045 section if it does not already exist.
11046 * attributes.cc (Attributes_section_data::Attributes_section_data):
11047 Don't crash if size is zero.
11048
135b9c78
ILT
110492010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11050 Ian Lance Taylor <iant@google.com>
11051
11052 * gold.cc (queue_middle_tasks): If no input files were opened,
11053 exit.
11054 * workqueue.h (Task_function::Task_function): Assert that there is
11055 a blocker.
11056
bb0bfe4f
DK
110572010-02-22 Doug Kwan <dougkwan@google.com>
11058
11059 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
11060 * icf.cc (get_section_contents): Cast snprintf arguments to long long
11061 types to avoid warnings due to different uint64_t implementations
11062 on different hosts.
11063
2a2b6d42
DK
110642010-02-21 Doug Kwan <dougkwan@google.com>
11065
11066 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
11067 handling of the maximum backward branch offset.
2e702c99 11068 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
11069 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
11070 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 11071 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
11072 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11073 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11074 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11075 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11076 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11077 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11078 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11079 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11080 thumb2_bl_out_of_range.o): New rules.
11081 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11082 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11083 thumb2_bl_out_of_range
11084 * testsuite/Makefile.in: Regenerate.
11085 * testsuite/arm_bl_in_range.s: New file.
11086 * testsuite/arm_bl_out_of_range.s: Ditto.
11087 * testsuite/arm_branch_in_range.sh: Ditto.
11088 * testsuite/arm_branch_range.t: Ditto.
11089 * testsuite/thumb2_branch_range.t: Ditto.
11090 * testsuite/thumb_bl_in_range.s: Ditto.
11091 * testsuite/thumb_bl_out_of_range.s: Ditto.
11092 * testsuite/thumb_branch_range.t: Ditto.
11093
b487ad64
ST
110942010-02-20 Sriraman Tallam <tmsriram@google.com>
11095
11096 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11097 Add reloc offset information.
11098 * icf.cc (get_section_contents): Change iterators to point to the new
11099 vectors. Add reloc offset information to the contents.
11100 * icf.h (Icf::Sections_reachable_info): New typedef.
11101 (Icf::Sections_reachable_list): New typedef.
11102 (Icf::Offset_info): New typedef.
11103 (Icf::Reloc_info): New struct typedef.
11104 (Icf::Reloc_info_list): New typedef.
11105 (Icf::symbol_reloc_list): Delete method.
11106 (Icf::addend_reloc_list): Delete method.
11107 (Icf::section_reloc_list): Delete method.
11108 (Icf::reloc_info_list): New method.
11109 (Icf::reloc_info_list_): New member.
11110
f96accdf
DK
111112010-02-19 Doug Kwan <dougkwan@google.com>
11112
11113 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11114 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11115 * arm.cc (Arm_relocation_functions): New forward declaration.
11116 (Target_arm::Target_arm): Initialize new data members
11117 got_mod_index_offset_ and tls_base_symbol_defined_.
11118 (Target_arm::Relocate::relocate_tls): New method.
11119 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11120 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11121 New methods.
2e702c99 11122 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
11123 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11124 (Target_arm::got_mod_index_offset_,
11125 Target_arm::tls_base_symbol_defined_): New data members.
11126 (Target_arm::Scan::local, Target::Scan::global,
11127 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11128 relocations.
11129
c8761b9a
DK
111302010-02-18 Doug Kwan <dougkwan@google.com>
11131
11132 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11133 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11134 text section as a parameter becuase some broken tools may not set
11135 the link in section header.
11136 (Target_arm::has_got_section): New method.
11137 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11138 without any mapping symbol as data only. Remove warning.
11139 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11140 link in its section header, try to discover the link by inspecting the
11141 REL31 relocation at the beginning of the section.
11142 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11143 in error message.
11144 (Target_arm::Scan::global): Treat any reference to the symbol
11145 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11146
21bb3914
ST
111472010-02-12 Sriraman Tallam <tmsriram@google.com>
11148
11149 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11150 (Scan::global_reloc_may_be_function_pointer): New function.
11151 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11152 (Scan::global_reloc_may_be_function_pointer): New function.
11153 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11154 (Scan::global_reloc_may_be_function_pointer): New function.
11155 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11156 (Scan::global_reloc_may_be_function_pointer): New function.
11157 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11158 (Scan::global_reloc_may_be_function_pointer): New function.
11159 (Scan::possible_function_pointer_reloc): New function.
11160 (Target_x86_64::can_check_for_function_pointers): New function.
11161 * gc.h (gc_process_relocs): Scan relocation types to determine if
11162 function pointers were taken for targets that support it.
11163 * icf.cc (Icf::find_identical_sections): Include functions for
11164 folding in safe ICF whose pointer is not taken.
11165 * icf.h (Secn_fptr_taken_set): New typedef.
11166 (fptr_section_id_): New member.
11167 (section_has_function_pointers): New function.
11168 (set_section_has_function_pointers): New function.
11169 (check_section_for_function_pointers): New function.
11170 * options.h: Fix comment for safe ICF option.
11171 * target.h (can_check_for_function_pointers): New function.
11172 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11173 Modify icf_safe_test for X86-64.
11174 * testsuite/Makefile.in: Regenerate.
11175 * testsuite/icf_safe_so_test.cc: New file.
11176 * testsuite/icf_safe_so_test.sh: New file.
11177 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11178 (main): Change to take pointer to function kept_func_3.
11179 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11180 folding is done correctly for X86-64.
11181
0da6fa6c
DM
111822010-02-12 David S. Miller <davem@davemloft.net>
11183
11184 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11185 is_symbolless parameter.
11186 (Output_reloc<SHT_REL>::is_symbolless): New.
11187 (Output_reloc<SHT_REL>::is_symbolless_): New.
11188 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11189 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11190 (Output_reloc<SHT_RELA>::is_symbolless): New.
11191 (Output_data_reloc::add_global): Handle is_symbolless.
11192 (Output_data_reloc::add_global_relative): Likewise.
11193 (Output_data_reloc::add_local): Likewise.
11194 (Output_data_reloc::add_local_relative): Likewise.
11195 (Output_data_reloc::add_symbolless_global_addend): New.
11196 (Output_data_reloc::add_symbolless_local_addend): New.
11197 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11198 is_symbolless.
11199 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11200 instead of ->is_relative_
11201 (Output_reloc::write): Likewise.
11202 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11203 (Output_reloc::write_rel): Simplify.
11204
11205 * sparc.cc (Target_sparc::Scan::local): Use
11206 ->add_symbolless_local_addend as needed.
11207 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11208 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11209 based upon relocation offset.
11210
e4782e83
DK
112112010-02-11 Doug Kwan <dougkwan@google.com>
11212
11213 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11214 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11215 beginning of function.
11216 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11217 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11218 parameter is_32bit in calls to should_apply_static_reloc.
11219 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11220 (check_DATA): Add arm_abs_global.stdout.
11221 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11222 arm_abs_global.stdout): New rules.
11223 (MOSTLLYCLEANFILES): Add arm_abs_global
11224 * Makefile.in: Regenerate.
11225 * testsuite/arm_abs_global.s: New file.
11226 * testsuite/arm_abs_global.sh: Ditto.
11227 * testsuite/arm_abs_lib.s: Ditto.
11228
93ceb764
ILT
112292010-02-11 Ian Lance Taylor <iant@google.com>
11230
11231 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11232 Read_relocs task.
11233 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11234 Allocate_commons_task first.
11235 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11236 task, rather than symtab_lock_.
11237 (Gc_process_relocs::~Gc_process_relocs): New function.
11238 (Gc_process_relocs::is_runnable): Check this_blocker_.
11239 (Gc_process_relocs::locks): Use next_blocker_ rather than
11240 blocker_.
11241 (Scan_relocs::~Scan_relocs): New function.
11242 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11243 symtab_lock_.
11244 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11245 next_blocker_.
11246 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11247 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11248 constructor accordingly.
11249 (class Gc_process_relocs): Likewise.
11250 (class Scan_relocs): Likewise.
11251 * common.h (class Allocate_commons_task): Remove symtab_lock_
11252 field, and corresponding constructor parameter.
11253 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11254 symtab_lock_.
11255 (Allocate_commons_task::locks): Likewise.
11256
114dfbe1
ILT
112572010-02-11 Ian Lance Taylor <iant@google.com>
11258
11259 * gold-threads.h (class Once): Define.
11260 (class Initialize_lock): Rewrite as child of Once.
11261 * gold-threads.cc (class Once_initialize): Define.
11262 (once_pointer_control): New static variable.
11263 (once_pointer, once_arg): New static variables.
11264 (c_run_once): New static function.
11265 (Once::Once, Once::run_once, Once::internal_run): New functions.
11266 (class Initialize_lock_once): Remove.
11267 (initialize_lock_control): Remove.
11268 (initialize_lock_pointer): Remove.
11269 (initialize_lock_once): Remove.
11270 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11271 (Initialize_lock::initialize): Rewrite.
11272 (Initialize_lock::do_run_once): New function.
11273 * archive.cc (Archive::interpret_header): Only clear name if it is
11274 not already empty.
11275 * fileread.cc: Include "gold-threads.h"
11276 (file_counts_lock): New static variable.
11277 (file_counts_initialize_lock): Likewise.
11278 (File_read::release): Only increment counts when using --stats.
11279 Use a lock around the increment.
11280 * parameters.cc (class Set_parameters_target_once): Define.
11281 (set_parameters_target_once): New static variable.
11282 (Parameters::Parameters): Move here from parameters.h.
11283 (Parameters::set_target): Rewrite.
11284 (Parameters::set_target_once): New function.
11285 (Parameters::clear_target): Move here and rewrite.
11286 * parameters.h (class Parameters): Update declarations. Add
11287 set_parameters_target_once_ field.
11288 (Parameters::Parameters): Move to parameters.cc.
11289 (Parameters::clear_target): Likewise.
11290 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11291 task.
11292 (Start_group::~Start_group): New function.
11293 (Start_group::is_runnable): New function.
11294 (Start_group::locks, Start_group::run): New functions.
11295 (Finish_group::run): Change saw_undefined to size_t.
11296 * readsyms.h (class Start_group): Define.
11297 (class Finish_group): Change saw_undefined_ field to size_t.
11298 (Finish_group::Finish_group): Remove saw_undefined and
11299 this_blocker parameters. Change all callers.
11300 (Finish_group::set_saw_undefined): New function.
11301 (Finish_group::set_blocker): New function.
11302 * symtab.h (class Symbol_table): Change saw_undefined to return
11303 size_t. Change saw_undefined_ field to size_t.
11304 * target-select.cc (Set_target_once::do_run_once): New function.
11305 (Target_selector::Target_selector): Initialize set_target_once_
11306 field. Don't initialize lock_ and initialize_lock_ fields.
11307 (Target_selector::instantiate_target): Rewrite.
11308 (Target_selector::set_target): New function.
11309 * target-select.h (class Set_target_once): Define.
11310 (class Target_selector): Update declarations. Make
11311 Set_target_once a friend. Remove lock_ and initialize_lock_
11312 fields. Add set_target_once_ field.
11313
fa17a3f4
ILT
113142010-02-10 Ian Lance Taylor <iant@google.com>
11315
11316 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11317 queueing any tasks.
11318 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11319 (queue_middle_tasks): Add all blockers before queueing any tasks.
11320 (queue_final_tasks): Likewise.
11321 * token.h (Task_token::add_blockers): New function.
11322 * object.h (Input_objects::number_of_relobjs): New function.
11323
c7177d31
ILT
113242010-02-10 Ian Lance Taylor <iant@google.com>
11325
5de0e392
ILT
11326 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11327 shared, not if not position independent.
11328 * x86_64.cc (Relocate::relocate_tls): Likewise.
11329 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11330 (tls_pie_pic_test): New target.
11331 * testsuite/Makefile.in: Rebuild.
11332
c7177d31
ILT
11333 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11334 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11335 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11336 * testsuite/Makefile.in: Rebuild.
11337
684b268a
DM
113382010-02-09 David S. Miller <davem@davemloft.net>
11339
11340 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11341 R_SPARC_RELATIVE using ->add_local_relative().
11342 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11343
612a8d3d
DM
11344 * output.h (Output_data_dynamic::add_section_size): New method
11345 that takes two Output_data objects.
11346 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11347 entry param. Handle it in initializers.
11348 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11349 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11350 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11351 arg.
11352 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11353 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11354 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11355 for dynrel_includes_plt.
11356 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11357 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11358 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11359 before .rela.plt
11360 (Target_sparc::do_finalize_sections): Update to pass true for
11361 dynrel_includes_plt.
11362 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11363 output before .rela.plt
11364 (Target_powerpc::do_finalize_sections): Update to pass true for
11365 dynrel_includes_plt when 32-bit.
11366
cb1be87e
DK
113672010-02-08 Doug Kwan <dougkwan@google.com>
11368
11369 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11370 method.
11371 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11372 Arm_relobj::scan_section_for_cortex_a8_stubs,
11373 Arm_relobj::do_relocation_section): Instead of calling
11374 Output_section::output_address, use faster
11375 Arm_relobj::simple_input_section_output_address.
11376
705b5121
DM
113772010-02-08 David S. Miller <davem@davemloft.net>
11378
11379 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11380 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11381 relocation helper function.
11382
024c4466
DM
11383 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11384 just like R_SPARC_GOT{10,13,22}.
11385 (Target_sparc::Scan::local): Likewise.
11386 (Target_sparc::Relocate:relocate): Likewise.
11387
9109c078
ILT
113882010-02-06 Ian Lance Taylor <iant@google.com>
11389
11390 * configure.ac: Rewrite targetobjs duplicate removal code to use
11391 only shell constructs.
11392 * configure: Rebuild.
11393
cf846138
DK
113942010-02-05 Doug Kwan <dougkwan@google.com>
11395
11396 PR 11247
11397 * arm.cc (Arm_relobj::section_is_scannable): New method.
11398 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11399 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11400
6cfaf60b
DK
114012010-02-04 Doug Kwan <dougkwan@google.com>
11402
11403 PR 11247
11404 * arm-reloc-property.cc (cstdio): Include.
11405 * configure.ac (targetobjs): Remove duplicates.
11406 * configure: Regenerate.
11407 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11408 big and little endian version for a given address size.
11409
5c57f1be
DK
114102010-02-03 Doug Kwan <dougkwan@google.com>
11411
11412 * arm-reloc-property.cc
11413 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11414 definition.
11415 * arm-reloc-property.h
11416 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11417 New method definition.
11418 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11419 declaration.
11420 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11421 overflow to N.
11422 (GOT_PREL): Change implemented to Y.
11423 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11424 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11425 (Arm_relocate_functions::movw_abs_nc): Remove method.
11426 (Arm_relocate_functions::movt_abs): Ditto.
11427 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11428 (Arm_relocate_functions::thm_movt_abs): Ditto.
11429 (Arm_relocate_functions::movw_rel_nc): Ditto.
11430 (Arm_relocate_functions::movw_rel): Ditto.
11431 (Arm_relocate_functions::movt_rel): Ditto.
11432 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11433 (Arm_relocate_functions:thm_movw_rel): Ditto.
11434 (Arm_relocate_functions:thm_movt_rel): Ditto.
11435 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11436 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11437 New method definitions.
11438 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11439 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11440 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11441 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11442 (Target_arm::Relocate::relocate): Check for non-static or
11443 unimplemented relocation code and exit early. Change calls to
11444 Target_arm::reloc_uses_thumb_bit and
11445 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11446 instead. Refactor code to handle similar relocations to increase
11447 code sharing. Remove check for unsupported relocation code in switch
11448 statement.
11449 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11450 relocation property table to find out size. Change error message to
11451 print out the name of a relocation code instead of the numeric value.
11452 (Target_arm::scan_reloc_for_stub): Use relocation property table
11453 instead of calling Target_arm::reloc_uses_thumb_bit().
11454
218c5831
DK
114552010-02-02 Doug Kwan <dougkwan@google.com>
11456
11457 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11458 types of relaxed input section.
11459
0d31c79d
DK
114602010-02-02 Doug Kwan <dougkwan@google.com>
11461
11462 * Makefile.am (HFILES): Add arm-reloc-property.h.
11463 (DEFFILES): New.
2e702c99
RM
11464 (TARGETSOURCES): Add arm-reloc-property.cc
11465 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11466 (libgold_a_SOURCES): $(DEFFILES)
11467 * Makefile.in: Regenerate.
11468 * arm-reloc-property.cc: New file.
11469 * arm-reloc-property.h: New file.
11470 * arm-reloc.def: New file.
11471 * arm.cc: Update comments.
11472 (arm-reloc-property.h): New included header.
11473 (arm_reloc_property_table): New global variable.
11474 (Target_arm::do_select_as_default_target): New method definition.
11475 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11476 arm-reloc-property to targ_extra_obj.
11477 * parameters.cc (set_parameters_target): Call
11478 Target::select_as_default_target().
11479 * target.h (Target::select_as_default_target): New method definition.
11480 (Target::do_select_as_default_target): Same.
11481
546c7457
DK
114822010-02-01 Doug Kwan <dougkwan@google.com>
11483
11484 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11485 first_output_text_section_.
11486 (Arm_exidx_fixup::first_output_text_section): New method definition.
11487 (Arm_exidx_fixup::first_output_text_section_): New data member.
11488 (Arm_exidx_fixup::process_exidx_section): Record the first text
11489 output section seen.
11490 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11491 and entsize in output section header.
11492
11b861d5
DK
114932010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11494
11495 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11496 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11497 (Arm_relocate_functions::thm_alu11): New Method.
11498 (Arm_relocate_functions::thm_pc8): New Method.
11499 (Arm_relocate_functions::thm_pc12): New Method.
11500 (Target_arm::Scan::local): Handle the relocations.
11501 (Target_arm::Scan::global): Likewise.
11502 (Target_arm::Relocate::relocate): Likewise.
11503 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11504
c9a2c125
DK
115052010-01-29 Doug Kwan <dougkwan@google.com>
11506
11507 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11508 of relocation types as ld.
11509
1521477a
DK
115102010-01-29 Doug Kwan <dougkwan@google.com>
11511
11512 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11513 to public.
11514 (Arm_relocate_functions::thumb_branch_common): Ditto.
11515 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11516 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11517 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11518 Arm_relocate_functions::jump24): Remove.
11519 (Target_arm::Relocate::relocate): Adjust code to call
11520 Arm_relocation_functions::arm_branch_common and
11521 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11522 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11523
e7eca48c
DK
115242010-01-29 Doug Kwan <dougkwan@google.com>
11525
11526 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11527 output_local_symbol_count_needs_update_.
11528 (Arm_relobj::output_local_symbol_count_needs_update,
11529 Arm_relobj::set_output_local_symbol_count_needs_update,
11530 Arm_relobj::update_output_local_symbol_count): New methods.
11531 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11532 member.
11533 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11534 of pointed function as in a R_ARM_PREL31 relocation.
11535 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11536 for output local symbol count updating.
11537 (Target_arm::do_relax): Update output local symbol counts in objects
11538 if necessary.
11539 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11540
02961d7e
ILT
115412010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11542
11543 * arm.cc: Added support for the ARM relocations:
11544 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11545 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11546 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11547 movw_prel_nc).
11548 (Arm_relocate_functions::movw_rel): New method.
11549 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11550 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11551 thm_movw_prel_nc).
11552 (Arm_relocate_functions::thm_movw_rel): New method.
11553 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11554 thm_movt_prel).
11555 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11556 relocations.
11557 (Target_arm::Scan::global): Likewise.
11558 (Target_arm::Relocate::relocate): Likewise.
11559 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11560 Likewise.
11561
b10d2873
ILT
115622010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11563
11564 * arm.cc: Added support for ARM group relocations.
11565 (Target_arm::reloc_needs_sym_origin): New method.
11566 (Arm_relocate_functions::calc_grp_kn): New method.
11567 (Arm_relocate_functions::calc_grp_residual): New method.
11568 (Arm_relocate_functions::calc_grp_gn): New method.
11569 (Arm_relocate_functions::arm_grp_alu): New Method.
11570 (Arm_relocate_functions::arm_grp_ldr): New Method.
11571 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11572 (Arm_relocate_functions::arm_grp_ldc): New Method.
11573 (Target_arm::Scan::local): Handle the ARM group relocations.
11574 (Target_arm::Scan::global): Likewise.
11575 (Target_arm::Relocate::relocate): Likewise.
11576 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11577 Likewise.
11578
2b328d4e
DK
115792010-01-26 Doug Kwan <dougkwan@google.com>
11580
11581 * arm.cc (set): Include.
11582 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11583 pointer type.
2e702c99 11584 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11585 (Arm_output_section::append_text_sections_to_list): New method.
11586 (Arm_output_section::fix_exidx_coverage): Ditto.
11587 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11588 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11589 Relobj::set_section_offset() instead of
11590 Sized_relobj::invalidate_section_offset().
2e702c99 11591 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11592 parameter for section headers. Ignore relocation sections for
11593 unallocated sections and EXIDX sections.
11594 (Target_arm::fix_exidx_coverage): New method.
11595 (Target_arm::output_section_address_less_than): New type.
11596 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11597 linked text section instead of the EXIDX section.
11598 (Arm_output_section::create_stub_group): Add an assertion to check
11599 that this is not an EXIDX output section.
11600 (Arm_output_section::append_text_sections_to_list): New method.
11601 (Arm_output_section::fix_exidx_coverage): Ditto.
11602 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11603 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11604 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11605 first pass.
11606 (Target_arm::fix_exidx_coverage): New method.
11607 * object.h (Relobj::set_output_section): New method.
11608 (Sized_relobj::invalidate_section_offset): Remove method.
11609 (Sized_relobj::do_invalidate_section_offset): Remove method.
11610 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11611
c7f3c371
DK
116122010-01-25 Doug Kwan <dougkwan@google.com>
11613
11614 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11615 Fix warning due to signed and unsigned comparison on a 32-bit host.
11616
8923b24c
DK
116172010-01-22 Doug Kwan <dougkwan@google.com>
11618
11619 * arm.cc (Target_arm::do_relax): Record an output section for section
11620 offset adjustment it contains any stub table that has changed.
11621 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11622 offsets in an output section if necessary.
11623 * output.cc (Output_section::Output_section): Initialize
11624 section_offsets_need_adjustments_.
11625 (Output_section::add_input_section_for_script): Renamed to
11626 Output_section::add_simple_input_section.
11627 (Output_section::save_states): Add a comment.
11628 (Output_section::discard_states): New method defintion.
11629 (Output_section::adjust_section_offsets): Same.
11630 * output.h (Output_section::add_input_section_for_script): Renamed to
11631 Output_section::add_simple_input_section.
11632 (Output_section::discard_states): New method declaration.
11633 (Output_section::adjust_section_offsets): Same.
11634 (Output_section::section_offsets_need_adjustment,
11635 Output_section::set_section_offsets_need_adjustment): New method
11636 definitions.
11637 (Output_section::section_offsets_need_adjustment_): New data member.
11638 * script-sections.cc
11639 (Output_section_element_input::set_section_address): Adjust code for
11640 renaming of Output_section::add_input_section_for_script.
11641 (Orphan_output_section::set_section_address): Same.
11642
9b2fd367
DK
116432010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11644
11645 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11646 Fix_v4bx enum values .
11647 * gold/options.h (General_options): New option definitions.
11648 (General_options::fix_v4bx): New method.
11649 (General_options::Fix_v4bx): New enum.
11650 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11651 (General_options::parse_fix_v4bx_interworking): New method.
11652
80d0d023
DK
116532010-01-22 Doug Kwan <dougkwan@google.com>
11654
11655 * arm.cc (Arm_exidx_fixup): New class.
11656
af2cdeae
DK
116572010-01-21 Doug Kwan <dougkwan@google.com>
11658
11659 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11660 classes.
11661 (Arm_exidx_section_offset_map): New type.
11662
993d07c1
DK
116632010-01-21 Doug Kwan <dougkwan@google.com>
11664
11665 * arm.cc (Arm_exidx_input_section): New class.
11666 (Arm_relobj::exidx_input_section_by_link,
11667 Arm_relobj::exidx_input_section_by_shndx,
11668 Arm_relobj::make_exidx_input_section): New methods.
11669 (read_arm_attributes_section): Remove.
11670 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11671 information about them.
11672 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11673 to here.
11674
5ac169d4
DK
116752010-01-20 Doug Kwan <dougkwan@google.com>
11676
11677 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11678 Input_section_specifier to Section_id.
11679 (Target_arm::new_arm_input_section: Adjust code for change of key
11680 type.
11681 (Target_arm::find_arm_input_section): Ditto.
11682 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11683 (Section_id): Remove.
11684 (Garbage_collection::Section_id_hash): Remove.
11685 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11686 (Section_id): Remove.
11687 (Icf::Section_id_hash): Remove.
11688 * object.h (Section_id, Const_section_id, Section_id_hash,
11689 Const_section_id_hash): New type definitions.
11690 * output.cc (Output_section::add_relaxed_input_section): Change to
11691 use Const_section_id instead of Input_section_specifier as key type.
11692 (Output_section::add_merge_input_section): Ditto.
11693 (Output_section::build_relaxation_map): Change to use Section_id
11694 instead of Input_section_specifier as key type.
2e702c99 11695 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11696 Ditto.
11697 (Output_section::convert_input_sections_to_relaxed_sections): Change
11698 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11699 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11700 (Output_section::find_relaxed_input_section): Ditto.
11701 * output.h (Input_section_specifier): Remove class.
11702 (Output_section::Output_section_data_by_input_section_map): Change
11703 key type to Const_section_id.
11704 (Output_section::Output_relaxed_input_section_by_input_section_map):
11705 Ditto.
11706 (Output_section::Relaxation_map): Change key type to Section_id.
11707
a2162063
ILT
117082010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11709
11710 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11711 (class Arm_v4bx_stub): New class.
11712 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11713 (Stub_factory::make_arm_v4bx_stub): New method.
11714 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11715 (Stub_table::empty): Handle v4bx stubs.
11716 (Stub_table::add_arm_v4bx_stub): New method.
11717 (Stub_table::find_arm_v4bx_stub): New method.
11718 (Arm_relocate_functions::v4bx): New method.
11719 (Target_arm::fix_v4bx): New method.
11720 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11721 (Stub_table::relocate_stubs): Likewise.
11722 (Stub_table::do_write): Likewise.
11723 (Stub_table::update_data_size_and_addralign): Likewise.
11724 (Stub_table::finalize_stubs): Likewise.
11725 (Target_arm::Scan::local): Likewise.
11726 (Target_arm::Scan::global): Likewise.
11727 (Target_arm::do_finalize_sections): Likewise.
11728 (Target_arm::Relocate::relocate): Likewise.
11729 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11730 Likewise.
11731 (Target_arm::scan_reloc_for_stub): Likewise.
11732 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11733
5696ab0b
ILT
117342010-01-19 Ian Lance Taylor <iant@google.com>
11735
11736 * output.cc (Output_section_headers::do_sized_write): Write large
11737 segment count to sh_info field.
11738 (Output_file_header::do_sized_write): For large segment count,
11739 write PN_XNUM to e_phnum field.
11740
800d0f56
ILT
117412010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11742
11743 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11744 (Arm_relocate_functions::thm_jump8): New function.
11745 (Arm_relocate_functions::thm_jump11): New function.
11746 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11747 R_ARM_THM_JUMP11.
11748 (Target_arm::Scan::global): Likewise.
11749 (Target_arm::Relocate::relocate): Likewise.
11750 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11751 Likewise.
11752
41263c05
DK
117532010-01-14 Doug Kwan <dougkwan@google.com>
11754
11755 * arm.cc (map, utility): Include headers.
11756 (Target_arm::apply_cortex_a8_workaround): New method.
11757 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11758 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11759 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11760 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11761 the --[no-]fix-cortex-a8 command line options.
11762 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11763 (Target_arm::relocate_stub): Use addend in instruction template.
11764 * options.h (DEFINE_bool): Set the user-set flag.
11765 (General_options): Add --[no-]-fix-cortex options.
11766 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11767 : Update fast look-up map after conversion.
41263c05 11768
459e9b03
ST
117692010-01-14 Sriraman Tallam <tmsriram@google.com>
11770
11771 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11772 in the first pass of do_layout.
11773
b521dfe4
DK
117742010-01-13 Doug Kwan <dougkwan@google.com>
11775
11776 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11777 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11778 apparent compiler problem of not folding static constant integral
11779 data members of elfcpp::Elf_sizes<32>.
11780
44272192
DK
117812010-01-13 Doug Kwan <dougkwan@google.com>
11782
11783 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11784 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11785 Arm_relobj::scan_section_for_cortex_a8_erratum,
11786 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11787 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11788 sections to scan for relocation stubs into a new method
11789 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11790 relocation and Cortex-A8 stub scanning.
11791 (Target_arm::do_relax): Force stubs to be after stubbed sections
11792 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11793 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11794 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11795
44b71ece
ILT
117962010-01-12 Ian Lance Taylor <iant@google.com>
11797
11798 * target-reloc.h (visibility_error): New inline function.
11799 (relocate_section): Call visibility_error.
11800 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11801 (MOSTLYCLEANFILES): Likewise.
11802 (protected_4_pic.o, protected_3.err): New targets.
11803 * testsuite/protected_4.cc: New file.
11804
a120bc7f
DK
118052010-01-12 Doug Kwan <dougkwan@google.com>
11806
11807 * arm.cc (Cortex_a8_reloc): New class.
11808 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11809 and cortex_a8_relocs_info_.
11810 (Target_arm::fix_cortex_a8): New method definition.
11811 (Target_arm::Cortex_a8_relocs_info): New type.
11812 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11813 New data member declarations.
11814 (Target_arm::scan_reloc_for_stub): Record information about
11815 relocations for THUMB branches that might be exempted from the
11816 Cortex-A8 workaround.
11817 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11818 at the beginning of a relaxation pass.
11819
20138696
DK
118202010-01-12 Doug Kwan <dougkwan@google.com>
11821
11822 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11823 (Arm_relobj::Mapping_symbol_position,
11824 Arm_reloj::Mapping_symbol_position_less,
11825 Arm_relobj::Mapping_symbols_info): New types.
11826 (Target_arm::is_mapping_symbol_name): New method definition.
11827 (Arm_relobj::do_count_local_symbols): Save information about mapping
11828 symbols.
11829
089d69dc
DK
118302010-01-11 Doug Kwan <dougkwan@google.com>
11831
11832 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11833 Arm_relocate_functions::thumb32_branch_upper,
11834 Arm_relocate_functions::thumb32_branch_lower,
11835 Arm_relocate_functions::thumb32_cond_branch_offset,
11836 Arm_relocate_functions::thumb32_cond_branch_upper,
11837 Arm_relocate_functions::thumb32_cond_branch_lower,
11838 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11839 branch offset encoding.
11840 (Arm_relocate_functions::thumb_branch_common): Use new branch
11841 offset encoding methods to avoid code duplication.
11842 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11843 (Stub_addend_reader::operator()): Use new branch encoding method
11844 to avoid code duplication.
11845
99e5bff2
DK
118462010-01-11 Doug Kwan <dougkwan@google.com>
11847
11848 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11849 (Target_arm::do_finalize_sections): Define special EXIDX section
11850 symbols only if referenced.
11851 * gc.h (Garbage_collection::add_reference): New method.
11852 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11853 code duplication.
11854
98e090bd
ILT
118552010-01-11 Ian Lance Taylor <iant@google.com>
11856
d0a91bd8
ILT
11857 * script.cc (Version_script_info::build_expression_list_lookup):
11858 Change complaing about duplicate wildcard match from error to
11859 warning.
11860
98e090bd
ILT
11861 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11862 of 2009-12-30.
11863 (Version_script_info::Version_script_info): Initialize globs_,
11864 default_version_, default_is_global_, and exact_. Don't
11865 initialize globals_ or locals_.
11866 (Version_script_info::build_lookup_tables): Build local symbols
11867 first.
11868 (Version_script_info::unquote): New function.
11869 (Version_script_info::add_exact_match): New function.
11870 (Version_script_info::build_expression_list_lookup): Remove lookup
11871 parameter. Add is_global parameter. Change all callers. Handle
11872 wildcard pattern specially. Unquote pattern. Call
11873 add_exact_match.
11874 (Version_script_info::get_name_to_match): New function.
11875 (Version_script_info::get_symbol_version): New function.
11876 (Version_script_info::get_symbol_version_helper): Remove.
11877 (Version_script_info::check_unmatched_names): Call unquote.
11878 * script.h (class Version_script_info): Change get_symbol_version
11879 to be non-inline and add is_global parameter; change all callers.
11880 Rewrite symbol_is_local. Update declarations. Define struct
11881 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11882 Remove globals_ and locals_ members. Add exact_, globs_,
11883 default_version_, is_global_.
11884 (Version_script_info::Glob): Remove pattern, add expression and
11885 is_global. Update constructor. Change all callers.
11886 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11887 default version.
11888 (Versions::symbol_section_contents): If a symbol is undefined, or
11889 defined in a dynamic object, set the version index to
11890 VER_NDX_LOCAL.
11891 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11892 symbol_is_local.
11893 (Symbol_table::add_from_pluginobj): Likewise.
11894 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11895
d56962d3
DK
118962010-01-11 Doug Kwan <dougkwan@google.com>
11897
11898 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11899 (incremental_dump_LDADD): Add linking option for libintl.
11900 * Makefile.in: Regenerate.
11901
94e6ee91
L
119022010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11903
11904 PR gold/11144
11905 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11906 instead of -Ds.
11907 * testsuite/Makefile.in: Regenerated.
11908
e96c574b
DK
119092010-01-10 Doug Kwan <dougkwan@google.com>
11910
11911 * options.h (DEFINE_var): Use parentheses around argument varname__
11912 in macro body to avoid any unintended subsequent substitutions.
11913
7198066b
ILT
119142010-01-10 Ian Lance Taylor <iant@google.com>
11915
ba4d53bf
ILT
11916 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11917 candidates before doing symbol resolution.
11918
7198066b
ILT
11919 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11920 ODR candidates if only one is weak.
11921
a2beed37
ILT
119222010-01-08 Ian Lance Taylor <iant@google.com>
11923
11924 * script.cc (Version_script_info::build_expression_list_lookup):
11925 Don't warn about ambiguous version, just record the ambiguity.
11926 (Version_script_info::get_symbol_version_helper): Give error if
11927 version is ambiguous.
11928
2fb7225c
DK
119292010-01-08 Doug Kwan <dougkwan@google.com>
11930
11931 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11932 prev_data_size_ and prev_addralign_. Remove initializer for
11933 deleted data member has_been_changed_.
11934 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11935 to determine if the table is empty.
11936 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11937 Remove.
11938 (Stub_table::add_reloc_stub): Define method in class definition
11939 instead of just declaring it there.
11940 (Stub_table::add_cortex_a8_stub): New method definition.
11941 (Stub_table::update_data_size_and_addralign): Ditto.
11942 (Stub_table::finalize_stubs): Ditto.
11943 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11944 (Stub_table::do_addralign_): Return address alignment in the
11945 (Stub_table::do_reset_address_and_file_offset): Define method in
11946 class definition instead of declaring it there. Set current data
11947 size to be the data size of the previous pass.
11948 (Stub_table::set_final_data_size): Use current data size as the
11949 final data size.
11950 (Stub_table::relocate_stub): Change parameter type of stub from
11951 Reloc_stub pointer to Stub pointer.
11952 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11953 (Stub_table::Cortex_a8_stub_list): New typedef.
11954 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11955 Stub_table::prev_addralign_): New data member.
11956 (Arm_relobj::Arm_relobj): Initialize data member
11957 section_has_cortex_a8_workaround_.
11958 (Arm_relobj::section_has_cortex_a8_workaround,
11959 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11960 definitions.
11961 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11962 declarations.
11963 (Target_arm::relocate_stub): Change parameter type of stub from
11964 Reloc_stub pointer to Stub pointer.
11965 (Insn_template::size, Insn_template::alignment): Handle
11966 THUMB16_SPECIAL_TYPE.
11967 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11968 Stub_table::update_data_size_and_addralign,
11969 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11970 definitions.
11971 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11972 (Stub_table::do_write): Ditto.
11973 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11974
880cd20d
ILT
119752010-01-08 Ian Lance Taylor <iant@google.com>
11976
11977 PR 11108
11978 * symtab.h (class Symbol): Remove fields is_target_special_ and
11979 has_plt_offset_. Add field is_defined_in_discarded_section_.
11980 (Symbol::is_defined_in_discarded_section): New function.
11981 (Symbol::set_is_defined_in_discarded_section): New function.
11982 (Symbol::has_plt_offset): Rewrite.
11983 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11984 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11985 Don't initialize is_target_special_ or has_plt_offset_.
11986 Initialize is_defined_in_discarded_section_.
11987 (Symbol_table::add_from_relobj): If appropriate, set
11988 is_defined_in_discarded_section.
11989 * resolve.cc (Symbol::override_base_with_special): Don't test
11990 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11991 * target-reloc.h (relocate_section): Do special handling for
11992 symbols defined in discarded sections for global symbols as well
11993 as local symbols.
11994
2703e3eb
ILT
119952010-01-08 Ian Lance Taylor <iant@google.com>
11996
11997 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11998 the SHT_SYMTAB case.
11999
339d40a3
ILT
120002010-01-08 Ian Lance Taylor <iant@google.com>
12001
12002 * object.cc (Sized_relobj::do_layout): Don't get confused if
12003 layout_eh_frame returns NULL.
12004
abecea76
ILT
120052010-01-08 Ian Lance Taylor <iant@google.com>
12006
12007 PR 11084
12008 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
12009 dynamic symbol table, use the normal symbol table.
12010 (Sized_dynobj::do_read_symbols): Remove assertion about type of
12011 symbol table.
12012
6b7dd3f3
ILT
120132010-01-08 Ian Lance Taylor <iant@google.com>
12014
12015 PR 11072
12016 * layout.cc (Layout::include_section): Remove .gnu_debuglink
12017 sections.
12018
36c50e63
L
120192010-01-08 H.J. Lu <hongjiu.lu@intel.com>
12020
12021 * version.cc (print_version): Change to "Copyright 2010".
12022
e291e7b9
ILT
120232010-01-08 Ian Lance Taylor <iant@google.com>
12024
12025 PR 10287
12026 PR 11063
12027 * i386.cc (class Target_i386): Change return type of plt_section
12028 to be non-const.
12029 (class Output_data_plt_i386): Add tls_desc_rel_ field.
12030 (Output_data_plt_i386::Output_data_plt_i386): Initialize
12031 tls_desc_rel_ field.
12032 (Output_data_plt_i386::rel_tls_desc): New function.
12033 (Target_i386::rel_tls_desc_section): New function.
12034 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
12035 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
12036 R_386_TLS_DESC reloc in rel_tls_desc_section.
12037 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
12038 Define struct Tlsdesc_info.
12039 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
12040 (Target_x86_64::do_reloc_symbol_index): New function.
12041 (Target_x86_64::add_tlsdesc_info): New function.
12042 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
12043 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
12044 tlsdesc_rel_ field.
12045 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
12046 all callers.
12047 (Output_data_plt_x86_64::rela_tlsdesc): New function.
12048 (Target_x86_64::rela_tlsdesc_section): New function.
12049 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
12050 handling.
12051 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
12052 (Target_x86_64::do_reloc_addend): New function.
12053 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
12054 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
12055 declarations. Define TARGET_CODE. Add arg field to u1_ union.
12056 (Output_reloc::type): New function.
12057 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
12058 (Output_reloc::is_target_specific): New function.
12059 (Output_reloc::target_arg): New function.
12060 (class Output_reloc) [SHT_RELA]: Add four new constructors for
12061 absolute relocs and target specific relocs.
12062 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
12063 add_target_specific.
12064 (class Output_data_reloc) [SHT_RELA]: Likewise.
12065 * output.cc (Output_reloc::Output_reloc): Add four new versions
12066 for absolute relocs and target specific relocs.
12067 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
12068 (Output_reloc::get_symbol_index): Likewise.
12069 (Output_reloc::local_section_offset): Check that local_sym_index_
12070 is not TARGET_CODE or 0.
12071 (Output_reloc::symbol_value): Likewise.
12072 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12073 reloc.
12074 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12075 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12076 functions.
12077 * layout.cc (add_target_dynamic_tags): Use output section for
12078 DT_PLTRELSZ and DT_JMPREL.
12079
3a44184e
ILT
120802010-01-07 Ian Lance Taylor <iant@google.com>
12081
12082 PR 11061
12083 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12084 function.
12085 (class Output_data_reloc_generic): Define.
12086 (class Output_data_reloc_base): Change base class to
12087 Output_data_reloc_generic. Change add() method to call
12088 bump_relative_reloc_count for a relative reloc. Remove
12089 sort_relocs_ field.
12090 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12091 to sort_relocs().
12092 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12093 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12094 appropriate.
12095 * layout.h (class Layout): Update declaration.
12096
ea715a34
ILT
120972010-01-07 Ian Lance Taylor <iant@google.com>
12098
12099 * output.h (class Output_data): Add const version of
12100 output_section and do_output_section.
12101 (class Output_section_data): Add const version of
12102 do_output_section.
12103 (class Output_section): Likewise.
12104 * layout.cc (Layout::add_target_dynamic_tags): New function.
12105 * layout.h (class Layout): Update declarations.
12106 * arm.cc (Target_arm::do_finalize_sections): Use
12107 add_target_dynamic_tags.
12108 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12109 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12110 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12111 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12112
659948a4
ILT
121132010-01-07 Ian Lance Taylor <iant@google.com>
12114
12115 PR 11042
12116 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12117 object as needed.
12118
9d3b86f6
ILT
121192010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12120 Ian Lance Taylor <iant@google.com>
12121
12122 PR 11019
12123 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12124 Xindex::read_symtab_xindex.
12125
bb0d3eb0
DK
121262010-01-07 Doug Kwan <dougkwan@google.com>
12127
12128 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12129 (Insn_template::thumb16_bcond_insn): New method declaration.
12130 (Insn_template): Fix spelling.
12131 (Stub::thumb16_special): New method declaration.
12132 (Stub::do_write): Define virtual method which was previously pure
12133 virtual.
12134 (Stub::do_thumb16_special): New method declaration.
12135 (Stub::do_fixed_endian_write): New template member.
12136 (Reloc_stub::do_write): Remove.
12137 (Reloc_stub::do_fixed_endian_write): Remove.
12138 (Cortex_a8_stub): New class definition.
12139 (Stub_factory::make_cortex_a8_stub): New method definition.
12140 (Stub_factory::Stub_factory): Add missing static storage class
12141 qualifier for elf32_arm_stub_a8_veneer_blx.
12142
ffeef7df
ILT
121432010-01-07 Ian Lance Taylor <iant@google.com>
12144
dc3f80fe
ILT
12145 PR 10980
12146 * options.h (class General_options): Add --warn-unresolved-symbols
12147 and --error-unresolved-symbols.
12148 * errors.cc (Errors::undefined_symbol): Implement
12149 --warn-unresolved-symbols.
12150
ffeef7df
ILT
12151 * options.h (class General_options): Add -z text and -z textoff.
12152 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12153
f1ec9ded
ST
121542010-01-06 Sriraman Tallam <tmsriram@google.com>
12155
12156 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12157 (Garbage_collection::cident_sections): New function.
12158 (Garbage_collection::add_cident_section): New function.
12159 (Garbage_collection::cident_sections_): New member.
12160 (gc_process_relocs): Add references to sections whose names are C
12161 identifiers.
12162 * gold.h (cident_section_start_prefix): New constant.
12163 (cident_section_stop_prefix): New constant.
12164 (is_cident): New function.
12165 * layout.cc (Layout::define_section_symbols): Replace string constants
12166 with the newly defined constants.
12167 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12168 C identifiers.
12169 * testsuite/Makefile.am: Add gc_orphan_section_test.
12170 * testsuite/Makefile.in: Regenerate.
12171 * testsuite/gc_orphan_section_test.cc: New file.
12172 * testsuite/gc_orphan_section_test.sh: New file.
12173
6eda8c29
ILT
121742010-01-06 Ian Lance Taylor <iant@google.com>
12175
b9674e17
ILT
12176 PR 10980
12177 * options.h (class General_options): Add --warn-shared-textrel.
12178 * layout.cc (Layout::finish_dynamic_section): Implement
12179 --warn-shared-textrel.
12180
6eda8c29
ILT
12181 PR 10980
12182 * options.h (class General_options): Add --warn-multiple-gp.
12183
32dcd44e
ILT
121842010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12185
12186 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12187 $(THREADSLIB) and $(LIBDL).
12188 * Makefile.in: Rebuild.
12189
a192ba05
ILT
121902010-01-06 Ian Lance Taylor <iant@google.com>
12191
12192 PR 10980
12193 * options.cc (General_options::parse_section_start): New function.
12194 (General_options::section_start): New function.
12195 (General_options::General_options): Initialize all members.
12196 * options.h: Include <map>
12197 (class General_options): Add --section-start. Add section_starts_
12198 member.
12199 * layout.cc (Layout::attach_allocated_section_to_segment): If
12200 --section-start was used, set the address of the segment. Remove
12201 local sort_sections.
12202 (Layout::relaxation_loop_body): If the address of the load segment
12203 has been set by --section-start, don't use it.
12204 * output.h (Output_segment::update_flags_for_output_section): New
12205 function.
12206 * output.cc (Output_segment::add_output_section): Call
12207 update_flags_for_output_section.
12208
dde3f402
ILT
122092010-01-05 Ian Lance Taylor <iant@google.com>
12210
62dfdd4d
ILT
12211 PR 10980
12212 * options.h (class General_options): Add --undefined-version.
12213 * script.cc (struct Version_expression): Add was_matched_by_symbol
12214 field.
12215 (Version_script_info::matched_symbol): New function.
12216 (Version_script_info::get_symbol_version_helper): Call
12217 matched_symbol.
12218 (Version_script_info::check_unmatched_names): New function.
12219 * script.h (class Version_script_info): Update declarations.
12220 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12221
9c4ae156
ILT
12222 * options.h (class General_options): Use DEFINE_bool_alias for
12223 allow_multiple_definition.
12224 * resolve.cc (Symbol_table::should_override): Don't test
12225 allow_multiple_definition.
12226
dde3f402
ILT
12227 PR 10980
12228 * options.h (class General_options): Add --cref.
12229 * main.cc (main): Print cref table if --cref. Don't close mapfile
12230 until after printing cref table.
12231 * cref.cc: Include "symtab.h".
12232 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12233 (Cref_table_compare::operator()): New function.
12234 (Cref_inputs::gather_cref): New function.
12235 (filecol): New static const.
12236 (Cref_inputs::print_cref): New function.
12237 (Cref::print_cref): New function.
12238 * cref.h: Include <cstdio>.
12239 (class Cref): Update declarations.
12240 * mapfile.h (Mapfile::file): New function.
12241 * object.h (class Object): Define Symbols. Declare virtual
12242 do_get_global_symbols.
12243 (Object::get_global_symbols): New function.
12244 * object.cc (Input_objects::add_object): Pass object to cref_ if
12245 --cref.
12246 (Input_objects::archive_start): Likewise.
12247 (Input_objects::archive_stop): Likewise.
12248 (Input_objects::print_cref): New function.
12249 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12250 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12251 --cref.
12252 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12253 function.
12254 * plugin.h (class Sized_pluginobj): Update declarations.
12255
8781f709
ILT
122562010-01-05 Ian Lance Taylor <iant@google.com>
12257
12258 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12259 to is_default_version. Rename insdef to insdefault.
12260 (Symbol_table::add_from_relobj): Rename def to is_default_version
12261 and local to is_forced_local.
12262 (Symbol_table::add_from_pluginobj): Likewise.
12263 (Symbol_table::add_from_dynobj): Likewise.
12264 (Symbol_table::define_special_symbol): Rename insdef to
12265 insdefault.
12266
fe35d28d
ILT
122672010-01-04 Ian Lance Taylor <iant@google.com>
12268
30bc8c46
ILT
12269 PR 10980
12270 * options.h (class General_options): Add
12271 --allow-multiple-definition and -z muldefs.
12272 * resolve.cc (Symbol_table::should_override): Don't warn about a
12273 multiple symbol definition if --allow-multiple-definition or -z
12274 muldefs.
12275
7eaea549
ILT
12276 PR 10980
12277 * options.h (class General_options): Add --add-needed and
12278 --copy-dt-needed-entries. Tweak --as-needed help entry.
12279 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12280 error if --copy-dt-needed-entries aka --add-needed is used and
12281 would cause a change in behaviour.
12282
fe35d28d
ILT
12283 PR 10980
12284 * options.h (class General_options): Add -G as a short version of
12285 --shared. Add no-op options -assert, -g, and -i.
12286
55a2bb35
ST
122872010-01-04 Sriraman Tallam <tmsriram@google.com>
12288
12289 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12290 check for .text or .gnu.linkonce.t sections.
12291 * icf.cc (Icf::find_identical_sections): Ditto.
12292 Change the detection for mangled function name within the section
12293 name.
12294 * icf.h (is_section_foldable_candidate): New function.
12295
719328e1
ILT
122962009-12-30 Ian Lance Taylor <iant@google.com>
12297
12298 PR 10980
12299 * options.h (class General_options): Permit two dashes with
12300 --retain-symbols-file.
12301
d7bb5745
ILT
123022009-12-30 Ian Lance Taylor <iant@google.com>
12303
403a15dd
ILT
12304 PR 10979
12305 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12306 don't put the file header and segment headers in the text
12307 segment.
12308
eda294df
ILT
12309 PR 10979
12310 * common.cc (Sort_commons::operator()): Stabilize sort when both
12311 entries are NULL.
12312 (Symbol_table::do_allocate_commons_list): When allocating common
12313 symbols, skip a symbol which is no longer common.
12314 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12315 an object before checking its type.
12316 * testsuite/common_test_2.c: New file.
12317 * testsuite/common_test_3.c: New file.
12318 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12319 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12320 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12321 (common_test_2_pic.o, common_test_2.so): New targets.
12322 (common_test_3_pic.o, common_test_3.so): New targets.
12323 * testsuite/Makefile.in: Rebuild.
12324
d7bb5745
ILT
12325 PR 10979
12326 * script.cc (read_input_script): If we see a new SECTIONS clause,
12327 and we have added an input section, give an error.
12328 * layout.h (class Layout): Add have_added_input_section function.
12329 Add have_added_input_section_ field.
12330 * layout.cc (Layout::Layout): Initialize
12331 have_added_input_section_.
12332 (Layout::layout): Set have_added_input_section_.
12333 (Layout::layout_eh_frame): Likewise.
12334
fc59c572
ILT
123352009-12-30 Ian Lance Taylor <iant@google.com>
12336
12337 PR 10931
12338 * options.h (class General_options): Add --sort-common option.
12339 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12340 * common.cc (Sort_common): Add sort_order parameter to
12341 constructor. Add sort_order_ field.
12342 (Sort_commons::operator): Check sort_order_.
12343 (Symbol_table::allocate_commons): Determine the sort order.
12344 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12345 Change all callers.
12346 (Symbol_table::do_allocate_commons_list): Likewise.
12347
1c74fab0
ILT
123482009-12-30 Ian Lance Taylor <iant@google.com>
12349
12350 PR 10916
12351 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12352 symbols from this object, don't change the visibility of an
12353 undefined symbol.
12354 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12355
6affe781
ILT
123562009-12-30 Ian Lance Taylor <iant@google.com>
12357
12358 PR 10861
12359 * script.h (class Version_script_info): Define Language enum.
12360 Update declarations. Define Glob, Exact, and Lookup types. Add
12361 new fields globals_, locals_, and is_finalized_.
12362 * script.cc: Various formatting fixes.
12363 (class Parser_closure): Change language_stack_ from a vector of
12364 std::string to one of Version_script_info::Language. Adjust all
12365 uses accordingly.
12366 (class Lazy_demangler): Remove.
12367 (struct Version_expression): Change language from std::string to
12368 Version_script_info::Language.
12369 (Version_script_info::Version_script_info): New function.
12370 (Version_script_info::~Version_script_info): Don't call clear.
12371 (Version_script_info::finalize): New function.
12372 (Version_script_info::build_lookup_tables): New function.
12373 (Version_script_info::build_expression_list_lookup): New
12374 function.
12375 (Version_script_info::get_symbol_version_helper): Rewrite to use
12376 lookup tables.
12377 (Version_script_info::print_expression_list): Adjust to use
12378 Version_script_info::Language.
12379 (script_push_lex_into_version_mode): Check that the version script
12380 has not been finalized.
12381 (version_script_push_lang): Change language string to
12382 Version_script_info::Language.
12383 * options.cc (Command_line::version_script): New function.
12384 * options.h (class General_options): Add finalize_dynamic_list
12385 function. Change version_script from declaration to definition.
12386 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12387 * testsuite/version_script.map: Remove duplicate def of foo.
12388 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12389 version_script.map.
12390 * testsuite/Makefile.in: Rebuild.
12391
818bf354
ILT
123922009-12-30 Ian Lance Taylor <iant@google.com>
12393
12394 PR 10843
12395 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12396 if the input symbol index is 0, make the output symbol index 0.
12397
ebcc8304
ILT
123982009-12-30 Ian Lance Taylor <iant@google.com>
12399
12400 PR 10670
12401 * options.h (class General_options): Add -x/--discard-all.
12402 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12403 --discard-all. If the local symbol needs a dynamic entry, check
12404 that before handling --discard-locals.
12405
176fe33f
ILT
124062009-12-30 Ian Lance Taylor <iant@google.com>
12407
bb321bb1
ILT
12408 PR 10450
12409 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12410 flags to PF_R.
12411 (Output_segment::add_output_section): Don't change the flags if
12412 the type is PT_TLS.
12413
176fe33f
ILT
12414 PR 10450
12415 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12416 GNU hash table if they need a dynamic value. Otherwise, don't add
12417 them if they are defined in a dynamic object or are forced local.
12418
e8cd95c7
ILT
124192009-12-29 Ian Lance Taylor <iant@google.com>
12420
1b81fb71
ILT
12421 PR 10450
12422 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12423 .gnu.hash table for a 32-bit target.
12424
8d6d383d
ILT
12425 PR 10450
12426 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12427 regular and a dynamic object only needs a dynamic symbol table
12428 entry if it is externally visible.
12429
e785ec03
ILT
12430 PR 10450
12431 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12432 constructor. Add global_offset_table_ field.
12433 (Target_i386::got_section): Set global_offset_table_.
12434 (Target_i386::do_finalize_sections): Set global_offset_table_
12435 size.
12436 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12437 in constructor. Add global_offset_table_ field.
12438 (Target_x86_64::got_section): Set global_offset_table_.
12439 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12440 size.
12441
1a2dff53
ILT
12442 * layout.cc (Layout::Layout): Initialize increase_relro_.
12443 (Layout::get_output_section): Add is_relro, is_last_relro, and
12444 is_first_non_relro parameters. Change all callers.
12445 (Layout::choose_output_section): Likewise.
12446 (Layout::add_output_section_data): Likewise.
12447 (Layout::make_output_section): Likewise.
12448 (Layout::set_segment_offsets): Clear increase_relro when using a
12449 linker script.
12450 * layout.h (class Layout): Add increase_relro method. Add
12451 increase_relro_ field. Update declarations.
12452 * output.cc (Output_section::Output_section): Initialize
12453 is_last_relro_ and is_first_non_relro_.
12454 (Output_segment::add_output_section): Group relro sections is
12455 do_sort is true. Handle is_last_relro and is_first_non_relro.
12456 (Output_segment::maximum_alignment): Remove relro handling.
12457 (Output_segment::set_section_addresses): Add increase_relro
12458 parameter. Change all callers. Add initial alignment to align
12459 relro sections on separate page. Remove old relro handling.
12460 (Output_segment::set_section_list_addresses): Remove in_relro
12461 parameter. Change all callers.
12462 (Output_segment::set_offset): Add increase parameter. Change all
12463 callers. Remove old relro handling.
12464 * output.h (class Output_section): Add new methods: is_last_relro,
12465 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12466 Add is_last_relro_ and is_first_non_relro_ fields.
12467 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12468 Create separate .got.plt section. Call increase_relro.
12469 * x86_64.cc (Target_x86_64::got_section): Likewise.
12470 * testsuite/relro_script_test.t: Add .got.plt.
12471
f0ba79e2
ILT
12472 PR 10450
12473 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12474 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12475 (Layout::finalize): Call set_dynamic_symbol_size.
12476 (Layout::set_dynamic_symbol_size): New function.
12477 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12478 set_dynamic_symbol_size.
12479
e8cd95c7
ILT
12480 PR 10450
12481 * output.h (class Output_section): Add is_entsize_zero_ field.
12482 * output.cc (Output_section::Output_section): Initialize
12483 is_entsize_zero_.
12484 (Output_section::set_entsize): If two different entsizes are
12485 requested, force it to zero.
12486 (Output_section::add_input_section): Set flags for .debug_str
12487 before updating section flags. Set entsize.
12488 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12489 and SHF_STRING if all input sections have those flags.
12490
3e1b9a8a
RÁE
124912009-12-29 Rafael Espindola <espindola@google.com>
12492
12493 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12494 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12495 reporting.
3e1b9a8a 12496
3dcad376
ST
124972009-12-29 Sriraman Tallam <tmsriram@google.com>
12498
12499 * options.cc (General_options::parse_version): Allow -v to exit
12500 without an error if there is nothing to link.
12501
084e2665
ILT
125022009-12-29 Ian Lance Taylor <iant@google.com>
12503
12504 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12505 using a version of gcc before 4.1.
12506 * configure: Rebuild.
12507
250acde3
CD
125082009-12-28 Chris Demetriou <cgd@google.com>
12509
12510 * attributes.cc (Output_attributes_section_data::do_write): Use
12511 std::vector::front rather than std::vector::data.
12512
99fff23b
ILT
125132009-12-28 Ian Lance Taylor <iant@google.com>
12514
12515 * symtab.h (class Symbol_table): Add enum Defined.
12516 * resolve.cc (Symbol_table::should_override): Add defined
12517 parameter. Change all callers. Test whether object is NULL
12518 before calling a method on it.
12519 (Symbol_table::report_resolve_problem): Add defined parameter.
12520 Change all callers.
12521 (Symbol_table::should_override_with_special): Likewise.
12522 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12523 parameter. Change all callers.
12524 (Symbol_table::do_define_in_output_data): Likewise.
12525 (Symbol_table::define_in_output_segment): Likewise.
12526 (Symbol_table::do_define_in_output_segment): Likewise.
12527 (Symbol_table::define_as_constant): Likewise.
12528 (Symbol_table::do_define_as_constant): Likewise.
12529 * script.h (class Symbol_assignment): Add is_defsym parameter to
12530 constructor; change all callers.
12531 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12532 parameter. Change all callers. Add is_defsym_ field.
12533 (class Parser_closure): Add parsing_defsym parameter to
12534 constructor; change all callers. Add parsing_defsym accessor
12535 function. Add parsing_defsym_ field.
12536
556bd683
ILT
125372009-12-28 Ian Lance Taylor <iant@google.com>
12538
12539 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12540 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12541
1782c879
ILT
125422009-12-23 Ian Lance Taylor <iant@google.com>
12543
12544 * i386.cc (Target_i386::do_calls_non_split): Recognize
12545 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12546 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12547 -fsplit-stack prologue when using %r11.
1782c879 12548
329ca2b1
ST
125492009-12-21 Sriraman Tallam <tmsriram@google.com>
12550
12551 * options.cc (General_options::parse_version): Make -v continue and do
12552 the link like GNU ld does.
12553
d675ff46
RÁE
125542009-12-17 Rafael Avila de Espindola <espindola@google.com>
12555
12556 * Makefile.am (CCFILES): Add timer.cc.
12557 (HFILES): Add timer.h.
12558 * configure.ac: Check for sysconf and times.
12559 * main.cc: include timer.h.
12560 (main): Use Timer instead of get_run_time.
12561 * timer.cc: New.
12562 * timer.h: New.
12563 * workqueue.cc: include timer.h.
12564 (Workqueue::find_and_run_task):
12565 Report user, sys and wall time.
12566 * Makefile.in: Regenerate.
12567 * config.in: Regenerate.
12568 * configure: Regenerate.
12569
d6344fb5
DK
125702009-12-16 Doug Kwan <dougkwan@google.com>
12571
12572 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12573 sections.
12574 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12575 relaxed input sections.
12576 * output.cc (Output_section::find_relaxed_input_section): Change
12577 return type to Output_relaxed_input_section pointer. Adjust code
12578 for new type of relaxed_input_section_map_.
12579 * output.h (Output_section::find_relaxed_input_section): Change
12580 return type to Output_relaxed_input_section pointer.
12581 (Output_section::Output_relaxed_input_section_by_input_section_map):
12582 New type.
12583 (Output_section::relaxed_input_section_map_): Change type to
12584 Output_section::Output_relaxed_input_section_by_input_section_map.
12585 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12586 input section.
12587
0e0d5469
ILT
125882009-12-15 Ian Lance Taylor <iant@google.com>
12589
12590 * layout.cc (Layout::create_shstrtab): Only write out after input
12591 sections if we are compressing debug sections.
12592
0649a889
ILT
125932009-12-15 Ian Lance Taylor <iant@google.com>
12594
12595 * archive.cc (Archive::add_symbols): Only look up a symbol without
12596 a version if there is, in fact, a version.
12597
2ea97941
ILT
125982009-12-14 Ian Lance Taylor <iant@google.com>
12599
12600 Revert -Wshadow changes, all changes from:
12601 2009-12-11 Doug Kwan <dougkwan@google.com>
12602 2009-12-11 Nick Clifton <nickc@redhat.com>
12603 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12604
b0eec2cc
DK
126052009-12-11 Doug Kwan <dougkwan@google.com>
12606
12607 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12608 due to -Wshadow.
12609 * attributes.cc (Object_attribute::size): Ditto.
12610 (Attributes_section_data::size): Ditto.
12611 (Attributes_section_data::Attributes_section_data): Ditto.
12612 (Output_attributes_section_data::do_write): Ditto.
12613 * attributes.h (Object_attribute::set_type): Ditto.
12614 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12615
91d6fa6a
NC
126162009-12-11 Nick Clifton <nickc@redhat.com>
12617
12618 * archive.cc: Fix shadowed variable warnings.
12619 * arm.cc: Likewise.
12620 * compressed_output.cc: Likewise.
12621 * compressed_output.h: Likewise.
12622 * configure: Likewise.
12623 * dwarf_reader.cc: Likewise.
12624 * dynobj.cc: Likewise.
12625 * dynobj.h: Likewise.
12626 * ehframe.cc: Likewise.
12627 * ehframe.h: Likewise.
12628 * errors.cc: Likewise.
12629 * expression.cc: Likewise.
12630 * fileread.cc: Likewise.
12631 * fileread.h: Likewise.
12632 * freebsd.h: Likewise.
12633 * i386.cc: Likewise.
12634 * icf.cc: Likewise.
12635 * incremental.h: Likewise.
12636 * layout.cc: Likewise.
12637 * layout.h: Likewise.
12638 * mapfile.cc: Likewise.
12639 * merge.cc: Likewise.
12640 * merge.h: Likewise.
12641 * object.cc: Likewise.
12642 * object.h: Likewise.
12643 * options.h: Likewise.
12644 * output.cc: Likewise.
12645 * output.h: Likewise.
12646 * parameters.cc: Likewise.
12647 * plugin.cc: Likewise.
12648 * powerpc.cc: Likewise.
12649 * reduced_debug_output.cc: Likewise.
12650 * reduced_debug_output.h: Likewise.
12651 * reloc.cc: Likewise.
12652 * reloc.h: Likewise.
12653 * resolve.cc: Likewise.
12654 * script-sections.cc: Likewise.
12655 * script.cc: Likewise.
12656 * script.h: Likewise.
12657 * sparc.cc: Likewise.
12658 * symtab.cc: Likewise.
12659 * symtab.h: Likewise.
12660 * target-select.cc: Likewise.
12661 * target-select.h: Likewise.
12662 * token.h: Likewise.
12663 * workqueue.cc: Likewise.
12664 * workqueue.h: Likewise.
12665 * x86_64.cc: Likewise.
12666
a0351a69
DK
126672009-12-10 Doug Kwan <dougkwan@google.com>
12668
12669 * arm.cc (attributes.h): New include.
12670 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12671 (Arm_relobj::~Arm_relobj): Delete object pointed by
12672 attributes_section_data_.
12673 (Arm_relobj::attributes_section_data): New method definition.
12674 (Arm_relobj::attributes_section_data_): New data member declaration.
12675 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12676 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12677 attributes_section_data_.
12678 (Arm_dynobj::attributes_section_data): New method definition.
12679 (Arm_dynobj::attributes_section_data_): New data member declaration.
12680 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12681 initialization value of may_use_blx_ to false.
2e702c99 12682 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12683 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12684 object attributes to compute results instead of hard-coding.
12685 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12686 Target_arm::get_secondary_compatible_arch,
12687 Target_arm::set_secondary_compatible_arch
12688 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12689 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12690 New method declarations.
12691 (Target_arm::get_aeabi_object_attribute): New method definition.
12692 (Target_arm::attributes_section_data_): New data member declaration.
12693 (read_arm_attributes_section): New template definition.
12694 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12695 (Arm_dynobj::do_read_symbols): Ditto.
12696 (Target_arm::do_finalize_sections): Merge attributes sections from
12697 input. Check for BLX use after attributes section merging.
12698 Fix __exidx_start and __exidx_end visibility. Create an
12699 .ARM.attributes section if necessary.
12700 (Target_arm::get_secondary_compatible_arch,
12701 Target_arm::set_secondary_compatible_arch,
12702 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12703 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12704 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12705 New method definitions.
12706
b59befec
ILT
127072009-12-09 Ian Lance Taylor <iant@google.com>
12708
12709 * plugin.cc (Plugin::load): Don't cast from void* to a function
12710 pointer.
12711
1276bc89
ILT
127122009-12-09 Ian Lance Taylor <iant@google.com>
12713
12714 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12715 information fields.
12716
2f2de248
L
127172009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12718
12719 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12720 Replace two_file_shared_1.so with two_file_shared_2.so.
12721 * testsuite/Makefile.in: Regenerated.
12722
4f787271
DK
127232009-12-08 Doug Kwan <dougkwan@google.com>
12724
12725 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12726 (HFILES): Add attributes.h and int_encoding.h.
12727 * Makefile.in: Regenerate.
12728 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12729 function definitions to int_encoding.cc
12730 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12731 prototypes to int_encoding.h
12732 * reduced_debug_output.cc (int_encoding.h): New include.
12733 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12734 function definitions to int_encoding.cc
12735 (insert_into_vector, read_from_pointer): Move template definitions to
12736 int_encoding.h
12737 * attributes.cc: New file.
12738 * attributes.h: New file.
12739 * int_encoding.cc: New file.
12740 * int_encoding.h: New file.
12741
20b52f1a
RÁE
127422009-12-07 Rafael Avila de Espindola <espindola@google.com>
12743
12744 PR gold/11055
12745 * incremental-dump.cc (dump_incremental_inputs): New.
12746 (main): Use dump_incremental_inputs.
12747
53d7974c
L
127482009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12749
12750 PR gold/10893
12751 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12752 checking elfcpp::STT_FUNC.
12753 (Target_i386::Relocate::relocate): Likewise.
12754 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12755
12756 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12757 symbols from shared libraries into normal FUNC symbols.
12758
12759 * symtab.h (Symbol): Add is_func and use it.
12760
05a352e6
DK
127612009-12-05 Doug Kwan <dougkwan@google.com>
12762
12763 * arm.cc (Target_arm::arm_info): Initialize new fields
12764 attributes_section and attributes_vendor.
12765 * i386.cc (Target_i386::i386_info): Same.
12766 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12767 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12768 fields attributes_section and attributes_vendor.
53d7974c 12769 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12770 * target.h (Target::attributes_section, Target::attributes_vendor,
12771 Target::is_attributes_section, Target::attribute_arg_type,
12772 Target::attributes_order): New method definitions.
12773 (Target::Target_info::attributes_section,
12774 Target::Target_info::attributes_vendor): New fields.
12775 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12776 virtual method definitions.
12777 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12778 attributes_section and attributes_vendor.
12779 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12780
f4e5969c
DK
127812009-12-05 Doug Kwan <dougkwan@google.com>
12782
12783 * arm.cc: Update comments about interworking and stub generation.
12784 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12785 considered as non-PIC.
12786 (Arm_relocate_functions::base_abs): Fix formatting.
12787 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12788 of function to use GOT entry address instead of offset.
12789 (Target_arm::Scan::global): Issue an error if a symbol would need a
12790 PLT does not get one because it is untyped. Remove code to create
12791 dynamic symbols for relative branches.
12792 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12793 takes unsigned integer instead of boolean.
12794
1abce4a6
L
127952009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12796
12797 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12798 (two_file_test_LDADD): Likewise.
12799 (common_test_1_LDADD): Likewise.
12800 (exception_test_LDADD) Likewise.
12801 (weak_test_LDADD): Likewise.
12802 (many_sections_test_LDADD): Likewise.
12803 (initpri1_LDADD): Likewise.
12804 (script_test_1_LDADD): Likewise.
12805 (script_test_2_LDADD): Likewise.
12806 (justsyms_LDADD): Likewise.
12807 (binary_test_LDADD): Likewise.
12808 (large_LDADD): Likewise.
12809 * testsuite/Makefile.in: Regenerated.
12810
adcf2816 128112009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12812
adcf2816
L
12813 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12814 (Symbol_table::override_with_special): Likewise.
12815 (Symbol_table::add_from_object): Likewise.
12816
28e67f5d
RÁE
128172009-12-04 Rafael Avila de Espindola <espindola@google.com>
12818
12819 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12820 Don't set the data_offset twice.
12821
ae10a101
RÁE
128222009-12-04 Rafael Avila de Espindola <espindola@google.com>
12823
12824 * testsuite/Makefile.in: Regenerate.
12825
f59f41f3
DK
128262009-12-03 Doug Kwan <dougkwan@google.com>
12827
12828 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12829 (Target_arm::do_finalize_sections): Add parameter for symbol table
12830 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12831 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12832 parameter for symbol table pointer.
12833 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12834 an additional parameter for a pointer to symbol table.
12835 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12836 parameter for a symbol table pointer.
12837 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12838 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12839 Ditto.
12840 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12841 parameter for a symbol table pointer.
12842
ca55d848
RÁE
128432009-12-03 Rafael Avila de Espindola <espindola@google.com>
12844
12845 * incremental.cc (Incremental_inputs_header)
12846 (Incremental_inputs_header_write, Incremental_inputs_entry)
12847 (Incremental_inputs_entry_write): Move ...
12848 * incremental.h (Incremental_inputs_header)
12849 (Incremental_inputs_header_write, Incremental_inputs_entry)
12850 (Incremental_inputs_entry_write): here.
12851
3aec4f9c
RÁE
128522009-12-02 Rafael Avila de Espindola <espindola@google.com>
12853
12854 * incremental.cc (make_sized_incremental_binary): Set the target.
12855 Error if it is incompatible.
12856 * output.h (Output_file): Add filename method.
12857
9c0ae74d
RÁE
128582009-12-02 Rafael Avila de Espindola <espindola@google.com>
12859
12860 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12861 from the get_* methods.
12862
a45500ae
RÁE
128632009-12-02 Rafael Avila de Espindola <espindola@google.com>
12864
12865 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12866 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12867 Write 0 for the data_offset of scripts.
12868
325e6408
RÁE
128692009-12-02 Rafael Avila de Espindola <espindola@google.com>
12870
12871 * testsuite/Makefile.am: Add the incremental_test.sh test.
12872 * testsuite/incremental_test.sh: New.
12873 * testsuite/incremental_test_1.c: New.
12874 * testsuite/incremental_test_2.c: New.
12875
954c3e2e
RÁE
128762009-12-01 Rafael Avila de Espindola <espindola@google.com>
12877
703d02da 12878 * incremental-dump.cc (main): Fix typos.
954c3e2e 12879
f8086623
RÁE
128802009-11-27 Rafael Avila de Espindola <espindola@google.com>
12881
12882 PR gold/11025
12883 * incremental-dump.cc (main): Use llu to print 64 bit values.
12884
3b0dd6ac
L
128852009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12886 H.J. Lu <hongjiu.lu@intel.com>
12887
12888 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12889 $(LIBDL).
12890 (incremental_dump_LDADD): Likewise.
12891 * Makefile.in: Regenerated.
12892
a6d1ef57 128932009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12894
a6d1ef57
DK
12895 Revert:
12896
12897 2009-11-25 Doug Kwan <dougkwan@google.com>
12898
12899 * arm.cc (Target_arm::Target_arm): Move method definition
12900 outside of class definition. Add code to handle
12901 --target1-rel, --target1-abs and --target2= options.
12902 (Target_arm::get_reloc_reloc_type): Change method to be
12903 non-static and const.
12904 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12905 New data member declaration.
12906 (Target_arm::Scan::local, Target_arm::Scan::global,
12907 Target_arm::Relocate::relocate,
12908 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12909 Adjust call to Target_arm::get_real_reloc_type.
12910 (Target_arm::get_real_reloc_type): Use command line options
12911 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12912 * options.h (--target1-rel, --target1-abs, --target2): New
12913 ARM-only options.
12914
50aeb7d4
DK
129152009-11-25 Doug Kwan <dougkwan@google.com>
12916
12917 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12918 class definition. Add code to handle --target1-rel, --target1-abs
12919 and --target2= options.
12920 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12921 and const.
12922 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12923 member declaration.
12924 (Target_arm::Scan::local, Target_arm::Scan::global,
12925 Target_arm::Relocate::relocate,
12926 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12927 call to Target_arm::get_real_reloc_type.
12928 (Target_arm::get_real_reloc_type): Use command line options to
12929 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12930 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12931 options.
12932
51938283
DK
129332009-11-25 Doug Kwan <dougkwan@google.com>
12934
12935 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12936 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12937 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12938 formatting.
12939 (Arm_relocate_functions::thm_call): Replace body with a call to
12940 Arm_relocate_functions::thumb_branch_common.
12941 (Arm_relocate_functions::thm_jump24,
12942 Arm_relocate_functions::thm_xpc22): New method definitions.
12943 (Arm_relocate_functions::thumb_branch_common): New method definition.
12944 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12945 operator.
12946 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12947 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12948
e2b8f3c4
RÁE
129492009-11-24 Rafael Avila de Espindola <espindola@google.com>
12950
12951 * Makefile.am: Build incremental-dump
12952 * Makefile.in: Regenerate.
12953 * incremental-dump.cc: New.
12954 * incremental.cc (Incremental_inputs_header_data,
12955 Incremental_inputs_entry_data): Move to incremental.h
12956 * incremental.h: (Incremental_inputs_header_data,
12957 Incremental_inputs_entry_data): Move from incremental.cc
12958
bcba9aec
RÁE
129592009-11-24 Rafael Avila de Espindola <espindola@google.com>
12960
12961 * incremental.cc (Incremental_inputs_header,
12962 Incremental_inputs_header_write, Incremental_inputs_entry,
12963 Incremental_inputs_entry_write): Add a typedef with the data type.
12964
7c3afe08
RÁE
129652009-11-24 Rafael Avila de Espindola <espindola@google.com>
12966
12967 * incremental.cc (Incremental_inputs_header,
12968 Incremental_inputs_header_write, Incremental_inputs_entry,
12969 Incremental_inputs_entry_write): Update comment about which
12970 type has the filed descriptions.
12971
d204b6e9
DK
129722009-11-15 Doug Kwan <dougkwan@google.com>
12973
12974 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12975 (Arm_relocate_functions::arm_branch_common): Change method defintion
12976 in class definition to a method declaration and update list of formal
12977 parameters.
12978 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12979 Arm_relocation_functions::jump24): Adjust call to
12980 Arm_relocate_functions::arm_branch_common. Update list of formal
12981 parameters.
12982 (Arm_relocate_functions::xpc25): New method definition.
12983 (Arm_relocate_functions::arm_branch_common): Move method defintion
12984 out from class definition. Use stubs for mode-switching and extending
12985 branch ranges.
12986 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12987 specially. Change code to enable use of stubs in ARM branches.
12988
43d12afe
DK
129892009-11-10 Doug Kwan <dougkwan@google.com>
12990
12991 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12992 in method declaration.
12993 (Target_arm::relocate_stub): New method declaration.
12994 (Target_arm::default_target): Change to return a pointer instead of
12995 a const reference.
12996 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12997 Target_arm::default_target.
12998 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12999 method definition.
13000 (Target_arm::relocate_section): Adjust view.
13001 (Target_arm::relocate_stub): New method definition.
13002
ac33a407
DK
130032009-11-10 Doug Kwan <dougkwan@google.com>
13004
13005 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
13006 a format warning.
13007 * incremental.cc (open_incremental_binary): Initialized local
13008 variables to avoid warnings.
13009 * object.cc (make_elf_object): Ditto.
13010 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
13011 a format warning.
e1df38aa 13012
88ee28e9
L
13013009-11-09 H.J. Lu <hongjiu.lu@intel.com>
13014
13015 PR gold/10930
13016 * testsuite/plugin_test.c: Include "config.h".
13017
2daedcd6
DK
130182009-11-09 Doug Kwan <dougkwan@google.com>
13019
13020 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
13021 (arm_symbol_value): Remove.
13022 (Arm_relocate_functions::arm_branch_common,
13023 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
13024 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
13025 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
13026 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
13027 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
13028 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
13029 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
13030 Arm_relocate_functions::thm_mobw_abs_nc,
13031 Arm_relocate_functions::thm_mov_abs,
13032 Arm_relocate_functions::movw_prel_nc,
13033 Arm_relocate_functions::thm_movt_abs,
13034 Arm_relocate_functions::movt_prel,
13035 Arm_relocate_functions::thm_movw_prel_nc,
13036 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
13037 (Target_arm::Relocate::relocate): Only decompose address into two
13038 parts if relocation type uses the thumb-bit and pass the actual
13039 bit instead of a flag indicating that the thumb-bit is used. Adjust
13040 calls to methods in Arm_relocate_functions for this change.
13041
1276bc89 130422009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
13043
13044 PR 10925
13045 * reloc.cc: Instantiate
13046 Sized_relobj::initialize_input_to_output_maps and
13047 Sized_relobj:free_input_to_output_maps.
13048
e53ad1b5
ILT
130492009-11-06 Ian Lance Taylor <iant@google.com>
13050
13051 PR 10876
13052 * defstd.cc (in_segment): Set only_if_ref true for "end".
13053
eb44217c
DK
130542009-11-06 Doug Kwan <dougkwan@google.com>
13055
13056 * arm.cc (class Reloc_stub): Correct a comment.
13057 (Target_arm::Target_arm): Initialize arm_input_section_map_.
13058 (Target_arm::scan_section_for_stubs): New method declaration.
13059 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
13060 Change methods from private to protected.
13061 (Target_arm::do_may_relax): New method definition.
13062 (Target_arm::do_relax, Target_arm::group_sections,
13063 Target_arm::scan_reloc_for_stub,
13064 Target_arm::scan_reloc_section_for_stubs): New method declarations.
13065 (Target_arm::arm_input_section_map_): New data member declaration.
13066 (Target_arm::scan_reloc_for_stub,
13067 Target_arm::scan_reloc_section_for_stubs,
13068 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
13069 Target_arm::do_relax): New method definitions.
13070
5d329b7d
ILT
130712009-11-06 Mikolaj Zalewski <mikolaj@google.com>
13072
13073 * configure.ac: Check for (struct stat)::st_mtim
13074 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13075 * config.in: Regenerate.
13076 * configure: Regenerate.
13077
96a0d71b
ILT
130782009-11-05 Ian Lance Taylor <iant@google.com>
13079
13080 PR 10910
13081 * output.cc (Output_segment::add_output_section): Add missing
13082 return statement.
13083
594c8e5e
ILT
130842009-11-04 Ian Lance Taylor <iant@google.com>
13085
13086 PR 10880
13087 * object.h (class Object): Add is_needed and set_is_needed
13088 methods. Add is_needed_ field. Make bool fields into bitfields.
13089 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13090 defined in a dynamic object and referenced by a regular object,
13091 set is_needed for the dynamic object.
13092 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13093 if the file is marked with as_needed and it is not needed.
13094
22b127cc
ILT
130952009-11-04 Ian Lance Taylor <iant@google.com>
13096
13097 PR 10887
13098 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13099 tags if data is discarded by linker script.
13100 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13101 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13102 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13103 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13104
f5c870d2
ILT
131052009-11-04 Ian Lance Taylor <iant@google.com>
13106
13107 * layout.cc (Layout::get_output_section): Add is_interp and
13108 is_dynamic_linker_section parameters. Change all callers.
13109 (Layout::choose_output_section): Likewise.
13110 (Layout::make_output_section): Likewise.
13111 (Layout::add_output_section_data): Add is_dynamic_linker_section
13112 parameter. Change all callers.
13113 * layout.h (class Layout): Update declarations.
13114 * output.h (class Output_section): Add is_interp, set_is_interp,
13115 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13116 Add is_interp_, is_dynamic_linker_section_ fields. Change
13117 generate_code_fills_at_write_ to a bitfield.
13118 * output.cc (Output_section::Output_sections): Initialize new
13119 fields.
13120 (Output_segment::add_output_section): Add do_sort parameter.
13121 Change all callers.
13122
1ae4d23b
ILT
131232009-11-03 Ian Lance Taylor <iant@google.com>
13124
13125 PR 10860
13126 * options.h (class General_options): Add --warn-common.
13127 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13128 merging two common symbols.
13129 (Symbol_table::should_override): Handle --warn-common when merging
13130 a common symbol with a defined symbol. Use report_resolve_problem
13131 for multiple definitions.
13132 (Symbol_table::report_resolve_problem): New function.
13133 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13134
55da9579
DK
131352009-11-03 Doug Kwan <dougkwan@google.com>
13136
13137 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13138 stub_factory_.
13139 (Target_arm::stub_factory): New method definition.
13140 (Target_arm::new_arm_input_section,
13141 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13142 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 13143 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
13144 New type definitions.
13145 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13146 member declarations.
13147 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13148 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13149 New method definitions.
13150
37a9ac43
ILT
131512009-11-03 Ian Lance Taylor <iant@google.com>
13152
13153 * options.h (class General_options): Add --warn_constructors.
13154
b3d6a3d4
ILT
131552009-11-03 Ian Lance Taylor <iant@google.com>
13156
13157 PR 10893
13158 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13159 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13160
934b01dd
ILT
131612009-11-03 Ian Lance Taylor <iant@google.com>
13162
13163 PR 10895
13164 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13165 --msgid-bugs-address.
13166 (install-pdf): New target.
13167 (install-data_yes): Look up one directory to find mkinstalldirs.
13168
03c1939b
L
131692009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13170
13171 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13172 tree.
13173
ebd95253
DK
131742009-10-30 Doug Kwan <dougkwan@google.com>
13175
13176 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13177
e9bbb538
DK
131782009-10-30 Doug Kwan <dougkwan@google.com>
13179
13180 * arm.cc (Stub_addend_reader): New struct template definition
13181 and partial specializations.
13182 (Stub_addend_reader::operator()): New method definition for a
13183 partially specialized template.
13184
d5b40221
DK
131852009-10-30 Doug Kwan <dougkwan@google.com>
13186
13187 * arm.cc (Arm_relobj::processor_specific_flags): New method
13188 definition.
13189 (Arm_relobj::do_read_symbols): New method declaration.
13190 (Arm_relobj::processor_specific_flags_): New data member declaration.
13191 (Arm_dynobj): New class definition.
13192 (Target_arm::do_finalize_sections): Add input_objects parameter.
13193 (Target_arm::do_adjust_elf_header): New method declaration.
13194 (Target_arm::are_eabi_versions_compatible,
13195 (Target_arm::merge_processor_specific_flags): New method declaration.
13196 (Target_arm::do_make_elf_object): New overloaded method definitions
13197 and declaration.
13198 (Arm_relobj::do_read_symbols): New method definition.
13199 (Arm_dynobj::do_read_symbols): Ditto.
13200 (Target_arm::do_finalize_sections): Add input_objects parameters.
13201 Merge processor-specific flags from all input objects.
13202 (Target_arm::are_eabi_versions_compatible,
13203 Target_arm::merge_processor_specific_flags,
13204 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13205 New method definitions.
13206 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13207 Input_objects pointer type parameter.
13208 * layout.cc (Layout::finalize): Pass input objects to target's.
13209 finalize_sections function.
13210 * output.cc (Output_file_header::do_sized_write): Set ELF file
13211 header's processor-specific flags.
13212 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13213 Input_objects pointer type parameter.
13214 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13215 * target.h (Input_objects): New forward class declaration.
13216 (Target::processor_specific_flags,
13217 Target::are_processor_specific_flags_sect): New method definitions.
13218 (Target::finalize_sections): Add input_objects parameter.
13219 (Target::Target): Initialize processor_specific_flags_ and
13220 are_processor_specific_flags_set_.
13221 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13222 parameter.
13223 (Target::set_processor_specific_flags): New method definition.
13224 (Target::processor_specific_flags_,
13225 Target::are_processor_specific_flags_set_): New data member
13226 declarations.
13227 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13228 Input_objects pointer type parameter.
13229
ebabffbd
DK
132302009-10-30 Doug Kwan <dougkwan@google.com>
13231
13232 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13233
ad0f2072
ILT
132342009-10-28 Ian Lance Taylor <iant@google.com>
13235
13236 * object.h (class Relobj): Drop options parameter from
13237 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13238 do_scan_relocs, do_relocate. Change all callers.
13239 (class Sized_relobj): Drop options parameters from
13240 do_gc_process_relocs, do_scan_relocs, do_relocate,
13241 do_relocate_sections, relocate_sections, emit_relocs_scan,
13242 emit_relocs_scan_reltype. Change all callers.
13243 (struct Relocate_info): Remove options field and all references to
13244 it.
13245 * reloc.h (class Read_relocs): Remove options constructor
13246 parameter and options_ field. Change all callers.
13247 (class Gc_process_relocs, class Scan_relocs): Likewise.
13248 (class Relocate_task): Likewise.
13249 * target-reloc.h (scan_relocs): Remove options parameter. Change
13250 all callers.
13251 (scan_relocatable_relocs): Likewise.
13252 * target.h (class Sized_target): Remove options parameter from
13253 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13254 all callers.
13255 * gc.h (gc_process_relocs): Remove options parameter. Change all
13256 callers.
13257 * arm.cc: Update functions to remove options parameters.
13258 * i386.cc: Likewise.
13259 * powerpc.cc: Likewise.
13260 * sparc.cc: Likewise.
13261 * x86_64.cc: Likewise.
13262 * testsuite/testfile.cc: Likewise.
13263
8ffa3667
DK
132642009-10-28 Doug Kwan <dougkwan@google.com>
13265
13266 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13267 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13268 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13269 New method definitions.
13270
40f36857
CC
132712009-10-28 Cary Coutant <ccoutant@google.com>
13272
13273 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13274 (Plugin::cleanup_done_): New member.
13275 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13276 (Plugin_manager::cleanup_done_): Remove.
13277 (Plugin_manager::add_input_file): Edit error message.
13278 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13279 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13280
2c849493
ILT
132812009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13282
13283 * fileread.cc: (File_read::View::~View): Use the new
13284 data_ownership_ filed.
13285 (File_read::~File_read): Dispose the new whole_file_view_.
13286 (File_read::open): Mmap the whole file if needed.
13287 (File_read::open): Use whole_file_view_ instead of contents_.
13288 (File_read::find_view): Use whole_file_view_ if applicable.
13289 (File_read::do_read): Use whole_file_view_ instead of contents_.
13290 (File_read::make_view): Use whole_file_view_ instead of contents_,
13291 update File_read::View::View call.
13292 (File_read::find_or_make_view): Update File_read::View::View
13293 call.
13294 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13295 remove contents_
13296 (File_read::View::Data_ownership): New enum.
13297 (File_read::View::View): Replace bool mapped_ with Data_ownership
13298 argument.
13299 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13300 (File_read::View::data_ownership_): New field.
13301 (File_read::contents_): Remove (replaced by whole_file_view_).
13302 (File_read::whole_file_view_): New field.
13303 * options.h (class General_options): Add --keep-files-mapped.
13304
24998053
CC
133052009-10-27 Cary Coutant <ccoutant@google.com>
13306
13307 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13308 * testsuite/Makefile.am (plugin_test_5): New test case.
13309 * testsuite/Makefile.in: Regenerate.
13310
72adc4fa
DK
133112009-10-25 Doug Kwan <dougkwan@google.com>
13312
13313 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13314 from private to protected to allow access by child class.
13315 (Sized_relobj::do_relocate_sections): New method declaration.
13316 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13317 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13318 Sized_relobj::relocate_sections. Instantiate template explicitly
13319 for different target sizes and endianity.
13320
07f508a2
DK
133212009-10-24 Doug Kwan <dougkwan@google.com>
13322
13323 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13324 (Arm_input_section::as_arm_input_section): New method.
13325 (Arm_output_section): New class definition.
13326 (Arm_output_section::create_stub_group,
13327 Arm_output_section::group_sections): New method definitions.
13328
10ad9fe5
DK
133292009-10-22 Doug Kwan <dougkwan@google.com>
13330
13331 * arm.cc (Arm_input_section): New class definition.
13332 (Arm_input_section::init, Arm_input_section:do_write,
13333 Arm_input_section::set_final_data_size,
13334 Arm_input_section::do_reset_address_and_file_offset): New method
13335 definitions.
13336
56ee5e00
DK
133372009-10-21 Doug Kwan <dougkwan@google.com>
13338
13339 * arm.cc (Stub_table, Arm_input_section): New forward class
13340 declarations.
13341 (Stub_table): New class defintion.
13342 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13343 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13344 New method definition.
13345
b569affa
DK
133462009-10-21 Doug Kwan <dougkwan@google.com>
13347
13348 * arm.cc: Update copyright comments.
13349 (Target_arm): New forward class template declaration.
13350 (Arm_address): New type.
13351 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13352 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13353 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13354 constants.
13355 (Insn_template): Same.
13356 (DEF_STUBS): New macro.
13357 (Stub_type): New enum type.
13358 (Stub_template): New class definition.
13359 (Stub): Same.
13360 (Reloc_stub): Same.
13361 (Stub_factory): Same.
13362 (Target_arm::Target_arm): Initialize may_use_blx_ and
13363 should_force_pic_veneer_.
13364 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13365 Target_arm::should_force_pic_veneer,
13366 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13367 Target_arm::using_thumb_only, Target_arm:;default_target): New
13368 method defintions.
13369 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13370 New data member declarations.
13371 (Insn_template::size, Insn_template::alignment): New method defintions.
13372 (Stub_template::Stub_template): New method definition.
13373 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13374 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13375 (Stub_factory::Stub_factory): New method definition.
13376 * gold.h (string_hash): New template.
13377 * output.h (Input_section_specifier::hash_value): Use
13378 gold::string_hash.
13379 (Input_section_specifier::string_hash): Remove.
13380 * stringpool.cc (Stringpool_template::string_hash): Use
13381 gold::string_hash.
13382
6c172549
DK
133832009-10-20 Doug Kwan <dougkwan@google.com>
13384
13385 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13386 symbols of relaxed input sections.
13387 * output.h (Output_section::find_relaxed_input_section): Make
13388 method public.
13389
c5617f2f
DK
133902009-10-16 Doug Kwan <dougkwan@google.com>
13391
13392 * dynobj.cc (Versions::Versions): Initialize version_script_.
13393 Only insert base version symbol definition for a shared object
13394 if version script defines any version versions.
13395 (Versions::define_base_version): New method definition.
13396 (Versions::add_def): Check that base version is not needed.
13397 (Versions::add_need): Define base version lazily.
13398 * dynobj.h (Versions::define_base_version): New method declaration.
13399 (Versions::needs_base_version_): New data member declaration.
13400 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13401 (check_DATA): Add no_version_test.stdout.
13402 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13403 New make rules.
13404 * testsuite/Makefile.in: Regenerate.
13405 * testsuite/no_version_test.c: New file.
13406 * testsuite/no_version_test.sh: Ditto.
13407
3c12dcdb
DK
134082009-10-16 Doug Kwan <dougkwan@google.com>
13409
13410 * expression.cc (class Segment_start_expression): New class definition.
13411 (Segment_start_expression::value): New method definition.
13412 (script_exp_function_segment_start): Return a new
13413 Segment_start_expression.
13414 * gold/script-c.h (script_saw_segment_start_expression): New function
13415 prototype.
13416 * script-sections.cc (Script_sections::Script_sections): Initialize
13417 SAW_SEGMENT_START_EXPRESSION_ to false.
13418 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13419 and -Tbbs options to specify section addresses if given in
13420 command line and no SEGMENT_START expression is seen in a script.
13421 * script-sections.h (Script_sections::saw_segment_start_expression,
13422 Script_sections::set_saw_segment_start_expression): New method
13423 definition.
13424 (Script_sections::saw_segment_start_expression_): New data member
13425 declaration.
13426 * script.cc (script_saw_segment_start_expression): New function.
13427 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13428 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13429 script_test_7.sh and script_test_8.sh.
13430 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13431 script_test_8.stdout.
13432 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13433 (script_test_6, script_test_6.stdout, script_test_7,
13434 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13435 * Makefile.in: Regenerate.
13436 * testsuite/script_test_6.sh: New file.
13437 * testsuite/script_test_6.t: Same.
13438 * testsuite/script_test_7.sh: Same.
13439 * testsuite/script_test_7.t: Same.
13440 * testsuite/script_test_8.sh: Same.
13441
64b1ae37
DK
134422009-10-16 Doug Kwan <dougkwan@google.com>
13443
13444 * output.cc (Output_segment::set_section_list_address): Cast
13445 expressions to unsigned long long type to avoid format warnings.
13446
661be1e2
ILT
134472009-10-15 Ian Lance Taylor <iant@google.com>
13448
12edd763 13449 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13450 dot assignment to script_sections_.
12edd763
ILT
13451 * script-sections.cc (Script_sections::add_dot_assignment):
13452 Initialize if necessary.
13453
68b6574b
ILT
13454 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13455 program headers with no load segment if there is a linker script.
13456
661be1e2
ILT
13457 * layout.cc (Layout::set_segment_offsets): Align the file offset
13458 to the segment aligment for -N or -n with no load segment.
13459 * output.cc (Output_segment::add_output_section): Don't crash if
13460 the first section is a TLS section.
13461 (Output_segment::set_section_list_addresses): Print an error
13462 message if the address moves backward in a linker script.
13463 * script-sections.cc
13464 (Output_section_element_input::set_section_addresses): Don't
13465 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13466 (Orphan_output_section::set_section_addresses): Likewise.
13467
f15f61a7
DK
134682009-10-15 Doug Kwan <dougkwan@google.com>
13469
13470 * layout.cc (Layout::finish_dynamic_section): Generate tags
13471 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13472 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13473 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13474
82bb573a
ILT
134752009-10-14 Ian Lance Taylor <iant@google.com>
13476
13477 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13478 fields.
13479 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13480 data_shdr fields of relinfo.
13481 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13482 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13483 R_386_TLS_LDO_32, adjust based on section flags.
13484 (Target_i386::Relocate::fix_up_ldo): Remove.
13485
374ad285
ILT
134862009-10-13 Ian Lance Taylor <iant@google.com>
13487
13488 Add support for -pie.
13489 * options.h (class General_options): Add -pie and
13490 --pic-executable.
13491 (General_options::output_is_position_independent): Test -pie.
13492 (General_options::output_is_executable): Return true if not shared
13493 and not relocatable.
13494 (General_options::output_is_pie): Remove.
13495 * options.cc (General_options::finalize): Reject incompatible uses
13496 of -pie.
13497 * gold.cc (queue_middle_tasks): A -pie link is not static.
13498 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13499 * symtab.cc (Symbol::final_value_is_known): Return false if
13500 output_is_position_independent.
13501 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13502 output_is_position_independent.
13503 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13504 output_is_position_independent.
13505 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13506 output_is_position_independent.
13507 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13508 two_file_pie_test.
13509 (basic_pie_test.o, basic_pie_test): New targets.
13510 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13511 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13512 (two_file_pie_test): New target.
13513 * testsuite/Makefile.in: Rebuild.
13514 * README: Remove note saying that -pie is not supported.
13515
c6585162
ILT
135162009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13517
13518 * options.h (class General_options): Add -init and -fini.
13519 * layout.cc (Layout::finish_dynamic_section): Emit
13520 given init and fini functions.
13521
032ce4e9
ST
135222009-10-13 Sriraman Tallam <tmsriram@google.com>
13523
13524 * gc.h (gc_process_relocs): Check if icf is enabled using new
13525 function.
13526 * gold.cc (queue_initial_tasks): Likewise.
13527 (queue_middle_tasks): Likewise.
13528 * object.cc (do_layout): Likewise.
13529 * symtab.cc (is_section_folded): Likewise.
13530 * main.cc (main): Likewise.
13531 * reloc.cc (Read_relocs::run): Likewise.
13532 (Sized_relobj::do_scan_relocs): Likewise.
13533 * icf.cc (is_function_ctor_or_dtor): New function.
13534 (Icf::find_identical_sections): Check if function is ctor or dtor when
13535 safe icf is chosen.
13536 * options.h (General_options::icf): Change option to be an enum.
13537 (Icf_status): New enum.
13538 (icf_enabled): New method.
13539 (icf_safe_folding): New method.
13540 (set_icf_status): New method.
13541 (icf_status_): New variable.
13542 * (options.cc) (General_options::finalize): Set icf_status_.
13543 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13544 icf_test and icf_keep_unique_test to use the --icf enum flag.
13545 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13546 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13547
f345227a
ST
135482009-10-12 Sriraman Tallam <tmsriram@google.com>
13549
13550 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13551 includes to gc.h and icf.h.
13552 * arm.cc: Include gc.h.
13553 * gold.cc: Likewise.
13554 * i386.cc: Likewise.
13555 * powerpc.cc: Likewise.
13556 * sparc.cc: Likewise.
13557 * x86_64.cc: Likewise.
13558 * gc.h: Include icf.h.
13559
1c7814ed
ILT
135602009-10-11 Ian Lance Taylor <iant@google.com>
13561
13562 * plugin.cc: Include "gold.h" before other header files.
13563
ae3b5189
CD
135642009-10-10 Chris Demetriou <cgd@google.com>
13565
13566 * options.h (Input_file_argument::Input_file_type): New enum.
13567 (Input_file_argument::is_lib_): Replace with...
13568 (Input_file_argument::type_): New member.
13569 (Input_file_argument::Input_file_argument): Take Input_file_type
13570 'type' rather than boolean 'is_lib' as second argument.
13571 (Input_file_argument::is_lib): Use type_.
13572 (Input_file_argument::is_searched_file): New function.
13573 (Input_file_argument::may_need_search): Handle is_searched_file.
13574 * options.cc (General_options::parse_library): Support -l:filename.
13575 (General_options::parse_just_symbols): Update for Input_file_argument
13576 changes.
13577 (Command_line::process): Likewise.
13578 * archive.cc (Archive::get_file_and_offset): Likewise.
13579 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13580 * script.cc (read_script_file, script_add_file): Likewise.
13581 * fileread.cc (Input_file::Input_file): Likewise.
13582 (Input_file::will_search_for): Handle is_searched_file.
13583 (Input_file::open): Likewise.
13584 * readsyms.cc (Read_symbols::get_name): Likewise.
13585 * testsuite/Makefile.am (searched_file_test): New test.
13586 * testsuite/Makefile.in: Regenerate.
13587 * testsuite/searched_file_test.cc: New file.
13588 * testsuite/searched_file_test_lib.cc: New file.
13589
f3048a1d
ILT
135902009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13591 Ian Lance Taylor <iant@google.com>
13592
13593 * descriptor.cc: Include <cstdio> and "binary-io.h".
13594 (Descriptors::open): Open the files in binary mode always.
13595 * script.cc (Lex::get_token): Treat \r as whitespace.
13596
d4780e57
ILT
135972009-10-09 Ian Lance Taylor <iant@google.com>
13598
13599 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13600
d9a893b8
ILT
136012009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13602 Ian Lance Taylor <iant@google.com>
13603
13604 * configure.ac: Check for readv function also.
13605 * fileread.cc (readv): Define if not HAVE_READV.
13606 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13607 does not exist.
13608 * config.in: Regenerate.
13609 * configure: Regenerate.
13610
c0a62865
DK
136112009-10-09 Doug Kwan <dougkwan@google.com>
13612
13613 * layout.cc (Layout::make_output_section): Call target hook to make
13614 ordinary output section.
13615 (Layout::finalize): Adjust parameter list of call the
13616 Target::may_relax().
13617 * layout.h (class Layout::section_list): New method.
13618 * merge.h (Output_merge_base::entsize): Change visibility to public.
13619 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13620 New methods.
13621 (Output_merge_string::do_is_string): New method.
13622 * object.cc (Sized_relobj::do_setup): renamed from
13623 Sized_relobj::set_up.
13624 * object.h (Sized_relobj::adjust_shndx,
13625 Sized_relobj::initializ_input_to_output_maps,
13626 Sized_relobj::free_input_to_output_maps): Change visibilities to
13627 protected.
13628 (Sized_relobj::setup): Virtualize.
13629 (Sized_relobj::do_setup): New method declaration.
13630 (Sized_relobj::invalidate_section_offset,
13631 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13632 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13633 * options.cc (parse_int): New function.
13634 * options.h (parse_int): New declaration.
13635 (DEFINE_int): New macro.
13636 (stub_group_size): New option.
13637 * output.cc (Output_section::Output_section): Initialize memebers
13638 merge_section_map_, merge_section_by_properties_map_,
13639 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13640 (Output_section::add_input_section): Handled deferred code-fill
13641 generation and remove an old comment.
13642 (Output_section::add_relaxed_input_section): New method definition.
13643 (Output_section::add_merge_input_section): Use merge section by
13644 properties map to speed to search. Update merge section maps
13645 as appropriate.
13646 (Output_section::build_relaxation_map): New method definition.
13647 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13648 Same.
13649 (Output_section::relax_input_section): Renamed to
13650 Output_section::convert_input_sections_to_relaxed_sections and change
13651 interface to take a vector of pointers to relaxed sections.
13652 (Output_section::find_merge_section,
13653 Output_section::find_relaxed_input_section): New method definitions.
13654 (Output_section::is_input_address_mapped,
13655 Output_section::output_offset, Output_section::output_address):
13656 Use output section data maps to speed up searching.
13657 (Output_section::find_starting_output_address): Add comments.
13658 (Output_section::do_write,
13659 Output_section::write_to_postprocessing_buffer): Do code-fill
13660 generation as appropriate.
13661 (Output_section::get_input_sections): Invalidate relaxed input section
13662 map.
13663 (Output_section::restore_states): Adjust type of checkpoint .
13664 Invalidate relaxed input section map.
13665 * output.h (Output_merge_base): New class declaration.
13666 (Input_section_specifier): New class defintion.
13667 (class Output_relaxed_input_section) Change base class to
13668 Output_section_data_build.
13669 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13670 base class initializer.
13671 (Output_section::add_relaxed_input_section): New method declaration.
13672 (Output_section::Input_section): Change visibility to protected.
2e702c99 13673 (Output_section::Input_section::relobj,
c0a62865
DK
13674 Output_section::Input_section::shndx): Handle relaxed input sections.
13675 Output_section::input_sections) Change visibility to protected. Also
13676 define overload to return a non-const pointer.
13677 (Output_section::Merge_section_properties): New class defintion.
13678 (Output_section::Merge_section_by_properties_map,
13679 Output_section::Output_section_data_by_input_section_map,
13680 Output_section::Relaxation_map): New types.
13681 (Output_section::relax_input_section): Rename method to
13682 Output_section::convert_input_sections_to_relaxed_sections and change
13683 interface to take a vector of relaxed section pointers.
13684 (Output_section::find_merge_section,
13685 Output_section::find_relaxed_input_section,
13686 Output_section::build_relaxation_map,
13687 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13688 New method declarations.
13689 (Output_section::merge_section_map_
13690 Output_section::merge_section_by_properties_map_,
13691 Output_section::relaxed_input_section_map_,
13692 Output_section::is_relaxed_input_section_map_valid_,
13693 Output_section::generate_code_fills_at_write_): New data members.
13694 * script-sections.cc
13695 (Output_section_element_input::set_section_addresses): Call
13696 current_data_size and addralign methods of relaxed input sections.
13697 (Orphan_output_section::set_section_addresses): Call current_data_size
13698 and addralign methods of relaxed input sections.
13699 * symtab.cc (Symbol_table::compute_final_value): Extract template
13700 from the body of Symbol_table::sized_finalize_symbol.
13701 (Symbol_table::sized_finalized_symbol): Call
13702 Symbol_table::compute_final_value.
13703 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13704 (Symbol_table::compute_final_value): New templated method declaration.
13705 * target.cc (Target::do_make_output_section): New method defintion.
13706 * target.h (Target::make_output_section): New method declaration.
13707 (Target::relax): Add more parameters for input objects, symbol table
13708 and layout. Adjust call to do_relax.
13709 (Target::do_make_output_section): New method declaration.
13710 (Target::do_relax): Add parameters for input objects, symbol table
13711 and layout.
13712
d446d6c4
ILT
137132009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13714
13715 * pread.c: Include stdio.h.
13716
bc06c745
ILT
137172009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13718
13719 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13720 defined.
13721
75aea3d0
ILT
137222009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13723
13724 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13725 Change read_shndx type to unsigned int.
13726 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13727 int.
13728 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13729 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13730 Change read_shndx type to unsigned int.
13731 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13732 int.
13733 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13734 * layout.cc (Layout::create_symtab_sections): Cast the result of
13735 local_symcount * symsize to off_t in the gold_assert.
13736
be8fcb75
ILT
137372009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13738
13739 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13740 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13741 R_ARM_BASE_ABS.
13742 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13743 (Arm_relocate_functions::thm_abs5): New function.
13744 (Arm_relocate_functions::abs12): New function.
13745 (Arm_relocate_functions::abs16): New function.
13746 (Arm_relocate_functions::base_abs): New function.
13747 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13748 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13749 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13750 R_ARM_BASE_ABS.
13751 (Scan::global): Likewise.
13752 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13753 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13754 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13755 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13756 R_ARM_BASE_ABS.
13757
c2a122b6
ILT
137582009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13759
13760 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13761 (Arm_relocate_functions::movt_prel): New function.
13762 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13763 (Arm_relocate_functions::thm_movt_prel): New function.
13764 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13765 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13766 (Scan::global, Relocate::relocate): Likewise.
13767 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13768
c4aa1e2d
ILT
137692009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13770
13771 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13772 Incremental_checker.
13773 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13774 unsigned int.
13775 (class Incremental_inputs_header): New class.
13776 (Incremental_inputs_header_writer): Edit comment.
13777 (Incremental_inputs_entry): New class.
13778 (Incremental_inputs_entry_writer): Edit comment.
13779 (Sized_incremental_binary::do_find_incremental_inputs_section):
13780 Add *strtab_shndx parameter, fill it.
13781 (Sized_incremental_binary::do_check_inputs): New method.
13782 (Incremental_checker::can_incrementally_link_output_file): Use
13783 Sized_incremental_binary::check_inputs.
13784 (Incremental_inputs::report_command_line): Save command line in
13785 command_line_.
13786 * incremental.h:
13787 (Incremental_binary::find_incremental_inputs_section): New
13788 method.
13789 (Incremental_binary::do_find_incremental_inputs_section): Add
13790 strtab_shndx parameter.
13791 (Incremental_binary::do_check_inputs): New pure virtual method.
13792 (Sized_incremental_binary::do_check_inputs): Declare.
13793 (Incremental_checker::Incremental_checker): Add incremental_inputs
13794 parameter, use it to initialize incremental_inputs_.
13795 (Incremental_checker::incremental_inputs_): New field.
13796 (Incremental_checker::command_line): New method.
13797 (Incremental_checker::inputs): New method.
13798 (Incremental_checker::command_line_): New field.
13799
c549a694
ILT
138002009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13801
13802 * incremental.cc: Include <cstdarg> and "target-select.h".
13803 (vexplain_no_incremental): New function.
13804 (explain_no_incremental): New function.
13805 (Incremental_binary::error): New method.
13806 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13807 method.
13808 (make_sized_incremental_binary): New function.
13809 (open_incremental_binary): New function.
13810 (can_incrementally_link_file): Add checks if output is ELF and has
13811 inputs section.
13812 * incremental.h: Include "elfcpp_file.h" and "output.h".
13813 (Incremental_binary): New class.
13814 (Sized_incremental_binary): New class.
13815 (open_incremental_binary): Declare.
13816 * object.cc (is_elf_object): Use
13817 elfcpp::Elf_recognizer::is_elf_file.
13818 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13819 * output.h (Output_file::filesize): New method.
13820
fd3c5f0b
ILT
138212009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13822
13823 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13824 New function.
13825 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13826 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13827 function.
13828 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13829 function.
13830 (Arm_relocate_functions::movw_abs_nc): New function.
13831 (Arm_relocate_functions::movt_abs): New function.
13832 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13833 (Arm_relocate_functions::thm_movt_abs): New function.
13834 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13835 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13836 (Scan::global): Likewise.
13837 (Relocate::relocate): Likewise.
13838 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13839
7f5309a5
ILT
138402009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13841
13842 * arm.cc (Arm_relocate_functions::got_prel) New function.
13843 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13844 (Relocate::relocate): Likewise.
13845 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13846
364c7fa5
ILT
138472009-10-06 Ian Lance Taylor <iant@google.com>
13848
13849 * options.h (class General_options): Define
13850 split_stack_adjust_size parameter.
13851 * object.h (class Object): Add uses_split_stack_ and
13852 has_no_split_stack_ fields. Add uses_split_stack and
13853 has_no_split_stack accessor functions. Declare
13854 handle_split_stack_section.
13855 (class Reloc_symbol_changes): Define.
13856 (class Sized_relobj): Define Function_offsets. Declare
13857 split_stack_adjust, split_stack_adjust_reltype, and
13858 find_functions.
13859 * object.cc (Object::handle_split_stack_section): New function.
13860 (Sized_relobj::do_layout): Call handle_split_stack_section.
13861 * dynobj.cc (Sized_dynobj::do_layout): Call
13862 handle_split_stack_section.
13863 * reloc.cc (Sized_relobj::relocate_sections): Call
13864 split_stack_adjust for executable sections in split_stack
13865 objects. Pass reloc_map to relocate_section.
13866 (Sized_relobj::split_stack_adjust): New function.
13867 (Sized_relobj::split_stack_adjust_reltype): New function.
13868 (Sized_relobj::find_functions): New function.
13869 * target-reloc.h: Include "object.h".
13870 (relocate_section): Add reloc_symbol_changes parameter. Change
13871 all callers.
13872 * target.h (class Target): Add calls_non_split method. Declare
13873 do_calls_non_split virtual method. Declare match_view and
13874 set_view_to_nop.
13875 * target.cc: Include "elfcpp.h".
13876 (Target::do_calls_non_split): New function.
13877 (Target::match_view): New function.
13878 (Target::set_view_to_nop): New function.
13879 * gold.cc (queue_middle_tasks): Give an error if mixing
13880 split-stack and non-split-stack objects with -r.
13881 * i386.cc (Target_i386::relocate_section): Add
13882 reloc_symbol_changes parameter.
13883 (Target_i386::do_calls_non_split): New function.
13884 * x86_64.cc (Target_x86_64::relocate_section): Add
13885 reloc_symbol_changes parameter.
13886 (Target_x86_64::do_calls_non_split): New function.
13887 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13888 parameter.
13889 * powerpc.cc (Target_powerpc::relocate_section): Add
13890 reloc_symbol_changes parameter.
13891 * sparc.cc (Target_sparc::relocate_section): Add
13892 reloc_symbol_changes parameter.
13893 * configure.ac: Call AM_CONDITIONAL for the default target.
13894 * configure: Rebuild.
13895 * testsuite/Makefile.am (TEST_AS): New variable.
13896 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13897 (check_DATA): Add split_i386 and split_x86_64 files.
13898 (SPLIT_DEFSYMS): Define.
13899 (split_i386_[1234n].o): New targets.
13900 (split_i386_[124]): New targets.
13901 (split_i386_[1234r].stdout): New targets.
13902 (split_x86_64_[1234n].o): New targets.
13903 (split_x86_64_[124]): New targets.
13904 (split_x86_64_[1234r].stdout): New targets.
13905 (MOSTLYCLEANFILES): Add new executables.
13906 * testsuite/split_i386.sh: New file.
13907 * testsuite/split_x86_64.sh: New file.
13908 * testsuite/split_i386_1.s: New file.
13909 * testsuite/split_i386_2.s: New file.
13910 * testsuite/split_i386_3.s: New file.
13911 * testsuite/split_i386_4.s: New file.
13912 * testsuite/split_i386_n.s: New file.
13913 * testsuite/split_x86_64_1.s: New file.
13914 * testsuite/split_x86_64_2.s: New file.
13915 * testsuite/split_x86_64_3.s: New file.
13916 * testsuite/split_x86_64_4.s: New file.
13917 * testsuite/split_x86_64_n.s: New file.
13918 * testsuite/testfile.cc (Target_test): Update relocation_section
13919 function.
13920 * testsuite/Makefile.in: Rebuild.
13921
e8a9fcda
ILT
139222009-10-06 Ian Lance Taylor <iant@google.com>
13923
13924 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13925 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13926 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13927 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13928 the address on ldo_addrs_.
13929 (Target_i386::Relocate::fix_up_ldo): New function.
13930
e99daf92
ILT
139312009-10-06 Rafael Espindola <espindola@google.com>
13932
13933 * plugin.cc (add_input_library): New.
13934 (Plugin::load): Add add_input_library to tv.
13935 (Plugin_manager::add_input_file): Add the is_lib argument.
13936 (add_input_file): Update call to Plugin_manager::add_input_file.
13937 (add_input_library): New.
13938 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13939
966d4097
DK
139402009-09-30 Doug Kwan <dougkwan@google.com>
13941
13942 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13943 symbol and call Symbol::may_need_copy_reloc to determine if
13944 a copy reloc is needed.
13945 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13946 nocopyreloc is given in command line.
13947 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13948 given in command line.
13949 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13950 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13951 of the removed Target_i386::may_need_copy_reloc.
13952 * options.h (copyreloc): New option with default value false.
13953 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13954 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13955 instead of the removed Target_powerpc::may_need_copy_reloc.
13956 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13957 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13958 instead of the removed Target_sparc::may_need_copy_reloc.
13959 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13960 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13961 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13962 instead of the removed Target_x86_64::may_need_copy_reloc.
13963
029ba973
ILT
139642009-09-30 Ian Lance Taylor <iant@google.com>
13965
13966 * object.h (class Object): Remove target_ field, and target,
13967 sized_target, and set_target methods.
13968 (Object::sized_target): Remove.
13969 (class Sized_relobj): Update declarations. Remove sized_target.
13970 * object.cc (Sized_relobj::setup): Remove target parameter.
13971 Change all callers.
13972 (Input_objects::add_object): Don't do anything with the target.
13973 (make_elf_sized_object): Add punconfigured parameter. Change all
13974 callers. Set or test parameter target.
13975 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13976 Change all callers.
13977 * parameters.cc (Parameters::set_target): Change parameter type to
13978 be non-const.
13979 (Parameters::default_target): Remove.
13980 (set_parameters_target): Change parameter type to be non-const.
13981 (parameters_force_valid_target): New function.
13982 (parameters_clear_target): New function.
13983 * parameters.h (class Parameters): Update declarations. Remove
13984 default_target method. Add sized_target and clear_target
13985 methods. Change target_ to be non-const.
13986 (set_parameters_target): Update declaration.
13987 (parameters_force_valid_target): Declare.
13988 (parameters_clear_target): Declare.
13989 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13990 as NULL if we aren't searching.
13991 (Add_symbols::run): Don't check for compatible target.
13992 * fileread.cc (Input_file::open_binary): Call
13993 parameters_force_valid_target.
13994 * gold.cc (queue_middle_tasks): Likewise.
13995 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13996 set_target on object.
13997 * dynobj.h (class Sized_dynobj): Update declarations.
13998 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13999 make_elf_object returns NULL.
14000 (Archive::include_member): Don't check whether object target is
14001 compatible.
14002 * output.cc (Output_section::add_input_section): Get target from
14003 parameters.
14004 (Output_section::relax_input_section): Likewise.
14005 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
14006 parameters.
14007 (Sized_relobj::do_scan_relocs): Likewise.
14008 (Sized_relobj::relocate_sections): Likewise.
14009 * resolve.cc (Symbol_table::resolve): Likewise.
14010 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
14011 parameter. Change all callers.
14012 (Symbol_table::add_from_object): Get target from parameters.
14013 (Symbol_table::add_from_relobj): Don't check object target.
14014 (Symbol_table::add_from_dynobj): Likewise.
14015 (Symbol_table::define_special_symbol): Get target from
14016 parameters.
14017 * symtab.h (class Symbol_table): Update declaration.
14018 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
14019 parameter. Change all callers. Clear parameter target.
14020 (Binary_test): Test target here.
14021 * testsuite/object_unittest.cc (gold_testsuite): Remove
14022 target_test_pointer parameter. Change all callers.
14023 (Object_test): Test target here.
14024
a6a22b83
ILT
140252009-09-26 Ian Lance Taylor <iant@google.com>
14026
14027 * testsuite/initpri1.c: Don't try to use constructor priorities if
14028 compiling with gcc before 4.3.
14029
6a8f49fe
ILT
140302009-09-22 Mikolaj Zalewski <mikolajz@google.com>
14031
14032 * testsuite/retain_symbols_file_test.sh (check_present): Change
14033 output file name to retain_symbols_file_test.stdout.
14034 (check_absent): Likewise.
14035
8c604651
CS
140362009-09-18 Craig Silverstein <csilvers@google.com>
14037
14038 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
14039 * options.cc: Include <cerrno> and <fstream>.
14040 (General_options::finalize): Parse -retain-symbols-file tag.
14041 * options.h: New flag.
14042 (General_options): New method should_retain_symbol, new
14043 variable symbols_to_retain.
14044 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
14045 should_retain_symbol map.
14046 * testsuite/Makefile.am (retain_symbols_file_test): New test.
14047 * testsuite/Makefile.in: Regenerate.
14048 * testsuite/retain_symbols_file_test.sh: New file.
14049
ca58b19f
NC
140502009-09-18 Nick Clifton <nickc@redhat.com>
14051
14052 * po/es.po: Updated Spanish translation.
14053
20e6d0d6
DK
140542009-09-17 Doug Kwan <dougkwan@google.com>
14055
14056 * debug.h (DEBUG_RELAXATION): New constant.
14057 (DEBUG_ALL): Add DEBUG_RELAXATION.
14058 (debug_string_to_enum): Add relaxation debug option.
14059 * layout.cc
14060 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
14061 Layout::Relaxation_debug_check::read_sections,
14062 Layout::Relaxation_debug_check::read_sections): New method definitions.
14063 (Layout::Layout): Initialize data members
14064 record_output_section_data_from_scrips_,
14065 script_output_section_data_list_ and relaxation_debug_check_.
14066 (Layout::save_segments, Layout::restore_segments,
14067 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14068 Layout::relaxation_loop_body): New method definitions.
14069 (Layout::finalize): Support relaxation. Move section layout code to
14070 Layout::relaxation_loop_body.
14071 (Layout::set_asection_address_from_script): Move code for orphan
14072 section placement out.
14073 (Layout::place_orphan_sections_in_script): New method definition.
14074 * layout.h (Output_segment_headers, Output_file_header):
14075 New forward class declarations.
14076 (Layout::~Layout): Define.
14077 (Layout::new_output_section_data_from_script): New method definition.
14078 (Layout::place_orphan_sections_in_script): New method declaration.
14079 (Layout::Segment_states): New type declaration.
14080 (Layout::save_segments, Layout::restore_segments,
14081 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14082 Layout::relaxation_loop_body): New method declarations.
14083 (Layout::Output_section_data_list): New type declaration.
14084 (Layout::Relaxation_debug_check): New class definition.
14085 (Layout::record_output_section_data_from_script_,
14086 Layout::script_output_section_data_list_, Layout::segment_states_,
14087 Layout::relaxation_debug_check_): New data members.
14088 * output.cc: (Output_section_headers::do_size): New method definition.
14089 (Output_section_headers::Output_section_headers): Move size
14090 computation to Output_section_headers::do_size.
14091 (Output_segment_headers::do_size): New method definition.
e1df38aa 14092 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
14093 Output_file_header::do_size and call it.
14094 (Output_file_header::do_size): New method definition.
14095 (Output_data_group::Output_data_group): Adjust call to
14096 Output_section_data.
14097 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14098 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 14099 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
14100 RELAXED_INPUT_SECTION_CODE.
14101 (Output_section::Output_section): Initialize data member checkpoint_.
14102 (Output_section::~Output_section): Delete checkpoint object pointed
14103 by checkpoint_.
14104 (Output_section::add_input_section): Always add an Input_section if
14105 relaxing.
14106 (Output_section::add_merge_input_section): Add assert.
14107 (Output_section::relax_input_section): New method definition.
14108 (Output_section::set_final_data_size): Set load address to zero for
14109 an unallocated section.
14110 (Output_section::do_address_and_file_offset_have_reset_values):
14111 New method definition.
14112 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14113 Handle relaxed input section.
14114 (Output_section::sort_attached_input_sections): Checkpoint input
14115 section list lazily.
14116 (Output_section::get_input_sections): Change type of input_sections to
14117 list of Simple_input_section pointers. Checkpoint input section list
14118 lazily. Also handle relaxed input sections.
14119 (Output_section::add_input_section_for_script): Take a reference to
14120 a Simple_input_section object instead of Relobj pointer and section
14121 index as parameter. Handle relaxed input sections.
14122 (Output_section::save_states, Output_section::restore_states): New
14123 method definitions.
14124 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14125 (Output_data::is_data_size_fixed): New method definition.
14126 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14127 if it is fixed.
14128 (Output_data::address_and_file_offset_have_reset_values): New method
14129 definition.
14130 (Output_data::do_address_and_file_offset_have_reset_values): New method
14131 definition.
14132 (Output_data::set_data_size): Check that data size is not fixed.
14133 (Output_data::fix_data_size): New method definition.
14134 (Output_data::is_data_size_fixed_): New data member.
14135 (Output_section_headers::set_final_data_size): New method definition.
14136 (Output_section_headers::do_size): New method declaration.
14137 (Output_segment_headers::set_final_data_size): New method definition.
14138 (Output_segment_headers::do_size): New method declaration.
14139 (Output_file_header::set_final_data_size)::New method definition.
14140 (Output_file_header::do_size)::New method declaration.
14141 (Output_section_data::Output_section_data): Add new parameter
14142 is_data_size_fixed and use it to fix data size.
14143 (Output_data_const::Output_data_const): Adjust call to base class
14144 constructor and fix data size.
14145 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14146 base class constructor and fix data size.
14147 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14148 base class constructor and fix data size.
14149 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14150 class constructor and fix data size.
14151 (Output_data_group::set_final_data_size): New method definition.
14152 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14153 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14154 class constructor and fix data size.
14155 (Output_relaxed_input_section): New class definition.
14156 (Output_section::Simple_input_section): New class definition.
14157 (Output_section::get_input_sections): Adjust parameter list.
14158 (Output_section::add_input_section_for_script): Same.
14159 (Output_section::save_states, Output_section::restore_states,
14160 Output_section::do_address_and_file_offset_have_reset_values,
14161 (Output_section::Input_section::Input_section): Handle
14162 RELAXED_INPUT_SECTION_CODE. Add new overload for
14163 Output_relaxed_input_section.
14164 (Output_section::Input_section::is_input_section,
14165 Output_section::Input_section::set_output_section): Handle relaxed
14166 input section.
14167 (Output_section::Input_section::is_relaxed_input_section,
14168 Output_section::Input_section::output_section_data,
14169 Output_section::Input_section::relaxed_input_section): New method
14170 definitions.
14171 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14172 value.
14173 (Output_section::Input_section::u1_): Update comments.
14174 (Output_section::Input_section::u2_): Add new union member poris.
14175 (Output_section::Checkpoint_output_section): New classs definition.
14176 (Output_section::relax_input_section): New method declaration.
14177 (Output_section::checkpoint_): New data member.
14178 (Output_segment): Update comments.
14179 (Output_segment::Output_segment): Un-privatize copy constructor.
14180 (Output_segment::operator=): Un-privatize.
14181 * script-sections.cc (Output_section_element::Input_section_list):
14182 Change element type to Output_section::Simple_input_section.
14183 (Output_section_element_dot_assignment::set_section_addresses):
14184 Register output section data for relaxation clean up.
14185 (Output_data_exression::Output_data_expression): Adjust call to base
14186 constructor to fix data size.
14187 (Output_section_element_data::set_section_addresses): Register
14188 Output_data_expression object for relaxation clean up.
14189 (struct Input_section_info): Replace Relobj pointer and section index
14190 pair with Output_section::Simple_input_section and Convert struct to a
14191 class.
14192 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14193 Input_section_info data member to use accessors.
20e6d0d6
DK
14194 (Output_section_element_input::set_section_addresses): Use layout
14195 parameter. Adjust code to use Output_section::Simple_input_section
14196 and Input_secction_info classes. Register filler for relaxation
14197 clean up.
14198 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14199 and section index pair with Output_section::Simple_input_section
14200 class. Adjust code accordingly.
14201 (Phdrs_element::release_segment): New method definition.
14202 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14203 segment list.
14204 (Script_sections::release_segments): New method definition.
14205 * gold/script-sections.h (Script_sections::release_segments): New
14206 method declaration.
14207 * gold/target.h (Target::may_relax, Target::relax,
14208 Target::do_may_relax, Target::do_relax): New method definitions.
14209
5e445df6
ILT
142102009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14211
14212 * arm.cc (has_signed_unsigned_overflow): New function.
14213 (Arm_relocate_functions::abs8): New function.
14214 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14215 (Target_arm::Scan::global): Likewise.
14216 (Target_arm::relocate::relocate): Likewise.
14217 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14218 Likewise.
14219
8c604651 142202009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14221
14222 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14223 * testsuite/Makefile.in: Regenerate.
14224
1e9cc1c2
NC
142252009-09-11 Nick Clifton <nickc@redhat.com>
14226
14227 * po/gold.pot: Updated by the Translation project.
14228
6a89f575
CC
142292009-09-08 Cary Coutant <ccoutant@google.com>
14230
14231 * output.cc (Output_file::open): Add execute permission to empty file.
14232 * testsuite/Makefile.am (permission_test): New test.
14233 * testsuite/Makefile.in: Regenerate.
14234
fdcac5af
ILT
142352009-09-02 Ian Lance Taylor <iant@google.com>
14236
14237 * output.cc (Output_file::resize): Call map_no_anonymous rather
14238 than map.
14239
44453f85
ILT
142402009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14241
14242 * gold.cc: Include "incremental.h".
14243 (queue_initial_tasks): Call Incremental_checker methods.
14244 * incremental.cc: Include "output.h".
14245 (Incremental_checker::can_incrementally_link_output_file): New
14246 method.
14247 * incremental.h (Incremental_checker): New class.
14248
14249 * output.cc (Output_file::open_for_modification): New method.
14250 (Output_file::map_anonymous): Changed return type to bool. Record
14251 map in base_ field.
14252 (Output_file::map_no_anonymous): New method, broken out of map.
14253 (Output_file::map): Use map_no_anonymous and map_anonymous.
14254 * output.h (class Output_file): Update declarations.
14255
293c1386
CC
142562009-08-24 Cary Coutant <ccoutant@google.com>
14257
14258 * options.h (Command_line::Pre_options): New class.
14259 (Command_line::pre_options): New member.
14260 * options.cc (gold::options::ready_to_register): New variable.
14261 (One_option::register_option): Do nothing if not registering options.
14262 Assert if same short option registered twice.
14263 (General_options::General_options): Turn off option registration when
14264 done constructing.
14265 (Command_line::Pre_options::Pre_options): New constructor.
14266
f773f3d2
CC
142672009-08-24 Cary Coutant <ccoutant@google.com>
14268
06a73cfe
CC
14269 * options.h (General_options::no_keep_memory): Remove incorrect
14270 short option.
f773f3d2 14271
a15af8e2
RW
142722009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14273
14274 * Makefile.am (am__skiplex, am__skipyacc): New.
14275 * Makefile.in: Regenerate.
14276
c462b41b
RW
142772009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14278
14ec8efd
RW
14279 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14280 (INCLUDES): ... this.
14281 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14282 (AM_CPPFLAGS): Renamed from ...
14283 (INCLUDE): ... this.
14284 * Makefile.in, testsuite/Makefile.in: Regenerate.
14285
81ecdfbb
RW
14286 * Makefile.in: Regenerate.
14287 * aclocal.m4: Likewise.
14288 * config.in: Likewise.
14289 * configure: Likewise.
14290 * testsuite/Makefile.in: Likewise.
14291
c462b41b
RW
14292 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14293 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14294 * Makefile.in: Regenerate.
14295 * testsuite/Makefile.in: Regenerate.
14296
2da73f13
CC
142972009-08-19 Cary Coutant <ccoutant@google.com>
14298
14299 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14300 symbols in shared libraries overridden by hidden or internal symbols
14301 in the main program.
14302
2db70501
CD
143032009-08-19 Chris Demetriou <cgd@google.com>
14304
14305 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14306 checking source file names in error messages.
14307
f733487b
DK
143082009-08-18 Doug Kwan <dougkwan@google.com>
14309
14310 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14311 an elcpp::Ehdr as parameter. Adjust call to set_target.
14312 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14313 an elfcpp::Ehdr as parameter.
14314 * object.cc (Object::set_target): Remove the version that looks up
14315 a target and sets it.
14316 (Sized_relobj::setup): Take a Target object instead of
14317 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14318 (make_elf_sized_object): Find target and ask target to
14319 make an ELF object.
14320 * object.h: (Object::set_target): Remove the version that looks up
14321 a target and sets it.
14322 (Sized_relobj::setup): Take a Target object instead of
14323 an elfcpp:Ehdr as parameter.
14324 * target.cc: Include dynobj.h.
14325 (Target::do_make_elf_object_implementation): New.
2e702c99 14326 (Target::do_make_elf_object): New.
f733487b
DK
14327 * target.h (Target::make_elf_object): New template declaration.
14328 (Target::do_make_elf_object): New method declarations.
14329 (Target::do_make_elf_object_implementation): New template declaration.
14330
cc70f101
ILT
143312009-08-14 Ian Lance Taylor <iant@google.com>
14332
14333 * gold.h (FUNCTION_NAME): Define.
14334 (gold_unreachable): Use FUNCTION_NAME.
14335
ef5e0cb1
ST
143362009-08-12 Sriraman Tallam <tmsriram@google.com>
14337
14338 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14339 symbol in the --keep-unique list is not found.
14340
48c187ce
ST
143412009-08-12 Sriraman Tallam <tmsriram@google.com>
14342
14343 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14344 been maked as --keep-unique.
14345 (Icf::unfold_section): New function.
14346 * icf.h (Icf::unfold_section): New function.
14347 * options.h (General_options::keep_unique): New option.
14348 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14349 * testsuite/Makefile.in: Regenerate.
14350 * testsuite/icf_keep_unique_test.sh: New file.
14351 * testsuite/icf_keep_unique_test.cc: New file.
14352
645afe0c
CC
143532009-08-12 Cary Coutant <ccoutant@google.com>
14354
14355 PR 10471
14356 * resolve.cc (Symbol_table::resolve): Check for references from
14357 dynamic objects to hidden and internal symbols.
14358 * testsuite/Makefile.am (hidden_test.sh): New test.
14359 * testsuite/Makefile.in: Regenerate.
14360 * testsuite/hidden_test.sh: New script.
14361 * testsuite/hidden_test_1.c: New test source.
14362 * testsuite/hidden_test_main.c: New test source.
14363
11af873f
DK
143642009-08-11 Doug Kwan <dougkwan@google.com>
14365
14366 * arm.cc: Update comments.
14367 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14368 segment to locate the .ARM.exidx section if present.
14369
b9f7d72d
DK
143702009-08-09 Doug Kwan <dougkwan@google.com>
14371
14372 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14373 patch.
14374
ddd3c53c
ST
143752009-08-07 Sriraman Tallam <tmsriram@google.com>
14376 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14377 compiler warnings.
14378
27721062
ST
143792009-08-06 Sriraman Tallam <tmsriram@google.com>
14380
14381 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14382 valid tls_segment only for non-debug-section relocations.
14383 * testsuite/Makefile.am: Add gc_tls_test.
14384 * testsuite/Makefile.in: Regenerate.
14385 * testsuite/gc_tls_test.cc: New file.
14386 * testsuite/gc_tls_test.sh: New file.
14387
ef15dade 143882009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14389
ef15dade
ST
14390 * icf.cc: New file.
14391 * icf.h: New file.
14392 * Makefile.am (CCFILES): Add icf.cc.
14393 (HFILES): Add icf.h
14394 * Makefile.in: Regenerate.
14395 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14396 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14397 section, symbol and addend information for the relocs.
14398 * gold.cc (queue_middle_tasks): Call identical code folding.
14399 * gold.h: Add defines for multimap.
14400 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14401 to the call of finalize_local_symbols.
14402 * main.cc (main): Create object of class Icf.
14403 * object.cc (Sized_relobj::do_layout): Allow this function to be
14404 called twice during icf.
14405 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14406 to sections marked as identical by icf.
14407 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14408 when available.
14409 (Sized_relobj::do_section_entsize): New function.
14410 * object.h (Object::section_entsize): New function.
14411 (Object::do_section_entsize): New pure virtual function.
14412 (Relobj::finalize_local_symbols): Add new parameter.
14413 (Relobj::do_section_entsize): New function.
14414 * options.h (General_options::icf): New option.
14415 (General_options::icf_iterations): New option.
14416 (General_options::print_icf_sections): New option.
14417 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14418 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14419 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14420 icf.
14421 * symtab.cc (Symbol_table::is_section_folded): New function.
14422 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14423 to sections marked as identical by icf.
14424 * symtab.h (Symbol_table::set_icf): New function.
14425 (Symbol_table::icf): New function.
14426 (Symbol_table::is_section_folded): New function.
14427 (Symbol_table::icf_): New data member.
14428 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14429 * testsuite/Makefile.am: Add commands to build icf_test.
14430 * testsuite/Makefile.in: Regenerate.
14431 * testsuite/icf_test.sh: New file.
14432 * testsuite/icf_test.cc: New file.
14433
c3b65ac4
CD
144342009-07-24 Chris Demetriou <cgd@google.com>
14435
14436 * layout.cc (is_compressible_debug_section): Fix incorrect
14437 comment about compressed section names.
14438
1caf2c51
ILT
144392009-07-20 Ian Lance Taylor <ian@airs.com>
14440
14441 PR 10419
14442 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14443
1ef4d87f
ILT
144442009-07-16 Ian Lance Taylor <iant@google.com>
14445
14446 PR 10400
14447 * layout.h: #include <map>.
14448 (class Kept_section): Change from struct to class. Add accessors
14449 and setters. Add section size to Comdat_group mapping. Change
14450 Comdat_group to std::map. Add is_comdat_ field. Add
14451 linkonce_size field in union.
14452 (class Layout): Update declaration of find_or_add_kept_section.
14453 Don't declare find_kept_object.
14454 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14455 parameter. Add object, shndx, is_comdat, and is_group_name
14456 parameters. Change all callers. Adjust for new Kept_section.
14457 (Layout::find_kept_object): Remove.
14458 * object.cc (Sized_relobj::include_section_group): Update use of
14459 Kept_section. Rename secnum to shndx. Only record
14460 Kept_comdat_section if sections are the same size.
14461 (Sized_relobj::include_linkonce_section): Update use of
14462 Kept_section. Only record Kept_comdat_section if sections are the
14463 same size. Set size of linkonce section.
14464 (Sized_relobj::map_to_kept_section): Update call to
14465 get_kept_comdat_section.
14466 * object.h (class Sized_relobj): Rename fields in
14467 Kept_comdat_section to drop trailing underscores; change object
14468 field to Relobj*. Change Kept_comdat_section_table to store
14469 struct rather than pointer.
14470 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14471 Add kept_object and kept_shndx parameters. Change all callers.
14472 (Sized_relobj::get_kept_comdat_section): Change return type to
14473 bool. Add kept_object and kept_shndx parameters. Change all
14474 callers.
14475 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14476 Layout::find_or_add_kept_section.
14477
37c3b7b0
ILT
144782009-07-09 Ian Lance Taylor <iant@google.com>
14479
14480 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14481 Reserve space in the hash table.
14482
98fa85cb
ILT
144832009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14484
14485 * fileread.cc (File_read::get_mtime): New method.
14486 * fileread.h (Timespec): New structure.
14487 (File_read::get_mtime): New method.
14488 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14489 Renamed from timestamp_nsec.
14490 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14491 Elf_Xword.
e1df38aa 14492 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14493 timestamp_nsec.
e1df38aa 14494 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14495 (Incremental_inputs::report_obejct): Save mtime; style fix.
14496 (Incremental_inputs::report_script): Save mtime; style fix.
14497 (Incremental_inputs::finalize_inputs): Style fix.
14498 (Incremental_inputs::finalize): Style fix.
14499 (Incremental_inputs::create_input_section_data): Store inputs
14500 mtime.
14501 * incremental.h (Incremental_inputs::report_script): Add mtime
14502 argument.
14503 (Incremental_inputs::Input_info::Input_info): Intialize only one
14504 union member.
14505 (Incremental_inputs::Input_info::archive): Move to nameless
14506 union.
14507 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14508 (Incremental_inputs::Input_info::script): Move to nameless union.
14509 (Incremental_inputs::mtime): New field.
14510 * script.cc (read_input_script): Pass file mtime to
14511 Incremental_input.
14512 * script.h (Script_info::inputs): Style fix.
14513
c9d70757
ILT
145142009-07-01 Ian Lance Taylor <ian@airs.com>
14515
14516 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14517 instead of 32.
14518
9c547ec3
ILT
145192009-06-24 Ian Lance Taylor <iant@google.com>
14520
14521 PR 10156
14522 * layout.cc (Layout::choose_output_section): If we find an
14523 existing section, update the flags.
14524 (Layout::create_notes): New function, broken out of
14525 Layout::finalize.
14526 (Layout::finalize): Don't create note sections.
14527 (Layout::create_note): Don't crash if linker script discards
14528 section.
14529 (Layout::create_gold_note): Likewise.
14530 (Layout::create_build_id): Likewise. Don't set
14531 after_input_sections on the section.
14532 (Layout::create_executable_stack_info): Remove target parameter.
14533 Change caller.
14534 * layout.h (class Layout): Declare create_notes. Update
14535 declaration of create_executable_stack_info.
14536 * gold.cc (queue_middle_tasks): Call create_notes.
14537 * output.cc (Output_section::update_flags_for_input_section): Move
14538 here from output.h. If SHF_ALLOC flag is newly set, mark address
14539 invalid.
14540 * output.h (Output_data::mark_address_invalid): New function.
14541 (class Output_section): Only declare, not define,
14542 update_flags_for_input_section. Remove set_flags.
14543
55458500
ILT
145442009-06-24 Ian Lance Taylor <iant@google.com>
14545
14546 * script-sections.cc (Output_section_definition::
14547 set_section_addresses): Rename shadowing local load_address to
14548 laddr.
14549
1307d6cd
ILT
145502009-06-24 Ian Lance Taylor <iant@google.com>
14551
14552 PR 10244
14553 * reloc.cc (relocate_sections): Skip empty relocation sections.
14554
ec3f783e
ILT
145552009-06-23 Ian Lance Taylor <iant@google.com>
14556
14557 PR 10156
14558 * layout.cc (Layout::create_note): Use choose_output_section
14559 rather than make_output_section.
14560
459c9f1c
ILT
145612009-06-23 Ian Lance Taylor <iant@google.com>
14562
14563 PR 10237
14564 * options.cc (General_options::parse_V): Set printed_version_.
14565 (General_options::General_options): Initialize printed_version_.
14566 * options.h (class General_options): Add printed_version_ field.
14567 * gold.cc (queue_initial_tasks): If there are no input files,
14568 don't give a fatal error if we printed the version information.
14569 (queue_middle_tasks): If using -r with a shared object, give a
14570 fatal error rather than an ordinary error.
14571
1518dc8f
ILT
145722009-06-23 Ian Lance Taylor <iant@google.com>
14573
14574 PR 10219
14575 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14576 (Layout::make_output_section): Set have_stabstr_section_ if we see
14577 a .stab*str section.
14578 (Layout::finalize): Call link_stabs_sections.
14579 (Layout::link_stabs_sections): New file.
14580 * layout.h (class Layout): Add have_stabstr_section_ field.
14581 Declare link_stabs_sections.
14582
3d857b98
DK
145832009-06-23 Doug Kwan <dougkwan@google.com>
14584
14585 * Makefile.am (libgold_a_LIBADD): New.
14586 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14587 * Makefile.in: Regenerate.
3d857b98
DK
14588 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14589 * configure: Regenerate.
14590 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14591 * fileread.cc: Include sys/state.h
14592 * gold.h: Declare memmem and strndup if found missing.
14593 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14594
0639a6f6
ILT
145952009-06-23 Ian Lance Taylor <iant@google.com>
14596
14597 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14598 * configure: Rebuild.
14599
8d63875c
ILT
146002009-06-23 Ian Lance Taylor <iant@google.com>
14601
14602 PR 10147
14603 * object.cc (Object::section_contents): Don't try to get a view if
14604 the section has length zero.
14605 (Object::handle_gnu_warning_section): If the section is empty, use
14606 the name of the section as the warning.
14607
f7c8a183
ILT
146082009-06-23 Ian Lance Taylor <iant@google.com>
14609
14610 PR 10133
14611 * stringpool.h (class Stringpool_template): Add optimize_ field.
14612 (Stringpool_template::set_optimize): New function.
14613 * stringpool.cc (Stringpool_template::Stringpool_template):
14614 Initialize optimize_ field.
14615 (Stringpool_template::set_string_offsets): Test local optimize
14616 fild rather than parameter.
14617 * layout.cc (Layout::Layout): Call set_optimize on the section
14618 name stringpool.
14619
e6a307ba
ILT
146202009-06-22 Ian Lance Taylor <iant@google.com>
14621
14622 PR 10030
14623 * yyscript.y: Parse TARGET.
14624 * script.cc (script_set_target): New function.
14625 * script-c.h (script_set_target): Declare.
14626 * options.cc (General_options::string_to_object_format): Rename
14627 from string_to_object_format in anonymous namespace. Change
14628 callers.
14629 * options.h (class General_options): Declare
14630 string_to_object_format.
14631
3ee173de
ILT
146322009-06-22 Ian Lance Taylor <iant@google.com>
14633
14634 * script-sections.cc (Script_sections::create_segments): Don't put
14635 program headers in a PT_LOAD segment if -n or -N.
14636
146372009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14638
14639 PR 10141
14640 * options.h (class General_options): Add -z lazy and -z now. Sort
14641 -z options into alphabetical order.
14642 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14643
cd6739a1 146442009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14645
14646 * layout.cc (Layout::make_output_section): Call
14647 Target::new_output_section.
14648 (Layout::attach_allocated_section_to_segment): Put large section
14649 sections in a separate load segment with the large segment flag
14650 set.
14651 (Layout::segment_precedes): Sort large data segments after other
14652 load segments.
14653 (align_file_offset): New static function.
14654 (Layout::set_segment_offsets): Use align_file_offset.
14655 * output.h (class Output_section): Add is_small_section_ and
14656 is_large_section_ fields.
14657 (Output_section::is_small_section): New function.
14658 (Output_section::set_is_small_section): New function.
14659 (Output_section::is_large_section): New function.
14660 (Output_section::set_is_large_section): New function.
14661 (Output_section::is_large_data_section): New function.
14662 (class Output_segment): Add is_large_data_segment_ field.
14663 (Output_segment::is_large_data_segment): New function.
14664 (Output_segment::set_is_large_data_segment): New function.
14665 * output.cc (Output_section::Output_section): Initialize new
14666 fields.
14667 (Output_segment::Output_segment): Likewise.
14668 (Output_segment::add_output_section): Add assertion that large
14669 data sections always go in large data segments. Force small data
14670 sections to the end of the list of data sections. Force small BSS
14671 sections to the start of the list of BSS sections. For large BSS
14672 sections to the end of the list of BSS sections.
14673 * symtab.h (class Symbol): Declare is_common_shndx.
14674 (Symbol::is_defined): Check Symbol::is_common_shndx.
14675 (Symbol::is_common): Likewise.
14676 (class Symbol_table): Define enum Commons_section_type. Update
14677 declarations. Add small_commons_ and large_commons_ fields.
14678 * symtab.cc (Symbol::is_common_shndx): New function.
14679 (Symbol_table::Symbol_table): Initialize new fields.
14680 (Symbol_table::add_from_object): Put small and large common
14681 symbols in the right list.
14682 (Symbol_table::sized_finalized_symbol): Check
14683 Symbol::is_common_shndx.
14684 (Symbol_table::sized_write_globals): Likewise.
14685 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14686 common symbol lists. Don't call do_allocate_commons_list if the
14687 list is empty.
14688 (Symbol_table::do_allocate_commons_list): Remove is_tls
14689 parameter. Add comons_section_type parameter. Change all
14690 callers. Handle small and large common symbols.
14691 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14692 Symbol::is_common_shndx.
14693 * resolve.cc (symbol_to_bits): Likewise.
14694 * target.h (Target::small_common_shndx): New function.
14695 (Target::small_common_section_flags): New function.
14696 (Target::large_common_shndx): New function.
14697 (Target::large_common_section_flags): New function.
14698 (Target::new_output_section): New function.
14699 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14700 small_common_section_flags, and large_common_section_flags
14701 fields.
14702 (Target::do_new_output_section): New virtual function.
14703 * arm.cc (Target_arm::arm_info): Initialize new fields.
14704 * i386.cc (Target_i386::i386_info): Likewise.
14705 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14706 Likewise.
14707 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14708 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14709 (Target_x86_64::do_new_output_section): New function.
14710 * configure.ac: Define conditional MCMODEL_MEDIUM.
14711 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14712 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14713 (large_LDFLAGS): Define.
14714 * testsuite/large.c: New file.
14715 * testsuite/testfile.cc (Target_test::test_target_info):
14716 Initialize new fields.
14717 * configure, testsuite/Makefile.in: Rebuild.
14718
bb04269c
DK
147192009-06-05 Doug Kwan <dougkwan@google.com>
14720
14721 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14722 * Makefile.in: Regenerate.
bb04269c
DK
14723 * i386.cc (class Target_i386): Define new virtual method to
14724 override do_is_local_label_name in parent.
14725 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14726 local symbols if --discard-locals or -X is given.
14727 * options.h (class General_options): Declare new options
14728 '--discard-locals' and '-X' for discarding locals.
14729 * target.h (class Target): Define new methods is_local_label_name.
14730 Declare new virtual method do_is_local_label_name.
14731 * target.cc: New file.
14732 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14733 (check_SCRIPTS): Add discard_locals_test.sh.
14734 (check_DATA): Add discard_local_tests.syms.
14735 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14736 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14737 * testsuite/Makefile.in: Regenerate.
14738 * testsuite/discard_locals_test.c: New file.
14739 * testsuite/discard_locals_test.sh: Same.
14740
805bb01c
DK
147412009-06-05 Doug Kwan <dougkwan@google.com>
14742
14743 * object.cc (Sized_relobj::Sized_relobj): Initialize
14744 discarded_eh_frame_shndx_ to -1U.
14745 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14746 section.
14747 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14748 a discarded .eh_frame section.
14749 (Sized_relobj::do_finalize_local_symbols): Ditto.
14750 * object.h (class Sized_relobj): Declare new member
14751 discarded_eh_frame_shndx_.
14752 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14753 (local_labels_test.o, local_labels_test): New rules.
14754 * testsuite/Makefile.in: Regenerate.
14755
1dcd334d
DK
147562009-06-04 Doug Kwan <dougkwan@google.com>
14757
14758 * layout.cc (Layout::section_name_mapping): Add mapping for
14759 special ARM sections.
14760
96d49306
DK
147612009-06-03 Doug Kwan <dougkwan@google.com>
14762
14763 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14764 (utils::has_overflow): Same.
14765
dff16297
ILT
147662009-06-03 Ian Lance Taylor <iant@google.com>
14767
14768 * layout.cc (Layout::section_name_mapping): New array, replacing
14769 Layout::linkonce_mapping.
14770 (Layout::section_name_mapping_count): New variable, replacing
14771 Layout::linkonce_mapping_count.
14772 (Layout::linkonce_output_name): Remove.
14773 (Layout::output_section_name): Rewrite.
14774 * layout.h (class Layout): Rename Linkonce_mapping to
14775 Section_name_mapping, linkonce_mapping to section_name_mapping,
14776 linkonce_mapping_count to section_name_mapping_count. Don't
14777 declare linkonce_output_name.
14778
c121c671
DK
147792009-06-03 Doug Kwan <dougkwan@google.com>
14780
14781 * gold/arm.cc (namespace utils): New.
14782 (Target_arm::reloc_is_non_pic): Define new method.
14783 (class Arm_relocate_functions): New.
14784 (Target_arm::Relocate::relocate): Handle relocation types used by
14785 Android.
14786
07800fab
ILT
147872009-06-03 Ian Lance Taylor <iant@google.com>
14788
14789 * arm.cc (Target_arm::scan::global): Use || instead of |.
14790
c121c671
DK
147912009-06-02 Doug Kwan <dougkwan@google.com>
14792
14793 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14794 issued_non_pic_error_.
14795 (class Target_arm::Scan): Declare new method check_non_pic.
14796 Define new method symbol_needs_plt_entry.
14797 Declare new data member issued_non_pic_error_.
14798 (class Target_arm::Relocate): Declare new method
14799 should_apply_static_reloc.
14800 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14801 (Target_arm::Scan::check_non_pic): Define new method.
14802 (Target_arm::Scan::local): Handle a small subset of reloc types used
14803 by Android.
14804 (Target_arm::Scan::local): Same.
14805 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14806
b19b0c6d
ILT
148072009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14808
14809 * incremental.cc (Incremental_inputs::report_command_line): Filter
14810 out --incremental-* options.
14811
94cdfcff
DK
148122009-05-29 Doug Kwan <dougkwan@google.com>
14813
14814 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14815 template class.
14816 (class Target_arm): Update comment.
14817 (Target_arm::Target_arm): Initialize new data members GOT_,
14818 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14819 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14820 and Target_arm::rel_dyn_section.
14821 Declare new_enum Target_arm::Got_type.
14822 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14823 and DYNBSS_.
14824 Update commments for member do_dynsym_value.
14825 (Target_arm::got_size, Target_arm::plt_section,
14826 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14827 new methods inside class defintion.
14828 (Target_arm::got_section): Define new method.
14829 (Target_arm::rel_dyn_section): Same.
14830 (Output_data_plt_arm): New template class.
14831 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14832 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14833 (Output_data_plt_arm::add_entry): Same.
14834 (Output_data_plt_arm::first_plt_entry): Define new
14835 static data member for PLT instruction template.
14836 (Output_data_plt_arm::plt_entry): Same.
14837 (Output_data_plt_arm::do_write): Define new method.
14838 (Target_arm::make_plt_entry): Same.
14839 (Target_arm::do_finalize_sections): Same.
14840 (Target_arm::do_dynsym_value): Same.
14841
4a657b0d
DK
148422009-05-28 Doug Kwan <dougkwan@google.com>
14843
14844 * Makefile.am (TARGETSOURCES): Add arm.cc.
14845 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14846 * Makefile.in: Regenerate.
14847 * arm.cc: New file.
14848 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14849
e7ae8c36
DK
148502009-05-26 Doug Kwan <dougkwan@google.com>
14851
14852 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14853 (General_options::check_excluded_libs): Strip off directories in
14854 archive name before matching like GNU ld does.
14855 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14856 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14857 (exclude_libs_test_LDFLAGS): Add linker option
14858 -Wl,--exclude-libs,libexclude_libs_test_3
14859 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14860 an explicit archive without using -l.
14861 (alt/libexclude_libs_test_3.a): New make rule.
14862 * testsuite/Makefile.in: Regenerate.
14863 * testsuite/exclude_libs_test.c : Declare lib3_default().
14864 (main): Call it.
14865 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14866 * exclude_libs_test_3.c: New file.
14867
f12e7348
NC
148682009-05-26 Nick Clifton <nickc@redhat.com>
14869
14870 * po/id.po: New Indonesian translation.
14871 * po/gold.pot: Updated template file.
14872
4daadc0d
ST
148732009-05-22 Sriraman Tallam <tmsriram@google.com>
14874
e1df38aa 14875 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14876 gc_comdat_test files. Add -Wl,--gc-sections to build
14877 gc_comdat_test.
14878 * testsuite/Makefile.in: Regenerate.
14879 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14880
531813ad
ST
148812009-05-21 Sriraman Tallam <tmsriram@google.com>
14882
14883 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14884 kept comdat section was garbage collected.
14885 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14886 * testsuite/Makefile.in: Regenerate.
14887 * testsuite/gc_comdat_test.sh: New file.
14888 * testsuite/gc_comdat_test_1.cc: New file.
14889 * testsuite/gc_comdat_test_2.cc: New file.
14890
65514900
CC
148912009-05-19 Doug Kwan <dougkwan@google.com>
14892
14893 * archive.cc (Archive::Archive): Move constructor from archive.h
14894 to here. Initialize no_export_.
14895 (Archive::get_elf_object_for_member): Set no_export flag of object.
14896 * archive.h (Archive::Archive): Move constructor body to
14897 archive.cc.
14898 (Archive::no_export): New method.
14899 (Archive::no_export_): New field.
14900 * object.h (Object::Object): Initialize no_export_ to false.
14901 (Object::no_export, Object::set_no_export): New methods.
14902 (Object::no_export_): New field.
14903 * options.cc (General_options::parse_exclude_libs): New method.
14904 (General_options::check_excluded_libs) Same.
14905 * options.h (exclude_libs): New option.
14906 (General_options::check_excluded_libs): New method declaration.
14907 (General_options::excluded_libs_): New field.
14908 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14909 default or protected visibility if an object has no-export flag set.
14910 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14911 (check_SCRIPTS): Add exclude_libs_test.sh.
14912 (check_DATA): Add exclude_libs_test.syms.
14913 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14914 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14915 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14916 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14917 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14918 libexclude_libs_test_2.a): New rules.
14919 * testsuite/Makefile.in: Regenerate.
14920 * testsuite/exclude_libs_test.c: New file.
14921 * testsuite/exclude_libs_test.sh: Ditto.
14922 * testsuite/exclude_libs_test_1.c: Ditto.
14923 * testsuite/exclude_libs_test_2.c: Ditto.
14924
1b77ea50
ILT
149252009-05-15 Ian Lance Taylor <iant@google.com>
14926
14927 * configure.ac: Check for declarations for cases where libiberty.h
14928 checks HAVE_DECL_xxx.
14929 * configure, config.in: Rebuild.
14930
072fe7ce
ILT
149312009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14932
14933 * gold.h (Incremental_argument_list): Remove (invalid) forward
14934 declaration.
14935 * incremental.cc (Incremental_inputs::report_achive): New method.
14936 (Incremental_inputs::report_object): New method.
14937 (Incremental_inputs::report_script): New method.
14938 (Incremental_inputs::finalize_inputs): New method.
14939 (Incremental_inputs::finalize): Call finalize_inputs().
14940 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14941 Create inputs entries.
14942 * incremental.h (Incremental_input_type): New enum.
14943 (Incremental_inputs::Incremental_input): Initialize new fields.
14944 (Incremental_inputs::report_inputs): New method.
14945 (Incremental_inputs::report_achive): New method.
14946 (Incremental_inputs::report_object): New method.
14947 (Incremental_inputs::report_script): New method.
14948 (Incremental_inputs::finalize_inputs): New method.
14949 (Incremental_inputs::Input_info): New struct.
14950 (Incremental_inputs::Input_info_map): New typedef.
14951 (Incremental_inputs::lock_): New field.
14952 (Incremental_inputs::Inputs_): New field.
14953 (Incremental_inputs::Inputs_map): New field.
14954 * main.cc (main): Call Incremental_input::report_inputs.
14955 * options.h (Input_argument_list): Typedef moved from
14956 Input_arguments.
14957 (Input_file_group::Files): Remove, use ::Input_argument_list.
14958 (Input_file_group::Input_argument_list): Remove, use
14959 ::Input_argument_list.
14960 * plugin.cc (Plugin_manager::add_input_file): Add error in
14961 incremental build.
14962 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14963 functions.
14964 * script.cc (read_input_script): Call
14965 Incremental_input::report_script.
14966 * script.h (Script_info): New class.
14967
b0481b0b
ILT
149682009-04-27 Ian Lance Taylor <iant@google.com>
14969
14970 * x86_64.cc (do_adjust_output_section): Set entsize to
14971 plt_entry_size.
14972
b22a5a41 149732009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14974
14975 * output.cc (Output_file::close): After short writes, continue
14976 writing from the correct offset in the buffer being written.
14977
40fde488
CD
149782009-04-23 Chris Demetriou <cgd@google.com>
14979
14980 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14981 * configure: Regenerate.
14982 * config.in: Regenerate.
14983 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14984 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14985
3ce2c28e
ILT
149862009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14987
14988 * incremental.cc (Incremental_inputs_header_data): Renamed from
14989 Incremental_input_header_data.
14990 (Incremental_inputs_header_data::data_size): New field.
14991 (Incremental_inputs_header_data::put_input_file_count): Renamed
14992 from input_file_count.
14993 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14994 from command_line_offset.
14995 (Incremental_inputs_header_data::put_reserved): Renamed from
14996 put_reserved.
14997 (Incremental_inputs_entry_data): Renamed from
14998 Incremental_input_entry_data.
14999 (Incremental_inputs_entry_data::data_size): New field.
15000 (Incremental_inputs::report_command_line): New method.
15001 (Incremental_inputs::finalize): New method.
15002 (Incremental_inputs::create_incremental_inputs_data): New method.
15003 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
15004 * incremental.h: New file.
15005 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 15006 (Layout::finalize): Create incremental inputs section in
3ce2c28e 15007 incremental builds.
703d02da 15008 (Layout::create_incremental_info_sections): New method.
3ce2c28e 15009 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
15010 (Layout::create_incremental_info_sections): New method.
15011 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
15012 * main.cc (main): Notify Incremental_input of the command line.
15013
e55bde5e
ILT
150142009-04-01 Ian Lance Taylor <iant@google.com>
15015 Mikolaj Zalewski <mikolajz@google.com>
15016
15017 * gold.h (reserve_unordered_map): Define, three versions, one for
15018 each version of Unordered_map.
15019 * layout.cc (Layout::Layout): Remove options parameter. Add
15020 number_of_input_files parameter. Don't initialize options_.
15021 Initialize number_of_input_files_ and resized_signatures_. Move
15022 sections_are_attached_.
15023 (Layout::layout_group): Reserve space for group_signatures_.
15024 (Layout::find_or_add_kept_section): Change name parameter to be a
15025 reference. Resize signatures_ map when it gets large enough.
15026 (Layout::layout_eh_frame): Use parameters->options() instead of
15027 this->options_.
15028 (Layout::make_output_section): Likewise.
15029 (Layout::attach_allocated_section_to_segment): Likewise.
15030 (Layout::finalize, Layout::create_executable_stack): Likewise.
15031 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
15032 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
15033 * layout.h (class Layout): Update declarations. Remove options_
15034 field. Add number_of_input_files_ and resized_signatures_
15035 fields. Move sections_are_attached_ field.
15036 * main.cc (main): Pass number of input files to Layout
15037 constructor. Don't pass options.
15038
154b857c
ILT
150392009-03-30 Ian Lance Taylor <iant@google.com>
15040
15041 * ffsll.c (ffsll): Correct implementation.
15042
2f35ab9b
ILT
150432009-03-27 Ian Lance Taylor <iant@google.com>
15044
fd03461a
ILT
15045 * ffsll.c: New file.
15046 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
15047 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
15048 * ftruncate.c (ftruncate): Declare before definition.
15049 * mremap.c (mremap): Likewise.
15050 * pread.c (pread): Likewise.
15051 * configure, Makefile.in, config.in: Rebuild.
15052
2f35ab9b
ILT
15053 * mremap.c: New file.
15054 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
15055 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
15056 (mremap): Declare if HAVE_MREMAP is not defined.
15057 * configure, Makefile.in, config.in: Rebuild.
15058
33aea2fd
CC
150592009-03-27 Cary Coutant <ccoutant@google.com>
15060
15061 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
15062 position independent.
15063 * sparc.cc (Target_sparc::check_non_pic): Likewise.
15064 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
15065
6d479619
CC
150662009-03-24 Cary Coutant <ccoutant@google.com>
15067
15068 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
15069 an executable.
15070 (needs_dynamic_reloc): Likewise.
15071
afc06bb8
ILT
150722009-03-24 Ian Lance Taylor <iant@google.com>
15073
15074 * yyscript.y (file_cmd): Recognize EXTERN.
15075 (extern_name_list, extern_name_list_body): New nonterminals.
15076 * script.cc (script_add_extern): Define.
15077 * script-c.h (script_add_extern): Declare.
15078
f6060a4d
ILT
150792009-03-24 Rafael Avila de Espindola <espindola@google.com>
15080
15081 * object.cc (is_elf_object): Define.
15082 * object.h (is_elf_object): Declare.
15083 * archive.cc (Archive::get_elf_object_for_member): Call
15084 is_elf_object.
33aea2fd 15085 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 15086
26736d8e
ILT
150872009-03-24 Elliott Hughes <enh@google.com>
15088
15089 * output.cc (Output_file::map_anonymous): Define.
15090 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15091 try an anonymous one. Report the size if the mmap fails.
15092 * output.h (class Output_file): Declare map_anonymous.
15093
22fd9730
ILT
150942009-03-24 Ian Lance Taylor <iant@google.com>
15095
15096 * target-select.cc (instantiate_target): Don't acquire the lock if
15097 the instantiated_target_ field has already been set.
15098
cb010894
ILT
150992009-03-23 Ian Lance Taylor <iant@google.com>
15100
7f055c20
ILT
15101 * gold-threads.h (class Initialize_lock): Define.
15102 * gold-threads.cc (class Initialize_lock_once): Define.
15103 (initialize_lock_control): New static variable.
15104 (initialize_lock_pointer): New static variable.
15105 (initialize_lock_once): New static function.
15106 (Initialize_lock::Initialize_lock): Define.
15107 (Initialize_lock::initialize): Define.
15108 * target-select.h: Include "gold-threads.h".
15109 (class Target_selector): Add lock_ and initialize_lock_ fields.
15110 Don't define instantiate_target, just declare it.
15111 * target-select.cc (Target_selector::Target_selector): Initialize
15112 new fields.
15113 (Target_selector::instantiate_target): Define.
15114 * descriptors.h: Include "gold-threads.h".
15115 (class Descriptors): Add initialize_lock_ field.
15116 * descriptors.cc (Descriptors::Descriptors): Initialize new
15117 field.
15118 (Descriptors::open): Use initialize_lock_ field
15119 * errors.h (class Errors): Add initialize_lock_ field.
15120 * errors.cc (Errors::Errors): Initialize new field.
15121 (Errors::initialize_lock): Use initialize_lock_ field.
15122 * powerpc.cc (class Target_selector_powerpc): Remove
15123 instantiated_target_ field. In do_recognize call
15124 instantiate_target rather than do_instantiate_target. In
15125 do_instantiate_target just allocate a new target.
15126 * sparc.cc (class Target_selector_sparc): Likewise.
15127
36959681
ILT
15128 * freebsd.h: New file.
15129 * i386.cc: Include "freebsd.h".
15130 (Target_i386): Derive from Target_freebsd rather than
15131 Sized_target.
15132 (Target_selector_i386): Derive from Target_selector_freebsd rather
15133 than Target_selector.
15134 * x86_64.cc: Include "freebsd.h".
15135 (Target_x86_64): Derive from Target_freebsd rather than
15136 Sized_target.
15137 (Target_selector_x86_64): Derive from Target_selector_freebsd
15138 rather than Target_selector.
15139 * target.h (class Target): Add adjust_elf_header and
15140 do_adjust_elf_header.
15141 * output.cc (Output_file_header:: do_sized_write): Call target
15142 adjust_elf_header routine.
15143 * configure.tgt: Set targ_osabi.
15144 * configure.ac: Define GOLD_DEFAULT_OSABI.
15145 * parameters.cc (Parameters::default_target): Pass
15146 GOLD_DEFAULT_OSABI to select_target.
15147 * target-select.h (class Target_selector): Make instantiate_target
15148 protected rather than private.
15149 * Makefile.am (HFILES): Add freebsd.h.
15150 * configure, Makefile.in, config.in: Rebuild.
15151
cb010894
ILT
15152 * merge.cc (do_add_input_section): Correct pend value. Change
15153 message about last entry not being null terminated from error to
15154 warning.
15155
0e879927
ILT
151562009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15157
15158 * incremental.cc: New file.
15159 * Makefile.am (CCFILES): Add incremental.cc.
15160 * Makefile.in: Rebuild.
15161
41105937
PP
151622009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15163
15164 * layout.cc (Layout::output_section_name): Preserve names
15165 of '.note.' sections.
e1df38aa 15166
60439920
ILT
151672009-03-19 Ian Lance Taylor <iant@google.com>
15168
15169 * descriptors.cc (Descriptors::open): Check that the options are
15170 valid before using them.
15171
0d371ad3
ILT
151722009-03-18 Ian Lance Taylor <iant@google.com>
15173
15174 * script-sections.h: Include <list>.
15175 (class Script_sections): Change Sections_elements from std::vector
15176 to std::list. Typedef public Elements_iterator. Add
15177 orphan_section_placement_, data_segment_align_start_, and
15178 saw_data_segment_align_ fields. Remove data_segment_align_index_
15179 field.
15180 * script-sections.cc (class Orphan_section_placement): New class.
15181 (class Sections_element): Add virtual functions is_relro and
15182 orphan_section_init. Remove virtual function place_orphan_here.
15183 (class Output_section_definition): Add is_relro and
15184 orphan_section_init. Remove place_orphan_here.
15185 (class Orphan_output_section): Likewise.
15186 (Script_sections::Script_sections): Update for field changes.
15187 (Script_sections::data_segment_align): Set saw_data_segment_align_
15188 and data_segment_align_start_, not data_segment_align_index.
15189 (Script_sections::data_segment_relro_end): Check
15190 saw_data_segment_align_. Use data_segment_align_start_ rather
15191 than data_segment_align_index_.
15192 (Script_sections::place_orphan): Rewrite to use
15193 Orphan_section_placement.
15194
9201d894
ILT
151952009-03-17 Ian Lance Taylor <iant@google.com>
15196
9c5b8369
ILT
15197 * archive.cc (Archive::add_symbols): Check for a version attached
15198 to the symbol name in the archive map.
15199 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15200 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15201 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15202 (ver_test_11.a): New target.
15203 * testsuite/Makefile.in: Rebuild.
15204
9201d894
ILT
15205 * configure.ac: Check for chsize and posix_fallocate. Replace
15206 ftruncate.
15207 * ftruncate.c: New file, from gnulib.
15208 * output.cc (posix_fallocate): Define dummy version if not
15209 HAVE_POSIX_FALLOCATE.
15210 (Output_file::map): Call posix_fallocate rather than lseek and
15211 write.
15212 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15213 * configure, Makefile.in, config.in: Rebuild.
15214
ef4ab7a8 152152009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15216
ef4ab7a8
PP
15217 * layout.h (Layout::create_note): Add section_name parameter.
15218 * layout.cc (Layout::create_note): Likewise.
15219 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15220
8c500701
ILT
152212009-03-17 Ian Lance Taylor <iant@google.com>
15222
e85b18e1
ILT
15223 * descriptors.cc: Include "options.h".
15224 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15225 (Descriptors::open): Always use O_CLOEXEC when opening a new
15226 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15227 then set FD_CLOEXEC.
15228
9efe6174
ILT
15229 * sparc.cc (class Target_sparc): Add has_got_section.
15230 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15231 make sure we have a GOT section.
15232
15233 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15234 (Target_sparc::Scan::local): Likewise.
15235 (Target_sparc::Scan::global): Likewise.
15236 (Target_sparc::Relocate::relocate): Likewise.
15237 (Target_sparc::Relocate::relocate_tls): Likewise.
15238
8c500701
ILT
15239 * symtab.cc (Symbol_table::define_default_version): New function,
15240 broken out of add_from_object.
15241 (Symbol_table::add_from_object): Call define_default_version.
15242 (Symbol_table::define_special_symbol): Add resolve_oldsym
15243 parameter. Change all callers. If the version for a symbol comes
15244 from a version script, resolve it with the symbol with the same
15245 name with no version. Also add the symbol without a version if
15246 appropriate.
15247 (do_define_in_output_data): If resolving with oldsym, don't delete
15248 sym.
15249 (do_define_in_output_segment): Likewise.
15250 (do_define_as_constant): Likewise.
15251 * symtab.h (class Symbol_table): Update declarations.
15252
f1ed28fb
ILT
152532009-03-13 Ian Lance Taylor <iant@google.com>
15254
15f8229b
ILT
15255 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15256 (Read_symbols::requeue): New function.
15257 (Read_symbols::do_read_symbols): If make_elf_object fails because
15258 the target type is not configured, and the file was searched for,
15259 issue a warning and retry with the next directory.
15260 (Add_symbols::run): If the file has an incompatible format, and
15261 it was searched for, requeue the Read_symbols task. On error,
15262 release the object.
15263 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15264 dirindex parameter to constructor. Change all callers. Declare
15265 incompatible_warning and requeue.
15266 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15267 input_argument_ and input_group_ fields. Add them to
15268 constructor. Change all callers.
15269 (class Read_script): Add dirindex_ field. Add it to constructor.
15270 Change all callers.
15271 * archive.cc (Archive::setup): Remove input_objects parameter.
15272 Change all callers.
15273 (Archive::get_file_and_offset): Likewise.
15274 (Archive::read_all_symbols): Likewise.
15275 (Archive::read_symbols): Likewise.
15276 (Archive::get_elf_object_for_member): Remove input_objects
15277 parameter. Add punconfigured parameter. Change all callers.
15278 (Archive::add_symbols): Change return type to bool. Check return
15279 value of include_member.
15280 (Archive::include_all_members): Likewise.
15281 (Archive::include_member): Change return type to bool. Return
15282 false if first included object has incompatible target. Set
15283 included_member_ field.
15284 (Add_archive_symbols::run): If add_symbols returns false, requeue
15285 Read_symbols task.
15286 * archive.h (class Archive): Add included_member_ field.
15287 Initialize it in constructor. Add input_file and searched_for
15288 methods. Update declarations.
15289 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15290 input_argument_ fields. Add them to constructor. Change all
15291 callers.
15292 * script.cc: Include "target-select.h".
15293 (class Parser_closure): Add skip_on_incompatible_target_ and
15294 found_incompatible_target_ fields. Add
15295 skip_on_incompatible_target parameter to constructor. Change all
15296 callers. Add methods skip_on_incompatible_target,
15297 clear_skip_on_incompatible_target, found_incompatible_target, and
15298 set_found_incompatible_target.
15299 (read_input_script): Add dirindex parameter. Change all callers.
15300 If parser finds an incompatible target, requeue Read_symbols
15301 task.
15302 (script_set_symbol): Clear skip_on_incompatible_target in
15303 closure.
15304 (script_add_assertion, script_parse_option): Likewise.
15305 (script_start_sections, script_add_phdr): Likewise.
15306 (script_check_output_format): New function.
15307 * script.h (read_input_script): Update declaration.
15308 * script-c.h (script_check_output_format): Declare.
15309 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15310 (ignore_cmd): Remove OUTPUT_FORMAT.
15311 * fileread.cc (Input_file::Input_file): Add explicit this.
15312 (Input_file::will_search_for): New function.
15313 (Input_file::open): Add pindex parameter. Change all callers.
15314 * fileread.h (class Input_file): Add input_file_argument method.
15315 Declare will_search_for. Update declarations.
15316 * object.cc (make_elf_object): Add punconfigured parameter.
15317 Change all callers.
15318 * object.h (class Object): Make input_file public. Add
15319 searched_for method.
15320 (make_elf_object): Update declaration.
15321 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15322 restart search.
15323 * dirsearch.h (class Dirsearch): Update declaration.
15324 * options.h (class General_options): Add --warn-search-mismatch.
15325 * parameters.cc (Parameters::is_compatible_target): New function.
15326 * parameters.h (class Parameters): Declare is_compatible_target.
15327 * workqueue.cc (Workqueue::add_blocker): New function.
15328 * workqueue.h (class Workqueue): Declare add_blocker.
15329
f1ed28fb
ILT
15330 * fileread.cc (Input_file::open): Remove options parameter.
15331 Change all callers.
15332 (Input_file::open_binary): Likewise.
15333 * script.cc (read_input_script): Likewise.
15334 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15335 options parameter from constructor. Change all callers.
15336 (class Read_script): Likewise.
15337 * fileread.h (class Input_file): Update declarations.
15338 * script.h (read_input_script): Update declaration.
15339
34dd024a
NC
153402009-03-10 Nick Clifton <nickc@redhat.com>
15341
15342 * po/es.po: New Spanish translation.
15343
6d71b17c
CC
153442009-03-06 Cary Coutant <ccoutant@google.com>
15345
15346 * options.cc (parse_short_option): Keep dash_z from registering itself.
15347
031cdbed
ILT
153482009-03-03 Ian Lance Taylor <iant@google.com>
15349
15350 PR 9918
15351 * target-reloc.h (relocate_section): Pass output_section to
15352 relocate.
15353 * i386.cc (Target_i386::should_apply_static_reloc): Add
15354 output_section parameter. Change all callers.
15355 (Target_i386::Relocate::relocate): Add output_section parameter.
15356 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15357 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15358 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15359 * testsuite/two_file_shared.sh: New script.
15360 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15361 (check_DATA): Add two_file_shared.dbg.
15362 (two_file_shared.dbg): New target.
15363 * testsuite/Makefile.in: Rebuild.
15364
15d5fa16
ILT
153652009-03-01 Ian Lance Taylor <iant@google.com>
15366
15367 * configure.ac: Check for byteswap.h.
15368 * configure: Rebuild.
15369 * config.in: Rebuild.
15370
8a4c0b0d
ILT
153712009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15372
15373 * layout.cc (Layout::find_or_add_kept_section): New function.
15374 (Layout::add_comdat): Removed.
15375 * layout.h (struct Kept_section): Move out of class Layout.
15376 Remove trailing underscores from field names. Add group_sections
15377 field. Rename group_ field to is_group. Change all uses.
15378 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15379 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15380 comdat_groups_ field.
15381 (Sized_relobj::include_section_group): Use
15382 find_or_add_kept_section and Kept_section::group_sections.
15383 (Sized_relobj::include_linkonce_section): Likewise.
15384 * object.cc (class Sized_relobj): Don't define Comdat_group or
15385 Comdat_group_table. Remove find_comdat_group and
15386 add_comdat_group. Remove comdat_groups_ field.
15387 * plugin.cc (include_comdat_group): Use
15388 Layout::find_or_add_kept_section.
15389
b4ecf66b
ILT
153902009-02-28 Ian Lance Taylor <iant@google.com>
15391
14359ca0
ILT
15392 * README: --gc-sections and map files are now supported. Document
15393 some build requirements.
15394
b4ecf66b
ILT
15395 PR 6992
15396 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15397 relocatable link set the value of the section symbol to zero.
15398 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15399 relocatable link don't include the section address in the local
15400 symbol value.
15401
0602e05a
ILT
154022009-02-27 Ian Lance Taylor <iant@google.com>
15403
fd9d194f
ILT
15404 PR 6811
15405 * options.h (class Search_directory): Add is_system_directory.
15406 (class General_options): Declare is_in_system_directory.
15407 * options.cc (get_relative_sysroot): Make static.
15408 (get_default_sysroot): Make static.
15409 (General_optoins::is_in_system_directory): New function.
15410 * fileread.cc (Input_file::is_in_system_directory): New function.
15411 * fileread.h (class Input_file): Declare is_in_system_directory.
15412 * object.h (class Object): Add is_in_system_directory.
15413 (class Input_objects): Remove system_library_directory_ field.
15414 * object.cc (Input_objects::add_object): Don't set
15415 system_library_directory_.
15416 (input_objects::found_in_system_library_directory): Remove.
15417 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15418 parameter. Change all callers.
15419 (Symbol_table::sized_write_globals): Likewise.
15420 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15421 Call Object::is_in_system_directory.
15422 * symtab.h (class Symbol_table): Update declarations.
15423
61edd21f
ILT
15424 PR 5990
15425 * descriptors.h (Open_descriptor): Add is_on_stack field.
15426 * descriptors.cc (Descriptors::open): If the descriptor is on the
15427 top of the stack, remove it. Initialize is_on_stack field.
15428 (Descriptors::release): Only add pod to stack if it is not on the
15429 stack already.
15430 (Descriptors::close_some_descriptor): Clear stack_next and
15431 is_on_stack fields.
15432
e29e076a
ILT
15433 PR 7091
15434 * output.cc (Output_section::find_starting_output_address): Rename
15435 from starting_output_address; add PADDR parameter; change return
15436 type.
15437 * output.h (class Output_section): Declare
15438 find_starting_output_address instead of starting_output_address.
15439 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15440 section symbol for which we can't find a merge section.
15441
0602e05a
ILT
15442 PR 9836
15443 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15444 hidden or internal, force the symbol to be local.
15445 * resolve.cc (Symbol::override_visibility): Define.
15446 (Symbol::override_base): Use override_visibility.
15447 (Symbol_table::resolve): Likewise.
15448 (Symbol::override_base_with_special): Likewise.
15449 (Symbol_table::override_with_special): If the visibility is hidden
15450 or internal, force the symbol to be local.
15451 * symtab.h (class Symbol): Add set_visibility and
15452 override_visibility.
15453 * testsuite/ver_test_1.sh: New file.
15454 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15455 (check_DATA): Add ver_test_1.syms.
15456 (ver_test_1.syms): New target.
15457 * testsuite/Makefile.in: Rebuild.
15458
401a9a73
CC
154592009-02-25 Cary Coutant <ccoutant@google.com>
15460
15461 * layout.cc (Layout::choose_output_section): Don't rename sections
15462 when using a linker script that has a SECTIONS clause.
15463 * Makefile.in: Regenerate.
15464
15465 * testsuite/Makefile.am (script_test_5.sh): New test case.
15466 * testsuite/Makefile.in: Regenerate.
15467 * testsuite/script_test_5.cc: New file.
15468 * testsuite/script_test_5.sh: New file.
15469 * testsuite/script_test_5.t: New file.
15470
f488e4b0
CC
154712009-02-13 Rafael Avila de Espindola <espindola@google.com>
15472
15473 * archive.cc (Archive::include_member): Update calls to add_symbols.
15474 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15475 the Layout argument.
15476 * dynobj.h (do_add_symbols): Add the Layout argument.
15477 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15478 Layout argument.
15479 * object.h (Object::add_symbols): Add the Layout argument.
15480 (Object::do_add_symbols): Add the Layout argument.
15481 (Sized_relobj::do_add_symbols): Add the Layout argument.
15482 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15483 Unify the two versions.
15484 (Add_plugin_symbols): Remove.
15485 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15486 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15487 (Add_plugin_symbols): Remove.
15488 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15489 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15490 (Add_symbols::run): Make it work with Pulginobj.
15491
89dd1680
ILT
154922009-02-06 Ian Lance Taylor <iant@google.com>
15493
15494 * object.cc (Sized_relobj::do_layout): Make info message start
15495 with lower case letter.
15496
266d0a74
ILT
154972009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15498
602b464e
ILT
15499 * binary.cc: Fix file comment.
15500
266d0a74
ILT
15501 * options.h (enum Incremental_disposition): Define.
15502 (class General_options): Add new options: --incremental,
15503 --incremental_changed, --incremental_unchanged,
15504 --incremental_unknown. Add incremental_disposition_ and
15505 implicit_incremental_ fields.
15506 (General_options::incremental_disposition): New function.
15507 (class Position_dependent_options): Add incremental_disposition
15508 option.
15509 (Position_dependent_options::copy_from_options): Set incremental
15510 dispositions.
15511 * options.cc (General_options::parse_incremental_changed): New
15512 function.
2e702c99
RM
15513 (General_options::parse_incremental_unchanged): New function.
15514 (General_options::parse_incremental_unknown): New function.
15515 (General_options::General_options): Initialize new fields
266d0a74 15516 incremental_disposition_ and implicit_incremental_.
2e702c99 15517 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15518 without --incremental.
15519
f073bbf7
CD
155202009-02-06 Chris Demetriou <cgd@google.com>
15521
15522 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15523 pointer and to report location as the file name associated with
15524 the symbol.
15525 (gold_undefined_symbol_at_location): New function to replace the
15526 old gold_undefined_symbol functionality.
15527 * target-reloc.h (relocate_section): Update to use
15528 gold_undefined_symbol_at_location.
15529 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15530 Call gold_undefined_symbol function rather than gold_error.
15531 * errors.h (Errors::undefined_symbol): Take location as a
15532 string, rather than calculating it from a relocation.
15533 * errors.cc (Errors::fatal): Print "fatal error:" before the
15534 formatted message.
15535 (Errors::error, Errors::error_at_location): Print "error: "
15536 before the formatted message.
15537 (Errors::undefined_symbol): Take location as a string, rather
15538 than calculating it from a relocation.
15539 (gold_undefined_symbol_at_location): New function akin to
15540 old gold_undefined_symbol, calculates location from relocation.
15541 (gold_undefined_symbol): Change to take only a Symbol pointer
15542 and to report location as the file name associated with the symbol.
15543 * testsuite/debug_msg.sh: Update for changed error messages.
15544 * testsuite/undef_symbol.sh: Likewise.
15545
8e94a90c
ILT
155462009-02-04 Duncan Sands <baldrick@free.fr>
15547
15548 PR 9812
15549 * reduced_debug_output.h
15550 (Output_reduced_debug_abbrev_section::failed): Use format for
15551 gold_warning.
15552 (Output_reduced_debug_info_section::faild): Likewise.
15553
88a0e15b
ILT
155542009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15555
15556 * script.cc (Lazy_demangler): New class.
2e702c99 15557 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15558 symbol only once.
15559
5efc7cd2
CC
155602009-01-29 Cary Coutant <ccoutant@google.com>
15561
15562 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15563 to __tls_get_addr.
15564 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15565
e0ebcf42
ILT
155662009-01-28 Ian Lance Taylor <iant@google.com>
15567
5efc7cd2 15568 * version.cc (version_string): Bump to 1.9.
75fe7426 15569
e0ebcf42
ILT
15570 * gold.h: Include <cstring> and <stdint.h>.
15571 * version.cc: Include <cstdio>.
15572 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15573 warning.
15574 * reduced_debug_output.cc (insert_into_vector): Rename from
15575 Insert_into_vector; change all callers. Use Swap_unaligned to
15576 avoid aliasing issue; remove union since it is unnecessary.
15577
8e2813be 155782009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15579
15580 * Makefile.am (CCFILES): Add gc.cc.
15581 (HFILES): Add gc.h.
15582 * Makefile.in: Regenerate.
15583 * gold.cc (Gc_runner): New class.
15584 (queue_initial_tasks): Call garbage collection related tasks
15585 when corresponding options are invoked.
15586 (queue_middle_gc_tasks): New function.
15587 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15588 processed early before laying out sections during garbage collection.
15589 * gold.h (queue_middle_gc_tasks): New function.
15590 (is_prefix_of): Move from "layout.cc".
15591 * i386.cc (Target_i386::gc_process_relocs): New function.
15592 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15593 * main.cc (main): Create object of class "Garbage_collection".
15594 * object.cc (Relobj::copy_symbols_data): New function.
15595 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15596 (Sized_relobj::do_layout): Allow this function to be called twice
15597 during garbage collection and defer layout of section during the
6d03d481
ST
15598 first call.
15599 * object.h (Relobj::get_symbols_data): New function.
15600 (Relobj::is_section_name_included): New function.
15601 (Relobj::copy_symbols_data): New function.
15602 (Relobj::set_symbols_data): New function.
15603 (Relobj::get_relocs_data): New function.
15604 (Relobj::set_relocs_data): New function.
15605 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15606 (Relobj::gc_process_relocs): New function.
15607 (Relobj::do_gc_process_relocs): New pure virtual function.
15608 (Relobj::sd_): New data member.
15609 (Sized_relobj::is_output_section_offset_invalid): New function.
15610 (Sized_relobj::do_gc_process_relocs): New function.
15611 * options.h (General_options::gc_sections): Modify to not be a no-op.
15612 (General_options::print_gc_sections): New option.
15613 * plugin.cc (Plugin_finish::run): Remove function call to
15614 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15615 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15616 * reloc.cc (Read_relocs::run): Add task to process relocs and
15617 determine unreferenced sections when doing garbage collection.
15618 (Gc_process_relocs): New class.
15619 (Sized_relobj::do_gc_process_relocs): New function.
15620 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15621 sections that are garbage collected.
15622 * reloc.h (Gc_process_relocs): New class.
15623 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15624 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15625 symbols whose corresponding sections are garbage collected.
15626 (Symbol_table::Symbol_table): Add new parameter for the garbage
15627 collection object.
15628 (Symbol_table::gc_mark_undef_symbols): New function.
15629 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15630 (Symbol_table::gc_mark_dyn_syms): New function.
15631 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15632 as garbage.
15633 (Symbol_table::add_from_object): Likewise.
15634 (Symbol_table::add_from_relobj): When building shared objects, do not
15635 treat externally visible symbols as garbage.
15636 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15637 table information for static and relocatable links.
15638 * symtab.h (Symbol_table::set_gc): New function.
15639 (Symbol_table::gc): New function.
15640 (Symbol_table::gc_mark_undef_symbols): New function.
15641 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15642 (Symbol_table::gc_mark_dyn_syms): New function.
15643 (Symbol_table::gc_): New data member.
e1df38aa 15644 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15645 function.
15646 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15647 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15648
3b293544
CF
156492009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15650
15651 * options.h (General_options::gc_sections): Define as a no-op for now.
15652 (General_options::no_keep_memory): Ditto.
15653 (General_options::Bshareable): Define.
15654 * options.cc (General_options::finalize): Honor -Bshareable.
15655
83d22aa8
AS
156562009-01-20 Andreas Schwab <schwab@suse.de>
15657
15658 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15659 read the value in the contents, since we don't use it. Use the
15660 template endianness when writing.
15661 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15662
cd536b21
AS
156632009-01-19 Andreas Schwab <schwab@suse.de>
15664
15665 * configure.tgt (powerpc64-*): Fix targ_obj.
15666
99e9a495
ILT
156672009-01-15 Ian Lance Taylor <iant@google.com>
15668
15669 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15670 local symbols when stripping all symbols.
15671
bbbfea06
CC
156722009-01-14 Cary Coutant <ccoutant@google.com>
15673
99e9a495 15674 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15675
0f7c0701
CC
156762009-01-14 Cary Coutant <ccoutant@google.com>
15677
15678 * archive.cc (Archive::get_elf_object_for_member): Remove call
15679 to File_read::claim_for_plugin.
15680 * descriptors.cc (Descriptors::open): Remove reference to
15681 is_claimed.
15682 (Descriptors::claim_for_plugin): Remove.
15683 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15684 (Descriptors::is_claimed): Remove.
15685 (claim_descriptor_for_plugin): Remove.
15686 * fileread.cc (File_read::claim_for_plugin): Remove.
15687 * fileread.h (File_read::claim_for_plugin): Remove.
15688 (File_read::descriptor): Reopen descriptor if necessary.
15689 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15690 (Plugin_manager::all_symbols_read): Add task parameter. Change
15691 all callers.
15692 (Plugin_manager::get_input_file): New function.
15693 (Plugin_manager::release_input_file): New function.
15694 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15695 corresponding data member.
15696 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15697 and pass to base constructor. Change all callers.
15698 (get_input_file, release_input_file): New functions.
15699 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15700 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15701 (Plugin_manager::all_symbols_read): Add task parameter.
15702 (Plugin_manager::get_input_file): New function.
15703 (Plugin_manager::release_input_file): New function.
15704 (Plugin_manager::task_): New data member.
15705 (Pluginobj::Pluginobj): Add filesize parameter.
15706 (Pluginobj::filename): New function.
15707 (Pluginobj::descriptor): New function.
15708 (Pluginobj::filesize): New function.
15709 (Pluginobj::filesize_): New data member.
15710 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15711 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15712 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15713
15714 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15715 with archive libraries.
15716 * testsuite/Makefile.in: Regenerate.
15717 * testsuite/plugin_test.c (struct sym_info): New type.
15718 (get_input_file, release_input_file): New static variables.
15719 (onload): Capture new transfer vector entries.
15720 (claim_file_hook): Stop reading at end of file according to filesize.
15721 Factor out parsing of readelf output into separate function.
15722 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15723 APIs and get the source file name from the symbol table. Convert
15724 source file name to corresponding object file name. Print info
15725 message when adding new input files.
15726 (parse_readelf_line): New function.
15727 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15728 * testsuite/plugin_test_2.sh: Likewise.
15729 * testsuite/plugin_test_3.sh: Likewise.
15730 * testsuite/plugin_test_4.sh: New test case.
15731
62a6d109
ILT
157322009-01-07 Ian Lance Taylor <iant@google.com>
15733
15734 * version.cc (version_string): Bump to 1.8.
15735
483620e8
CC
157362008-12-23 Cary Coutant <ccoutant@google.com>
15737
15738 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15739 * plugin.cc (Plugin_manager::finish): Rename as
15740 layout_deferred_objects. Move cleanup to separate function.
15741 (Plugin_manager::cleanup): New function.
15742 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15743 separately.
15744 * plugin.h (Plugin_manager::finish): Rename as
15745 layout_deferred_objects.
15746 (Plugin_manager::cleanup): New function.
15747 (Plugin_manager::cleanup_done): New field.
15748
d66a9eb3
CC
157492008-12-23 Cary Coutant <ccoutant@google.com>
15750
15751 * plugin.cc (is_visible_from_outside): New function.
15752 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15753 so we don't return "IR only" status for exported symbols or -r links.
15754
15755 * testsuite/Makefile.am (plugin_test_3): New test case.
15756 * testsuite/Makefile.in: Regenerate.
15757 * testsuite/plugin_test_3.sh: New file.
15758
5995b570
CC
157592008-12-22 Cary Coutant <ccoutant@google.com>
15760
15761 * object.cc (Sized_relobj::layout_section): New function.
15762 (Sized_relobj::do_layout): Defer layout of input sections until after
15763 plugin has provided replacement files.
15764 (Sized_relobj::do_layout_deferred_sections): New function.
15765 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15766 (Relobj::layout_deferred_sections): New function.
15767 (Relobj::do_layout_deferred_sections): New function.
15768 (Sized_relobj::do_layout_deferred_sections): New function.
15769 (Sized_relobj::layout_section): New function.
15770 (Sized_relobj::Deferred_layout): New structure.
15771 (Sized_relobj::deferred_layout_): New field.
15772 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15773 Change all callers. Layout deferred sections.
15774 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15775 references.
15776 (Plugin_hook::run): Move code from do_plugin_hook inline.
15777 (Plugin_hook::do_plugin_hook): Remove.
15778 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15779 (Plugin_manager::finish): Renamed, was cleanup.
15780 (Plugin_manager::should_defer_layout): New function.
15781 (Plugin_manager::add_deferred_layout_object): New function.
15782 (Plugin_manager::Deferred_layout_list): New type.
15783 (Plugin_manager::deferred_layout_objects_): New field.
15784 (Plugin_hook::do_plugin_hook): Remove.
15785
ee769c88
ILT
157862008-12-17 Ian Lance Taylor <iant@google.com>
15787
15788 * options.h (class General_options): Add --no case for
15789 --export-dynamic.
15790
abc8dcba
CC
157912008-12-16 Cary Coutant <ccoutant@google.com>
15792
15793 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15794 vector.
15795 (Plugin_manager::claim_file): Create plugin object even if
15796 plugin did not call the add_symbols callback.
15797 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15798 asking for more symbols than were added.
15799 * testsuite/Makefile.am (plugin_test_1): Add test case with
15800 no global symbols.
15801 (empty.syms): New target.
15802 * testsuite/Makefile.in: Regenerate.
15803 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15804 message. Don't call add_symbols if no globals.
15805 (all_symbols_read_hook): Don't provide replacement for empty
15806 claimed file.
15807
b0074644
ILT
158082008-12-12 Ian Lance Taylor <iant@google.com>
15809
68943102
ILT
15810 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15811 r_type == 0 for a local symbol with r_sym == 0.
15812 (scan_relocatable_relocs): Pass r_sym to
15813 local_non_section_strategy.
15814 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15815 r_sym parameter.
15816
b0074644
ILT
15817 * configure.ac: Update test for TLS descriptors: they are
15818 supported as of glibc 2.9.
15819 * configure: Rebuild.
15820
c2508178
ILT
158212008-12-11 Ian Lance Taylor <iant@google.com>
15822
15823 PR 7091
15824 * target-reloc.h (Default_scan_relocatable_relocs): For each
15825 function, map r_type == 0 to RELOC_DISCARD.
15826
2756a258
CC
158272008-12-10 Cary Coutant <ccoutant@google.com>
15828
15829 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15830 object to override a kept COMDAT group from a plugin object.
15831
bb6f53d3
ILT
158322008-12-09 Ian Lance Taylor <iant@google.com>
15833
fbc558e1
ILT
15834 PR 7088
15835 * yyscript.y (file_cmd): Handle INPUT.
15836
bb6f53d3
ILT
15837 * testsuite/initpri1.c: Change all declarations to be full
15838 prototypes by adding void, to avoid compiler warnings.
15839
4674ecfc
CC
158402008-12-05 Rafael Avila de Espindola <espindola@google.com>
15841
15842 * options.cc (General_options::parse_plugin_opt): New.
15843 (General_options::add_plugin): The argument now is just the filename.
15844 (General_options::add_plugin_option): New.
15845 * options.h (plugin_opt): New.
15846 (add_plugin): Change argument name.
15847 (add_plugin_option): New.
15848 * plugin.cc (Plugin::load): Don't parse the plugin option.
15849 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15850 (Plugin::add_option): New.
15851 (Plugin::args_): Change type.
15852 (Plugin::filename_): New.
15853 (Plugin_manager::add_plugin_option): New.
15854 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15855 * testsuite/Makefile.in: Regenerate.
15856
fd06b4aa
CC
158572008-12-05 Cary Coutant <ccoutant@google.com>
15858
15859 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15860 Handle --strip-lto-sections option.
15861 * options.h (strip_lto_sections): New option.
15862
6c52134c
CC
158632008-12-01 Cary Coutant <ccoutant@google.com>
15864
15865 * plugin.cc (ld_plugin_message): Change format parameter to const.
15866 Fix mismatch between new[] and delete.
15867
a45248e0
CC
158682008-11-14 Cary Coutant <ccoutant@google.com>
15869
15870 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15871 instead of -1U.
15872
c82fbeee
CS
158732008-11-05 Craig Silverstein <csilvers@google.com>
15874
15875 * options.cc (General_options::parse_dynamic_list): New function.
15876 * options.h (General_options): New flags dynamic_list,
15877 dynamic_list_data, dynamic_list_cpp_new, and
15878 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15879 (General_options::in_dynamic_list): New function.
15880 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15881 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15882 (Lex::can_continue_name): Likewise.
15883 (yylex): Likewise.
15884 (read_script_file): New parameter script_options.
15885 (read_dynamic_list): New function.
15886 (Script_options::define_dynamic_list): New function.
15887 (dynamic_list_keyword_parsecodes): New variable.
15888 (dynamic_list_keywords): New variable.
15889 * script.h (Script_options::define_dynamic_list): New function
15890 prototype.
15891 (read_dynamic_list): New function prototype.
15892 * symtab.cc (strprefix): New macro.
15893 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15894 dynamic_list_data, dynamic_list_cpp_new, and
15895 dynamic_list_cpp_typeinfo.
15896 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15897 (dynamic_list_expr): New rule.
15898 (dynamic_list_nodes): Likewise.
15899 (dynamic_list_node): Likewise.
15900 * testsuite/Makefile.am (dynamic_list): New test.
15901 * testsuite/Makefile.in: Regenerated.
15902 * testsuite/dynamic_list.t: New file.
15903 * testsuite/dynamic_list.sh: New file.
15904
e0bb29a5
CS
159052008-11-05 Craig Silverstein <csilvers@google.com>
15906
15907 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15908 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15909 (t11_last): Likewise.
15910 * testsuite/ver_test_6.c (main): Likewise.
15911
4e1e25e0
CC
159122008-10-07 Cary Coutant <ccoutant@google.com>
15913
15914 * options.c (General_options::finalize): Add check for -static and
15915 -shared.
15916 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15917 is not empty.
15918
92f03fcb
CC
159192008-10-02 Cary Coutant <ccoutant@google.com>
15920
15921 * plugin.cc (make_sized_plugin_object): Fix conditional
15922 compilation to work when not all targets are enabled.
15923
fbd8a257
CC
159242008-09-29 Cary Coutant <ccoutant@google.com>
15925
15926 * archive.cc (Archive::get_file_and_offset): Use filename instead
15927 of name to get library path.
15928 (Archive::include_member): Unlock external member of a thin archive.
15929
15930 * testsuite/Makefile.am (TEST_AR): New variable.
15931 (thin_archive_test_1): New test.
15932 (thin_archive_test_2): New test.
81636b3f
CC
15933 * testsuite/Makefile.in: Regenerate.
15934 * testsuite/thin_archive_main.cc: New file.
15935 * testsuite/thin_archive_test_1.cc: New file.
15936 * testsuite/thin_archive_test_2.cc: New file.
15937 * testsuite/thin_archive_test_3.cc: New file.
15938 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15939
eff45813
CC
159402008-09-29 Cary Coutant <ccoutant@google.com>
15941
15942 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15943 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15944 instead of -1U.
15945 (Sized_relobj::do_finalize_local_symbols): Likewise.
15946 (Sized_relobj::map_to_kept_section): Likewise.
15947 * object.h (Sized_relobj::invalid_address): New constant.
15948 (Sized_relobj::do_output_section_offset): Check for invalid_address
15949 and return -1ULL.
15950 * output.cc (Output_reloc::local_section_offset): Use constant
15951 invalid_address instead of -1U.
15952 (Output_reloc::get_address): Likewise.
15953 (Output_section::output_address): Change -1U to -1ULL.
15954 * output.h (Output_reloc::invalid_address): New constant.
15955 * reloc.cc (Sized_relobj::write_sections): Use constant
15956 invalid_address instead of -1U.
15957 (Sized_relobj::relocate_sections): Likewise.
15958 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15959 values for merge sections.
15960 * target-reloc.h (relocate_for_relocatable): Use constant
15961 invalid_address instead of -1U.
15962
89fc3421
CC
159632008-09-19 Cary Coutant <ccoutant@google.com>
15964
15965 Add plugin functionality for link-time optimization (LTO).
15966 * configure.ac (plugins): Add --enable-plugins option.
15967 * configure: Regenerate.
15968 * config.in: Regenerate.
15969 * Makefile.am (LIBDL): New variable.
15970 (CCFILES): Add plugin.cc.
15971 (HFILES): Add plugin.h.
15972 (ldadd_var): Add LIBDL.
15973 * Makefile.in: Regenerate.
15974
15975 * archive.cc: Include "plugin.h".
15976 (Archive::setup): Don't preread archive symbols when using a plugin.
15977 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15978 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15979 files.
15980 (Archive::include_member): Add symbols from plugin objects.
15981 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15982 * descriptors.cc (Descriptors::open): Check for file descriptors
15983 abandoned by plugins.
15984 (Descriptors::claim_for_plugin): New function.
15985 * descriptors.h (Descriptors::claim_for_plugin): New function.
15986 (Open_descriptor::is_claimed): New field.
15987 (claim_descriptor_for_plugin): New function.
15988 * fileread.cc (File_read::claim_for_plugin): New function.
15989 * fileread.h (File_read::claim_for_plugin): New function.
15990 (File_read::descriptor): New function.
15991 * gold.cc: Include "plugin.h".
15992 (queue_initial_tasks): Add task to call plugin hooks for generating
15993 new object files.
15994 * main.cc: Include "plugin.h".
15995 (main): Load plugin libraries.
15996 * object.h (Pluginobj): Declare.
15997 (Object::pluginobj): New function.
15998 (Object::do_pluginobj): New function.
15999 (Object::set_target): New function.
16000 * options.cc: Include "plugin.h".
16001 (General_options::parse_plugin): New function.
16002 (General_options::General_options): Initialize plugins_ field.
16003 (General_options::add_plugin): New function.
16004 * options.h (Plugin_manager): Declare.
16005 (General_options): Add --plugin option.
16006 (General_options::has_plugins): New function.
16007 (General_options::plugins): New function.
16008 (General_options::add_plugin): New function.
16009 (General_options::plugins_): New field.
16010 * plugin.cc: New file.
16011 * plugin.h: New file.
16012 * readsyms.cc: Include "plugin.h".
16013 (Read_symbols::do_read_symbols): Check for archive before checking
16014 for ELF file. Call plugin hooks to claim files.
16015 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
16016 from a real object file; force override when processing replacement
16017 files.
16018 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
16019 (Symbol::init_base_object): Likewise.
16020 (Symbol::init_base_output_data): Likewise.
16021 (Symbol::init_base_output_segment): Likewise.
16022 (Symbol::init_base_constant): Likewise.
16023 (Symbol::init_base_undefined): Likewise.
16024 (Symbol::output_section): Assert that object is not a plugin.
16025 (Symbol_table::add_from_pluginobj): New function.
16026 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
16027 undefined.
16028 (Symbol_table::sized_write_globals): Likewise.
16029 (Symbol_table::add_from_pluginobj): Instantiate template.
16030 * symtab.h (Sized_pluginobj): Declare.
16031 (Symbol::in_real_elf): New function.
16032 (Symbol::set_in_real_elf): New function.
16033 (Symbol::in_real_elf_): New field.
16034 (Symbol_table::add_from_pluginobj): New function.
16035
16036 * testsuite/Makefile.am (AM_CFLAGS): New variable.
16037 (LIBDL): New variable.
16038 (LDADD): Add LIBDL.
16039 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
16040 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
16041 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
16042 (MOSTLYCLEANFILES): Likewise.
16043 * testsuite/Makefile.in: Regenerate.
16044 * testsuite/plugin_test.c: New file.
16045 * testsuite/plugin_test_1.sh: New file.
16046 * testsuite/plugin_test_2.sh: New file.
16047
de31bda5
ILT
160482008-09-16 Ian Lance Taylor <iant@google.com>
16049
9c2d0ef9
ILT
16050 * target-reloc.h (relocate_section): Check whether a symbol is
16051 defined by the ABI before reporting an undefined symbol error.
16052 * target.h (Target::is_defined_by_abi): Make parameter const.
16053 (Target::do_is_defined_by_abi): Likewise.
16054 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
16055 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
16056 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
16057 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
16058 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
16059 * testsuite/Makefile.in: Rebuild.
16060
de31bda5
ILT
16061 * fileread.cc (make_view): Add casts to avoid warning.
16062
9fa33bee
AO
160632008-09-16 Alexandre Oliva <aoliva@redhat.com>
16064
16065 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
16066 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16067
183fd0e3
AO
160682008-09-16 Alexandre Oliva <aoliva@redhat.com>
16069
16070 * options.h (General_options::output_is_executable): New.
16071 (General_options::output_is_pie): New.
16072 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16073 for shared libraries.
16074 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16075
7be8330a
CD
160762008-09-11 Chris Demetriou <cgd@google.com>
16077
16078 * options.h (origin): New -z option.
16079 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16080 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16081 in DT_FLAGS_1.
16082
a9caad02
CC
160832008-09-05 Cary Coutant <ccoutant@google.com>
16084
16085 * fileread.cc (File_read::make_view): Add check for attempt to map
16086 beyond end of file.
16087
ae6dce4d
CC
160882008-09-05 Cary Coutant <ccoutant@google.com>
16089
16090 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16091 explicit instantiations.
16092
d7ab2a47
KVH
160932008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16094
16095 PR gold/6858
16096 * options.cc (General_options::finalize): Allow undefined symbols
16097 in shlibs if linking -shared.
16098
16099 PR gold/6859
16100 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16101 symbols as not needing a dynsym entry.
16102
1e52a9c1
CS
161032008-08-20 Craig Silverstein <csilvers@google.com>
16104
16105 * fileread.cc (File_read::open): Do not lock the file unless it
16106 was successfully opened.
16107
d85c80a3
CC
161082008-08-14 Cary Coutant <ccoutant@google.com>
16109
16110 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16111 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16112 * testsuite/tls_test.cc (struct int128): 128-bit struct
16113 for testing TLS relocs with non-zero addend.
16114 (v12): New TLS variable.
16115 (t12): New test.
16116 (t_last): Add check for v12.
16117 * testsuite/tls_test.h (t12): New function.
16118 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16119
2d924fd9
ILT
161202008-08-13 Ian Lance Taylor <iant@google.com>
16121
16122 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16123 set tls_segment_ or relro_segment_.
16124 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16125 when appropriate.
16126 * output.h (Output_section::clear_is_relro): New function.
16127 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16128 sections specially even when output_data_ is empty.
16129 (Output_segment::maximum_alignment): When first section is relro,
16130 only force alignment for PT_LOAD segments.
16131 * script.cc (script_data_segment_align): New function.
16132 (script_data_segment_relro_end): New function.
16133 * script-c.h (script_data_segment_align): Declare.
16134 (script_data_segment_relro_end): Declare.
16135 * script-sections.h (class Script_sections): Declare
16136 data_segment_align and data_segment_relro_end. Add fields
16137 segment_align_index_ and saw_relro_end_.
16138 * script-sections.cc (class Sections_element): Add set_is_relro
16139 virtual function. Add new bool* parameter to place_orphan_here.
16140 Add get_output_section virtual function.
16141 (class Output_section_definition): Add set_is_relro. Add new
16142 bool* parameter to place_orphan_here. Add get_output_section.
16143 Add is_relro_ field.
16144 (Output_section_definition::Output_section_definition): Initialize
16145 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16146 and is_relro_ fields.
16147 (Output_section_definition::place_orphan_here): Add is_relro
16148 parameter.
16149 (Output_section_definition::set_section_addresses): Set relro for
16150 output section.
16151 (Output_section_definition::alternate_constraint): Likewise.
16152 (class Orphan_output_section): Add new bool* parameter to
16153 place_orphan_here. Add get_output_section.
16154 (Orphan_output_section::place_orphan_here): Add is_relro
16155 parameter.
16156 (Script_sections::Script_sections): Initialize
16157 data_segment_align_index_ and saw_relro_end_.
16158 (Script_sections::data_segment_align): New function.
16159 (Script_sections::data_segment_relro_end): New function.
16160 (Script_sections::place_orphan): Set or clear is_relro.
16161 (Script_sections::set_section_addresses): Force alignment of first
16162 TLS section.
16163 * yyscript.y (exp): Call script_data_segment_align and
16164 script_data_segment_relro_end.
16165 * testsuite/relro_script_test.t: New file.
16166 * testsuite/relro_test.cc (using_script): Declare.
16167 (t1, t2): Test using_script.
16168 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16169 (relro_script_test_SOURCES): Define.
16170 (relro_script_test_DEPENDENCIES): Define.
16171 (relro_script_test_LDFLAGS): Define.
16172 (relro_script_test_LDADD): Define.
16173 (relro_script_test.so): New target.
16174 * testsuite/Makefile.in: Rebuild.
16175
f827c9a9
CC
161762008-08-06 Cary Coutant <ccoutant@google.com>
16177
16178 * archive.cc (Archive::total_archives, Archive::total_members)
16179 (Archive::total_members_loaded): New variables.
16180 (Archive::setup): Add parameter. Add option to preread
16181 archive symbols.
16182 (Archive::read_armap): Add counter.
16183 (Archive::get_file_and_offset): New function.
16184 (Archive::get_elf_object_for_member): New function.
16185 (Archive::read_all_symbols): New function.
16186 (Archive::read_symbols): New function.
16187 (Archive::add_symbols): Add counters.
16188 (Archive::include_all_members): Use armap to find members if it's
16189 already built.
16190 (Archive::include_member): Skip reading symbols if already read.
16191 Factored code into Archive::get_file_and_offset and
16192 Archive::get_elf_object_for_member. Changed call to
16193 Mapfile::report_include_archive_member.
16194 (Archive::print_stats): New function.
16195 * archive.h: Declare Object and Read_symbols_data classes.
16196 (Archive::Archive): Add initializers for new members.
16197 (Archive::setup): Add parameter.
16198 (Archive::print_stats): New function.
16199 (Archive::total_archives, Archive::total_members)
16200 (Archive::total_members_loaded): New variables.
16201 (Archive::get_file_and_offset): New function.
16202 (Archive::get_elf_object_for_member): New function.
16203 (Archive::read_all_symbols): New function.
16204 (Archive::read_symbols): New function.
16205 (Archive::Archive_member): New class.
16206 (Archive::members_): New member.
16207 (Archive::num_members_): New member.
16208 * main.cc: Include archive.h.
16209 (main): Call Archive::print_stats.
16210 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16211 archive parameter; member_name is now the fully-decorated name.
16212 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16213 * options.h: (General_options): Add --preread-archive-symbols option.
16214 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16215 Archive::setup.
16216
de4c45bd
ILT
162172008-08-04 Ian Lance Taylor <iant@google.com>
16218
16219 * symtab.h (Symbol::use_plt_offset): New function.
16220 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16221 * powerpc.cc (Relocate::relocate): Likewise.
16222 * sparc.cc (Relocate::relocate): Likewise.
16223 * x86_64.cc (Relocate::relocate): Likewise.
16224 * testsuite/weak_plt.sh: New test.
16225 * testsuite/weak_plt_main.cc: New test.
16226 * testsuite/weak_plt_shared.cc: New test.
16227 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16228 (check_PROGRAMS): Add weak_plt.
16229 (check_DATA): Add weak_plt_shared.so.
16230 (weak_plt_main_pic.o, weak_plt): New targets.
16231 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16232 * testsuite/Makefile.in: Rebuild.
16233
16234 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16235 gcctestdir/ld.
16236 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16237 * testsuite/Makefile.in: Rebuild.
16238
323ee3f4
AM
162392008-08-04 Alan Modra <amodra@bigpond.net.au>
16240
16241 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16242 * Makefile.in: Regenerate.
16243 * po/POTFILES.in: Regenerate.
16244
7c07ecec
ILT
162452008-07-29 Ian Lance Taylor <iant@google.com>
16246
16247 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16248 symbols before other symbols.
16249 * testsuite/script_test_2.cc (test_addr): Declare.
16250 (test_addr_alias): Declare.
16251 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16252 values.
7c07ecec
ILT
16253 * testsuite/script_test_2.t: Define test_addr_alias and
16254 test_addr.
16255
5778530e
ILT
162562008-07-24 Ian Lance Taylor <iant@google.com>
16257
2a00e4fb
ILT
16258 PR 5990
16259 * descriptors.cc: New file.
16260 * descriptors.h: New file.
16261 * gold-threads.h (class Hold_optional_lock): New class.
16262 * fileread.cc: Include "descriptors.h".
16263 (File_read::~File_read): Release descriptor rather than closing
16264 it.
16265 (File_read::open) [file]: Call open_descriptor rather than open.
16266 Set is_descriptor_opened_.
16267 (File_read::open) [memory]: Assert that descriptor is not open.
16268 (File_read::reopen_descriptor): New function.
16269 (File_read::release): Release descriptor.
16270 (File_read::do_read): Make non-const. Reopen descriptor.
16271 (File_read::read): Make non-const.
16272 (File_read::make_view): Reopen descriptor.
16273 (File_read::do_readv): Likewise.
16274 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16275 Update declarations.
16276 * layout.cc: Include "descriptors.h".
16277 (Layout::create_build_id): Use open_descriptor rather than open.
16278 * output.cc: Include "descriptors.h".
16279 (Output_file::open): Use open_descriptor rather than open.
16280 * archive.cc (Archive::const_iterator): Change Archive to be
16281 non-const.
16282 (Archive::begin, Archive::end): Make non-const.
16283 (Archive::count_members): Likewise.
16284 * archive.h (class Archive): Update declarations.
16285 * object.h (Object::read): Make non-const.
16286 * Makefile.am (CCFILES): Add descriptors.cc.
16287 (HFILES): Add descriptors.h.
16288 * Makefile.in: Rebuild.
16289
801647d1
ILT
16290 PR 6716
16291 * gold.h: Always include <clocale>. Add Solaris workarounds
16292 following code in binutils/sysdep.h.
16293
5edd166e
ILT
16294 PR 6048
16295 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16296 this->eh_frame_hdr_ is NULL before using it.
16297
c89ad728
ILT
16298 * dynobj.cc (Versions::Versions): Update comment.
16299
aa86f06b
ILT
16300 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16301 the base version name.
16302
5778530e
ILT
16303 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16304 array size plus one.
16305 (Stringpool_template::set_string_offsets): Subtract one from key
16306 before using it as an array index.
16307 (Stringpool_template::get_offset_with_length): Likewise.
16308 (Stringpool_template::write_to_buffer): Likewise.
16309 * stringpool.h (Stringpool_template::get_offset_from_key):
16310 Likewise.
16311
057ead22
ILT
163122008-07-23 Ian Lance Taylor <iant@google.com>
16313
7f649c59
ILT
16314 PR 6658
16315 * object.h (Merged_symbol_value::value): Do our best to handle a
16316 negative addend.
16317
057ead22
ILT
16318 PR 6647
16319 * script.cc (Version_script_info::get_versions): Don't add empty
16320 version tag to return value.
16321 (Version_script_info::get_symbol_version_helper): Change return
16322 type to bool. Add pversion parameter. Change all callers.
16323 (script_register_vers_node): Don't require a non-NULL tag.
16324 * script.h (class Version_script_info): Update declarations.
16325 (Version_script_info::get_symbol_version): Change return type to
16326 bool. Add version parameter. Change all callers.
16327 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16328 handling. Handle an empty version from a version script.
16329 (Symbol_table::define_special_symbol): Likewise.
16330 * testsuite/ver_test_10.script: New file.
16331 * testsuite/ver_test_10.sh: New file.
16332 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16333 (check_DATA): Add ver_test_10.syms.
16334 (ver_test_10.syms, ver_test_10.so): New target.
16335 * testsuite/Makefile.in: Rebuild.
16336
58e54ac2
CD
163372008-07-23 Simon Baldwin <simonb@google.com>
16338
16339 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16340 to zero for undefined symbols from dynamic libraries.
16341
95d14cd3
ILT
163422008-07-23 Ian Lance Taylor <iant@google.com>
16343
16344 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16345 Change all callers.
16346 * symtab.h (class Symbol_table): Update declaration.
16347 * testsuite/ver_test_9.cc: New file.
16348 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16349 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16350 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16351 (ver_test_9.so, ver_test_9.o): New targets.
16352 * testsuite/Makefile.in: Rebuild.
16353
92de84a6
ILT
163542008-07-22 Ian Lance Taylor <iant@google.com>
16355
34810851
ILT
16356 * options.h (class General_options): Define --check-sections.
16357 * layout.cc (Layout::set_segment_offsets): Handle
16358 --check-sections.
16359
af6156ef
ILT
16360 * options.h (class General_options): Define -n/--nmagic and
16361 -N/--omagic.
16362 * options.cc (General_options::finalize): For -n/--nmagic or
16363 -N/--omagic, set -static.
16364 * layout.cc (Layout::attach_allocated_section_to_segment): If
16365 -N/--omagic, don't put read-only and read-write sections in
16366 different segments.
16367 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16368 finding a read-only segment.
16369 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16370 don't set the minimum segment alignment to the common page size,
16371 and don't set the file offset to the address modulo the page size.
16372 * script-sections.cc (Script_sections::create_segments): If
16373 -n/--omagic, don't put read-only and read-write sections in
16374 different segments.
16375
92de84a6
ILT
16376 * cref.cc: New file.
16377 * cref.h: New file.
16378 * options.h (class General_options): Add --print-symbol-counts.
16379 * main.cc (main): Issue defined symbol report if requested.
16380 * archive.cc (Archive::interpret_header): Make into a const member
16381 function.
16382 (Archive::add_symbols): Call Input_objects::archive_start and
16383 archive_stop.
16384 (Archive::const_iterator): Define new class.
16385 (Archive::begin, Archive::end): New functions.
16386 (Archive::include_all_members): Rewrite to use iterator.
16387 (Archive::count_members): New function.
16388 * archive.h (class Archive): Update declarations.
16389 (Archive::filename): New function.
16390 * object.cc: Include "cref.h".
16391 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16392 (Sized_relobj::do_get_global_symbol_counts): New function.
16393 (Input_objects::add_object): Add object to cross-referencer.
16394 (Input_objects::archive_start): New function.
16395 (Input_objects::archive_stop): New function.
16396 (Input_objects::print_symbol_counts): New function.
16397 * object.h: Declare Cref and Archive.
16398 (Object::get_global_symbol_counts): New function.
16399 (Object::do_get_global_symbol_counts): New pure virtual function.
16400 (class Sized_relobj): Add defined_count_ field. Update
16401 declarations.
16402 (class Input_objects): Add cref_ field. Update constructor.
16403 Update declarations.
16404 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16405 defined_count_.
16406 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16407 symbol counts.
16408 (Sized_dynobj::do_get_global_symbol_counts): New function.
16409 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16410 defined_count_. Update declarations. Define Symbols typedef.
16411 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16412 parameter. Change all callers.
16413 (Symbol_table::add_from_dynobj): Add sympointers and defined
16414 parameters. Change all callers.
16415 * symtab.h (class Symbol_table): Update declarations.
16416 * Makefile.am (CCFILES): Add cref.cc.
16417 (HFILES): Add cref.h.
16418 * Makefile.in: Rebuild.
16419
3f7c5e1d
CD
164202008-07-22 Simon Baldwin <simonb@google.com>
16421
16422 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16423 to zero when writing undefined symbols.
16424
e0b64032
ILT
164252008-07-22 Ian Lance Taylor <iant@google.com>
16426
16427 * output.cc (Output_section::add_input_section): Don't try to
16428 merge empty merge sections.
16429
096b02cf
CS
164302008-07-21 Craig Silverstein <csilvers@google.com>
16431
16432 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16433 Include symbol version in error message.
cd536b21 16434
1d1f116d
CD
164352008-07-20 Chris Demetriou <cgd@google.com>
16436
cd536b21 16437 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16438 (RANDOM_SEED_CFLAGS): New substituted variable.
16439 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16440 * configure: Rebuild.
16441 * Makefile.in: Likewise.
16442 * testsuite/Makefile.in: Likewise.
16443
a18f591e
ILT
164442008-07-18 Ian Lance Taylor <iant@google.com>
16445
16446 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16447 where we see NAME/NULL and NAME/VERSION as separate symbols.
16448 * testsuite/ver_test_main.cc (main): Call t4.
16449 (t4, t4_2a): Define.
16450 * testsuite/ver_test_2.cc (t4_2): Define.
16451 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16452 * testsuite/ver_test_4.cc (t4_2a): Define.
16453 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16454 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16455
c6e3f6ed
ILT
164562008-07-17 Ian Lance Taylor <iant@google.com>
16457
16458 * dynobj.cc (Versions::add_def): If we give an error about a
16459 missing version, go ahead and create the version anyhow.
16460
ef9beddf
ILT
164612008-07-10 Ian Lance Taylor <iant@google.com>
16462
16463 Handle output sections with more than 0x7fffffff bytes.
16464 * object.h (class Relobj): Change map_to_output_ to
16465 output_sections_, and just keep a section pointer. Change all
16466 uses. Move comdat group support to Sized_relobj.
16467 (Relobj::is_section_specially_mapped): Remove.
16468 (Relobj::output_section): Remove poff parameter. Change all
16469 callers.
16470 (Relobj::output_section_offset): New function.
16471 (Relobj::set_section_offset): Rewrite.
16472 (Relobj::map_to_output): Remove.
16473 (Relobj::output_sections): New function.
16474 (Relobj::do_output_section_offset): New pure virtual function.
16475 (Relobj::do_set_section_offset): Likewise.
16476 (class Sized_relobj): Add section_offsets_ field. Add comdat
16477 group support from Relobj. Update declarations.
16478 (Sized_relobj::get_output_section_offset): New function.
16479 (Sized_relobj::do_output_section_offset): New function.
16480 (Sized_relobj::do_set_section_offset): New function.
16481 * object.cc (Relobj::output_section_address): Remove.
16482 (Sized_relobj::Sized_relobj): Initialize new fields.
16483 (Sized_relobj::include_section_group): Cast find_kept_object to
16484 Sized_relobj.
16485 (Sized_relobj::include_linkonce_section): Likewise.
16486 (Sized_relobj::do_layout): Use separate arrays for output section
16487 and output offset.
16488 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16489 output_sections.
16490 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16491 output_sections and section_offsets.
16492 (Sized_relobj::write_local_symbols): Likewise.
16493 (map_to_kept_section): Compute output address directly.
16494 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16495 output_sections and section_offsets.
16496 (Sized_relobj::write_sections): Likewise.
16497 (Sized_relobj::relocate_sections): Likewise.
16498 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16499 * output.h (class Output_reloc): Update declarations. Change
16500 u2_.relobj to Sized_relobj*.
16501 (class Output_data_reloc): Change add functions to use
16502 Sized_relobj*.
16503 * output.cc (Output_reloc::Output_reloc): Change relobj to
16504 Sized_relobj*.
16505 (Output_reloc::local_section_offset): Change return type to
16506 Elf_Addr. Use get_output_section_offset.
16507 (Output_reloc::get_address): Likewise.
16508 (Output_section::is_input_address_mapped): Don't call
16509 is_section_specially_mapped.
16510 (Output_section::output_offset): Likewise.
16511 (Output_section::output_address): Likewise.
16512 (Output_section::starting_output_address): Likewise.
16513 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16514 parameter to Sized_relobj*.
16515 (Copy_relocs::need_copy_reloc): Likewise.
16516 (Copy_relocs::save): Likewise.
16517 * copy-relocs.h (class Copy_relocs): Update declarations.
16518 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16519 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16520 * target-reloc.h (relocate_for_relocatable): Change
16521 offset_in_output_section type to Elf_Addr. Change code that uses
16522 it as well.
16523 * layout.cc (Layout::layout): Always set *off.
16524 * mapfile.cc (Mapfile::print_input_section): Use
16525 output_section_offset.
16526 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16527 Sized_relobj*.
16528 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16529 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16530 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16531
5cb66f97
ILT
165322008-07-03 Ian Lance Taylor <iant@google.com>
16533
16534 * layout.cc (Layout::include_section): Do not discard unrecognized
16535 SHT_STRTAB sections.
16536
afe47622
CS
165372008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16538
16539 * script.cc (Lex::can_continue_name): Make '?' allowable in
16540 version-script names.
16541 * testsuite/version_script.map: Change glob pattern to use '?'
16542
5adf9721
ILT
165432008-06-30 Manish Singh <yosh@gimp.org>
16544
16545 PR 6585
16546 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16547 Correct typo.
16548
e6fde208
ILT
165492008-06-30 Ian Lance Taylor <iant@google.com>
16550
16551 PR 6660
16552 PR 6682
16553 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16554 versions]: Don't try to read the value in the contents, since we
16555 don't use it. Use the template endianness when writing.
16556
3f2e6a2d
CC
165572008-06-25 Cary Coutant <ccoutant@google.com>
16558
16559 * fileread.cc (File_read::make_view): Assert on zero-length view.
16560 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16561 symbol table when there are no symbols to read.
16562
c43d3a48
CS
165632008-06-23 Craig Silverstein <csilvers@google.com>
16564
16565 * version.cc (version_string): Bump to 1.7
16566
5f494ea0
CS
165672008-06-18 Craig Silverstein <csilvers@google.com>
16568
16569 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16570 constant 0xFFFF to type Valtype.
16571 (Powerpc_relocate_functions::rel16_ha): Likewise.
16572
c42e122e
ILT
165732008-06-17 Ian Lance Taylor <iant@google.com>
16574
f34787f8
ILT
16575 * output.h (Output_section::Input_section): Initialize p2align_ to
16576 zero for Output_section_data constructors.
16577 (Output_section::Input_section::addralign): If not an input
16578 section, return the alignment of the Output_section_data.
16579 * testsuite/copy_test.cc: New file.
16580 * testsuite/copy_test_1.cc: New file.
16581 * testsuite/copy_test_2.cc: New file.
16582 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16583 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16584 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16585 (copy_test_1_pic.o, copy_test_1.so): New targets.
16586 (copy_test_2_pic.o, copy_test_2.so): New targets.
16587 * testsuite/Makefile.in: Rebuild.
16588
c42e122e
ILT
16589 * script-sections.cc (Script_sections::place_orphan): Initialize
16590 local variable exact.
16591
ce3ac18a
DE
165922008-06-13 David Edelsohn <edelsohn@gnu.org>
16593
16594 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16595
42cacb20
DE
165962008-06-12 David Edelsohn <edelsohn@gnu.org>
16597 David S. Miller <davem@davemloft.net>
16598
16599 * powerpc.cc: New file.
16600 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16601 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16602 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16603 * Makefile.in: Rebuild.
16604
7b308235
ILT
166052008-06-09 Ian Lance Taylor <iant@google.com>
16606
16607 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16608 <exception>.
16609 (throwing, orig_terminate): New static variables.
16610 (terminate_handler): New static function.
16611 (t2): Set terminate handler.
16612
f0b886e3
ILT
166132008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16614
16615 PR 6584
cd536b21 16616 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16617 alignment.
16618
3e90f135
CC
166192008-05-30 Cary Coutant <ccoutant@google.com>
16620
16621 * archive.cc (Archive::include_all_members) Correct to step
16622 over symbol table and extended name table in thin archives.
16623
e09ad04a
ILT
166242008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16625
16626 PR 6407
16627 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16628 calculation.
16629
62b01cb5
ILT
166302008-05-28 Caleb Howe <cshowe@google.com>
16631
16632 * reduced_debug_output.cc: New file.
16633 * reduced_debug_output.h: New file.
92de84a6 16634 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16635 * options.cc (General_options::finalize): Add strip_debug_non_line
16636 to the strip heirarchy.
16637 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16638 fields.
16639 * layout.cc: Include "reduced_debug_output.h".
16640 (Layout::Layout): Initialize new fields.
16641 (line_only_debug_sections): New static array.
16642 (is_lines_only_debug_sections): New static inline function.
16643 (Layout::include_section): Handle --strip-debug-non-line.
16644 (Layout::make_output_section): If --strip-debug-non-line, build
16645 new output sections for .debug_abbrev and .debug_info.
16646 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16647 gold. Warn about possible overflow.
16648 (read_signed_LEB_128): Likewise.
16649 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16650 (read_signed_LEB_128): Declare.
16651 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16652 (HFILES): Add reduced_debug_output.h.
16653 * Makefile.in: Rebuild.
16654
7d9e3d98
ILT
166552008-05-21 Ian Lance Taylor <iant@google.com>
16656
16657 * mapfile.cc: New file.
16658 * mapfile.h: New file.
16659 * options.h (class General_options): Add -M/--print-map and -Map.
16660 * options.cc (General_options::finalize): Make -M equivalent to
16661 -Map -.
16662 * main.cc: Include <cstdio> and "mapfile.h".
16663 (main): Open mapfile if requested.
16664 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16665 constructor. Change caller.
16666 (queue_initial_tasks): Add mapfile parameter. Change caller.
16667 (queue_middle_tasks): Likewise.
16668 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16669 declarations.
16670 * archive.cc: Include "mapfile.h".
16671 (Archive::add_symbols): Add mapfile parameter. Change all
16672 callers. Pass mapfile, symbol, and reason to include_member.
16673 (Archive::include_all_members): Add mapfile parameter. Change all
16674 callers.
16675 (Archive::include_member): Add mapfile, sym, and why parameters.
16676 Change all callers. Report inclusion to map file.
16677 * archive.h: Include "fileread.h".
16678 (class Archive): Update declarations.
16679 (Archive::file): New const method.
16680 (class Add_archive_symbols): Add mapfile_ field. Update
16681 constructor. Change all callers.
16682 * readsyms.h (class Read_symbols): Likewise.
16683 (class Finish_group): Likewise.
16684 (class Read_script): Likewise.
16685 * common.cc: Include "mapfile.h".
16686 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16687 all callers.
16688 (Symbol_table::do_allocate_commons): Likewise.
16689 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16690 symbol allocation to mapfile.
16691 * common.h (class Allocate_commons_task): Add mapfile_ field.
16692 Update constructor. Change all callers.
16693 * symtab.h (class Symbol_table): Update declarations.
16694 * layout.cc: Include "mapfile.h".
16695 (Layout_task_runner::run): Print information to mapfile.
16696 (Layout::create_gold_note): Change Output_data_fixed_space to
16697 Output_data_zero_fill.
16698 (Layout::create_build_id): Likewise.
16699 (Layout::print_to_mapfile): New function.
16700 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16701 constructor. Change caller.
16702 (class Layout): Declare print_to_mapfile.
16703 * output.cc (Output_section::Input_section::print_to_mapfile): New
16704 function.
16705 (Output_section::add_input_section): If producing a map, always
16706 add to input_sections_ list.
16707 (Output_section::do_print_to_mapfile): New function.
16708 (Output_segment::print_sections_to_mapfile): New function.
16709 (Output_segment::print_section_list_to_mapfile): New function.
16710 * output.h: Include "mapfile.h".
16711 (Output_data::print_to_mapfile): New function.
16712 (Output_data::do_print_to_mapfile): New virtual function.
16713 (Output_segment_headers::do_print_to_mapfile): New function.
16714 (Output_file_header::do_print_to_mapfile): New function.
16715 (Output_data_const::do_print_to_mapfile): New function.
16716 (class Output_data_const_buffer): Add map_name_ field. Update
16717 constructor. Change all callers. Add do_print_to_mapfile
16718 function.
16719 (class Output_data_fixed_space): Likewise.
16720 (class Output_data_space): Likewise.
16721 (class Output_data_zero_fill): New class.
16722 (Output_data_strtab::do_print_to_mapfile): New function.
16723 (Output_data_reloc_base::do_print_to_mapfile): New function.
16724 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16725 (Output_data_group::do_print_to_mapfile): New function.
16726 (Output_data_got::do_print_to_mapfile): New function.
16727 (Output_data_dynamic::do_print_to_mapfile): New function.
16728 (Output_symtab_xindex::do_print_to_mapfile): New function.
16729 (class Output_section): Declare do_print_to_mapflie. Declare
16730 print_to_mapfile in Input_section.
16731 (class Output_segment): Declare new functions.
16732 * object.h (Sized_relobj::symbol_count): New function.
16733 * script-sections.cc
16734 (Output_section_element_dot_assignment::set_section_addresses):
16735 Change Output_data_fixed_space to Output_data_zero_fill.
16736 (Output_data_expression::do_print_to_mapfile): New function.
16737 * script.cc (read_input_script): Add mapfile parameter. Change
16738 all callers.
16739 * script.h (read_input_script): Update declaration.
16740 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16741 (Eh_frame::do_print_to_mapfile): New function.
16742 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16743 (Output_merge_string::do_print_to_mapfile): New function.
16744 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16745 function.
16746 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16747 function.
16748 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16749 function.
16750 * Makefile.am (CCFILES): Add mapfile.cc.
16751 (HFILES): Add mapfile.h.
16752 * Makefile.in: Rebuild.
16753
9f1d377b
ILT
167542008-05-19 Ian Lance Taylor <iant@google.com>
16755
16756 * options.h (class General_options): Add -z relro.
16757 * layout.cc (Layout::Layout): Initialize relro_segment_.
16758 (Layout::add_output_section_data): Return the output section.
16759 (Layout::make_output_section): Rcognize relro sections and mark
16760 them appropriately.
16761 (Layout::attach_allocated_section_to_segment): Put relro sections
16762 in a PT_GNU_RELRO segment.
16763 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16764 section as relro.
16765 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16766 PT_TLS segments.
16767 (Layout::linkonce_mapping): Map d.rel.ro.local to
16768 .data.rel.ro.local.
16769 (Layout::output_section_name): Us .data.rel.ro.local for any
16770 section which begins with that.
16771 * layout.h (class Layout): Update add_output_section_data
16772 declaration. Add relro_segment_ field.
16773 * output.cc (Output_section::Output_section): Initialize is_relro_
16774 and is_relro_local_ fields.
16775 (Output_segment::add_output_section): Group relro sections.
16776 (Output_segment::is_first_section_relro): New function.
16777 (Output_segment::maximum_alignment): If there is a relro section,
16778 align the segment to the common page size.
16779 (Output_segment::set_section_addresses): Track whether we are
16780 looking at relro sections. If the last section is a relro
16781 section, align to the common page size.
16782 (Output_segment::set_section_list_addresses): Add in_relro
16783 parameter. Change all callers. Align to the page size when
16784 moving from relro to non-relro section.
16785 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16786 segment.
16787 * output.h (class Output_section): Add is_relro_ and
16788 is_relro_local_ fields.
16789 (Output_section::is_relro): New function.
16790 (Output_section::set_is_relro): New function.
16791 (Output_section::is_relro_local): New function.
16792 (Output_section::set_is_relro_local): New function.
16793 (class Output_segment): Update declarations.
16794 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16795 * sparc.cc (Target_sparc::got_section): Likewise.
16796 * x86_64.cc (Target_x86_64::got_section): Likewise.
16797 * testsuite/relro_test_main.cc: New file.
16798 * testsuite/relro_test.cc: New file.
16799 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16800 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16801 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16802 (relro_test.so, relro_test_pic.o): New targets.
16803 * testsuite/Makefile.in: Rebuild.
16804
a984ee1d
ILT
168052008-05-16 Ian Lance Taylor <iant@google.com>
16806
01676dcd
ILT
16807 * output.cc (Output_segment::add_output_section): Remove front
16808 parameter.
16809 * output.h (class Output_segment): Remove
16810 add_initial_output_section and overloaded add_output_section.
16811 Update declaration of remaining add_output_section.
16812 * layout.cc (Layout::create_interp): Call add_output_section
16813 rather than add_initial_output_section.
16814 (Layout::finish_dynamic_section): Likewise.
16815
497897f9
ILT
16816 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16817 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16818 know the dynamic type.
16819 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16820 field. Initialize it in constructor.
16821 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16822 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16823 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16824 reloc.
16825
a984ee1d
ILT
16826 * output.cc (Output_reloc::get_address): Change return type to
16827 Elf_Addr.
16828 * output.h (class Output_reloc): Update get_address declaration.
16829 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16830 for section addresses.
16831
55ba0940
ILT
168322008-05-09 Ian Lance Taylor <iant@google.com>
16833
16834 PR 6493
16835 * gold.cc (gold_nomem): Use return value of write.
16836
75517b77
ILT
168372008-05-08 Ian Lance Taylor <iant@google.com>
16838
16839 * symtab.c (Symbol::init_base_output_data): Add version
16840 parameter. Change all callers.
16841 (Symbol::init_base_output_segment): Likewise.
16842 (Symbol::init_base_constant): Likewise.
16843 (Symbol::init_base_undefined): Likewise.
16844 (Sized_symbol::init_output_data): Likewise.
16845 (Sized_symbol::init_output_segment): Likewise.
16846 (Sized_symbol::init_constant): Likewise.
16847 (Sized_symbol::init_undefined): Likewise.
16848 (Symbol_table::do_define_in_output_data): If the new symbol has a
16849 version, mark it as the default.
16850 (Symbol_table::do_define_in_output_segment): Likewise.
16851 (Symbol_table::do_define_as_constant): Likewise.
16852 * symtab.h (class Symbol): Update declarations.
16853 (class Sized_symbol): Likewise.
16854 * resolve.cc (Symbol::override_version): New function.
c42e122e 16855 (Symbol::override_base): Call override_version.
75517b77
ILT
16856 (Symbol::override_base_with_special): Likewise.
16857 * testsuite/ver_script_8.script: New file.
16858 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16859 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16860 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16861 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16862
f1f70eae
ILT
168632008-05-06 Ian Lance Taylor <iant@google.com>
16864
f3e9c5c5
ILT
16865 PR 6049
16866 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16867 functions.
16868 (class General_options): Remove existing --undefined, and add
16869 --no-undefined instead. Add new --undefined as synonym for -u.
16870 * archive.cc (Archive::add_symbols): Check whether symbol was
16871 named with -u.
16872 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16873 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16874 all uses. Add IS_UNDEFINED. Update declarations to split
16875 different versions of init_base. Declare init_base_undefined.
16876 (Symbol::is_defined): Handle IS_UNDEFINED.
16877 (Symbol::is_undefined): Likewise.
16878 (Symbol::is_weak_undefined): Call is_undefined.
16879 (Symbol::is_absolute): Handle IS_CONSTANT.
16880 (class Sized_symbol): Update declarations to split different
16881 versions of init. Declare init_undefined.
16882 (class Symbol_table): Declare new functions.
16883 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16884 Change all callers.
16885 (Symbol::init_base_output_data): Likewise.
16886 (Symbol::init_base_output_segment): Likewise.
16887 (Symbol::init_base_constant): Likewise.
16888 (Symbol::init_base_undefined): New function.
16889 (Sized_symbol::init_object): Rename from init. Change all
16890 callers.
16891 (Sized_symbol::init_output_data): Likewise.
16892 (Sized_symbol::init_output_segment): Likewise.
16893 (Sized_symbol::init_constant): Likewise.
16894 (Sized_symbol::init_undefined): New function.
16895 (Symbol_table::add_undefined_symbols_from_command_line): New
16896 function.
16897 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16898 function.
16899 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16900 (Symbol::output_section): Likewise.
16901 (Symbol::set_output_section): Likewise.
16902 (Symbol_table::sized_finalize_symbol): Likewise.
16903 (Symbol_table::sized_write_globals): Likewise.
16904 * resolve.cc (Symbol_table::should_override): Likewise.
16905 (Symbol::override_base_with_special): Likewise.
16906
8bdcdf2c
ILT
16907 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16908 symbol, change it to have default visibility.
16909 * testsuite/protected_1.cc: New file.
16910 * testsuite/protected_2.cc: New file.
16911 * testsuite/protected_3.cc: New file.
16912 * testsuite/protected_main_1.cc: New file.
16913 * testsuite/protected_main_2.cc: New file.
16914 * testsuite/protected_main_3.cc: New file.
16915 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16916 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16917 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16918 (protected_1.so): New target.
16919 (protected_1_pic.o, protected_2_pic.o): New targets.
16920 (protected_3_pic.o): New target.
16921 (check_PROGRAMS): Add protected_2.
16922 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16923 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16924 * testsuite/Makefile.in: Rebuild.
16925
2b706932
ILT
16926 * options.h (DEFINE_var): Add set_user_set_##varname__.
16927 (DEFINE_bool_alias): New macro.
16928 (class General_options): Define -Bstatic using DEFINE_bool_alias
16929 rather than DEFINE_special. Add --undefined as an alias for -z
16930 defs.
16931 * options.cc (General_options::parse_Bstatic): Remove.
16932
d82a5bcc
ILT
16933 * options.h (class General_options): Add --fatal-warnings.
16934 * main.cc (main): Implement --fatal-warnings.
16935 * errors.h (Errors::warning_count): New function.
16936
f1f70eae
ILT
16937 * options.h (class General_options): Add -Bsymbolic-functions.
16938 * symtab.h (Symbol::is_preemptible): Check for
16939 -Bsymbolic-functions.
16940
8825ac63
ILT
169412008-05-05 Ian Lance Taylor <iant@google.com>
16942
d98bc257
ILT
16943 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16944 as noVARNAME rather than no-VARNAME.
16945 (class General_options): Add option -z combreloc.
16946 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16947 get_address.
16948 (Output_reloc::sort_before) [SHT_REL]: New function.
16949 (Output_reloc::sort_before) [SHT_RELA]: New function.
16950 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16951 Sort_relocs_comparison.
16952 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16953 parameter. Change all callers.
16954 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16955 sort_relocs parameter. Change all callers.
16956 * output.cc (Output_reloc::get_address): New function, broken out
16957 of write_rel.
16958 (Output_reloc::write_rel): Call it.
16959 (Output_reloc::compare): New function.
16960 (Output_data_reloc_base::do_write): Optionally sort relocs.
16961
60b2b4e7
ILT
16962 * configure.ac: If targ_extra_obj is set, link it in.
16963 * configure.tgt: Initialize all variables.
16964 (x86_64*): Set targ_extra_obj and targ_extra_size.
16965 * configure: Rebuild.
16966
8825ac63
ILT
16967 * object.cc (Sized_relobj::include_section_group): Adjust section
16968 indexes read from group data. Build vector to pass to
16969 layout_group.
16970 * layout.cc (Layout::layout_group): Add flags and shndxes
16971 parameters. Remove contents parameter. Change caller. Update
16972 explicit instantiations.
16973 * layout.h (class Layout): Update layout_group declaration.
16974 * output.cc (Output_data_group::Output_data_group): Add flags and
16975 input_shndxes parameters. Remove contents parameter. Change
16976 caller.
16977 (Output_data_group::do_write): Change input_sections_ to
16978 input_shndxes_.
16979 * output.h (class Output_data_group): Update constructor
16980 declaration. Rename input_sections_ to input_shndxes_.
16981 * testsuite/many_sections_test.cc: Add template.
16982
e94cf127
CC
169832008-04-30 Cary Coutant <ccoutant@google.com>
16984
4418b2d5
CC
16985 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16986
e94cf127
CC
16987 * layout.cc (Layout::include_section): Refactored check for debug
16988 info section.
16989 (Layout::add_comdat): Add new parameters. Change type
16990 of signature parameter. Add object and shndx to signatures table.
16991 (Layout::find_kept_object): New function.
16992 * layout.h: Include <cstring>.
16993 (Layout::is_debug_info_section): New function.
16994 (Layout::add_comdat): Add new parameters.
16995 (Layout::find_kept_object): New function.
16996 (Layout::Kept_section): New struct.
16997 (Layout::Signatures): Change type of map range.
16998 * object.cc (Relobj::output_section_address): New function.
16999 (Sized_relobj::include_section_group): Add new parameters. Change
17000 calls to Layout::add_comdat. Change to build table of kept comdat
17001 groups and table mapping discarded sections to kept sections.
17002 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
17003 (Sized_relobj::do_layout): Change calls to include_section_group and
17004 include_linkonce_section.
17005 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
17006 value to zero when section is discarded.
17007 (Sized_relobj::map_to_kept_section): New function.
17008 * object.h (Relobj::output_section_address): New function.
17009 (Relobj::Comdat_group): New type.
17010 (Relobj::find_comdat_group): New function.
17011 (Relobj::Comdat_group_table): New type.
17012 (Relobj::Kept_comdat_section): New type.
17013 (Relobj::Kept_comdat_section_table): New type.
17014 (Relobj::add_comdat_group): New function.
17015 (Relobj::set_kept_comdat_section): New function.
17016 (Relobj::get_kept_comdat_section): New function.
17017 (Relobj::comdat_groups_): New field.
17018 (Relobj::kept_comdat_sections_): New field.
17019 (Symbol_value::input_value): Update comment.
17020 (Sized_relobj::map_to_kept_section) New function.
17021 (Sized_relobj::include_linkonce_section): Add new parameter.
17022 * target-reloc.h (Comdat_behavior): New type.
17023 (get_comdat_behavior): New function.
17024 (relocate_section): Add code to map a discarded section to the
17025 corresponding kept section when applying a relocation.
17026
e4e5049b
CS
170272008-04-30 Craig Silverstein <csilvers@google.com>
17028
17029 * dwarf_reader.cc (next_generation_count): New static var.
17030 (Addr2line_cache_entry): New struct.
17031 (addr2line_cache): New static var.
17032 (Dwarf_line_info::one_addr2line): Added caching.
17033 (Dwarf_line_info::clear_addr2line_cache): New function.
17034 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
17035 cache-size parameter.
17036 (Dwarf_line_info::one_addr2line_cache): New function.
17037 * symtab.cc (Symbol_table::detect_odr_violations): Pass
17038 new cache-size argument to one_addr2line(), and clear cache.
17039
d09e9154
CC
170402008-04-28 Cary Coutant <ccoutant@google.com>
17041
17042 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
17043 R_386_PC8 relocations.
17044
7ef73768
ILT
170452008-04-23 Ian Lance Taylor <iant@google.com>
17046
55438702
ILT
17047 * object.cc (Sized_relobj::include_section_group): Check for
17048 invalid section group.
17049
c165fb93
ILT
17050 * object.cc (make_elf_object): Correct test for 64-bit ELF file
17051 header size.
17052
7ef73768
ILT
17053 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
17054 than read for file header.
17055 * archive.cc (Archive::include_member): Likewise.
17056
6194aaab
L
170572008-04-23 Paolo Bonzini <bonzini@gnu.org>
17058
17059 * aclocal.m4: Regenerate.
17060 * configure: Regenerate.
17061
d491d34e
ILT
170622008-04-19 Ian Lance Taylor <iant@google.com>
17063
5ea2bac6
ILT
17064 * version.cc (version_string): Bump to 1.6.
17065
7bc3e21a
ILT
17066 * testsuite/Makefile.am (many_sections_r_test): New target.
17067 (many_sections_r_test_SOURCES): Remove.
17068 (many_sections_r_test_DEPENDENCIES): Remove.
17069 (many_sections_r_test_LDFLAGS): Remove.
17070 (many_sections_r_test_LDADD): Remove.
17071
7fcd3aa9
ILT
17072 * object.cc (Sized_relobj::do_add_symbols): Always pass
17073 local_symbol_count_ to add_from_relobj.
17074
4c94d6ae
ILT
17075 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17076 every thousand variables.
17077 * testsuite/Makefile.in: Rebuild.
17078
d491d34e
ILT
17079 * object.cc (Xindex::initialize_symtab_xindex): New function.
17080 (Xindex::read_symtab_xindex): New function.
17081 (Xindex::sym_xindex_to_shndx): New function.
17082 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17083 available.
17084 (Sized_relobj::do_initialize_xindex): New function.
17085 (Sized_relobj::do_read_symbols): Adjust section links.
17086 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17087 parameter. Change all callers.
17088 (Sized_relobj::include_section_group): Adjust section links and
17089 symbol section indexes.
17090 (Sized_relobj::do_layout): Adjust section links.
17091 (Sized_relobj::do_count_local_symbols): Adjust section links and
17092 symbol section indexes.
17093 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17094 ordinary and special symbols.
17095 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17096 dynsym_xindex parameters. Change all callers. Adjust section
17097 links. Use SHN_XINDEX when needed.
17098 (Sized_relobj::get_symbol_location_info): Adjust section links.
17099 Don't get fooled by special symbols.
17100 * object.h (class Xindex): Define.
17101 (class Object): Add xindex_ parameter. Declare virtual functoin
17102 do_initialize_xindex.
17103 (Object::adjust_sym_shndx): New function.
17104 (Object::set_xindex): New protected function.
17105 (class Symbol_value): Add is_ordinary_shndx_ field.
17106 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17107 (Symbol_value::value): Assert ordinary section.
17108 (Symbol_value::initialize_input_to_output_map): Likewise.
17109 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17110 Change all callers.
17111 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17112 all callers.
17113 (class Sized_relobj): Update declarations.
17114 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17115 parameter. Change all callers.
17116 (Sized_relobj::adjust_shndx): New function.
17117 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17118 field.
17119 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17120 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17121 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17122 (Sized_dynobj::read_dynsym_section): Adjust section links.
17123 (Sized_dynobj::read_dynamic): Likewise.
17124 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17125 section links.
17126 (Sized_dynobj::do_initialize_xindex): New function.
17127 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17128 do_initialize_xindex.
17129 (Sized_dynobj::adjust_shndx): New function.
17130 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17131 dynsym_xindex_ fields.
17132 (Layout::finalize): Add a call to set_section_indexes before
17133 creating the symtab sections.
17134 (Layout::set_section_indexes): Don't do anything if the section
17135 already has a section index.
17136 (Layout::create_symtab_sections): Add shnum parameter. Change
17137 caller. Create .symtab_shndx section if needed.
17138 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17139 caller.
17140 (Layout::allocated_output_section_count): New function.
17141 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17142 needed.
17143 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17144 fields. Update declarations.
17145 (Layout::symtab_xindex): New function.
17146 (Layout::dynsym_xindex): New function.
17147 (class Write_symbols_task): Add layout_ field.
17148 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17149 Change caller.
17150 * output.cc (Output_section_headers::Output_section_headers): Add
17151 shstrtab_section parameter. Change all callers.
17152 (Output_section_headers::do_sized_write): Store overflow values
17153 for section count and section string table section index in
17154 section header zero.
17155 (Output_file_header::do_sized_write): Check for overflow of
17156 section count and section string table section index.
17157 (Output_symtab_xindex::do_write): New function.
17158 (Output_symtab_xindex::endian_do_write): New function.
17159 * output.h (class Output_section_headers): Add shstrtab_section_.
17160 Update declarations.
17161 (class Output_symtab_xindex): Define.
17162 (Output_section::has_out_shndx): New function.
17163 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17164 field.
17165 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17166 Change all callers.
17167 (Sized_symbol::init): Likewise.
17168 (Symbol::output_section): Check for ordinary symbol.
17169 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17170 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17171 callers.
17172 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17173 Change all callers. Simplify handling of symbols from sections
17174 not included in the link.
17175 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17176 distinction.
17177 (Weak_alias_sorter::operator()): Assert that symbols are
17178 ordinary.
17179 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17180 distinction.
17181 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17182 parameters. Change all callers.
17183 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17184 symbol distinction. Use SHN_XINDEX when needed.
17185 (Symbol_table::write_section_symbol): Add symtab_xindex
17186 parameter. Change all callers.
17187 (Symbol_table::sized_write_section_symbol): Likewise. Use
17188 SHN_XINDEX when needed.
17189 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17190 declarations.
17191 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17192 (Symbol::is_defined): Check is_ordinary.
17193 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17194 (Symbol::is_absolute, Symbol::is_common): Likewise.
17195 (class Sized_symbol): Update declarations.
17196 (class Symbol_table): Update declarations.
17197 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17198 parameters. Change all callers.
17199 (Sized_symbol::override): Likewise.
17200 (Symbol_table::override): Likewise.
17201 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17202 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17203 is_ordinary, and orig_st_shndx parameters. Change all callers.
17204 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17205 to be in an ordinary section.
17206 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17207 object and is_ordinary parameters. Change all callers.
17208 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17209 Change all callers. Don't add undefined or non-ordinary symbols
17210 to reloc_map_.
17211 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17212 Change all callers.
17213 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17214 declarations.
17215 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17216 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17217 (Sized_relobj::relocate_sections): Likewise.
17218 * target-reloc.h (scan_relocs): Adjust section symbol index.
17219 (scan_relocatable_relocs): Likewise.
17220 * i386.cc (Scan::local): Check for ordinary symbols.
17221 * sparc.cc (Scan::local): Likewise.
17222 * x86_64.cc (Scan::local): Likewise.
17223 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17224 to symbol_section_and_value.
17225 * testsuite/many_sections_test.cc: New file.
17226 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17227 (check_PROGRAMS): Add many_sections_test.
17228 (many_sections_test_SOURCES): Define.
17229 (many_sections_test_DEPENDENCIES): Define.
17230 (many_sections_test_LDFLAGS): Define.
17231 (BUILT_SOURCES): Add many_sections_define.h.
17232 (many_sections_define.h): New target.
17233 (BUILT_SOURCES): Add many_sections_check.h.
17234 (many_sections_check.h): New target.
17235 (check_PROGRAMS): Add many_sections_r_test.
17236 (many_sections_r_test_SOURCES): Define.
17237 (many_sections_r_test_DEPENDENCIES): Define.
17238 (many_sections_r_test_LDFLAGS): Define.
17239 (many_sections_r_test_LDADD): Define.
17240 (many_sections_r_test.o): New target.
17241 * testsuite/Makefile.in: Rebuild.
17242
c5818ff1
CC
172432008-04-17 Cary Coutant <ccoutant@google.com>
17244
17245 * errors.cc (Errors::info): New function.
17246 (gold_info): New function.
17247 * errors.h (Errors::info): New function.
17248 * gold.h (gold_info): New function.
17249 * object.cc (Input_objects::add_object): Print trace output.
17250 * options.cc (options::parse_set): New function.
17251 (General_options::parse_wrap): Deleted.
17252 (General_options::General_options): Deleted initializer.
17253 * options.h (options::String_set): New typedef.
17254 (options::parse_set): New function.
17255 (DEFINE_set): New macro.
17256 (General_options::wrap): Changed to use DEFINE_set. Changed
17257 callers of any_wrap_symbols and is_wrap_symbol.
17258 (General_options::trace, General_options::trace_symbol):
17259 New options.
17260 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17261 (General_options::wrap_symbols_): Deleted.
17262 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17263
b5be4a7c
DM
172642008-04-17 David S. Miller <davem@davemloft.net>
17265
17266 * options.cc (General_options::parse_V): New function.
17267 * options.h: Add entries for -V and -Qy.
17268
155a0dd7
ILT
172692008-04-17 Ian Lance Taylor <iant@google.com>
17270
17271 * common.cc (Symbol_table::allocate_commons): Remove options
17272 parameter. Change caller.
17273 (Symbol_table::do_allocate_commons): Remove options parameter.
17274 Change caller. Just call do_allocate_commons_list twice.
17275 (Symbol_table::do_allocate_commons_list): New function, broken out
17276 of do_allocate_commons.
17277 * common.h (class Allocate_commons_task): Remove options_ field.
17278 Update constructor.
17279 * symtab.cc (Symbol_table::Symbol_table): Initialize
17280 tls_commons_.
17281 (Symbol_table::add_from_object): Put TLS common symbols on
17282 tls_commons_ list.
17283 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17284 which are IN_OUTPUT_DATA.
17285 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17286 allocate_commons and do_allocate_commons declarations. Declare
17287 do_allocate_commons_list.
17288 * gold.cc (queue_middle_tasks): Update creation of
17289 Allocate_commons_task to not pass options.
17290 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17291 (TLS_TEST_C_FLAGS): New variable.
17292 (tls_test_c_pic.o): New target.
17293 (tls_test_shared.so): Link in tls_test_c_pic.o.
17294 (tls_test_c_pic_ie.o): New target.
17295 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17296 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17297 (tls_test_c.o): New target.
17298 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17299 (tls_pic_test_LDADD): Likewise.
17300 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17301 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17302 (tls_test_c_gnu2.o): New target.
17303 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17304 tls_test_c_gnu2.o.
17305 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17306 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17307 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17308 * testsuite/tls_test.cc: Include "config.h".
17309 (t_last): Call t11_last.
17310 * testsuite/tls_test.h (t11, t11_last): Declare.
17311 * testsuite/tls_test_c.c: New file.
17312 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17313 * configure.ac: Check for OpenMP support.
17314 * configure, config.in, Makefile.in: Rebuild.
17315 * testsuite/Makefile.in: Rebuild.
17316
edfbb029
CC
173172008-04-16 Cary Coutant <ccoutant@google.com>
17318
17319 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17320 (Target_i386::tls_base_symbol_defined_): New field.
17321 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17322 (Target_i386::Scan::global): Likewise.
17323 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17324 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17325 (Target_x86_64::tls_base_symbol_defined_): New field.
17326 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17327 (Target_x86_64::Scan::global): Likewise.
17328
f3c69fca
CC
173292008-04-16 Cary Coutant <ccoutant@google.com>
17330
17331 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17332 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17333 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17334 building shared libraries.
17335 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17336 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17337 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17338 * testsuite/Makefile.in: Rebuild.
17339 * testsuite/weak_undef.h: New file.
17340 * testsuite/weak_undef_file1.cc: Add extra test cases.
17341 * testsuite/weak_undef_file2.cc: Likewise.
17342 * testsuite/weak_undef_test.cc: Likewise.
17343
7c414435
DM
173442008-04-16 David S. Miller <davem@davemloft.net>
17345
32b769e1
DM
17346 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17347 Add issued_non_pic_error_ field. Declare check_non_pic.
17348 (Target_sparc::Scan::check_non_pic): New function.
17349 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17350 (Target_sparc::Scan::global): Likewise.
17351
11936fb1
DM
17352 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17353 * configure: Rebuild.
17354
7c414435
DM
17355 * options.h (DEFINE_enable): New macro.
17356 (new_dtags): New enable option.
17357 (initfirst, interpose, loadfltr, nodefaultlib,
17358 nodelete, nodlopen, nodump): New -z options.
17359 * layout.cc (Layout:finish_dynamic_section): If new
17360 dtags enabled, emit DT_RUNPATH. Also, emit a
17361 DT_FLAGS_1 containing any specified -z flags.
17362
85c7bf8b
ILT
173632008-04-16 Ian Lance Taylor <iant@google.com>
17364
12c0daef
ILT
17365 * copy-relocs.cc: New file.
17366 * copy-relocs.h: New file.
17367 * reloc.cc: Remove Copy_relocs code.
17368 * reloc.h: Likewise.
17369 * reloc-types.h (struct Reloc_types) [both versions]: Add
17370 get_reloc_addend_noerror.
17371 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17372 variants of add_global which take an addend which must be zero.
17373 * i386.cc: Include "copy-relocs.h".
17374 (class Target_i386): Change type of copy_relocs_ to variable,
17375 update initializer.
17376 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17377 Change all callers.
17378 (Target_i386::do_finalize_sections): Change handling of
17379 copy_relocs_.
17380 * sparc.cc: Include "copy-relocs.h".
17381 (class Target_sparc): Change type of copy_relocs_ to variable,
17382 update initializer.
17383 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17384 Change all callers.
17385 (Target_sparc::do_finalize_sections): Change handling of
17386 copy_relocs_.
17387 * x86_64.cc: Include "copy-relocs.h".
17388 (class Target_x86_64): Change type of copy_relocs_ to variable,
17389 update initializer.
17390 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17391 class. Change all callers.
17392 (Target_x86_64::do_finalize_sections): Change handling of
17393 copy_relocs_.
17394 * Makefile.am (CCFILES): Add copy-relocs.cc.
17395 (HFILES): Add copy-relocs.h.
17396
4f4995b6
ILT
17397 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17398
85c7bf8b
ILT
17399 * testsuite/script_test_4.sh: Permit leading zeroes.
17400
4f2a9edd
ILT
174012008-04-15 Ian Lance Taylor <iant@google.com>
17402
e6188289
ILT
17403 * script-sections.cc (Script_sections::create_segments): Use
17404 header_size_adjustment even when there is enough room for the
17405 headers.
17406 * testsuite/script_test_4.sh: New file.
17407 * testsuite/script_test_4.t: New file.
17408 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17409 (check_DATA): Add script_test_4.stdout.
17410 (MOSTLYCLEANFILES): Likewise.
17411 (script_test_4): New target.
17412 (script_test_4.stdout): New target.
17413 * testsuite/Makefile.in: Rebuild.
17414
4f2a9edd
ILT
17415 * sparc.cc: Add definitions for Output_data_plt_sparc class
17416 constants.
17417
f5314dd5
DM
174182008-04-14 David S. Miller <davem@davemloft.net>
17419
17420 * sparc.cc: New file.
17421 * Makefile.am (TARGETSOURCES): Add sparc.cc
17422 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17423 * configure.tgt: Document targ_extra_size and
17424 targ_extra_big_endian. Add entries for sparc-* and
17425 sparc64-*.
17426 * configure.ac: Handle targ_extra_size and
17427 targ_extra_big_endian.
17428 * Makefile.in: Rebuild.
17429 * configure: Likewise.
17430 * po/POTFILES.in: Likewise.
17431 * po/gold.pot: Likewise.
17432
154e0e9a
ILT
174332008-04-14 Ian Lance Taylor <iant@google.com>
17434
17435 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17436 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17437 in the name/type/flags to section mapping. Don't call
17438 allocate_output_section.
17439 (Layout::choose_output_section): Change parameter from adjust_name
17440 to is_input_section. Don't permit input sections after sections
17441 are attached to segments. Don't call allocate_output_section.
17442 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17443 not write_enable_output_section.
17444 (Layout::make_output_section): Don't push to
17445 unattached_section_list_ nor call attach_to_segment. Call
17446 attach_section_to_segment if sections are attached.
17447 (Layout::attach_sections_to_segments): New function.
17448 (Layout::attach_section_to_segment): New function.
17449 (Layout::attach_allocated_section_to_segment): Rename from
17450 attach_to_segment. Remove flags parameter.
17451 (Layout::allocate_output_section): Remove function.
17452 (Layout::write_enable_output_section): Remove function.
17453 * layout.h (class Layout): Update for above changes. Add new
17454 field sections_are_attached_.
17455 * output.h (Output_section::update_flags_for_input_section): New
17456 function.
17457 * output.cc (Output_section::add_input_section): Call
17458 update_flags_for_input_section.
17459 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17460
009a67a2
CC
174612008-04-11 Cary Coutant <ccoutant@google.com>
17462
17463 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17464 thought unnecessary.
17465 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17466
759b1a24
ILT
174672008-04-11 Ian Lance Taylor <iant@google.com>
17468
17469 * output.h (class Output_section_data): Remove inline definition
17470 of set_addralign.
17471 * output.cc (Output_section_data::set_addralign): New function.
17472
c2b45e22
CC
174732008-04-11 Cary Coutant <ccoutant@google.com>
17474
17475 Add support for TLS descriptors for i386 and x86_64.
17476 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17477 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17478 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17479 GOT_TYPE_TLS_DESC.
17480 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17481 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17482 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17483 relocations.
17484 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17485 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17486 Fix problem with initial-exec relocations.
17487 (Target_i386::Relocate::relocate_tls): Likewise.
17488 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17489 relaxation.
17490 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17491 support for section-plus-offset dynamic table entries.
17492 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17493 (Output_data_dynamic::Dynamic_entry): Add support for
17494 section-plus-offset dynamic table entries.
17495 (Output_data_dynamic::Classification): Likewise.
17496 (Output_data_dynamic::classification_): Renamed offset_.
17497 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17498 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17499 (Target_x86_64::make_plt_section): New function.
17500 (Target_x86_64::reserve_tlsdesc_entries): New function.
17501 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17502 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17503 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17504 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17505 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17506 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17507 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17508 add extra PLT entry for TLS descriptors.
17509 (Output_data_plt_x86_64::got_): New field.
17510 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17511 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17512 fields.
17513 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17514 descriptors.
17515 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17516 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17517 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17518 R_386_TLS_DESC_CALL relocations.
17519 (Target_x86_64::Scan::global): Likewise.
17520 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17521 for TLS descriptors.
17522 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17523 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17524 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17525 GD-to-IE relaxation.
17526 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17527 and TLS_DESCRIPTORS.
17528 * Makefile.in: Rebuild.
17529 * configure: Rebuild.
17530 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17531 (tls_test_shared2.so): New target.
17532 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17533 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17534 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17535 (tls_shared_gd_to_ie_test_LDADD): New variable.
17536 (tls_shared_gnu2_gd_to_ie_test): New target.
17537 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17538 New targets.
17539 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17540 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17541 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17542 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17543 (tls_shared_gnu2_test): New target.
17544 (tls_test_gnu2_shared.so): New target.
17545 (tls_shared_gnu2_test_SOURCES): New variable.
17546 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17547 (tls_shared_gnu2_test_LDFLAGS): New variable.
17548 (tls_shared_gnu2_test_LDADD): New variable.
17549 * testsuite/Makefile.in: Rebuild.
17550 * testsuite/Makefile.
17551
83bfb6b7
ILT
175522008-04-11 Ian Lance Taylor <iant@google.com>
17553
17554 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17555 justsyms.t.
17556 * testsuite/Makefile.in: Rebuild.
17557
17558 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17559 long.
17560 * testsuite/script_test_2.cc (main): Adjust test.
17561
706e1f5e
ILT
175622008-04-11 David S. Miller <davem@davemloft.net>
17563 Ian Lance Taylor <iant@google.com>
17564
17565 * options.h (General_options): Add entries for '-Y' and
17566 '-relax'.
17567 * options.cc (General_options:finalize): If -Y was used, add those
17568 entries to the library path instead of the default "/lib" and
17569 "/usr/lib".
17570
7c98e6bb
DM
175712008-04-11 David S. Miller <davem@davemloft.net>
17572
17573 * testsuite/justsyms.t: Start at 0x100.
17574 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17575 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17576 long.
17577 * testsuite/script_test_2.cc: Adjust string and section length
17578 checks.
7c98e6bb 17579
99a37bfd
ILT
175802008-04-09 Ian Lance Taylor <iant@google.com>
17581
2cefc357
ILT
17582 PR gold/5996
17583 * script-sections.cc (Sections_element::allocate_to_segment): Add
17584 orphan parameter.
17585 (Output_section_definition::allocate_to_segment): Likewise.
17586 (Orphan_output_section::allocate_to_segment): Likewise.
17587 (Script_sections::attach_sections_using_phdrs_clause): Don't
17588 propagate non-PT_LOAD segments to orphan sections.
17589 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17590 readelf rather than objdump.
17591 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17592 .interp section and PT_INTERP segment are the same size.
17593 * testsuite/Makefile.in: Rebuild.
17594
99a37bfd
ILT
17595 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17596 aliases for symbols defined in the same object.
17597 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17598 (weak_alias_test_SOURCES): New variable.
17599 (weak_alias_test_DEPENDENCIES): New variable.
17600 (weak_alias_test_LDFLAGS): New variable.
17601 (weak_alias_test_LDADD): New variable.
17602 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17603 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17604 (weak_alias_test_3.o): New target.
17605 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17606 * testsuite/weak_alias_test_main.cc: New file.
17607 * testsuite/weak_alias_test_1.cc: New file.
17608 * testsuite/weak_alias_test_2.cc: New file.
17609 * testsuite/weak_alias_test_3.cc: New file.
17610
780e49c5
ILT
176112008-04-08 Ian Lance Taylor <iant@google.com>
17612
cdb0b8f5
ILT
17613 * options.h (class General_options): Add --noinhibit-exec option.
17614 * main.cc (main): Check --noinhibit-exec.
17615
0864d551
ILT
17616 * options.h (class General_options): Define --wrap as a special
17617 option. Add wrap_symbols_ field.
17618 (General_options::any_wrap_symbols): New function.
17619 (General_options::is_wrap_symbol): New function.
17620 * options.cc (General_options::parse_wrap): New function.
17621 (General_options::General_options): Initialize wrap_symbols_.
17622 * symtab.cc (Symbol_table::wrap_symbol): New function.
17623 (Symbol_table::add_from_object): Handle --wrap.
17624 * symtab.h (class Symbol_table): Declare wrap_symbol.
17625 * target.h (Target::wrap_char): New function.
17626 (Target::Target_info): Add wrap_char field.
17627 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17628 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17629 * testsuite/testfile.cc (Target_test::test_target_info):
17630 Likewise.
17631
789aa6de
ILT
17632 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17633 there is one.
17634
2c38906f
ILT
17635 * layout.h (class Layout): Add added_eh_frame_data_ field.
17636 * layout.cc (Layout::Layout): Initialize new field.
17637 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17638 output section until we find a section we merged successfully.
17639 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17640 that the size be non-zero.
17641
780e49c5
ILT
17642 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17643 qualifier.
17644
7fcd0256
ILT
176452008-04-08 Craig Silverstein <csilvers@google.com>
17646
17647 * configure.ac: Export new conditional variable HAVE_ZLIB.
17648 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17649 on HAVE_ZLIB.
17650 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17651 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17652
6835af53
ILT
176532008-04-07 Ian Lance Taylor <iant@google.com>
17654
e24f324c
ILT
17655 * version.cc (version_string): Set to "1.5".
17656
a036edd8
ILT
17657 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17658 Add issued_non_pic_error_ field. Declare check_non_pic.
17659 (Target_x86_64::Scan::check_non_pic): New function.
17660 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17661 (Target_x86_64::Scan::global): Likewise.
17662
624f8810
ILT
17663 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17664 addend parameter. Change caller. Handle merge sections.
17665 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17666 Address to Addend. Don't add in the result of
17667 local_section_offset, pass down the addend and use the returned
17668 value.
17669 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17670 Update declarations of local_section_offset and symbol_value.
17671 * testsuite/two_file_test_1.cc (t18): New function.
17672 * testsuite/two_file_test_2.cc (f18): New function.
17673 * testsuite/two_file_test_main.cc (main): Call t18.
17674 * testsuite/two_file_test.h (t18, f18): Declare.
17675
6835af53
ILT
17676 * configure.ac: Don't test for objdump, c++filt, or readelf.
17677 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17678 conditionals.
17679 (TEST_READELF): New variable.
17680 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17681 (check_PROGRAMS): Add two_file_strip_test.
17682 (two_file_strip_test): New target.
17683 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17684 (two_file_same_shared_strip_test_SOURCES): New variable.
17685 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17686 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17687 (two_file_same_shared_strip_test_LDADD): New variable.
17688 (two_file_shared_strip.so): New target.
17689 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17690 (ver_test_5.syms, ver_test_7.syms): Likewise.
17691 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17692 (strip_test_3.stdout): Use TEST_OBJDUMP.
17693 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17694
86925eef
CC
176952008-04-04 Cary Coutant <ccoutant@google.com>
17696
17697 * symtab.h (Symbol::is_weak_undefined): New function.
17698 (Symbol::is_strong_undefined): New function.
17699 (Symbol::is_absolute): New function.
17700 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17701 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17702 absolute symbols.
17703 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17704 (weak_undef_test): New target.
17705 * testsuite/Makefile.in: Rebuild.
17706 * testsuite/weak_undef_file1.cc: New file.
17707 * testsuite/weak_undef_file2.cc: New file.
17708 * testsuite/weak_undef_test.cc: New file.
17709
126f3ece
ILT
177102008-04-03 Craig Silverstein <csilvers@google.com>
17711
17712 * compressed_output.h (class Output_compressed_section): Use
17713 unsigned buffer.
17714 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17715 add zlib header.
17716 (zlib_compressed_suffix): Removed.
17717 (Output_compressed_section::set_final_data_size): Use unsigned
17718 buffers.
17719 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17720 Fix linker invocation.
17721 (flagstest_o_specialfile_and_compress_debug_sections):
17722 Likewise.
17723 * testsuite/Makefile.in: Regenerated.
17724
deae2a14
DM
177252008-04-02 David S. Miller <davem@davemloft.net>
17726
17727 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17728 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17729
70752818
ILT
177302008-04-02 Craig Silverstein <csilvers@google.com>
17731
17732 * TODO: New file.
17733
39d0cb0e
ILT
177342008-04-02 Ian Lance Taylor <iant@google.com>
17735
17736 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17737 parameters. Update for new key type to views_. Change all
17738 callers.
17739 (File_read::read): Adjust for byteshift in returned view.
17740 (File_read::add_view): New function, broken out of
17741 find_and_make_view.
17742 (File_read::make_view): New function, broken out of
17743 find_and_make_view.
17744 (File_read::find_or_make_view): Add offset and aligned
17745 parameters. Rewrite accordingly. Change all callers.
17746 (File_read::get_view): Add offset and aligned parameters. Adjust
17747 for byteshift in return value.
17748 (File_read::get_lasting_view): Likewise.
17749 * fileread.h (class File_read): Update declarations.
17750 (class File_read::View): Add byteshift_ field. Add byteshift to
17751 constructor. Add byteshift method.
17752 * archive.h (Archive::clear_uncached_views): New function.
17753 (Archive::get_view): Add aligned parameter. Change all callers.
17754 * object.h (Object::get_view): Add aligned parameter. Change all
17755 callers.
17756 (Object::get_lasting_view): Likewise.
17757
17758 * fileread.cc (File_read::release): Don't call clear_views if
17759 there are multiple objects.
17760 * fileread.h (File_read::clear_uncached_views): New function.
17761 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17762 on the archive.
17763
a1207466
CC
177642008-03-31 Cary Coutant <ccoutant@google.com>
17765
17766 Add thin archive support.
17767 * archive.cc (Archive::armagt): New const.
17768 (Archive::setup): Remove task parameter and calls to unlock.
17769 (Archive::unlock_nested_archives): New function.
17770 (Archive::read_header): Add nested_off parameter. Change
17771 all callers.
17772 (Archive::interpret_header): Likewise.
17773 (Archive::include_all_members): Change to handle thin
17774 archives.
17775 (Archive::include_member): Likewise.
17776 * archive.h (Archive::Archive): Add new parameters and
17777 initializers.
17778 (Archive::armagt): New const.
17779 (Archive::setup): Remove task parameter.
17780 (Archive::unlock_nested_archives): New function.
17781 (Archive::read_header): Add nested_off parameter.
17782 (Archive::interpret_header): Likewise.
17783 (Archive::Nested_archive_table): New typedef.
17784 (Archive::is_thin_archive_): New field.
17785 (Archive::nested_archives_): New field.
17786 (Archive::options_): New field.
17787 (Archive::dirpath_): New field.
17788 (Archive::task_): New field.
17789 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17790 for thin archives. Pass additional parameters to
17791 Archive::Archive. Unlock the archive file after calling
17792 Archive::setup.
cd536b21 17793
479f6503
ILT
177942008-03-29 Ian Lance Taylor <iant@google.com>
17795
686c8caf
ILT
17796 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17797 version symbol to be local.
17798 * testsuite/ver_test_4.sh: New file.
17799 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17800 (check_DATA): Add ver_test_4.syms.
17801 (ver_test_4.syms): New target.
17802 * testsuite/Makefile.in: Rebuild.
17803
ab794b6b
ILT
17804 * output.cc
17805 (Output_section::Input_section_sort_entry::has_priority): New
17806 function.
17807 (Output_section::Input_section_sort_entry::match_file_name): New
17808 function.
17809 (Output_section::Input_section_sort_entry::match_section_name):
17810 Remove.
17811 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17812 Remove.
17813 (Output_section::Input_section_sort_entry::match_section_file):
17814 Remove.
17815 (Output_section::Input_section_sort_compare::operator()): Rewrite
17816 using new Input_section_sort_entry functions. Sort crtbegin and
17817 crtend first. Sort sections with no priority before sections with
17818 a priority.
17819 * testsuite/initpri1.c (d3): Check j != 4.
17820 (cd5): New constructor/destructor function.
17821 (main): Check j != 2.
17822
479f6503
ILT
17823 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17824 new symbol when resolving, don't call set_is_default.
17825 * testsuite/ver_test_7.cc: New file.
17826 * testsuite/ver_test_7.sh: New file.
17827 * testsuite/Makefile.am (ver_test_7.so): New target.
17828 (ver_test_7.o): New target.
17829 (check_SCRIPTS): Add ver_test_7.sh.
17830 (check_DATA): Add ver_test_7.syms.
17831 (ver_test_7.syms): New target.
17832
2fd32231
ILT
178332008-03-28 Ian Lance Taylor <iant@google.com>
17834
17835 * layout.cc (Layout::layout): If we see an input section with a
17836 name that needs sorting, set the must_sort flag for the output
17837 section.
17838 (Layout::make_output_section): If the name of the output section
17839 indicates that it might require sorting, set the may_sort flag.
17840 * output.h (Output_section::may_sort_attached_input_sections): New
17841 function.
17842 (Output_section::set_may_sort_attached_input_sections): New
17843 function.
17844 (Output_section::must_sort_attached_input_sections): New
17845 function.
17846 (Output_section::set_must_sort_attached_input_sections): New
17847 function.
17848 (class Output_section): Declare Input_section_sort_entry. Define
17849 Input_section_sort_compare. Declare
17850 sort_attached_input_sections. Add new fields:
17851 may_sort_attached_input_sections_,
17852 must_sort_attached_input_sections_,
17853 attached_input_sections_are_sorted_.
17854 * output.cc (Output_section::Output_section): Initialize new
17855 fields.
17856 (Output_section::add_input_section): Add an entry to
17857 input_sections_ if may_sort or must_sort are true.
17858 (Output_section::set_final_data_size): Call
17859 sort_attached_input_sections if necessary.
17860 (Output_section::Input_section_sort_entry): Define new class.
17861 (Output_section::Input_section_sort_compare::operator()): New
17862 function.
17863 (Output_section::sort_attached_input_sections): New function.
17864 * configure.ac: Check whether the compiler supports constructor
17865 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17866 * testsuite/initpri1.c: New file.
17867 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17868 CONSTRUCTOR_PRIORITY.
17869 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17870 (initpri1_LDFLAGS): New variable.
17871 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17872
18e6b24e
ILT
178732008-03-27 Ian Lance Taylor <iant@google.com>
17874
49bdd526
ILT
17875 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17876 * testsuite/common_test_1.c: New file.
17877 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17878 (common_test_1_SOURCES): New variable.
17879 (common_test_1_DEPENDENCIES): New variable.
17880 (common_test_1_LDFLAGS): New variable.
17881
18e6b24e
ILT
17882 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17883 and commons_ correctly when NAME/VERSION does not override
17884 NAME/NULL.
17885 * testsuite/ver_test_6.c: New file.
17886 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17887 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17888 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17889
04bf7072
ILT
178902008-03-26 Ian Lance Taylor <iant@google.com>
17891
5871526f
ILT
17892 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17893 of an undefined symbol from a version script.
17894 * testsuite/Makefile.am (ver_test_5.so): New target.
17895 (ver_test_5.o): New target.
17896 (check_SCRIPTS): Add ver_test_5.sh.
17897 (check_DATA): Add ver_test_5.syms.
17898 (ver_test_5.syms): New target.
17899 * testsuite/ver_test_5.cc: New file.
17900 * testsuite/ver_test_5.script: New file.
17901 * testsuite/ver_test_5.sh: New file.
17902 * Makefile.in, testsuite/Makefile.in: Rebuild.
17903
04bf7072
ILT
17904 PR gold/5986
17905 Fix problems building gold with gcc 4.3.0.
17906 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17907 (gold_error_at_location, gold_warning_at_location): Use it.
17908 * configure.ac: Check whether we can compile and use a template
17909 function with a printf attribute.
17910 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17911 when jumping over bytes.
17912 * object.cc: Instantiate Object::read_section_data.
17913 * debug.h: Include <cstring>
17914 * dwarf_reader.cc: Include <algorithm>
17915 * main.cc: Include <cstring>.
17916 * options.cc: Include <cstring>.
17917 * output.cc: Include <cstring>.
17918 * script.cc: Include <cstring>.
17919 * script.h: Include <string>.
17920 * symtab.cc: Include <cstring> and <algorithm>.
17921 * target-select.cc: Include <cstring>.
17922 * version.cc: Include <string>.
17923 * testsuite/testmain.cc: Include <cstdlib>.
17924 * configure, config.in: Rebuild.
17925
874c5b28
ILT
179262008-03-25 Ian Lance Taylor <iant@google.com>
17927
819d6c3a
ILT
17928 * options.cc: Include "../bfd/bfdver.h".
17929 (options::help): Print bug reporting address.
17930
f4b2c6f5
ILT
17931 * version.cc (print_version): Adjust output for current value of
17932 BFD_VERSION_STRING.
17933
17934 * NEWS: New file.
17935
e96caa79
ILT
17936 * options.cc (options::help): Print list of supported targets.
17937 * target-select.h: Include <vector>.
17938 (class Target_selector): Make machine_, size_, and is_big_endian_
17939 fields const. Add bfd_name_ and instantiated_target_ fields.
17940 (Target_selector::Target_selector): Add bfd_name parameter.
17941 (Target_selector::recognize): Make non-virtual, call
17942 do_recognize.
17943 (Target_selector::recognize_by_name): Make non-virtual, call
17944 do_recognize_by_name.
17945 (Target_selector::supported_names): New function.
17946 (Target_selector::bfd_name): New function.
17947 (Target_selector::do_instantiate_target): New pure virtual
17948 function.
17949 (Target_selector::do_recognize): New virtual function.
17950 (Target_selector::do_recognize_by_name): New virtual function.
17951 (Target_selector::instantiate_target): New private function.
17952 (supported_target_names): Declare.
17953 * target-select.cc (Target_selector::Target_selector): Update for
17954 new parameter and fields.
17955 (select_target_by_name): Check that the name matches before
17956 calling recognize_by_name.
17957 (supported_target_names): New function.
17958 * i386.cc (class Target_selector_i386): Update Target_selector
17959 constructor call. Remove recognize and recognize_by_name. Add
17960 do_instantiate_target.
17961 * x86_64.cc (class Target_selector_x86_64): Likewise.
17962 * testsuite/testfile.cc (class Target_selector_test): Update for
17963 changes to Target_selector.
17964
874c5b28
ILT
17965 * README: Rewrite, with some notes on unsupported features.
17966
0a65a3a7
CC
179672008-03-24 Cary Coutant <ccoutant@google.com>
17968
17969 * i386.cc (Target_i386::Got_type): New enum declaration.
17970 (Target_i386::Scan::local): Updated callers of Output_data_got
17971 member functions.
17972 (Target_i386::Scan::global): Likewise.
17973 (Target_i386::Relocate::relocate): Likewise.
17974 (Target_i386::Relocate::relocate_tls): Likewise.
17975 * object.h (Got_offset_list): New class.
17976 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17977 (Sized_relobj::local_got_offset): Likewise.
17978 (Sized_relobj::set_local_got_offset): Likewise.
17979 (Sized_relobj::local_has_tls_got_offset): Removed.
17980 (Sized_relobj::local_tls_got_offset): Removed.
17981 (Sized_relobj::set_local_tls_got_offset): Removed.
17982 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17983 * output.cc (Output_data_got::add_global): Added got_type parameter.
17984 (Output_data_got::add_global_with_rel): Likewise.
17985 (Output_data_got::add_global_with_rela): Likewise.
17986 (Output_data_got::add_global_pair_with_rel): New function.
17987 (Output_data_got::add_global_pair_with_rela): New function.
17988 (Output_data_got::add_local): Added got_type parameter.
17989 (Output_data_got::add_local_with_rel): Likewise.
17990 (Output_data_got::add_local_with_rela): Likewise.
17991 (Output_data_got::add_local_pair_with_rel): New function.
17992 (Output_data_got::add_local_pair_with_rela): New function.
17993 (Output_data_got::add_global_tls): Removed.
17994 (Output_data_got::add_global_tls_with_rel): Removed.
17995 (Output_data_got::add_global_tls_with_rela): Removed.
17996 (Output_data_got::add_local_tls): Removed.
17997 (Output_data_got::add_local_tls_with_rel): Removed.
17998 (Output_data_got::add_local_tls_with_rela): Removed.
17999 * output.h (Output_data_got::add_global): Added got_type parameter.
18000 (Output_data_got::add_global_with_rel): Likewise.
18001 (Output_data_got::add_global_with_rela): Likewise.
18002 (Output_data_got::add_global_pair_with_rel): New function.
18003 (Output_data_got::add_global_pair_with_rela): New function.
18004 (Output_data_got::add_local): Added got_type parameter.
18005 (Output_data_got::add_local_with_rel): Likewise.
18006 (Output_data_got::add_local_with_rela): Likewise.
18007 (Output_data_got::add_local_pair_with_rel): New function.
18008 (Output_data_got::add_local_pair_with_rela): New function.
18009 (Output_data_got::add_global_tls): Removed.
18010 (Output_data_got::add_global_tls_with_rel): Removed.
18011 (Output_data_got::add_global_tls_with_rela): Removed.
18012 (Output_data_got::add_local_tls): Removed.
18013 (Output_data_got::add_local_tls_with_rel): Removed.
18014 (Output_data_got::add_local_tls_with_rela): Removed.
18015 * resolve.cc (Symbol::override_base_with_special): Removed
18016 reference to has_got_offset_ field.
18017 * symtab.cc (Symbol::init_fields): Replaced initialization
18018 of got_offset_ with got_offsets_. Removed initialization
18019 of has_got_offset_
53fcba31 18020 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
18021 (Symbol::got_offset): Likewise.
18022 (Symbol::set_got_offset): Likewise.
18023 (Symbol::has_tls_got_offset): Removed.
18024 (Symbol::tls_got_offset): Removed.
18025 (Symbol::set_tls_got_offset): Removed.
18026 (Symbol::got_offset_): Removed.
18027 (Symbol::tls_mod_got_offset_): Removed.
18028 (Symbol::tls_pair_got_offset_): Removed.
18029 (Symbol::got_offsets_): New field.
18030 (Symbol::has_got_offset): Removed.
18031 (Symbol::has_tls_mod_got_offset): Removed.
18032 (Symbol::has_tls_pair_got_offset): Removed.
18033 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
18034 (Target_x86_64::Scan::local): Updated callers of Output_data_got
18035 member functions.
18036 (Target_x86_64::Scan::global): Likewise.
18037 (Target_x86_64::Relocate::relocate): Likewise.
18038 (Target_x86_64::Relocate::relocate_tls): Likewise.
18039
bd52eafb
BE
180402008-03-25 Ben Elliston <bje@au.ibm.com>
18041
18042 * yyscript.y: Fix spelling error in comment.
18043
8b105e34
ILT
180442008-03-24 Ian Lance Taylor <iant@google.com>
18045
8ed814a9
ILT
18046 * options.h (class General_options): Define build_id option.
18047 * layout.h (class Layout): Declare write_build_id, create_note,
18048 create_build_id. Add build_id_note_ member.
18049 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
18050 "libiberty.h", "md5.h", "sha1.h".
18051 (Layout::Layout): Initialize eh_frame_data_,
18052 eh_frame_hdr_section_, and build_id_note_.
18053 (Layout::finalize): Call create_build_id.
18054 (Layout::create_note): New function, broken out of
18055 Layout::create_gold_note.
18056 (Layout::create_gold_note): Call create_note.
18057 (Layout::create_build_id): New function.
18058 (Layout::write_build_id): New function.
18059 (Close_task_runner::run): Call write_build_id.
18060
8b105e34
ILT
18061 * x86_64.cc: Correct license to GPLv3.
18062
086a1841
ILT
180632008-03-23 Ian Lance Taylor <iant@google.com>
18064
18065 * options.cc: Include "demangle.h".
18066 (parse_optional_string): New function.
18067 (parse_long_option): Handle takes_optional_argument.
18068 (parse_short_option): Update dash_z initializer. Handle
18069 takes_optional_argument.
18070 (General_options::General_options): Initialize do_demangle_.
18071 (General_options::finalize): Set do_demangle_. Handle demangling
18072 style.
18073 * options.h (parse_optional_string): Declare.
18074 (struct One_option): Add optional_arg field. Update constructor.
18075 Update call constructor calls. Add takes_optional_argument
18076 function.
18077 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18078 (DEFINE_optional_string): Define.
18079 (General_options::demangle): Change from DEFINE_bool to
18080 DEFINE_optional_string.
18081 (General_options::no_demangle): New function.
18082 (General_options::do_demangle): New function.
18083 (General_options::set_do_demangle): New function.
18084 (General_options::execstack_status_): Move definition to end of
18085 class definition.
18086 (General_options::static_): Likewise.
18087 (General_options::do_demangle_): New field.
18088 * object.cc (big_endian>::get_symbol_location_info): Call
18089 Options::do_demangle, not Options::demangle.
18090 * symtab.cc (demangle): Likewise.
18091
cbb93e63
ILT
180922008-03-22 Ian Lance Taylor <iant@google.com>
18093
18094 * gold.h: Include <cstddef> and <sys/types.h>
18095 * options.h: Include <cstring>.
18096
ec531623
ILT
180972008-03-21 Ian Lance Taylor <iant@google.com>
18098
18099 * Added source code to GNU binutils.
752937aa 18100\f
b90efa5b 18101Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
18102
18103Copying and distribution of this file, with or without modification,
18104are permitted in any medium without royalty provided the copyright
18105notice and this notice are preserved.
18106
18107Local Variables:
18108mode: change-log
18109left-margin: 8
18110fill-column: 74
18111version-control: never
18112End:
This page took 1.197201 seconds and 4 git commands to generate.