Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
39040bb9
CC
12015-12-13 Cary Coutant <ccoutant@gmail.com>
2
3 * object.h (Object::get_output_view): remove const from return type.
4 (Object::do_get_output_view): Likewise.
5 (Sized_relobj_file::do_get_output_view): Likewise.
6 * reloc.cc (Sized_relobj_file::do_get_output_view): Likewise.
7
6e0813d3
CC
82015-12-11 Cary Coutant <ccoutant@gmail.com>
9
10 * target.h (Target::calls_non_split): Add prelocs, reloc_count
11 parameters.
12 (Target::do_calls_non_split): Likewise.
13 * target.cc (Target::do_calls_non_split): Likewise.
14 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Adjust
15 call to Target::calls_non_split.
16 * i386.cc (Target_i386::do_calls_non_split): Add prelocs, reloc_count
17 parameters.
18 * powerpc.cc (Target_powerpc::do_calls_non_split): Likewise.
19 * x86_64.cc (Target_x86_64::do_calls_non_split): Likewise.
20
6b2353a5
CC
212015-12-11 Cary Coutant <ccoutant@gmail.com>
22
23 * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize
24 output_views_.
25 * object.h (Object::get_output_view): New function.
26 (Object::do_get_output_view): New function.
27 (Sized_relobj_file::do_get_output_view): New function.
28 (Sized_relobj_file::output_views_): New data member.
29 * reloc.cc: (Sized_relobj_file::do_relocate): Store pointer to
30 output views in class object.
31 (Sized_relobj_file::do_get_output_view): New function.
32
bebf4942
L
332015-12-10 H.J. Lu <hongjiu.lu@intel.com>
34
35 PR ld/19317
36 * symtab.cc (Symbol_table::add_from_relobj): Don't complain
37 plugin needed to handle slim lto object for relocatable link.
38
dcfc7dd4
AM
392015-12-09 Alan Modra <amodra@gmail.com>
40
41 * powerpc.cc (Target_powerpc::Relocate::relocate): New constant
42 d_offset. Use throughout.
43 (Target_powerpc::relocate_relocs): Likewise.
44
e3a7574e
AM
452015-12-09 Alan Modra <amodra@gmail.com>
46
47 * powerpc.cc (Target_powerpc::Relocate::relocate): Edit ELFv2
48 entry code.
49 (Target_powerpc::relocate_relocs): Edit relocs to suit.
50
91a65d2f
AM
512015-12-09 Alan Modra <amodra@gmail.com>
52
53 * object.h (struct Relocate_info): Add "rr".
54 * reloc.h (Relocatable_relocs::set_strategy): New accessor.
55 * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
56 relinfo.rr for relocate_section and relocate_relocs.
57 * powerpc.cc (relocate): Add rel_type and preloc parameters.
58 Delete rela and r_type params, instead recalculate these from
59 preloc.
60 (relocate_relocs): Delete Relocatable_relocs* param, instead
61 use relinfo->rr.
62 * aarch64.cc: Likewise.
63 * arm.cc: Likewise.
64 * i386.cc: Likewise.
65 * mips.cc: Likewise.
66 * s390.cc: Likewise.
67 * sparc.cc: Likewise.
68 * target.h: Likewise.
69 * tilegx.cc: Likewise.
70 * x86_64.cc: Likewise.
71 * testsuite/testfile.cc: Likewise.
72 * target-reloc.h (relocate_section): Adjust to suit.
73 (apply_relocation, relocate_relocs): Likewise.
74
549dba71
AM
752015-12-07 Alan Modra <amodra@gmail.com>
76
77 * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
78 (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
79 (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
80
7ef8ae7c
VR
812015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
82
83 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
84 Local_got_entry_key for searching in local_got_offsets_.
85 * object.h (class Local_got_entry_key): New class.
86 (Relobj::local_has_got_offset): New overloaded method.
87 (Relobj::local_got_offset): Likewise.
88 (Relobj::set_local_got_offset): Likewise.
89 (Relobj::do_local_has_got_offset): Add addend argument.
90 (Relobj::do_local_got_offset): Likewise.
91 (Relobj::do_set_local_got_offset): Likewise.
92 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
93 Local_got_entry_key for searching through local_got_offsets_.
94 (Sized_relobj::do_local_got_offset): Likewise.
95 (Sized_relobj::do_set_local_got_offset): Likewise.
96 (Sized_relobj::Local_got_offsets): Change type of the key from
97 unsigned int to Local_got_entry_key, and add hash and equal_to.
98 * output.cc (Got_entry::write): Take addend into account for
99 calculating value of the local symbol for GOT.
100 (Output_data_got::add_local): New definition of overloaded method.
101 (Output_data_got::add_local_with_rel): Likewise.
102 (Output_data_got::add_local_pair_with_rel): Likewise.
103 * output.h (Output_data_got::add_local): New declaration of overloaded
104 method.
105
74b03b91
CC
1062015-11-25 Cary Coutant <ccoutant@gmail.com>
107
108 PR gold/19291
109 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
110 subtract section address from symbol value.
111
751e4d66
AM
1122015-11-25 Alan Modra <amodra@gmail.com>
113
114 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
115 to 256 byte boundary.
116
32d849b3
AM
1172015-11-19 Alan Modra <amodra@gmail.com>
118
119 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
120 GOT16 and TOC16 relocs to RELATIVE_REF.
121
db1ff028
CC
1222015-11-14 Cary Coutant <ccoutant@gmail.com>
123
124 PR gold/19244
125 PR gold/18548
126 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
127 local symbols only for predefined symbols.
128
a680de9a
PB
1292015-11-11 Alan Modra <amodra@gmail.com>
130 Peter Bergner <bergner@vnet.ibm.com>
131
132 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
133 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
134 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
135 (Target_powerpc::Scan::global): Likewise.
136 (Target_powerpc::Relocate::relocate): Likewise.
137
cc203475
VR
1382015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
139
140 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
141 sections.
142
859d7987
CC
1432015-11-09 Cary Coutant <ccoutant@gmail.com>
144 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
145
146 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
147 with type, offset, addend.
148 (Copy_relocs::save): Likewise.
149 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
150 (Copy_relocs::save): Likewise.
151 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
152 and r_addend to Copy_relocs::copy_reloc.
153 * arm.cc (Target_arm::copy_reloc): Likewise.
154 * i386.cc (Target_i386::copy_reloc): Likewise.
155 * mips.cc (Target_mips::copy_reloc): Likewise.
156 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
157 * s390.cc (Target_s390::copy_reloc): Likewise.
158 * sparc.cc (Target_sparc::copy_reloc): Likewise.
159 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
160 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
161
96f9814d
CC
1622015-11-05 Cary Coutant <ccoutant@gmail.com>
163
164 PR gold/19119
165 PR gold/19172
166 PR gold/19197
167 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
168 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
169 * options.h (General_options): Remove "obsolete" from -m.
170 * parameters.cc (set_parameters_target): Check if input target
171 is compatible with output emulation set by "-m emulation".
172
0eccf19f
CC
1732015-11-05 Cary Coutant <ccoutant@gmail.com>
174
175 PR gold/19163
176 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
177 certain relocations if --no-apply-dynamic-relocs is set.
178 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
179
c1e7d6a8
AM
1802015-11-03 Alan Modra <amodra@gmail.com>
181
182 * po/POTFILES.in: Regenerate.
183
26f187cd
NC
1842015-10-30 Nick Clifton <nickc@redhat.com>
185
186 * po/zh_CN.po: New (simplified) Chinese translation.
187
41e83f2b
L
1882015-10-29 H.J. Lu <hongjiu.lu@intel.com>
189
190 PR gold/19184
191 * incremental.cc (Got_plt_view_info): Add got_entry_size.
192 (Local_got_offset_visitor::visit): Replace got_entry_size_
193 with info_.got_entry_size.
194 (Local_got_offset_visitor::got_entry_size_): Removed.
195 (Global_got_offset_visitor::visit): Replace got_entry_size_
196 with info_.got_entry_size.
197 (Global_got_offset_visitor::got_entry_size_): Removed.
198 (Output_section_incremental_inputs::write_got_plt): Initialize
199 view_info.got_entry_size.
200 * target.h (Sized_target::got_entry_size): New virtual function.
201 * x86_64.cc (Target_x86_64::got_entry_size): New function.
202
238830c6
MK
2032015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
204
205 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
206 * testsuite/script_test_12a.c: Likewise.
207 * testsuite/script_test_1a.cc: Likewise.
208 * testsuite/script_test_2.cc: Likewise.
209
bd890911
MK
2102015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
211
212 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
213
a817ff49
MK
2142015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
215
216 PR gold/18959
217 * stringpool.cc (Stringpool_template::new_key_offset): Align all
218 strings, even zero-length.
219 (Stringpool_template::set_string_offsets): Likewise.
220
e79a4bad
MK
2212015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
222
223 * s390.cc: New file.
224 * Makefile.am (TARGETSOURCES): Add s390.cc.
225 (ALL_TARGETOBJS): Add s390.o.
226 * Makefile.in: Regenerate.
227 * configure.ac: Add s390 support.
228 * configure: Regenerate.
229 * configure.tgt: Add s390-*-* and s390x-*-*.
230 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
231 support.
232
6f97897d
MK
2332015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
234
235 * archive.cc (Archive::sym64name): New const.
236 (Archive::setup): Add support for SYM64 armap.
237 (Archive::read_armap): Likewise.
238 (Archive::interpret_header): Likewise.
239 (Archive::const_iterator::read_next_header): Likewise.
240 * archive.h (Archive::sym64name): New const.
241 (Archive::read_armap): Add mapsize template parameter.
242
8d9743bd
MK
2432015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
244
245 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
246 target-specific entry size.
247 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
248 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
249 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
250 hash_entry_size.
251 * target.h (Target::hash_entry_size): New method.
252 (Target::Target_info::hash_entry_size): New data member.
253
254 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
255 * arm.cc (Target_arm::arm_info): Likewise.
256 (Target_arm_nacl::arm_nacl_info): Likewise.
257 * i386.cc (Target_i386::i386_info): Likewise.
258 (Target_i386_nacl::i386_nacl_info): Likewise.
259 (Target_iamcu::iamcu_info): Likewise.
260 * mips.cc (Target_mips::mips_info): Likewise.
261 (Target_mips_nacl::mips_nacl_info): Likewise.
262 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
263 * sparc.cc (Target_sparc::sparc_info): Likewise.
264 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
265 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
266 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
267 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
268
3043c1ab
L
2692015-10-28 H.J. Lu <hongjiu.lu@intel.com>
270
271 PR gold/19177
272 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
273 and R_386_GOT32X relocations without base register.
274
4d2f5d58
HS
2752015-10.27 Han Shen <shenhan@google.com>
276
277 PR gold/19042 - unsupported reloc 311/312.
278
279 * aarch64.cc (Target_aarch64::Scan::local): Add support for
280 reloc 311/312.
281
2891b491
L
2822015-10-22 H.J. Lu <hongjiu.lu@intel.com>
283
284 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
285 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
286 as R_X86_64_GOTPCREL.
287 (Target_x86_64<size>::Scan::local): Likewise.
288 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
289 Likewise.
290 (Target_x86_64<size>::Scan::global): Likewise.
291 (Target_x86_64<size>::Relocate::relocate): Likewise.
292 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
293 Likewise.
294
493d4b48
L
2952015-10-22 H.J. Lu <hongjiu.lu@intel.com>
296
297 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
298 R_386_GOT32X the same as R_386_GOT32.
299 (Target_i386::Scan::local): Likewise.
300 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
301 (Target_i386::Scan::global): Likewise.
302 (Target_i386::Relocate::relocate): Likewise.
303 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
304 Likewise.
305
0fd15345
L
3062015-10-20 H.J. Lu <hongjiu.lu@intel.com>
307
308 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
309 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
310 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
311 x86_64_mov_to_lea1.o.
312 * testsuite/Makefile.in: Regenerated.
313
64571972
L
3142015-10-16 H.J. Lu <hongjiu.lu@intel.com>
315
316 PR gold/19119
317 * options.h (General_options): Remove "obsolete" from -m.
318 * parameters.cc (set_parameters_target): Check if input target
319 is compatible with output emulation set by "-m emulation".
320
01f573ad
L
3212015-10-13 H.J. Lu <hongjiu.lu@intel.com>
322
323 PR gold/19118
324 * i386.cc (Target_iamcu): New class.
325 (Target_selector_iamcu): Likewise.
326 (Target_iamcu::iamcu_info): New variable.
327 (target_selector_iamcu): Likewise.
328
3b0357da
AS
3292015-10-07 Andreas Schwab <schwab@suse.de>
330
331 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
332
9eacb935
CC
3332015-10-06 Cary Coutant <ccoutant@gmail.com>
334
335 PR gold/18855
336 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
337 parameter.
338 (Sparc_relocate_functions::gdop_lox10): Likewise.
339 (Target_sparc::Relocate::relocate): Use addend when computing
340 symbol value for R_SPARC_GOTDATA_OP*.
341
3d4fde69
CC
3422015-09-07 Cary Coutant <ccoutant@gmail.com>
343
344 PR gold/18930
345 PR gold/18886
346 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
347 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
348
358de988
L
3492015-09-02 H.J. Lu <hongjiu.lu@intel.com>
350
351 PR gold/18886
352 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
353 shared libraries into normal FUNC symbols.
354 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
355 symbols aren't from shared libraries.
356
d49044c7
AM
3572015-09-02 Alan Modra <amodra@gmail.com>
358
359 PR 18878
360 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
361 (Target_powerpc::Branch_info::make_stub): Determine whether long
362 branch stub is for save/restore function.
363 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
364 (Stub_table): Add need_save_res_.
365 (Stub_table:clear_stubs): Clear need_save_res_.
366 (Stub_table:set_address_and_size): Add save/restore section size.
367 (Stub_table::add_long_branch_entry): Add save_res param. Set
368 need_save_res_, but don't add space for save/restore stubs.
369 (Stub_table::find_long_branch_entry): Return offset to local copy
370 of save/restore func.
371 (Stub_table::do_write): Don't output save/restore stubs. Instead
372 copy the save/restore functions.
373 (Output_data_save_res:contents): New accessor.
374 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
375
7c61d651
CC
3762015-08-25 Cary Coutant <ccoutant@gmail.com>
377
378 PR gold/18847
379 * script-sections.cc (Memory_region::set_address): New method.
380 (Script_sections::find_memory_region): Add explicit_only parameter.
381 (Output_section_definition::set_section_addresses): Handle case where
382 script specifies both address and vma region.
383 * script-sections.h (Script_sections::find_memory_region): Add
384 explicit_only parameter.
385
4bfacfd3
CC
3862015-08-25 Cary Coutant <ccoutant@gmail.com>
387
388 PR gold/18859
389 * object.cc (Input_objects::add_object): Store objects in a map,
390 indexed by soname; update as-needed flag when necessary.
391 * object.h (Object::clear_as_needed): New method.
392 (Input_objects::so_names_): Change from set to map.
393
1757d35c
CC
3942015-08-25 Cary Coutant <ccoutant@gmail.com>
395
396 PR gold/14746
397 * expression.cc (Expression::Expression_eval_info): Add
398 is_valid_pointer field.
399 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
400 Adjust all callers.
401 (Addr_expression::value_from_output_section): Check whether address
402 is valid.
403 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
404 if evaluation failed due to address that is not yet valid.
405 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
406 parameter.
407
3ac0a36c
CC
4082015-08-25 Cary Coutant <ccoutant@gmail.com>
409
410 PR gold/18866
411 PR gold/18703
412 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
413
9215b98b
AM
4142015-08-20 Alan Modra <amodra@gmail.com>
415
416 PR gold/18846
417 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
418 Subtract os->address() from addend.
419 * powerpc.cc (relocate_relocs): Likewise.
420
40fc1451
SD
4212015-08-12 Simon Dardis <simon.dardis@imgtec.com>
422
423 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
424 lazy_stub_normal_1, lazy_stub_normal_1_n64,
425 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
426 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
427 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
428 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
429 of 'addu/daddu'.
430
37a42ee9
L
4312015-07-27 H.J. Lu <hongjiu.lu@intel.com>
432
433 * configure: Regenerated.
434
ab3b14b0
DK
4352015-07-26 Doug Kwan <dougkwan@google.com>
436
437 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
438 disassembler output format.
439
cdb06167
HS
4402015-07-23 Ian Coolidge <icoolidge@google.com>
441 Plumb --pic-veneer option for gold.
442
443 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
444 generation.
445 * options.h (General_options): Add --pic-veneer option.
446
5b2af7dd
L
4472015-07-22 H.J. Lu <hongjiu.lu@intel.com>
448
449 PR gold/18663
450 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
451 script_test_1a.cc script_test_1b.cc.
452 (script_test_11_r.o): Replace script_test_11.o with
453 script_test_11a.o script_test_11b.o.
454 (script_test_11.o): Removed.
455 (script_test_11a.o): New.
456 (script_test_11b.o): Likewise.
457 * testsuite/Makefile.in: Regenerated.
458 * testsuite/script_test_1.h: New file.
459 * testsuite/script_test_1b.cc: Likewise.
460 * testsuite/script_test_11.h: Likewise.
461 * testsuite/script_test_11b.c: Likewise.
462 * testsuite/script_test_1.cc: Renamed to ...
463 * testsuite/script_test_1a.cc: This.
464 Include "script_test_1.h".
465 (main): Call check_int and check_ptr.
466 * testsuite/script_test_11.c: Renamed to ...
467 * testsuite/script_test_11a.c: This.
468 Include "script_test_11.h".
469 (main): Call ptr_equal.
470
cd78ea77
L
4712015-07-22 H.J. Lu <hongjiu.lu@intel.com>
472
473 PR gold/18628
474 * testsuite/ifuncdep2.c (global): Change protected to hidden.
475 * testsuite/ifuncmod1.c (global): Likewise.
476 * testsuite/ifuncmod5.c (global): Likewise.
477
f945ba50
AM
4782015-07-22 Alan Modra <amodra@gmail.com>
479
480 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
481
5417c94d
CC
4822015-07-21 Cary Coutant <ccoutant@gmail.com>
483
484 PR gold/18548
485 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
486 forced local symbol even when oldsym != NULL.
487 (Symbol_table::do_define_in_output_segment): Likewise.
488 (Symbol_table::do_define_as_constant): Likewise.
489
cb5cf5e2
CC
4902015-07-21 Cary Coutant <ccoutant@gmail.com>
491
b8c6c5ef 492 PR gold/18698
cb5cf5e2
CC
493 * archive.cc (Library_base::should_include_member): Don't use entry
494 point for relocatable links, or if target is not yet valid.
495 * parameters.cc (Parameters::entry): Check target_valid().
496
0ef3814f
HS
4972015-07-20 Han Shen <shenhan@google.com>
498
499 Optimize erratum 843419 fix.
500
501 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
502 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
503 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
504 (E843419_stub): New sub-class of Erratum_stub.
505 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
506 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
507 (AArch64_relobj::create_erratum_stub): Add 1 argument.
508 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
509
2bca0377
HS
5102015-07-20 Han Shen <shenhan@google.com>
511
512 Fix arm elf header flags wrt hardfp bit.
513
514 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
515
f54f5e31
L
5162015-07-20 H.J. Lu <hongjiu.lu@intel.com>
517
518 PR gold/18689
519 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
520 from input group section for relocatable link.
521 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
522 (check_DATA): Add pr18689.stdout.
523 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
524 (pr18689.stdout): New rule.
525 (pr18689a.o): Likewise.
526 (pr18689b.o): Likewise.
527 (pr18689.o): Likewise.
528 * testsuite/pr18689.c: New file.
529 * testsuite/pr18689.sh: Likewise.
530 * testsuite/Makefile.in: Regenerated.
531
c20ceeb2
YW
5322015-07-20 Yiran Wang <yiran@google.com>
533 Cary Coutant <ccoutant@gmail.com>
534
535 PR gold/15574
536 * resolve.cc (Symbol_table): Remove warning about references
537 from shared objects to hidden symbols.
538 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
539 * testsuite/Makefile.in: Regenerate.
540 * testsuite/hidden_test.sh: Check dynamic symbol table; update
541 expected error messages.
542
19a7fe52
L
5432015-07-14 H.J. Lu <hongjiu.lu@intel.com>
544
545 * compressed_output.cc (Output_compressed_section::set_final_data_size):
546 Make --compress-debug-sections=zlib the same as
547 --compress-debug-sections=zlib-gabi.
548 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
549 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
550 ".zdebug_".
551 * testsuite/Makefile.in: Regenerated.
552
fb8b9dbc
L
5532015-07-12 H.J. Lu <hongjiu.lu@intel.com>
554
555 PR gold/18322
556 * compressed_output.cc (zlib_compress): Add argument for
557 compression header size. Set header size to compression header
558 size if it isn't 0. Don't write out the zlib header here.
559 (Output_compressed_section::set_final_data_size): Support
560 zlib-gnu and zlib-gabi compressions. Pass compression header
561 size to zlib_compress and write out compression header. Set
562 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
563 clear the SHF_COMPRESSED bit
564 * options.h (compress_debug_sections): Add zlib-gnu and
565 zlib-gabi.
566 * output.h (Output_section::set_flags): New.
567 * testsuite/Makefile.am (check_PROGRAMS): Add
568 flagstest_compress_debug_sections_none,
569 flagstest_compress_debug_sections_gnu and
570 flagstest_compress_debug_sections_gabi.
571 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
572 flagstest_compress_debug_sections.stdout,
573 flagstest_compress_debug_sections.cmp,
574 flagstest_compress_debug_sections.check,
575 flagstest_compress_debug_sections_gnu.stdout,
576 flagstest_compress_debug_sections_gnu.cmp,
577 flagstest_compress_debug_sections_gnu.check,
578 flagstest_compress_debug_sections_gabi.stdout,
579 flagstest_compress_debug_sections_gabi.cmp and
580 flagstest_compress_debug_sections_gabi.check.
581 (flagstest_compress_debug_sections_none): New.
582 (flagstest_compress_debug_sections_none.stdout): Likewise.
583 (flagstest_compress_debug_sections.stdout): Likewise.
584 (flagstest_compress_debug_sections.check): Likewise.
585 (flagstest_compress_debug_sections.cmp): Likewise.
586 (flagstest_compress_debug_sections_gnu): Likewise.
587 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
588 (flagstest_compress_debug_sections_gnu.check): Likewise.
589 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
590 (flagstest_compress_debug_sections_gabi): Likewise.
591 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
592 (flagstest_compress_debug_sections_gnu.check): Likewise.
593 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
594 * testsuite/Makefile.in: Regenerated.
595
48058663
L
5962015-07-12 H.J. Lu <hongjiu.lu@intel.com>
597
598 PR gold/18321
599 * compressed_output.h (decompress_input_section): Add arguments
600 for ELF class, big endian and sh_flags.
601 * compressed_output.cc (decompress_input_section): Likewise.
602 Support the SHF_COMPRESSED section.
603 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
604 functions.
605 * plugin.h (Pluginobj): Likewise.
606 * layout.cc (Layout::get_output_section_flags): Also clear the
607 SHF_COMPRESSED bit.
608 * object.h (Compressed_section_info): Add flag to store sh_flags.
609 (Object): Add pure virtual elfsize and is_big_endian member
610 functions.
611 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
612 prefix here.
613 (build_compressed_section_map): Check SHF_COMPRESSED for
614 uncompressed size. Store sh_flags in Compressed_section_info.
615 Pass size, big_endian and sh_flags to decompress_input_section.
616 Skip the ".debug"/".zdebug" prefix when passing section name to
617 need_decompressed_section.
618 (Sized_relobj_file<size, big_endian>::do_find_special_section):
619 Don't check ".zdebug_*" sections.
620 (Object::decompressed_section_contents): Pass ELF class, big
621 endian and sh_flags to decompress_input_section.
622 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
623 Likewise.
624 * testsuite/Makefile.am (check_DATA): Add
625 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
626 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
627 gdb_index_test_2_gabi.stdout.
628 (debug_msg_cdebug_gabi.o): New.
629 (odr_violation1_cdebug_gabi.o): Likewise.
630 (odr_violation2_cdebug_gabi.o): Likewise.
631 (debug_msg_cdebug_gabi.err): Likewise.
632 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
633 (gdb_index_test_cdebug_gabi.o): Likewise.
634 (gdb_index_test_2_gabi): Likewise.
635 (gdb_index_test_2_gabi.stdout): Likewise.
636 * testsuite/gdb_index_test_2_gabi.sh: New file.
637 * testsuite/Makefile.in: Regenerated.
638
73854cdd
HS
6392015-07-09 Han Shen <shenhan@google.com>
640
641 Use "gold_info" instead of "gold_warning" for erratum fix.
642
643 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
644 'gold_info'.
645 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
646
61163dfa
HS
6472015-07-09 Han Shen <shenhan@google.com>
648
649 Drop missing symbol warning for arm/aarch64.
650
651 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
652 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
653 symbol warning.
654
b91deca9
HS
6552015-07-07 Han Shen <shenhan@google.com>
656
657 Make gold aarch64 accept long form of mapping symbols.
658
659 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
660 of mapping symbols.
661
15162bef
DK
6622015-06-29 Doug Kwan <dougkwan@google.com>
663
664 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
665 at address expected by test.
666 * testsuite/arm_cortex_a8_b.s: Ditto.
667 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
668 * testsuite/arm_cortex_a8_bl.s: Ditto.
669 * testsuite/arm_cortex_a8_blx.s: Ditto.
670 * testsuite/arm_cortex_a8_local.s: Ditto.
671 * testsuite/arm_fix_v4bx.s: Ditto.
672 * testsuite/arm_unaligned_reloc.s: Ditto.
673 * testsuite/thumb_bl_out_of_range.s: Ditto.
674 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
675 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 676
56b06706
HS
6772015-06-29 Han Shen <shenhan@google.com>
678
679 Patch for erratum 843419 internal error.
680
72f4393d
L
681 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
682 (Erratum_stub::update_erratum_insn): New method.
683 (Stub_table::relocate_stubs): Modified to place relocated insn.
684 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 685
2f0c79aa
HS
6862015-06-12 Han Shen <shenhan@google.com>
687
688 Fix erratum 835769.
689
72f4393d
L
690 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
691 defintion outside class definition.
692 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
693 (AArch64_insn_utilities::aarch64_op31): New member.
694 (AArch64_insn_utilities::aarch64_ra): New member.
695 (AArch64_insn_utilities::aarch64_mac): New member.
696 (AArch64_insn_utilities::aarch64_mlxl): New member.
697 (ST_E_835769): New global enum member.
698 (Stub_table::relocate_stubs): Add 835769 handler.
699 (Stub_template_repertoire::Stub_template_repertoire): Install new
700 stub type.
701 (AArch64_relobj::scan_errata): This func is renamed from
702 scan_erratum_843419.
703 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
704 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
705 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
706 (Target_aarch64::scan_erratum_835769_span): New method.
707 (Target_aarch64::create_erratum_stub): New method.
708 (Target_aarch64::is_erratum_835769_sequence): New method.
709 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
710 code into create_erratum_stub.
711 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 712
5d7908e0
CC
7132015-06-11 Cary Coutant <ccoutant@gmail.com>
714
715 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
716 outside class body.
717 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
718
dd68f8fa
CC
7192015-06-11 Cary Coutant <ccoutant@gmail.com>
720
721 PR gold/17731
722 * layout.cc (corresponding_uncompressed_section_name): New function.
723 (Layout::choose_output_section): Call it.
724 * layout.h (corresponding_uncompressed_section_name): New function.
725 * script-sections.cc (Input_section_info::set_section_name): Check
726 for compressed debug section (.zdebug style).
727
a3a0c391
JY
7282015-06-11 Jing Yu <jingyu@google.com>
729
730 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
731 * testsuite/Makefile.in: Regenerate.
732
970cdef2
DI
7332015-06-11 Davide Italiano <dccitaliano@gmail.com>
734
735 * gold.h (is_cident): Correct typo.
736
a48d0c12
HS
7372015-06-10 Han Shen <shenhan@google.com>
738 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
739
740 Now fixing for 843419 is fully functional.
741
742 The first part of the erratum fix CL is here -
743 https://sourceware.org/ml/binutils/2015-04/msg00229.html
744
745 * aarch64.cc(global enum): New constants representing stub types.
746 (Stub_template): New POD struct.
747 (Stub_template_repertoire): New class.
748 (Stub_base): New class.
749 (Erratum_stub): New class.
750 (Reloc_stub): Refactored to be a subclass of Stub_base.
751 (Reloc_stub::Stub_type): Removed.
752 (Reloc_stub::offset): Moved to Stub_base.
753 (Reloc_stub::set_offset): Moved to Stub_base.
754 (Reloc_stub::destination_address): Moved to Stub_base.
755 (Reloc_stub::set_destination_address): Moved to Stub_base.
756 (Reloc_stub::reset_destination_address): Moved to Stub_base.
757 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
758 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
759 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
760 (Reloc_stub::write): Moved to Stub_base.
761 (Reloc_stub::invalid_offset): Moved to Stub_base.
762 (Reloc_stub::invalid_address): Moved to Stub_base.
763 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
764 (Reloc_stub::stub_insns_): Moved to Stub_base.
765 (Reloc_stub::offset_): Moved to Stub_base.
766 (Reloc_stub::destination_address_): Moved to Stub_base.
767 (Stub_table::The_aarch64_relobj): New typedef.
768 (Stub_table::The_erratum_stub): New typedef.
769 (Stub_table::The_erratum_stub_less): New typedef.
770 (Stub_table::The_erratum_stub_set): New typedef.
771 (Stub_table::The_erratum_stub_set_iter): New typedef.
772 (Stub_table::empty): Added emptiness testing for erratum stubs.
773 (Stub_table::add_erratum_stub): New method to add an erratum stub.
774 (Stub_table::find_erratum_stub): New method.
775 (Stub_table::find_erratum_stubs_for_input_section): New method.
776 (Stub_table::erratum_stub_address): New method.
777 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
778 (Stub_table::do_addralign): Modified to handle erratum stubs.
779 (Stub_table::erratum_stubs_): New member.
780 (Stub_table::erratum_stub_size_): New member.
781 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
782 (Stub_table::do_write): Modified to handle erratum stubs.
783 (AArch64_relobj::The_erratum_stub): New typedef.
784 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
785 (AArch64_relobj::fix_errata): New method.
786 (Target_aarch64::The_reloc_stub_type): Removed.
787 (Target_aarch64::The_erratum_stub): New typede.
788 (AArch64_relocate_functions::construct_b): New method.
789
1e1b2efc
NC
7902015-06-08 Nick Clifton <nickc@redhat.com>
791
792 * po/fr.po: New French Translation.
793
b8cf5075
CC
7942015-06-07 Cary Coutant <ccoutant@gmail.com>
795
796 PR gold/18288
797 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
798 callers. Don't use STT_COMMON to check for common symbols.
799 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
800 symbol that's not in a common section.
801 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
802 common symbols.
803
bdd2d2b7
CC
8042015-06-04 Cary Coutant <ccoutant@gmail.com>
805
806 PR gold/18200
807 * Makefile.am (diststuff): Add target.
808 * Makefile.in: Regenerate.
809
cd3c333f
CC
8102015-06-04 Cary Coutant <ccoutant@gmail.com>
811
812 PR gold/17498
813 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
814 temporary locals in merge sections.
815 * options.cc (General_options::parse_discard_all): New method.
816 (General_options::parse_discard_locals): New method.
817 (General_options::parse_discard_none): New method.
818 (General_options::General_options): Initialize discard_locals_.
819 * options.h (--discard-all): Convert to special option.
820 (--discard-locals): Likewise.
821 (--discard-none): New option.
822 (General_options::discard_all): New method.
823 (General_options::discard_locals): New method.
824 (General_options::discard_sec_merge): New method.
825 (General_options::Discard_locals): New enum.
826 (General_options::discard_locals_): New data member.
827
8086551f
CC
8282015-06-03 Cary Coutant <cary@google.com>
829
830 * script-sections.cc (Script_sections::Script_sections): Initialize
831 segments_created_.
832 (Script_sections::create_note_and_tls_segments): Set flag when
833 segments are created.
834 (Script_sections::expected_segment_count): Count PT_INTERP.
835 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
836 segments are created.
837 * script-sections.h (Script_sections::segments_created_): New data
838 member.
839
374082df
CC
8402015-06-03 Cary Coutant <ccoutant@gmail.com>
841
842 PR gold/15370
843 * script-sections.cc
844 (Output_section_element_input::set_section_addresses): When there
845 are several patterns with no sort spec, put all sections in the same
846 bin.
847 * testsuite/Makefile.am (script_test_12): New testcase.
848 (script_test_12i): New testcase.
849 * testsuite/Makefile.in: Regenerate.
850 * testsuite/script_test_12.t: New test linker script.
851 * testsuite/script_test_12i.t: New test linker script.
852 * testsuite/script_test_12a.c: New test source file.
853 * testsuite/script_test_12b.c: New test source file.
854
775ed62e
CC
8552015-06-02 Cary Coutant <ccoutant@gmail.com>
856
857 * nacl.h (Sniff_file): Switch parameters to get_view to get an
858 aligned view.
859
9c7fe3c5
CC
8602015-06-03 Cary Coutant <ccoutant@gmail.com>
861
72f4393d
L
862 PR gold/17819
863 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
864 separate task to schedule the build id computation.
865 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
866 add Output_file and offset.
867 (Hash_task::run): Get and release the input views.
868 (Hash_task::is_runnable): Always return NULL (always runnable).
869 (Layout::queue_build_id_tasks): Remove.
870 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
871 parameters; use them instead of class members.
872 (Build_id_task_runner::run): New function.
873 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
874 to write_build_id.
875 * layout.h (Layout::queue_build_id_tasks): Remove.
876 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
877 parameters.
878 (Layout::array_of_hashes_): Remove.
879 (Layout::size_of_array_of_hashes_): Remove.
880 (Layout::input_view_): Remove.
881 (Build_id_task_runner): New class.
882 (Close_task_runner::Close_task_runner): Add array_of_hashes and
883 size_of_hashes parameters.
884 (Close_task_runner::array_of_hashes_): New data member.
885 (Close_task_runner::size_of_hashes_): New data member.
886 * testsuite/Makefile.am
887 (flagstest_compress_debug_sections_and_build_id_tree): New test.
888 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 889
400f8944
RÁE
8902015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
891
892 * merge.cc (get_input_merge_map): Update for data structure change.
893 (get_or_make_input_merge_map): Update for data structure change.
894 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
895 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
896
bbec1a5d
AM
8972015-05-16 Alan Modra <amodra@gmail.com>
898
899 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
900 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
901 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
902 (lis_0): Rename from lis_0_0.
903
efc6fa12
CC
9042015-04-29 Cary Coutant <cary@google.com>
905 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
906
907 * gc.h (Garbage_collection::is_section_garbage): Change Object*
908 to Relobj*.
909 (Garbage_collection::add_reference): Likewise.
910 (Garbage_collection::gc_process_relocs): Likewise. Don't push
911 object/shndx pair onto *secvec for dynamic objects. Don't follow
912 relocations pointing to dynamic objects for GC.
913 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
914 (Icf::unfold_section): Likewise.
915 (Icf::is_section_folded): Likewise.
916 (Icf::get_folded_section): Likewise.
917 * icf.h: (Icf::get_folded_section): Likewise.
918 (Icf::unfold_section): Likewise.
919 (Icf::is_section_folded): Likewise.
920 (Icf::section_has_function_pointers): Likewise.
921 (Icf::set_section_has_function_pointers): Likewise.
922 * object.h (Section_id): Likewise.
923 (Const_section_id): Likewise.
924 * output.cc (Output_section::update_section_layout): Likewise.
925 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
926 Likewise.
927 * plugin.cc (update_section_order): Likewise.
928 (unique_segment_for_sections): Likewise.
929 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
930 (Target_powerpc::do_gc_add_reference): Likewise.
931 (Target_powerpc::gc_process_relocs): Likewise.
932 (Target_powerpc::do_gc_add_reference): Likewise.
933 * symtab.cc (Symbol_table::is_section_folded): Likewise.
934 (Symbol_table::gc_mark_symbol): Likewise.
935 * symtab.h: (Symbol_table::is_section_folded): Likewise.
936 * target.h: (Sized_target::gc_add_reference): Likewise.
937 (Sized_target::do_gc_add_reference): Likewise.
938
f9d3ecaa
NC
9392015-04-29 Nick Clifton <nickc@redhat.com>
940
941 * po/fi.po: Updated Finnish translation.
942
faa2211d
AM
9432015-04-28 Alan Modra <amodra@gmail.com>
944
945 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
946 than unsigned int for find_global_entry result temp. Compare
947 against invalid_address.
948 (Target_powerpc::do_plt_address_for_global): Likewise.
949 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
950 on plt call stub existence for debug info. Do assert for plt
951 and global entry stub existence if an alloc section.
952
6ec65f28
AM
9532015-04-28 Alan Modra <amodra@gmail.com>
954
955 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
956 on missing global entry stub due to bogus debug info.
957
7a2a1c79
HS
9582015-04-27 Han Shen <shenhan@google.com>
959
960 * options.h (--fix-cortex-a53-843419): Rename option.
961 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
962 option.
963 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
964
cfbf0e3c
RÁE
9652015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
966
967 PR gold/18327
968 * output.cc (Output_section::is_input_address_mapped): Assume a missing
969 entry is mapped.
970 * testsuite/Makefile.am: Add the eh_test test.
971 * testsuite/Makefile.in: Regenerate.
972 * testsuite/eh_test_a.cc: New test.
973 * testsuite/eh_test_b.cc: New test.
974
6ec65f28
AM
9752015-04-23 Sriraman Tallam <tmsriram@google.com>
976
a100d66f
ST
977 * options.h (--weak-unresolved-symbols): New option.
978 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
979 binding to weak with new option.
980 * symtab.h (is_weak_undefined): Check for new option.
981 (is_strong_undefined): Check for new option.
982 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
983 * testsuite/Makefile.in: Regenerate.
984 * testsuite/weak_unresolved_symbols_test.cc: New file.
985
4b889c30
IC
9862015-04-20 Ian Coolidge <icoolidge@google.com>
987
988 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
989 GNU_UNIQUE.
990
4277535c
RÁE
9912015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
992
993 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
994 push_back.
995 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
996 * object.cc (Sized_relobj_file::do_layout): Use push_back.
997 * powerpc.cc (process_gc_mark): Use push_back.
998 (Target_powerpc::do_gc_mark_symbol): Use push_back.
999 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
1000
7a2a1c79 10012015-04-16 Han Shen <shenhan@google.com>
5019d64a 1002
6ec65f28
AM
1003 * aarch64.cc (AArch64_insn_utilities): New utility class.
1004 (AArch64_relobj::Mapping_symbol_position): New struct.
1005 (AArch64_relobj::Mapping_symbol_info): New typedef.
1006 (AArch64_relobj::do_count_local_symbols): New function overriding
1007 parent's implementation.
1008 (AArch64_relobj::mapping_symbol_info_): New member
1009 (AArch64_relobj::scan_erratum_843419): New method.
1010 (Target_aarch64::scan_erratum_843419_span): New method.
1011 (Target_aarch64::is_erratum_843419_sequence): New method.
1012 * options.h (fix_cortex_a53): New option.
5019d64a 1013
a6a17750
CC
10142015-04-09 Cary Coutant <ccoutant@google.com>
1015
1016 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
1017 in a PIE link.
1018 * testsuite/Makefile.am (tls_pie_test.sh): New test.
1019 * testsuite/Makefile.in: Regenerate.
1020 * testsuite/tls_pie_test.sh: New.
1021
437ddf0c
CC
10222015-04-09 Cary Coutant <ccoutant@google.com>
1023
1024 * debug.h (DEBUG_LOCATION): New.
1025 (DEBUG_ALL): Include DEBUG_LOCATION.
1026 (debug_string_to_enum): Add DEBUG_LOCATION.
1027 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
1028 output to print correct context.
1029 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
1030 up to 4 more locations at the beginning of the function.
1031 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
1032 result before sorting list of line numbers.
1033 * testsuite/debug_msg.sh: Allow range of line numbers for
1034 canonical results on optimized code.
1035
24491327
HS
10362015-04-07 HC Yen <hc.yen@mediatek.com>
1037
1038 Add AArch32 support for gold linker.
1039 gold/
1040 * arm.cc: Add V8 arch combine table.
1041
7fa5525f
RÁE
10422015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1043
1044 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
1045
5368dcf2
RÁE
10462015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1047
1048 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
1049 to find by using the return value of insert.
1050
9dbb4b02
RÁE
10512015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1052
1053 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
1054 constructor call.
1055
1fa29f10
IT
10562015-04-06 Ilya Tocar <ilya.tocar@intel.com>
1057
1058 PR gold/17641
1059 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
1060 (Target_x86_64::Scan::local): Don't create GOT entry, when we
1061 can convert mov to lea.
1062 (Target_x86_64::Scan::global): Ditto.
1063 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
1064 %reg to lea foo(%rip), %reg if possible.
1065 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
1066 * testsuite/x86_64_mov_to_lea1.s: New.
1067 * testsuite/x86_64_mov_to_lea2.s: Ditto.
1068 * testsuite/x86_64_mov_to_lea3.s: Ditto.
1069 * testsuite/x86_64_mov_to_lea4.s: Ditto.
1070 * testsuite/x86_64_mov_to_lea.sh: Ditto.
1071
39f3de7c
L
10722015-04-02 H.J. Lu <hongjiu.lu@intel.com>
1073
1074 * configure: Regenerated.
1075
c4fc4724
IT
10762015-04-01 Ilya Tocar <ilya.tocar@intel.com>
1077
1078 PR gold/17640
1079 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1080 (Target_i386::Scan::local): Don't create GOT entry, when we
1081 can convert GOT to GOTOFF.
1082 (Target_i386::Scan::global): Ditto.
1083 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1084 lea foo@GOTOFF(%reg), %reg if possible.
1085 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1086 * testsuite/i386_mov_to_lea1.s: New.
1087 * testsuite/i386_mov_to_lea2.s: Ditto.
1088 * testsuite/i386_mov_to_lea3.s: Ditto.
1089 * testsuite/i386_mov_to_lea4.s: Ditto.
1090 * testsuite/i386_mov_to_lea5.s: Ditto.
1091 * testsuite/i386_mov_to_lea.sh: Ditto.
1092
918357b9
L
10932015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1094
1095 * Makefile.am (ZLIB): New.
1096 (ZLIBINC): Likewise.
1097 (AM_CFLAGS): Add $(ZLIBINC).
1098 (AM_CXXFLAGS): Likewise.
1099 (ldadd_varldadd_var): Add $(ZLIB).
1100 (incremental_dump_LDADD): Likewise.
1101 (dwp_LDADD): Likewise.
1102 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1103 <zlib.h>.
1104 (zlib_compress): Don't check HAVE_ZLIB_H.
1105 (zlib_decompress): Likewise.
1106 * options.h (compress_debug_sections): Likewise.
1107 * configure.ac (AM_CONDITIONAL): Removed.
1108 * testsuite/Makefile.am (ZLIB): New.
1109 (LDADD): Add $(ZLIB).
1110 Don't check HAVE_ZLIB.
1111 * Makefile.in: Regenerated.
1112 * config.in: Likewise.
1113 * configure: Likewise.
1114 * testsuite/Makefile.in: Likewise.
1115
6b0ad2eb
JY
11162015-03-30 Jing Yu <jingyu@google.com>
1117
1118 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1119 TLSLD_ADD_DTPREL_LO12_NC.
1120 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1121 _TLS_MODULE_BASE_ point to the start of tls segment.
1122 (Target_aarch64::optimize_tls_reloc): Add cases for
1123 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1124 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1125 (Target_aarch64::Scan::local): Likewise.
1126 (Target_aarch64::Scan::global): Likewise.
1127 (Target_aarch64::Relocate::relocate): Likewise.
1128 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1129 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1130 relocations.
1131
0916f9e7
RÁE
11322015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1133
1134 * merge.cc (Object_merge_map::add_mapping): call
1135 Object_merge_map::Input_merge_map::add_mapping.
1136 (Object_merge_map::Input_merge_map::add_mapping): New.
1137 (Output_merge_data::do_add_input_section): Call
1138 get_or_make_input_merge_map before a loop.
1139 (Output_merge_string<Char_type>::finalize_merged_data): Call
1140 get_or_make_input_merge_map before a loop.
1141 * merge.h (Object_merge_map): Make Input_merge_map public.
1142 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1143 (Relobj::get_or_create_merge_map): New.
1144 * object.h (Relobj::get_or_create_merge_map): New.
1145
282c9750
AM
11462015-03-24 Alan Modra <amodra@gmail.com>
1147
1148 PR 18147
1149 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1150 relocation errors for branches to strong undefined symbols.
1151
67f95b96
RÁE
11522015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1153
1154 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1155 (Object_merge_map::is_merge_section_for): Remove.
1156 (Object_merge_map::find_merge_section): New.
1157 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1158 (Object_merge_map::find_merge_section): New.
1159 (Object_merge_map::get_input_merge_map): Add a const version.
1160 * object.cc (Relobj::is_merge_section_for): Remove.
1161 (Relobj::find_merge_section): New.
1162 * object.h (Relobj::is_merge_section_for): Remove.
1163 (Relobj::find_merge_section): New.
1164 * output.cc
1165 (Output_section::Input_section::is_merge_section_for): Remove.
1166 (Output_section::add_merge_input_section): Don't call
1167 add_merge_input_section.
1168 (Output_section::find_merge_section): Return const. Use
1169 object->find_merge_section.
1170 (Output_section::build_lookup_maps): Don't build a map for
1171 merge sections.
1172 (Output_section::is_input_address_mapped): Return false if
1173 section is not found.
1174 (Output_section::find_starting_output_address): Use
1175 find_merge_section instead of is_merge_section_for.
1176 (Output_section::add_script_input_section): Don't build a map for
1177 merge sections.
1178 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1179 (Output_section_lookup_maps::find_merge_section): Remove.
1180 (Output_section_lookup_maps::add_merge_input_section) Remove.
1181 (Output_section::find_merge_section): Return const.
1182
152f7024
CC
11832015-03-22 Cary Coutant <cary@google.com>
1184
1185 PR gold/18106
1186 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1187 non-SIB form of lea, with nop after the call.
1188
bccffdfd
CC
11892015-03-21 Cary Coutant <cary@google.com>
1190
1191 PR gold/14217
1192 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1193 .tdata section.
1194 (Output_segment::set_section_addresses): Don't align size of relro
1195 segment for .tbss.
1196
1c582fe7
CC
11972015-03-21 Cary Coutant <cary@google.com>
1198
1199 PR gold/18010
1200 * stringpool.cc (Stringpool_template): Don't optimize if section
1201 alignment is greater than sizeof(char).
1202
410da591
CC
12032015-03-21 Cary Coutant <cary@google.com>
1204
1205 PR gold/18048
1206 * script-c.h (script_include_directive): Add first_token parameter.
1207 * script.cc (script_include_directive): Add first_token parameter, and
1208 pass it to read_script_file.
1209 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1210 (PARSING_MEMORY_DEF): New tokens.
1211 (top): Add new productions for INCLUDE files.
1212 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1213 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1214 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1215 (section_cmd): Pass PARSING_SECTION_CMDS.
1216 (file_or_sections_cmd): Remove.
1217 (memory_def): Pass PARSING_MEMORY_DEF.
1218 * testsuite/Makefile.am (memory_test_2): New test.
1219 * testsuite/Makefile.in: Regenerate.
1220 * testsuite/memory_test_inc.t: New script file.
1221 * testsuite/memory_test_inc_1.t.src: New script file.
1222 * testsuite/memory_test_inc_2.t.src: New script file.
1223 * testsuite/memory_test_inc_3.t.src: New script file.
1224
0d5bbdb0
CC
12252015-03-21 Cary Coutant <cary@google.com>
1226
1227 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1228 (Sized_relobj_dwo::setup): Build compressed section map.
1229 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1230 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1231 section map.
1232 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1233 compressed_sections_ field.
1234 (build_compressed_section_map): Take Object instead of
1235 Sized_relobj_file parameter; add decompress_if_needed parameter.
1236 (Sized_relobj_file::do_find_special_sections): Store compressed
1237 section map in parent Object.
1238 (Sized_relobj_file::do_decompressed_section_contents): Move
1239 implementation to Object::decompressed_section_contents.
1240 (Sized_relobj_file::do_discard_decompressed_sections): Move
1241 implementation to Object::discard_decompressed_sections.
1242 * object.h (build_compressed_section_map): Declare.
1243 (Object::Object): Add compressed_sections_ field.
1244 (Object::section_is_compressed): Move implementation here.
1245 (Object::decompressed_section_contents): De-virtualize.
1246 (Object::discard_decompressed_sections): De-virtualize.
1247 (Object::do_section_is_compressed): Delete.
1248 (Object::do_decompressed_section_contents): Delete.
1249 (Object::set_compressed_sections): New method.
1250 (Object::compressed_sections): New method.
1251 (Object::compressed_sections_): New data member.
1252 (Compressed_section_info, Compressed_section_map): Move to top of file.
1253 (Sized_relobj_file::do_section_is_compressed): Delete.
1254 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1255 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1256 (Sized_relobj_file::compressed_sections_): Move to Object class.
1257
bd9e0d46
CC
12582015-03-21 Cary Coutant <ccoutant@google.com>
1259
1260 PR gold/18152
1261 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1262 deferred objects.
1263
943c8b43
CC
12642015-03-11 Cary Coutant <ccoutant@google.com>
1265
1266 * options.cc (General_options::finalize): Don't allow -z relro
1267 with incremental linking.
1268 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1269 (incremental_test_2): Likewise.
1270 (incremental_test_3): Likewise.
1271 (incremental_test_4): Likewise.
1272 (incremental_test_5): Likewise.
1273 (incremental_test_6): Likewise.
1274 (incremental_copy_test): Likewise.
1275 (incremental_common_test_1): Likewise.
1276 (incremental_comdat_test_1): Likewise.
1277 * testsuite/Makefile.in: Regenerate.
1278
e1663197
CC
12792015-03-09 Cary Coutant <ccoutant@google.com>
1280
1281 PR gold/14675
1282 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1283 return enum indicating whether .eh_frame section is empty, optimizable,
1284 unrecognized, or an end marker. Adjust explicit instantiations.
1285 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1286 (Eh_frame::add_ehframe_input_section): Change return type.
1287 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1288 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1289 to the .eh_frame output section until we see the end marker.
1290 (Layout::finalize_eh_frame_section): New.
1291 * layout.h: (Layout::finalize_eh_frame_section): New.
1292
beb8418f
L
12932015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1294
1295 * output.cc (Relobj::initialize_input_to_output_map<size>):
1296 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1297
48c73428
CC
12982015-03-04 Cary Coutant <ccoutant@google.com>
1299
1300 * parameters.cc (Parameters::set_target_once): Call
1301 Target::select_as_default_target just once from here...
1302 (set_parameters_target): ...instead of from here.
1303
13042015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1305
1306 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1307 Output_section_data instead of a Merge_map.
1308 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1309 (Eh_frame::read_cie): Use add_merge_mapping instead of
1310 Merge_map::add_mapping.
1311 (Eh_frame::read_fde): Ditto.
1312 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1313 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1314 merge_map_->get_output_offset.
1315 (Eh_frame::do_is_merge_section_for): Delete.
1316 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1317 instead of a Merge_map.
1318 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1319 Merge_map.
1320 (Eh_frame::do_is_merge_section_for): Delete.
1321 (Eh_frame::merge_map_): Delete.
1322 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1323 and use a Output_section_data instead of a Merge_map.
1324 (Object_merge_map::add_mapping): Ditto.
1325 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1326 (Object_merge_map::is_merge_section_for): Pass in and use a
1327 Output_section_data instead of a Merge_map.
1328 (Merge_map): Delete.
1329 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1330 of merge_map_.get_output_offset.
1331 (Output_merge_base::do_is_merge_section_for): Delete.
1332 (Output_merge_data::do_add_input_section): Use
1333 object->add_merge_mapping instead of add_mapping.
1334 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1335 * merge.h (Merge_map): Delete forward declaration.
1336 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1337 instead of a Merge_map.
1338 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1339 (Object_merge_map::is_merge_section_for): Pass in and use a
1340 Output_section_data instead of a Merge_map.
1341 (Input_merge_map::Object_merge_map::merge_map): Replace with
1342 output_data.
1343 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1344 Output_section_data instead of a Merge_map.
1345 (Merge_map): Delete.
1346 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1347 (Output_merge_base::do_is_merge_section_for): Delete.
1348 (Output_merge_base::add_mapping): Delete.
1349 (Output_merge_base::merge_map_): Delete.
1350 * object.cc (Relobj::initialize_input_to_output_map): New.
1351 (Relobj::initialize_input_to_output_map): New.
1352 (Relobj::merge_output_offset): New.
1353 (Relobj::is_merge_section_for): New.
1354 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1355 bits.
1356 * object.h (Relobj::merge_map): Delete.
1357 (initialize_input_to_output_map): New.
1358 (set_merge_map): Delete.
1359 (add_merge_mapping): New.
1360 (merge_output_offset): New.
1361 (is_merge_section_for): New.
1362 * output.cc (Output_section::Input_section::is_merge_section_for):
1363 Use object->is_merge_section_for.
1364 * output.h (Output_section_data::is_merge_section_for): Delete.
1365 (Output_section_data::do_is_merge_section_for): Delete.
1366 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1367 Use object->initialize_input_to_output_map.
1368 (Merged_symbol_value<size>::value_from_output_section): Use
1369 object->merge_output_offset.
1370
48c73428 13712015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1372 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1373
1374 * output.cc (Output_section::add_merge_input_section): Do not
1375 attempt to merge sections with an entsize of 0.
1376
48c73428 13772015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1378
1379 * attributes.h (class Output_attributes_section_data ): Add
1380 do_print_to_mapfile function.
1381
ec86f434
AM
13822015-02-24 Alan Modra <amodra@gmail.com>
1383
1384 PR 18010
1385 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1386 complain if value is not a multiple of four.
1387 (Target_powerpc::Relocate::relocate): Correct handling of
1388 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1389
be66981e
L
13902015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1391
1392 * configure.ac (default_size): Set to 32 for x32.
1393 * configure: Regenerated.
1394
e3ee8ed4
AM
13952015-02-18 Alan Modra <amodra@gmail.com>
1396
1397 PR 17954
1398 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1399 visibility.
1400
3a935c6c
RÁE
14012015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1402
1403 * gc.h (Garbage_collection::add_reference): Don't use find.
1404
e0a1e121
RÁE
14052015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1406
1407 * object.cc (write_local_symbols): avoid std::vector copy.
1408
45a4fb1a
RÁE
14092015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1410
1411 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1412
2d9afefe
MW
14132015-02-09 Mark Wielaard <mjw@redhat.com>
1414
1415 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1416 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1417
e9c1bdad
CC
14182015-02-16 Cary Coutant <ccoutant@google.com>
1419
1420 PR gold/13577
1421 PR gold/16992
1422 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1423 DF_SYMBOLIC if --dynamic-list option is used.
1424 * options.cc (General_options::finalize): --dynamic-list is not
1425 mutually exclusive with -Bsymbolic.
1426 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1427 listed in --dynamic-list.
1428 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1429 -Bsymbolic-functions.
1430 * testsuite/Makefile.in: Regenerate.
1431
0ed4b0bf
CC
14322015-02-16 Cary Coutant <ccoutant@google.com>
1433
1434 PR gold/17971
1435 * incremental.cc: Remove redundant include of "output.h".
1436
1a920511
JY
14372015-02-12 Jing Yu <jingyu@google.com>
1438
1439 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1440 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1441 New relocation.
1442 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1443 TLSLE_MOVW_* relocations.
1444 (Target_aarch64::Scan::global): Likewise.
1445 (Target_aarch64::Relocate::relocate): Likewise.
1446 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1447 for new TLSLE_MOVW_* relocations.
1448
07f107f3
WN
14492015-02-11 Will Newton <will.newton@linaro.org>
1450
1451 PR gold/13321
1452 * arm.cc (Target_arm::make_plt_section): Create an ARM
1453 state mapping symbol at the start of the PLT.
1454
e051a5b5
L
14552015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1456
1457 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1458 Replace two_file_shared_2.so with two_file_shared_1.so.
1459 * testsuite/Makefile.in: Regenerated.
1460
dddcc5b9
AM
14612015-02-09 Alan Modra <amodra@gmail.com>
1462
1463 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1464 plugin_test_thin.a and defsym_test.
1465 * testsuite/Makefile.in: Regenerate.
1466
b39b8b9d
RÁE
14672015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1468
1469 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1470 body.
1471
b66d1c52
CC
14722015-02-04 Peter Collingbourne <pcc@google.com>
1473
1474 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1475 forwarding symbols when computing symbol resolution info for plugins.
1476 * plugin.h (Plugin_manager::symtab): New method.
1477 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1478
23081de0
CC
14792015-02-03 Cary Coutant <ccoutant@google.com>
1480 Peter Collingbourne <pcc@google.com>
1481
1482 PR gold/15660
1483 * archive.cc (Thin_archive_object_unlocker): New class.
1484 (Archive::include_member): Unlock external members of thin archives.
1485 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1486 (plugin_test_2): Likewise.
1487 (plugin_test_3): Likewise.
1488 (plugin_test_4): Likewise.
1489 (plugin_test_5): Likewise.
1490 (plugin_test_6): Likewise.
1491 (plugin_test_7): Likewise.
1492 (plugin_test_8): Likewise.
1493 (plugin_test_9): Likewise.
1494 (plugin_test_10): Likewise.
1495 (plugin_test_11): New test case.
1496 * testsuite/Makefile.in: Regenerate.
1497 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1498 file to decide whether to claim file.
1499 (all_symbols_read_hook): Likewise.
1500 * testsuite/plugin_test_1.sh: Adjust expected output.
1501 * testsuite/plugin_test_2.sh: Likewise.
1502 * testsuite/plugin_test_3.sh: Likewise.
1503 * testsuite/plugin_test_6.sh: Likewise.
1504 * testsuite/plugin_test_tls.sh: Likewise.
1505 * testsuite/plugin_test_11.sh: New testcase.
1506
15072015-02-03 Cary Coutant <ccoutant@google.com>
1508
1509 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1510 file descriptors when debugging enabled. Add debug output.
1511 (Descriptors::release): Add debug output.
1512 (Descriptors::close_some_descriptor): Likewise.
1513 (Descriptors::close_all): Likewise.
1514 * fileread.cc (File_read::lock): Likewise.
1515 (File_read::unlock): Likewise.
1516
24dd5808
CC
15172015-02-02 Cary Coutant <ccoutant@google.com>
1518
1519 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1520 executable output file.
1521
fa89cc82
HS
15222015-01-22 Han Shen <shenhan@google.com>
1523
1524 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1525 (Target_arm::do_plt_address_for_global): New method.
1526 (Target_arm::do_plt_address_for_local): New method.
1527 (Target_arm::rel_irelative_section): New method.
1528 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1529 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1530 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1531 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1532 (Target_arm::Scan::check_non_pic): Add ifunc support.
1533 (Target_arm::Scan::local): Add ifunc support.
1534 (Target_arm::Scan::global): Add ifunc support.
1535 (Target_arm::make_plt_section): New method.
1536 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1537 (Target_arm::make_local_ifunc_plt_entry): New method.
1538 (Target_arm::got_irelative_): New member.
1539 (Target_arm::rel_irelative_): New member.
1540 (Target_arm::got_section): Add creation for got_irelative_.
1541 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1542 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1543 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1544 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1545 (Output_data_plt_arm::IRelative_data): New type.
1546 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1547 (Output_data_plt_arm::add_entry): Add more parameters.
1548 (Output_data_plt_arm::add_relocation): New method.
1549 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1550 (Output_data_plt_arm::rel_irelative): New method.
1551 (Output_data_plt_arm::entry_count): Modified.
1552 (Output_data_plt_arm::address_for_global): New method.
1553 (Output_data_plt_arm::address_for_local): New method.
23081de0 1554gold/
fa89cc82
HS
1555 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1556 (Output_data_plt_arm::insert_irelative_data): New method.
1557 (Output_data_plt_arm::irelative_rel_): New member.
1558 (Output_data_plt_arm::got_): New member.
1559 (Output_data_plt_arm::got_irelative_): New member.
1560 (Output_data_plt_arm::irelative_count_): New member.
1561 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1562 (Output_data_plt_arm::irelative_data_vec_): New member.
1563 (Output_data_plt_arm::do_write): Write out irelative entries.
1564 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1565 more parameters to ctor.
1566 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1567 more parameters to ctor.
1568 * output.h (Output_data_reloc::add_local_relative): New method.
1569 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1570
0f81d3f0
AM
15712015-01-29 Alan Modra <amodra@gmail.com>
1572
1573 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1574 and GOT_TLSGD to LE optimization.
1575
65d92137
CC
15762015-01-28 Cary Coutant <ccoutant@google.com>
1577
1578 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1579 for undef TLS symbols.
1580 (Target_x86_64::Relocate::relocate_tls): Likewise.
1581 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1582
5485698a
CC
15832015-01-25 Cary Coutant <ccoutant@google.com>
1584
1585 * output.cc (Output_segment::set_section_addresses): Fix calculation
1586 of size of relro segment.
1587
b01a4b04
AM
15882015-01-22 Alan Modra <amodra@gmail.com>
1589
1590 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1591 condition for need of ifunc plt entry.
1592 (Target_powerpc::Scan::global <got relocs>): Likewise.
1593
3d0064a9
CC
15942015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1595
1596 * mips.cc (reloc_high): Add r_sym.
1597 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1598 reloc_high constructor.
1599 (Mips_relocate_functions::relgot16_local): Likewise.
1600 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1601 r_type to decide whether LO16 matches HI16.
1602 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1603 rello16 and relgot16_local.
1604
a5cd8f05
CC
16052015-01-09 Cary Coutant <ccoutant@google.com>
1606
1607 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1608 unless alignment is larger than page size.
1609
4fc1b9d4
L
16102015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1611 Cary Coutant <ccoutant@google.com>
1612
1613 PR gold/17729
1614 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1615 (DEFAULT_TARGET_X32): Set for x32.
1616 * x86_64.cc (cmp_insn_32): New.
1617 (lea_r10_insn_32): Likewise.
1618 (lea_r11_insn_32): Likewise.
1619 (cmp_insn_64): Likewise.
1620 (lea_r10_insn_64): Likewise.
1621 (lea_r11_insn_64): Likewise.
1622 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1623 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1624 (check_DATA): Add split_x32 files.
1625 (split_x32_[1234n].o): New targets.
1626 (split_x32_[124]): New targets.
1627 (split_x32_[1234r].stdout): New targets.
1628 * testsuite/split_x32.sh: New file.
1629 * testsuite/split_x32_1.s: Likewise.
1630 * testsuite/split_x32_2.s: Likewise.
1631 * testsuite/split_x32_3.s: Likewise.
1632 * testsuite/split_x32_4.s: Likewise.
1633 * testsuite/split_x32_n.s: Likewise.
1634 * configure: Regenerated.
1635 * testsuite/Makefile.in: Likewise.
1636
e749cab8
L
16372015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1638
1639 PR gold/17809
1640 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1641 x32.
1642
af759df0
AM
16432015-01-02 Alan Modra <amodra@gmail.com>
1644
1645 * version.cc (print_version): Just print current year.
1646 * dwp.cc (print_version): Likewise.
1647
b90efa5b
AM
16482015-01-01 Alan Modra <amodra@gmail.com>
1649
1650 Update year range in copyright notice of all files.
1651
f12d1e8a
AM
16522014-12-25 Alan Modra <amodra@gmail.com>
1653
1654 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1655 new enums.
1656 (Target_arm::merge_object_attributes, ): Likewise.
1657
5c294fee
TG
16582014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1659
1660 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1661 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1662 AEABI_VFP_args_vfp to check that.
1663 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1664 value and replace hardcoded values by enum values.
1665
e30880c2
CC
16662014-12-22 Cary Coutant <ccoutant@google.com>
1667
1668 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1669
bd040da1
L
16702014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1671
1672 PR gold/14608
1673 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1674 to "return i * i * 3;".
1675
e02a4046
CC
16762014-12-16 Cary Coutant <ccoutant@google.com>
1677
1678 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1679 (Mapfile::print_output_data): Use current_data_size() to avoid
1680 assert for sections requiring postprocessing; if address is not valid,
1681 print 0.
1682 (Mapfile::print_output_section): Use current_data_size(); print note
1683 that addresses and sizes are before compression.
1684
add6016b
L
16852014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1686
1687 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1688 Cast current_group_size to unsigned long when reporting error.
1689
0bf32ea9
JY
16902014-12-10 Jing Yu <jingyu@google.com>
1691
1692 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1693 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1694 Update error message.
1695 (Target_aarch64::do_relax): Use absolute value of option
1696 stub_group_size. Replace local variable with class member
1697 stub_group_size_.
1698
cbcb23fa
AM
16992014-12-04 Alan Modra <amodra@gmail.com>
1700
1701 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1702 addend of PLTREL24 reloc when not generating a plt stub. Make
1703 max_branch_offset an "Address".
fbad6518 1704 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1705 (Target_powerpc::Relocate::relocate): Likewise.
1706
1611bc4a
AM
17072014-12-04 Alan Modra <amodra@gmail.com>
1708
1709 PR 17670
1710 * symtab.cc (Symbol::set_undefined): Remove assertion.
1711 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1712 on symbols defined in discarded sections, instead return false.
1713 Rearrange params, update all callers.
1714 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1715 branches to syms in discarded sections.
1716 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1717 undefined and flag as discarded.
1718 (Target_powerpc::Relocate::relocate): Localize variable.
1719
4759c34e
L
17202014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1721
1722 PR gold/17675
1723 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1724 * testsuite/Makefile.in: Regenerated.
1725
1f98a074
AM
17262014-12-03 Alan Modra <amodra@gmail.com>
1727
1728 PR 17566
1729 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1730 when adding dynamic relocations against section symbols.
1731
fb257835
DI
17322014-12-01 Dimitry Ivanov <dimitry@google.com>
1733
1734 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1735 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1736 * options.h (General_options): New -z option (global).
1737
d8e60314
CC
17382014-12-01 Cary Coutant <ccoutant@google.com>
1739
1740 PR gold/17578
1741 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1742 is given.
1743 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1744 given but some inputs require executable stack.
1745
982bbd97
CC
17462014-11-26 Cary Coutant <ccoutant@google.com>
1747
1748 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1749 .debug_str_offsets; strip .debug_gnu_pubnames and
1750 .debug_gnu_pubtypes.
1751 (lines_only_debug_sections): Strip all four new sections.
1752
bb779192
HS
17532014-11-26 Jing Yu <jingyu@google.com>
1754
1755 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1756 register to be x0 when to relax TLSDESC_LD64_LO12.
1757
a3e60ddb
AM
17582014-11-26 Alan Modra <amodra@gmail.com>
1759
1760 * powerpc.cc (struct Stub_table_owner): New.
1761 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1762 unsigned int vector. Update all references.
1763 (powerpc_relobj::set_stub_table): Take an unsigned int param
1764 rather than a Stub_table. Update callers.
1765 (Powerpc_relobj::clear_stub_table): New function.
1766 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1767 stub_group_size_ vars.
1768 (Target_powerpc::new_stub_table): Delete.
1769 (max_branch_delta): New function, extracted from..
1770 (Target_powerpc::Relocate::relocate): ..here..
1771 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1772 status on whether stub created successfully.
1773 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1774 default sizing to..
1775 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1776 reduce on relax failure.
1777 (Target_powerpc::group_sections): Add "no_size_errors" param.
1778 Use stub_group_size_. Set up group info in a temp vector,
1779 before building Stub_table vector. Account for input sections
1780 possibly already converted to relaxed sections.
1781 (Stub_table::init): Delete. Merge into..
1782 (Stub_table::Stub_table): ..here.
1783 (Stub_table::can_reach_stub): New function.
1784 (Stub_table::add_plt_call_entry): Add "from" parameter and
1785 return true iff stub could be reached.
1786 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1787 param too.
1788 (Stub_table::clear_stubs): Add "all" param.
1789
a20605cf
AM
17902014-11-26 Alan Modra <amodra@gmail.com>
1791
1792 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1793 (Target_powerpc::group_sections): Use it.
1794
43b64deb
CC
17952014-11-25 Cary Coutant <ccoutant@google.com>
1796
1797 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1798 (Binary_to_elf::write_symbol): Add st_size parameter.
1799 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1800
c924eb67
CC
18012014-11-25 Cary Coutant <ccoutant@google.com>
1802
1803 PR gold/17639
1804 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1805 (Sized_relobj_file::do_layout): Handle deferred sections properly
1806 during GC pass 1. Don't add reloc sections to deferred list twice.
1807 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1808 (Sized_relobj_file::is_deferred_layout_): New data member.
1809
9d585188
L
18102014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1811
1812 PR gold/17619
1813 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1814 Check PC-relative offset overflow in PLT entry.
1815
3ffaac20
AM
18162014-11-21 Alan Modra <amodra@gmail.com>
1817
1818 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1819 for undefined weaks.
1820
0cfb0717
AM
18212014-11-20 Alan Modra <amodra@gmail.com>
1822
1823 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1824 from --stub-group-size parameter divided by 1024.
1825 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1826 template parameter. Update all uses.
1827 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1828 has_stub_value. Set for long branches. Don't report overflow for
1829 branch to undefined weak symbols. Print info message on
1830 overflowing branch to stub.
1831
f9dffbf0
AM
18322014-11-20 Alan Modra <amodra@gmail.com>
1833
1834 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1835
e88ba8d5
L
18362014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1837
1838 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1839 entry for R_X86_64_GOTPLT64.
1840 (Target_x86_64<size>::Relocate::relocate): Update comments for
1841 R_X86_64_GOTPLT64.
1842
d37ffe25
ED
18432014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1844
1845 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1846 * plugin.h: add lock definition
1847
9726c3c1
HS
18482014-10-29 Han Shen <shenhan@google.com>
1849 Jing Yu <jingyu@google.com>
1850
1851 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1852 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1853 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1854 Symbol::TLS_REF.
1855 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1856 method.
1857 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1858 (Target_aarch64::tls_ld_to_le): New method.
1859 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1860 for 64bit targets.
1861 (Output_data_plt_aarch64::irelative_rel_): New data member.
1862 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1863 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1864 (Output_data_plt_aarch64::add_relocation): New method.
1865 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1866 offset. Add got_irelative size to got size.
1867 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1868 type string with the new typename.
1869 (AArch64_relocate_functions::update_adr): Replace parameter x with
1870 immed.
1871 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1872 (AArch64_relocate_functions::reloc_common): New method.
1873 (AArch64_relocate_funcsions::rela_general): Extract common part out
1874 into reloc_common method.
1875 (AArch64_relocate_functions::rela_general): Likewise.
1876 (AArch64_relocate_functions::pcrela_general): Likewise.
1877 (AArch64_relocate_functions::adr): New method.
1878 (AArch64_relocate_functions::adrp): Calculate immed before calling
1879 update_adr.
1880 (AArch64_relocate_functions::adrp): Likewise.
1881 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1882 comparing x to 0. Calculate immed from ~x when x < 0.
1883 (Target_aarch64::optimize_tls_reloc): Add new cases for
1884 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1885 TLSLD_MOVW_DTPREL_G0_NC.
1886 (Target_aarch64::possible_function_pointer_reloc): Implement this
1887 method.
1888 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1889 comment.
1890 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1891 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1892 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1893 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1894 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1895 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1896 (Target_aarch64::make_plt_entry): Call add_entry with two more
1897 parameters.
1898 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1899 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1900 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1901 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1902 (Target_aarch64::Relocate::relocate_tls): Add cases for
1903 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1904 TLSLD_MOVW_DTPREL_G0_NC.
1905 * testsuite/icf_safe_so_test.cc: Correct test comment.
1906 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1907
80272b8c
AM
19082014-10-22 Alan Modra <amodra@gmail.com>
1909
1910 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1911 thread_starter.
1912
998a69f4
AS
19132014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1914
1915 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1916
aed56ec5
CC
19172014-10-17 Cary Coutant <ccoutant@google.com>
1918
1919 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1920 Add "typename" keyword.
1921
bb779192 19222014-10-15 Han Shen <shenhan@google.com>
72f4393d 1923 Jing Yu <jingyu@google.com>
83a01957
HS
1924
1925 Patch for gold aarch64 backend to support relaxation.
1926 * aarch64-reloc.def: Change format.
1927 * aarch64.cc (class Reloc_stub): New class.
1928 (class Stub_table): New class.
1929 (class AArch64_relobj): New class.
1930 (class AArch64_input_section): New class.
1931 (class AArch64_output_section): New class.
1932 (Target_aarch64::new_stub_table): New method.
1933 (Target_aarch64::new_aarch64_input_section): New method.
1934 (Target_aarch64::find_aarch64_input_section): New method.
1935 (Target_aarch64::scan_section_for_stubs): New method.
1936 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1937 (Target_aarch64::relocate_stub): New method.
1938 (Target_aarch64::current_target): New method.
1939 (Target_aarch64::do_make_elf_object): New method.
1940 (Target_aarch64::do_may_relax): New method.
1941 (Target_aarch64::do_relax): New method.
1942 (Target_aarch64::group_sections): New method.
1943 (Target_aarch64::scan_reloc_for_stub): New method.
1944 (Target_aarch64::do_make_output_section): New method.
1945 (Target_aarch64::stub_tables_): New data member.
1946 (Target_aarch64::aarch64_input_section_map_): New data member.
1947 (AArch64_relocate_functions::maybe_apply_stub): New method.
1948
db4c9594
CC
19492014-09-30 Cary Coutant <ccoutant@google.com>
1950
1951 PR gold/17432
1952 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1953
cd6da036
KC
19542014-09-30 Kito Cheng <kito@0xlab.org>
1955
1956 PR gold/13597
1957 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1958 hash table before sysv-style hash table.
1959
5f772412
ST
19602014-09-29 Sriraman Tallam <tmsriram@google.com>
1961
1962 * options.h (--pic-executable): Add negative to alias to -no-pie.
1963
5efeedf6
CC
19642014-09-26 Cary Coutant <ccoutant@google.com>
1965
1966 PR gold/16773
1967 * object.cc (Sized_relobj_file): Compute value of section symbols
1968 for TLS sections the same as TLS symbols.
1969
1707f183
CC
19702014-09-25 Cary Coutant <ccoutant@google.com>
1971
1972 PR gold/17432
1973 * resolve.cc (Symbol_table::resolve): Override common placeholder
1974 symbols, but adjust sizes.
1975 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1976 symbols to common lists.
1977
00cac886
AM
19782014-09-24 Alan Modra <amodra@gmail.com>
1979
1980 * po/POTFILES.in: Regenerate.
1981
635aa30e 19822014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1983 Cary Coutant <ccoutant@google.com>
635aa30e 1984
71b9b91b 1985 PR gold/14860
635aa30e
CC
1986 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1987 on input_sections_blocker.
1988 * layout.cc (Write_sections_task::locks): Unblock
1989 input_sections_blocker_.
1990 * layout.h (Write_sections_task::Write_sections_task): Add
1991 input_sections_blocker.
1992 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1993 to DEPENDENCIES.
1994 * testsuite/Makefile.in: Regenerate.
1995
c0c71592
RÁE
19962014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1997
1998 * testsuite/Makefile.am (plugin_test_10): New test.
1999 * testsuite/Makefile.in: Regenerate
2000 * testsuite/plugin_common_test_2.c (c1): Align to 8.
2001 * testsuite/plugin_test_10.sh: New file.
2002
6168c2a1
RÁE
20032014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2004
2005 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
2006 * resolve.cc (Symbol_table::resolve): Don't override common symbols
2007 during the replacement phase.
2008
3a531937
JY
20092014-09-17 Han Shen <shenhan@google.com>
2010 Jing Yu <jingyu@google.com>
2011
2012 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
2013 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
2014 * aarch64.cc (Target_aarch64): Add data members
2015 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
2016 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
2017 constructor.
2018 (Target_aarch64::do_reloc_symbol_index): New method.
2019 (Target_aarch64::do_reloc_addend): New method.
2020 (Target_aarch64::add_tlsdesc_info): New method.
2021 (Target_aarch64::do_dynsym_value): New method.
2022 (Target_aarch64::do_make_data_plt): Add new parameters: got,
2023 got_irelative. Pass them to Output_data_plt_aarch64_standard.
2024 (Target_aarch64::make_data_plt): Add new parameters: got,
2025 got_irelative. Pass them to do_make_data_plt.
2026 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
2027 (Target_aarch64::Relocate:tls_gd_to_le): New method.
2028 (Target_aarch64::Relocate:tls_ie_to_le): New method.
2029 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
2030 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
2031 (Target_aarch64::got_tlsdesc_section): New method.
2032 (Target_aarch64::make_local_ifunc_plt_entry): New method.
2033 (Target_aarch64::define_tls_base_symbol): New method.
2034 (Target_aarch64::reserve_tlsdesc_entries): New method.
2035 (Target_aarch64::got_mod_index_entry): New method.
2036 (Target_aarch64::rela_tlsdesc_section): New method.
2037 (Target_aarch64::rela_irelative_section): New method.
2038 (Target_aarch64::Tlsdesc_info): New struct.
2039 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
2040 relocations and tlsdesc relocations.
2041 (Target_aarch64::optimize_tls_reloc): Implement method.
2042 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
2043 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
2044 in constructor.
2045 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
2046 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
2047 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
2048 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
2049 (Output_data_plt_aarch64::rela_tlsdesc): New method.
2050 (Output_data_plt_aarch64::rela_irelative): New method.
2051 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
2052 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
2053 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
2054 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
2055 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
2056 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
2057 (Output_data_plt_aarch64_standard): New member variables:
2058 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
2059 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
2060 New parameter: got, got_irelative.
2061 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
2062 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
2063 (Output_data_plt_aarch64::do_write): Replace got_address with
2064 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
2065 (AArch64_relocate_functions::update_movnz): New method.
2066 (AArch64_relocate_functions): Correct format.
2067 (AArch64_relocate_functions::movnz): New method.
2068 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
2069 before the switch. Add new cases to switch.
00cac886 2070 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
2071 tlsgd tlsdesc cases.
2072 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
2073 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
2074 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
2075 Call reloc_name_in_error_message to print unsupported reloc.
2076 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
2077 make_data_plt.
2078 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
2079 relocs. Fill in some more dynamic tags.
2080 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2081 Skip call tls_get_addr when tlsgd is relaxed.
2082 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2083 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2084 tlsdesc->ie relaxation.
2085
62661c93
SS
20862014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2087
2088 * mips.cc (Target_mips_nacl): New class.
2089 (Target_selector_mips_nacl): New class.
2090 (target_selector_mips32): Rename from target_selector_mips32be and use
2091 Target_selector_mips_nacl instead of Target_selector_mips.
2092 (target_selector_mips32el): Rename from target_selector_mips32 and use
2093 Target_selector_mips_nacl instead of Target_selector_mips.
2094 (target_selector_mips64): Rename from target_selector_mips64be and use
2095 Target_selector_mips_nacl instead of Target_selector_mips.
2096 (target_selector_mips64el): Rename from target_selector_mips64 and use
2097 Target_selector_mips_nacl instead of Target_selector_mips.
2098 (Target_mips::mips_info): Add const attribute.
2099
54674d38
CC
21002014-09-02 Cary Coutant <ccoutant@google.com>
2101
2102 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2103 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2104 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2105 (Sized_incr_dynobj::do_section_name): Likewise.
2106 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2107 (Sized_incr_dynobj::do_section_name): Likewise.
2108 * object.h (Object::section_name): Likewise.
2109 (Object::do_section_name): Likewise.
2110 (Sized_relobj_file::do_section_name): Likewise.
2111 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2112 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2113
9860cbcf
CC
21142014-09-02 Cary Coutant <ccoutant@google.com>
2115
2116 PR gold/17005
2117 * ehframe.cc (Fde::write): Add output_offset parameter.
2118 (Cie::write): Likewise.
2119 (Eh_frame::set_final_data_size): Account for offset within output
2120 section.
2121 (Eh_frame::do_sized_write): Likewise.
2122 * ehframe.h (Fde::write): Add output_offset parameter.
2123 (Cie::write): Likewise.
2124 * output.cc (Output_section::Input_section_sort_entry): Remove
2125 section_has_name_; add output_section_name parameter. Use
2126 output section name for non-input sections.
2127 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2128 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2129 (Output_section::Input_section_sort_compare): Remove logic for
2130 sections without names.
2131 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2132 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2133 Likewise.
2134 (Output_section::Input_section_sort_section_name_compare): Likewise.
2135
8e33481e
HS
21362014-08-29 Han Shen <shenhan@google.com>
2137 Jing Yu <jingyu@google.com>
2138
2139 * aarch64-reloc-property.cc
2140 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2141 reference reloc property in the table.
2142 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2143 3 other entries.
2144 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2145 2 new overloaded methods.
2146 (Output_data_got_aarch64::do_write): Add code to write out
2147 static relocs.
2148 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2149 static relocs.
2150 (Output_data_got_aarch64::static_relocs): New vector to
2151 hold static relocs.
2152 (Target_aarch64::TCB_SIZE): New const static memeber.
2153 (Target_aarch64::tcb_size): New method.
2154 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2155 (Target_aarch64::Relocate::relocate_tls): New method.
2156 (Target_aarch64::Scan::local): Add code handling new reloc types.
2157 (Target_aarch64::Scan::global): Add code handling new reloc types.
2158
81233653
ST
21592014-08-13 Sriraman Tallam <tmsriram@google.com>
2160
2161 * options.h (-no-pie): Add option.
2162
9363c7c3
JY
21632014-08-08 Jing Yu <jingyu@google.com>
2164 Han Shen <shenhan@google.com>
2165
2166 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2167 (DEFFILES): add aarch64-reloc.def.
2168 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2169 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2170 * Makefile.in: Regenerate.
2171 * aarch64-reloc-property.cc: New file.
2172 * aarch64-reloc-property.h: New file.
2173 * aarch64-reloc.def: New file.
2174 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2175 with tab to make the format consistent.
2176 (Output_data_got_aarch64::symbol_table_): New method.
2177 (Target_aarch64::do_plt_address_for_global): New method.
2178 (Target_aarch64::do_plt_address_for_local): New method.
2179 (Target_aarch64::do_select_as_default_target): New method.
2180 (Target_aarch64::do_make_data_plt): New method.
2181 (Target_aarch64::make_data_plt): New method.
2182 (Output_data_plt_aarch64::has_irelative_section): New method.
2183 (Output_data_plt_aarch64::address_for_global): New method.
2184 (Output_data_plt_aarch64::address_for_local): New method.
2185 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2186 (Output_data_plt_aarch64::add_entry): Implement contents.
2187 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2188 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2189 the got_pov entry to plt0.
2190 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2191 Implement contents.
2192 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2193 (AArch64_howto): New struct.
2194 (aarch64_howto[]): New static const array.
2195 (AArch64_relocate_functions): New class.
2196 (Target_aarch64::Scan::get_reference_flags): Remove method.
2197 (Target_aarch64::Scan::local): Implement to support a few relocations.
2198 (Target_aarch64::Scan::global): Implement to support a few relocations.
2199 (Target_aarch64::make_plt_section): Implement contents.
2200 (Target_aarch64::make_plt_entry): Implement contents.
2201 (Target_aarch64::do_finalize_sections): Implement contents.
2202 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2203 (Target_aarch64::relocate_section): Implement contents.
2204
ad9fe6c1
AM
22052014-08-06 Alan Modra <amodra@gmail.com>
2206
2207 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2208
7cd4e5b7
AM
22092014-08-06 Alan Modra <amodra@gmail.com>
2210
2211 PR 13227
2212 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2213
5ad9b0a7
ST
22142014-07-21 Sriraman Tallam <tmsriram@google.com>
2215
2216 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 2217 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 2218
e051745c
CC
22192014-07-08 Cary Coutant <ccoutant@google.com>
2220
2221 * expression.cc (struct Expression::Expression_eval_info): Add
2222 new fields type_pointer, vis_pointer, and nonvis_pointer.
2223 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2224 nonvis_pointer parameters. Adjust all calls.
2225 (Symbol_expression::value): Update type, visibility, and nonvis bits
2226 in caller.
2227 * script.cc (Symbol_assignment::sized_finalize): Update type,
2228 visibility, and remaining st_other bits for new symbol.
2229 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2230 vis_pointer, and nonvis_pointer parameters.
2231 * symtab.h (Symbol::set_type): New method.
2232
2233 * testsuite/Makefile.am (defsym_test): New test.
2234 * testsuite/Makefile.in: Regenerate.
2235 * testsuite/defsym_test.c: New file.
2236 * testsuite/defsym_test.sh: New file.
2237
f35c4853
CC
22382014-07-08 Cary Coutant <ccoutant@google.com>
2239
2240 PR gold/15639
2241 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2242 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2243 (Sized_dynobj::base_read_symbols): ...new method.
2244 * object.h (Sized_relobj_file::base_read_symbols): New method.
2245 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2246 (Sized_relobj_file::base_read_symbols): ...new method.
2247 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2248 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2249 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2250
2900af2d
AM
22512014-07-04 Alan Modra <amodra@gmail.com>
2252
2253 * po/POTFILES.in: Regenerate.
2254
053a4d68
JY
22552014-07-02 Jing Yu <jingyu@google.com>
2256
2257 * aarch64.cc: New file
2258 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2259 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2260 * Makefile.in: Regenerate.
2261 * configure.tgt: Add entries for aarch64*.
2262 * configure.ac: Likewise.
2263 * configure: Likewise.
2264
7b549045
AM
22652014-06-27 Alan Modra <amodra@gmail.com>
2266
2267 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2268
cb818dbf
CC
22692014-06-24 Cary Coutant <ccoutant@google.com>
2270
2271 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2272 sections.
2273 (Dwo_file::sized_read_unit_index): Likewise.
2274
9810d34d
SS
22752014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2276
2277 * mips.cc: New file.
2278 * Makefile.am (TARGETSOURCES): Add mips.cc
2279 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2280 * configure.tgt: Add entries for mips*.
2281 * configure.ac: Likewise.
2282 * Makefile.in: Regenerate.
2283 * configure: Likewise.
2284
9baa787b
CC
22852014-06-09 Cary Coutant <ccoutant@google.com>
2286
2287 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2288 unit_length is within section bounds.
2289
8f89af0a
CC
22902014-06-09 Cary Coutant <ccoutant@google.com>
2291
2292 PR gold/16980
2293 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2294 map.
2295
a47622ac
AM
22962014-06-07 Alan Modra <amodra@gmail.com>
2297
2298 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2299
4320c691
CC
23002014-06-06 Cary Coutant <ccoutant@google.com>
2301
2302 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2303 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2304 (Dwarf_pubnames_table::read_header): Likewise.
2305 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2306 .debug_gnu_pubtypes.
2307
270c9937
JB
23082014-06-05 Joel Brobecker <brobecker@adacore.com>
2309
2310 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2311 * Makefile.in, configure: Regenerate.
2312
397998fc
AM
23132014-06-03 Alan Modra <amodra@gmail.com>
2314
2315 * powerpc.cc (addis_12_2): Define.
2316 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2317
61f5c66f
AM
23182014-06-03 Alan Modra <amodra@gmail.com>
2319
2320 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2321 st_other output.
2322
f6971787
AM
23232014-06-02 Alan Modra <amodra@gmail.com>
2324
2325 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2326 Only ignore relocs on ELFv1.
2327 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2328
f6fb8322
CC
23292014-05-30 Cary Coutant <ccoutant@google.com>
2330
2331 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2332 * testsuite/Makefile.in: Regenerate.
2333 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2334
c23dd342
L
23352014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2336
2337 PR gold/16945
2338 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2339 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2340
5fe7ffdc
AM
23412014-05-15 Alan Modra <amodra@gmail.com>
2342
2343 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2344 Compare FDE contents with DW_CFA_nop rather than 0.
2345
a82bef93
ST
23462014-05-13 Sriraman Tallam <tmsriram@google.com>
2347
2348 * symtab.h (may_need_copy_reloc): Remove check for position independent
2349 code.
2350 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2351 position independence before pc absolute may_need_copy_reloc call.
2352 Add check for executable output befor pc relative may_need_copy_reloc
2353 call.
2354 * i386.cc: Ditto.
2355 * arm.cc: Ditto.
2356 * sparc.cc: Ditto.
2357 * tilegx.cc: Ditto.
2358 * powerpc.cc: Add check for no position independence before
2359 may_need_copy_reloc calls.
2360 * testsuite/pie_copyrelocs_test.cc: New file.
2361 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2362 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2363 * Makefile.in: Regenerate.
a82bef93 2364
53c66605
ML
23652014-05-08 Martin Liška <mliska@suse.cz>
2366
2367 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2368
57b2284c
CC
23692014-05-06 Cary Coutant <ccoutant@google.com>
2370
2371 PR gold/16900
2372 * i386.cc (Output_data_got_plt_i386): New class.
2373 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2374 parameter. Change all callers.
2375 (Output_data_plt_i386::layout_): Remove.
2376 (Output_data_plt_i386::got_plt_): Change type.
2377 (Target_i386::got_plt_): Change type. Change all references.
2378 (Target_i386::got_section): Create instance of new class.
2379 (Output_data_got_plt_i386::do_write): New function.
2380 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2381 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2382 parameter. Change all callers.
2383 (Output_data_plt_x86_64::layout_): Remove.
2384 (Output_data_plt_x86_64::got_plt_): Change type.
2385 (Target_x86_64::got_plt_): Change type. Change all references.
2386 (Target_x86_64::got_section): Create instance of new class.
2387 (Output_data_got_plt_x86_64::do_write): New function.
2388 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2389 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2390 class.
2391
6b97515d 23922014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2393
6b97515d
CC
2394 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2395 if we have pubnames/pubtypes.
2396
d1bddd3c
CC
23972014-05-02 Cary Coutant <ccoutant@google.com>
2398
5fe7ffdc
AM
2399 * defstd.cc (in_segment): Define __ehdr_start here...
2400 * layout.cc (Layout::finalize): ...Instead of here. Set the
2401 output segment when known.
2402 * resolve.cc (Symbol::override_base_with_special): Remember
2403 the original binding.
2404 * symtab.cc (Symbol::set_output_segment): New function.
2405 (Symbol::set_undefined): New function.
2406 * symtab.h (Symbol::is_weak_undefined): Check original undef
2407 binding.
2408 (Symbol::is_strong_undefined): New function.
2409 (Symbol::set_output_segment): New function.
2410 (Symbol::set_undefined): New function.
2411 * target-reloc.h (is_strong_undefined): Remove.
2412 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2413 Check for hidden undefs.
2414 (relocate_section): Call Symbol::is_strong_undefined.
2415
2416 * testsuite/Makefile.am (ehdr_start_test_1)
2417 (ehdr_start_test_2, ehdr_start_test_3)
2418 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2419 * testsuite/Makefile.in: Regenerate.
2420 * testsuite/ehdr_start_def.cc: New source file.
2421 * testsuite/ehdr_start_test.cc: New source file.
2422 * testsuite/ehdr_start_test.t: New linker script.
2423 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2424
7849f6d8
CC
24252014-04-23 Cary Coutant <ccoutant@google.com>
2426
bf2cc635 2427 PR gold/16870
7849f6d8
CC
2428 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2429
99fd8cff
CC
24302014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2431
2432 * layout.cc (Layout::include_section): Allow a target to decide
2433 whether to include a section.
2434 * target.h (Target::should_include_section): New function.
2435 (Target::do_should_include_section): New function.
2436
91f43acd
CC
24372014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2438
2439 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2440 inline into ...
2441 (Copy_relocs::emit): ... here.
2442 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2443 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2444 (Copy_reloc_entry::entries_): Change from private to protected.
2445
c4eb27e1
ST
24462014-04-02 Sriraman Tallam <tmsriram@google.com>
2447
2448 * icf.cc (get_section_contents): Replace copies of reloc
2449 vectors with const references.
2450
ae447ddd
CC
24512014-04-02 Cary Coutant <ccoutant@google.com>
2452
2453 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2454 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2455 * configure: Regenerate.
2456 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2457 -fno-use-linker-plugin.
2458 (LINK1, CXXLINK1): Add it to the link command.
2459 * testsuite/Makefile.in: Regenerate.
2460
fa47fa92
AM
24612014-03-12 Alan Modra <amodra@gmail.com>
2462
2463 * Makefile.in: Regenerate.
2464
9b12c500
CC
24652014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2466
2467 * symtab.h (Symbol::set_nonvis): New function.
2468
beacaa96
CC
24692014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2470
2471 * symtab.cc (Sized_symbol<32>::init_output_data):
2472 Instantiate the template.
2473 (Sized_symbol<64>::init_output_data): Likewise.
2474
800d9823
CC
24752014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2476
2477 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2478 adjust dynamic symbol value.
2479 * target.h (Target::adjust_dyn_symbol): New function.
2480 (Target::do_adjust_dyn_symbol): New function.
2481
918fc1f8 24822014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2483
918fc1f8
CC
2484 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2485 Get the value of DYNAMIC_CUSTOM dynamic entry.
2486 * output.h (Output_data_dynamic::add_custom): New function.
2487 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2488 dynamic entry.
2489 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2490 * target.h (Target::dynamic_tag_custom_value): New function.
2491 (Target::do_dynamic_tag_custom_value): New function.
2492
98ff9231
CC
24932014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2494
2495 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2496 dynsym indexes.
2497 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2498 (Target::do_has_custom_set_dynsym_indexes): New function.
2499 (Target::set_dynsym_indexes): New function.
2500 (Target::do_set_dynsym_indexes): New function.
2501
b80eed39
AM
25022014-03-07 Alan Modra <amodra@gmail.com>
2503
2504 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2505 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2506 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2507 (Powerpc_relocate_functions::has_overflow_bitfield,
2508 overflowed): Use the above.
2509 (Target_powerpc::Relocate::relocate): Correct overflow checking
2510 for a number of relocations. Modify overflow test for 16-bit
2511 fields in instructions to signed/unsigned according to whether
2512 the field takes a signed or unsigned value.
2513
4b95cf5c
AM
25142014-03-05 Alan Modra <amodra@gmail.com>
2515
2516 Update copyright years.
2517
45965137
AM
25182014-03-05 Alan Modra <amodra@gmail.com>
2519
2520 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2521 R_PPC64_ADDR64_LOCAL.
2522 (Target_powerpc::Relocate::relocate): Likewise.
2523
2c80b753
AM
25242014-03-03 Alan Modra <amodra@gmail.com>
2525
2526 * dwp.cc (print_version): Update copyright year to current.
2527
c1c69e83
AM
25282014-02-10 Alan Modra <amodra@gmail.com>
2529
2530 * po/gold.pot: Regenerate.
2531
dd0c4e70
CC
25322014-02-06 Cary Coutant <ccoutant@google.com>
2533
2534 Fix problem where -u is ignored when a weak undef is seen.
2535
2536 * archive.cc (Library_base::should_include_member): Reorder
2537 code to check for -u option if a weak undef has already been seen.
2538 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2539 * testsuite/Makefile.in: Regenerate.
2540 * testsuite/weak_undef_file3.cc: New file.
2541 * testsuite/weak_undef_file4.cc: New file.
2542 * testsuite/weak_undef_test_2.cc: New file.
2543
1a221d3d
CC
25442014-02-05 Cary Coutant <ccoutant@google.com>
2545
2546 Fix issues with gold undefined symbol diagnostics.
2547
2548 PR binutils/15435
2549 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2550 check to here.
2551 * target-reloc.h (is_strong_undefined): New function.
2552 (relocate_section): Move undef vtable symbol check from here.
2553 Check for is_strong_undefined.
2554
e889f0a4 25552014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2556
e889f0a4
CC
2557 Fix problems with the --dynamic-list option.
2558
2559 PR gold/13577
2560 * options.cc (General_options::parse_dynamic_list):
2561 Set have_dynamic_list_.
2562 (General_options::General_options): Initialize have_dynamic_list_.
2563 (General_options::finalize): Turn off -Bsymbolic and
2564 -Bsymbolic-functions if --dynamic-list provided.
2565 * options.h (General_options::have_dynamic_list): New function.
2566 (General_options::have_dynamic_list_): New data member.
2567 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2568 correctly.
5fe7ffdc 2569
e889f0a4
CC
2570 PR gold/16530
2571 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2572 in --dynamic-list, mark it.
5fe7ffdc 2573
e889f0a4
CC
2574 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2575 (dynamic_list_2): New test case.
2576 * testsuite/Makefile.in: Regenerate.
2577 * testsuite/dynamic_list_2.cc: New file.
2578 * testsuite/dynamic_list_2.t: New file.
2579 * testsuite/dynamic_list_lib1.cc: New file.
2580 * testsuite/dynamic_list_lib2.cc: New file.
2581 * testsuite/gc_dynamic_list_test.c: New file.
2582 * testsuite/gc_dynamic_list_test.sh: New file.
2583 * testsuite/gc_dynamic_list_test.t: New file.
2584
ec673e64
CC
25852014-01-28 Cary Coutant <ccoutant@google.com>
2586
2587 Add .gdb_index version 7 support.
2588
2589 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2590 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2591 debug sections.
2592 (Dwarf_ranges_table::read_ranges_table): Likewise.
2593 (Dwarf_pubnames_table::read_section): Check for GNU-style
2594 sections, and for compressed debug sections.
2595 (Dwarf_pubnames_table::read_header): Compute end address of table.
2596 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2597 for end of list by offset, not by offset == 0.
2598 (Dwarf_info_reader::do_read_string_table): Check for compressed
2599 debug sections.
2600 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2601 Initialize new data members.
2602 (Dwarf_pubnames_table::next_name): return flag_byte.
2603 (Dwarf_pubnames_table::end_of_table_): New data member.
2604 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2605 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2606 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2607 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2608 read skeleton type unit DIEs.
2609 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2610 (Gdb_index::do_write): Write flag_byte.
2611 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2612 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2613 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2614 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2615
221fd5d5
L
26162014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2617
2618 * version.cc (print_version): Update copyright year to 2014.
2619
6c09fb0b
ILT
26202013-12-19 Dimitry Andric <dimitry@andric.com>
2621
2622 * stringpool.cc (Stringpool_template::reserve): Add
2623 HAVE_UNORDERED_MAP case.
2624 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2625
8356f2d0
CC
26262013-12-18 Cary Coutant <ccoutant@google.com>
2627
2628 * configure.ac: Check for <unordered_set> and <unordered_map>.
2629 * config.in: Regenerate.
2630 * configure: Regenerate.
2631 * system.h: Use <unordered_set> and <unordered_map> if available.
2632
f2c7d7ee
RM
26332013-12-10 Roland McGrath <mcgrathr@google.com>
2634
2635 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2636 with $(INSTALL_PROGRAM_ENV).
2637 * Makefile.in: Regenerate.
2638
6632e8cc
CC
26392013-11-22 Cary Coutant <ccoutant@google.com>
2640
2641 * configure.ac: Add check for which library is needed for
2642 dlopen.
2643 * configure: Regenerate.
2644
0c075858
CC
26452013-11-22 Cary Coutant <ccoutant@google.com>
2646
2647 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2648 assembler.
2649 * testsuite/Makefile.in: Regenerate.
2650
f49fe902
L
26512013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2652
2653 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2654 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2655 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2656 (Target_x86_64<size>::Scan::local): Likewise.
2657 (Target_x86_64<size>::Scan::global): Likewise.
2658 (Target_x86_64<size>::Relocate::relocate): Likewise.
2659 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2660 Likewise.
2661 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2662 R_X86_64_PC32_BND.
2663
2664 * testsuite/Makefile.am (check_PROGRAMS): Add
2665 exception_x86_64_bnd_test.
2666 (exception_x86_64_bnd_test_SOURCES): New macro.
2667 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2668 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2669 (exception_x86_64_bnd_test_LDADD): Likewise.
2670 (exception_x86_64_bnd_1.o): New rule.
2671 (exception_x86_64_bnd_2.o): Likewise.
2672 * testsuite/Makefile.in: Regenerated.
2673
9055360d
AM
26742013-11-15 Alan Modra <amodra@gmail.com>
2675
2676 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2677 accessor.
2678 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2679 Only call ppc64_local_entry_offset for 64-bit. Restrict
2680 symval_for_branch lookup to ELFv1.
2681 (Stub_table::add_plt_call_entry): Use unsigned int off.
2682 (Output_data_glink::Address, invalid_address): New.
2683 (Output_data_glink::add_eh_frame): Move out of line. Add
2684 support for ELFv2.
2685 (Output_data_glink::add_global_entry, find_global_entry,
2686 global_entry_address): New functions.
2687 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2688 ge_size): New variables.
2689 (Output_data_glink::set_final_data_size): Add global entry
2690 stub sizing.
2691 (Output_data_glink::do_write): Write global entry stubs.
2692 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2693 parameter. Return true for ELFv2. Adjust callers.
2694 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2695 ELFv1. Similarly for ifunc and dynamic relocation processing
2696 specific to ELFv1. Recognize that symbols are defined on
2697 their plt entries for ELFv2.
2698 (Target_powerpc::symval_for_branch): Assert if called for
2699 ELFv2 or ppc32.
2700 (Target_powerpc::Relocate::relocate): Use global entry plt
2701 stub for symbol value if such exists on ELFv2.
2702 (Target_powerpc::Relocate::relocate): Don't call
2703 symval_for_branch when ELFv2. Do adjust for local entry
2704 offset when ELFv2.
2705 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2706 plt stub for ELFv2.
2707 (Target_powerpc::do_plt_address_for_global): Similarly.
2708
cafdd569
CC
27092013-11-14 Cary Coutant <ccoutant@google.com>
2710
2711 Revert patch -- this did not fix the problem, and there is
2712 no race there.
2713
2714 2013-11-14 Cary Coutant <ccoutant@google.com>
2715
2716 PR gold/14860
2717 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2718 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2719 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2720 updating fde_offsets_.
2721 (Eh_frame_hdr::lock_): New data member.
2722
94e49e16
CC
27232013-11-14 Cary Coutant <ccoutant@google.com>
2724
2725 * dwp.cc (Dwo_file_entry): New type.
2726 (File_list): Use Dwo_file_entry.
2727 (Dwo_file::verify): New function.
2728 (Dwo_file::verify_dwo_list): New function.
2729 (Dwo_file::sized_verify_dwo_list): New function.
2730 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2731 list.
2732 (Dwp_options): New enum type.
2733 (dwp_options): Add --verify-only.
2734 (usage): Likewise.
2735 (main): Likewise.
2736 * dwp.h (gold_info): Add declaration.
2737
7cdd7d57
CC
27382013-11-14 Cary Coutant <ccoutant@google.com>
2739
2740 PR gold/14860
2741 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2742 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2743 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2744 updating fde_offsets_.
2745 (Eh_frame_hdr::lock_): New data member.
2746
1d946cb3
CC
27472013-11-06 Cary Coutant <ccoutant@google.com>
2748
2749 PR gold/15758
2750 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2751 before reloc sections.
2752
4f65b40e
AM
27532013-11-04 Alan Modra <amodra@gmail.com>
2754
2755 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2756 (Symbol::needs_dynamic_reloc): Test new flag.
2757 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2758 (Target_powerpc::Scan::get_reference_flags): Add target param.
2759 Return FUNC_DESC_ABI for 64-bit ELFv1.
2760 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2761 call.
2762 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2763 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2764
908794a9
CC
27652013-10-31 Cary Coutant <ccoutant@google.com>
2766
2767 Restore support for dwp v2 DWARF package file format.
2768
2769 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2770 tu_length parameter. Adjust all callers.
2771 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2772 * dwp.cc: Include dwarf.h.
2773 (Section_bounds): New struct type.
2774 (Unit_set): New struct type.
2775 (Dwo_file::Dwo_file): Initialize new data member.
2776 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2777 Combine and rename to...
2778 (Dwo_file::read_unit_index): ...this.
2779 (Dwo_file::sized_read_compunit_index)
2780 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2781 (Dwo_file::sized_read_unit_index): ...this.
2782 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2783 parameters; add section_id parameter.
2784 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2785 (Dwo_file::add_unit_set): ...this.
2786 (Dwo_file::shndx_map_): Remove.
2787 (Dwo_file::sect_offsets_): New data member.
2788 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2789 (Dwp_output_file::add_section): Rename to...
2790 (Dwp_output_file::add_contribution): ...this.
2791 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2792 (Dwp_output_file::add_tu_set): Likewise.
2793 (Dwp_output_file::Contribution): New type.
2794 (Dwp_output_file::Section::contributions): New data member.
2795 (Dwp_output_file::Cu_or_tu_set): Remove.
2796 (Dwp_output_file::Section::Section): New ctor.
2797 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2798 (Dwp_output_file::Dwp_index::Section_table): New type.
2799 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2800 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2801 parameter.
2802 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2803 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2804 (Dwp_output_file::Dwp_index::section_table): New member function.
2805 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2806 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2807 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2808 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2809 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2810 (Dwp_output_file::Dwp_index::section_table_): New data member.
2811 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2812 (Dwp_output_file::add_output_section): New member function.
2813 (Dwp_output_file::write_new_section): New member function.
2814 (Dwp_output_file::write_contributions): New member function.
2815 (Dwp_output_file::section_id_map_): New data member.
2816 (class Dwo_id_info_reader): Remove.
2817 (class Unit_reader): New class.
2818 (get_dwarf_section_name): New function.
2819 (Dwo_file::read_executable): Adjust initializations of class data.
2820 (Dwo_file::read): Add support for v2 package file format.
2821 (Dwo_file::read_unit_index): Likewise.
2822 (Dwo_file::sized_read_unit_index): Likewise.
2823 (Dwo_file::copy_section): Likewise.
2824 (Dwo_file::add_unit_set): Likewise.
2825 (Dwp_output_file::add_output_section): Likewise.
2826 (Dwp_output_file::add_contribution): Likewise.
2827 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2828 for empty slot.
2829 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2830 file format.
2831 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2832 slot.
2833 (Dwp_output_file::initialize): Remove unused function.
2834 (Dwp_output_file::finalize): Add support for v2 package file format.
2835 (Dwp_output_file::write_index): Likewise.
2836 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2837 function prototype.
2838
2500c017
CC
28392013-10-31 Cary Coutant <ccoutant@google.com>
2840
2841 * configure.ac: Fix check for -fmerge-constants.
2842 * configure.ac: Regenerate.
2843
dd0845d7
RM
28442013-10-30 Roland McGrath <mcgrathr@google.com>
2845
2846 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2847 Correct 9-byte nop sequence to match what the assembler generates.
2848
b4f7960d
AM
28492013-10-30 Alan Modra <amodra@gmail.com>
2850
2851 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2852 ppc64_local_entry_offset, ppc64_local_entry_offset,
2853 do_read_symbols): New functions.
2854 (Powerpc_relobj::e_flags_, st_other_): New vars.
2855 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2856 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2857 (Powerpc_relobj::e_flags_): New var.
2858 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2859 and adjust for ELFv2.
2860 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2861 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2862 (Powerpc_dynobj::do_find_special_sections): Likewise.
2863 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2864 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2865 to ELFv2 local entry.
2866 (Target_powerpc::do_relax): No thread safe barriers needed for
2867 ELFv2.
2868 (Output_data_plt_powerpc::initial_plt_entry_size_,
2869 plt_entry_size): Delete. Replace all uses with
2870 first_plt_entry_offset() and plt_entry_size().
2871 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2872 reserved_size parm. Update callers.
2873 (Output_data_plt_powerpc::entry_count): Update.
2874 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2875 and use Target_powerpc::first_plt_entry_offset().
2876 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2877 rename to plt_entry_size.
2878 (Output_data_plt_powerpc::add_ifunc_entry,
2879 add_local_ifunc_entry): Adjust reloc for ELFv2.
2880 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2881 (glink_eh_frame_fde_64v2): New.
2882 (Stub_table::plt_call_size): Support ELFv2 sizing.
2883 (Output_data_glink::add_eh_frame): Use the new FDE.
2884 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2885 (Stub_table::do_write): Write ELFv2 stubs and glink.
2886 (Target_powerpc::Relocate::relocate): Replaces nop after call
2887 with ld 2,24(1) and adjust local offset destination for ELFv2.
2888
f9c6b907
AM
28892013-10-30 Alan Modra <amodra@gmail.com>
2890
2891 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2892 (Target_powerpc::Scan::global, local): Likewise.
2893 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2894 on all ppc64 @h and @ha relocs.
2895
e84fe78f
AM
28962013-10-14 Alan Modra <amodra@gmail.com>
2897
2898 * output.h (Output_data_got::add_constant): Tidy.
2899 (Output_data_got::add_constant_pair): New function.
2900 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2901 methods used so as to first call reserve_ent().
2902
679e4abf
RM
29032013-10-11 Roland McGrath <mcgrathr@google.com>
2904
44dcb735
RM
2905 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2906 add_got_entry and add_got_entry_pair.
2907
13323c49
RM
2908 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2909 (HAVE_PUBNAMES): Likewise.
2910 * configure: Regenerate.
2911
1496b446
RM
2912 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2913 * testsuite/Makefile.in: Regenerate.
2914
cc84c10b
RM
2915 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2916 Remove const from declaration.
2917 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2918 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2919 * output.h (Output_file_header): Remove const from member target_
2920 and corresponding constructor argument.
2921 * output.cc (Output_file_header::Output_file_header): Update prototype.
2922 (Output_file_header::do_sized_write): Use this->target_ in place
2923 of parameters()->target().
2924
52f66a2c
RM
2925 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2926
2b64b551
RM
2927 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2928 * configure: Regenerate.
2929 * Makefile.in: Regenerate.
2930 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2931 * testsuite/merge_string_literals_2.c: Likewise.
2932 * testsuite/Makefile.am
2933 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2934 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2935 literal -fmerge-constants.
2936 * testsuite/Makefile.in: Regenerate.
2937
43819297
RM
2938 * i386.cc (Target_i386): Remove unused member dynbss_.
2939 * arm.cc (Target_arm): Likewise.
2940 * powerpc.cc (Target_powerpc): Likewise.
2941 * sparc.cc (Target_sparc): Likewise.
2942 * tilegx.cc (Target_tilegx): Likewise.
2943 * x86_64.cc (Target_x86_64): Likewise.
2944 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2945 type_signature_, type_offset_.
2946 * plugin.h (Plugin_hook): Remove unused member layout_.
2947 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2948 mapfile_.
2949 (Read_member): Remove unused members input_objects_, symtab_,
2950 mapfile_, layout_.
2951 (Check_library): Remove unused member symtab_.
2952 * archive.h (Lib_group): Remove unused member lib_.
2953 * archive.cc (Lib_group::Lib_group): Update initializer.
2954 * incremental.h (Incremental_binary): Remove unused member target_.
2955 (Incremental_script_entry): Removed unused member script_.
2956 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2957 * icf.h (Icf): Remove unused member num_tracked_relocs.
2958
39d9ead7
RM
2959 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2960 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2961 its only use.
2962 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2963
679e4abf
RM
2964 * archive.h: Use struct rather than class for forward declaration
2965 of Read_symbols_data.
2966
54de2ea6
CC
29672013-10-07 Cary Coutant <ccoutant@google.com>
2968
2969 PR gold/16010
2970 * testsuite/Makefile.am (icf_test): Fix dependencies.
2971 (icf_safe_test): Likewise.
2972 (icf_safe_so_test): Likewise.
2973 (large_symbol_alignment): Add empty _LDADD rule.
2974 * testsuite/Makefile.in: Regenerate.
2975
b14016f0
L
29762013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2977
2978 PR gold/15927
2979 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2980 relocation for R_X86_64_32 on x32.
2981
eb426534
RM
29822013-08-27 Roland McGrath <mcgrathr@google.com>
2983
2984 * output.cc (Output_segment::set_section_addresses): Take new
2985 Target* argument. If target->isolate_execinstr() and the segment
2986 is executable and starts at a target->abi_pagesize() boundary,
2987 pad its end out to a target->abi_pagesize() boundary with code fill.
2988 * output.h (Output_segment::set_section_addresses): Update decl.
2989 * layout.h (Layout::check_output_data_for_reset_values): Take new
2990 argument RELAX_OUTPUTS.
2991 (Layout): New member relax_output_list_.
2992 (Layout::add_relax_output): New method.
2993 * layout.cc (Layout::Layout): Update constructor.
2994 (Layout::reset_relax_output): New method.
2995 (Layout::clean_up_after_relaxation): Call it.
2996 (Layout::prepare_for_relaxation): Update caller.
2997 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2998 Call reset_relax_output before re-processing segments for
2999 isolate_execinstr case.
3000 (Layout::write_data): Handle relax_output_list_.
3001 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
3002 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
3003
9aff4b7a
NC
30042013-08-23 Yuri Chornoivan <yurchor@ukr.net>
3005
3006 PR binutils/15834
3007 * object.h: Fix typos.
3008
93f8221c
RM
30092013-08-16 Roland McGrath <mcgrathr@google.com>
3010
3011 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
3012 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
3013
e44c3715
CC
30142013-08-07 Cary Coutant <ccoutant@google.com>
3015
3016 Revert support for v2 DWP files:
3017
3018 2013-03-01 Cary Coutant <ccoutant@google.com>
3019
3020 Add dwp support for v2 DWARF package file format.
3021 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3022 tu_length parameter. Adjust all callers.
3023 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3024 * dwp.cc: Include dwarf.h.
3025 (Section_bounds): New struct type.
3026 (Unit_set): New struct type.
3027 (Dwo_file::Dwo_file): Initialize new data member.
3028 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3029 Combine and rename to...
3030 (Dwo_file::read_unit_index): ...this.
3031 (Dwo_file::sized_read_compunit_index)
3032 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3033 (Dwo_file::sized_read_unit_index): ...this.
3034 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3035 parameters; add section_id parameter.
3036 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3037 (Dwo_file::add_unit_set): ...this.
3038 (Dwo_file::shndx_map_): Remove.
3039 (Dwo_file::sect_offsets_): New data member.
3040 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3041 (Dwp_output_file::add_section): Rename to...
3042 (Dwp_output_file::add_contribution): ...this.
3043 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3044 (Dwp_output_file::add_tu_set): Likewise.
3045 (Dwp_output_file::Contribution): New type.
3046 (Dwp_output_file::Section::contributions): New data member.
3047 (Dwp_output_file::Cu_or_tu_set): Remove.
3048 (Dwp_output_file::Section::Section): New ctor.
3049 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3050 (Dwp_output_file::Dwp_index::Section_table): New type.
3051 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3052 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3053 parameter.
3054 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3055 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3056 (Dwp_output_file::Dwp_index::section_table): New member function.
3057 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3058 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3059 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3060 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3061 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3062 (Dwp_output_file::Dwp_index::section_table_): New data member.
3063 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3064 (Dwp_output_file::add_output_section): New member function.
3065 (Dwp_output_file::write_new_section): New member function.
3066 (Dwp_output_file::write_contributions): New member function.
3067 (Dwp_output_file::section_id_map_): New data member.
3068 (class Dwo_id_info_reader): Remove.
3069 (class Unit_reader): New class.
3070 (get_dwarf_section_name): New function.
3071 (Dwo_file::read_executable): Adjust initializations of class data.
3072 (Dwo_file::read): Add support for v2 package file format.
3073 (Dwo_file::read_unit_index): Likewise.
3074 (Dwo_file::sized_read_unit_index): Likewise.
3075 (Dwo_file::copy_section): Likewise.
3076 (Dwo_file::add_unit_set): Likewise.
3077 (Dwp_output_file::add_output_section): Likewise.
3078 (Dwp_output_file::add_contribution): Likewise.
3079 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3080 for empty slot.
3081 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3082 file format.
3083 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3084 slot.
3085 (Dwp_output_file::initialize): Remove unused function.
3086 (Dwp_output_file::finalize): Add support for v2 package file format.
3087 (Dwp_output_file::write_index): Likewise.
3088 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3089 function prototype.
3090
c6905c28
CC
30912013-07-31 Cary Coutant <ccoutant@google.com>
3092
3093 * object.cc (Sized_relobj::do_output_section_address): New function.
3094 (Sized_relobj): Instantiate explicitly.
3095 * object.h (Object::output_section_address): New function.
3096 (Object::do_output_section_address): New function.
3097 (Sized_relobj::do_output_section_address): New function.
3098 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3099
31002013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 3101 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
3102
3103 * parameters.cc (Parameters::entry): Return target-specific entry
3104 symbol name.
3105 * target.h (Target::entry_symbol_name): New function.
3106 (Target_info::entry_symbol_name): New data member.
3107
3108 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3109 * i386.cc (Target_i386::i386_info): Likewise.
3110 (Target_i386_nacl::i386_nacl_info): Likewise.
3111 * sparc.cc (Target_sparc::sparc_info): Likewise.
3112 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3113 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3114 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3115 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3116
234d4ab8
SA
31172013-07-22 Sterling Augustine <saugustine@google.com>
3118
3119 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3120 Convert parameter shndx to local variable. Add parameters symtab
3121 and symtab_size. Scan over section names. Find relocation
3122 section corresponding to current section. Create and initialize
3123 reloc_mapper_ and reloc_type_.
3124 (Dwarf_pubnames_table::read_header): Add assertion. Change
3125 unit_length to off_t. Initialize member unit_length_. Fill in field
3126 cu_offset_.
3127 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3128 Initialize new fields unit_length_ and cu_offset_.
3129 (Dwarf_pubnames_table::read_section): Update prototype.
3130 (Dwarf_pubnames_table::cu_offset): New member function.
3131 (Dwarf_pubnames_table::subsection_size): Likewise.
3132 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3133 New fields.
3134 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3135 member functions public.
3136 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3137 Update comment. Rework logic. Move repeated parts to...
3138 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3139 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3140 pubtypes_table_, and stmt_list_offset.
3141 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3142 Gdb_index::find_pubtype_offset,
3143 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3144 (Gdb_index::pubnames_read): Update prototype and rework logic.
3145 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3146 Forward declare.
3147 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3148 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3149 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3150 Gdb_index::map_pubtable_to_dies):
3151 Declare functions.
3152 (Gdb_index::pubnames_read): Update declaration.
3153 (Gdb_index::Pubname_offset_map): New type.
3154 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3155 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3156 Gdb_index::stmt_list_offset): Declare.
3157 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3158 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3159 Gdb_index::pubtypes_offset_): Remove.
3160
a3ed37d8
RM
31612013-07-19 Roland McGrath <mcgrathr@google.com>
3162
3163 * options.h (General_options): Add -Trodata-segment option.
3164 * parameters.cc (Parameters::check_rodata_segment): New function.
3165 (Parameters::set_target_once): Call it.
3166 * parameters.h (Parameters): Declare it (private member function).
3167 * layout.cc (load_seg_unusable_for_headers): New function, broken
3168 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3169 then validate rodata segment rather than text segment.
3170 (relaxation_loop_body): Call that.
3171 (is_text_segment): New function. Don't admit a non-executable
3172 segment if TARGET->isolate_execinstr().
3173 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3174
eb5b4ded
CC
31752013-07-15 Shawn Landden <shawnlandden@gmail.com>
3176
3177 PR gold/15070
3178 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3179 * nacl.h (Sniff_file::View::View): Request aligned view.
3180
4d5effb9
CC
31812013-07-11 Cary Coutant <ccoutant@google.com>
3182
3183 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3184 correct BRLT entry size.
3185
ba8ca3e7
AM
31862013-07-03 Alan Modra <amodra@gmail.com>
3187
3188 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3189 comment.
3190
267257d2
CC
31912013-07-01 Cary Coutant <ccoutant@google.com>
3192
3193 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3194 reloc_type_.
3195 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3196 (Dwarf_ranges_table::lookup_reloc): New function.
3197 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3198 reloc_type_.
3199 (Dwarf_ranges_table::lookup_reloc): New function.
3200 (Dwarf_ranges_table::reloc_type_): New data member.
3201
06f30c9d
CC
32022013-06-27 Jing Yu <jingyu@google.com>
3203
3204 PR gold/15662
3205 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3206 function.
3207 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3208 (Target_powerpc::do_relax): Call the above.
3209
a2d7bf59
AM
32102013-06-27 Cary Coutant <ccoutant@google.com>
3211
3212 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3213 on garbage collected .opd section.
3214
32152013-06-27 Alan Modra <amodra@gmail.com>
3216
3217 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3218 is non-zero.
3219 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3220 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3221
32364e50
CC
32222013-06-14 Cary Coutant <ccoutant@google.com>
3223
3224 * resolve.cc (Symbol::override_base): Don't override st_type
3225 from plugin placeholder symbols.
3226 (Symbol_table::resolve): Likewise.
3227 (Symbol_table::should_override): Don't complain about TLS mismatch
3228 if the TO symbol is a plugin placeholder.
3229 * testsuite/Makefile.am (plugin_test_tls): New test.
3230 * testsuite/Makefile.in: Regenerate.
3231 * testsuite/plugin_test_tls.sh: New test script.
3232 * testsuite/two_file_test_2_tls.cc: New test source.
3233 * testsuite/two_file_test_tls.cc: New test source.
3234
7fb47cc9
CC
32352013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3236
3237 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3238 the maximum segment alignment is larger than the page size.
3239 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3240 correctly aligns the symbols with large alignemnt.
3241 * testsuite/Makefile.in: Regenerate.
3242 * testsuite/large_symbol_alignment.cc: New file.
3243
6934001a
CC
32442013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3245 Sriraman Tallam <tmsriram@google.com>
3246
3247 * options.h (sort_section): New option.
3248 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3249 Rename from Input_section_sort_section_name_special_ordering_compare.
3250 (Input_section_sort_section_name_compare): New struct.
3251 * output.cc (Output_section::Input_section_sort_section_name_compare::
3252 operator()): New function.
3253 (Output_section::sort_attached_input_sections): Use new sort function
3254 for .text if --sort-section=name is specified.
3255 * layout.cc (Layout::make_output_section):
3256 Add sorting by name when --sort-section=name is specified.
3257 * testsuite/Makefile.am (text_section_grouping): Test option
3258 --sort-section=name.
3259 * testsuite/Makefile.in: Regenerate.
3260 * testsuite/section_sorting_name.cc: New file.
3261 * testsuite/section_sorting_name.sh: New file.
3262
93acabad
CC
32632013-05-21 Cary Coutant <ccoutant@google.com>
3264
3265 * symtab.h (Symbol::is_cxx_vtable): New function.
3266 * target-reloc.h (relocate_section): Check for vtable symbol.
3267 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3268 * testsuite/Makefile.in: Regenerate.
3269 * testsuite/missing_key_func.cc: New test source.
3270 * testsuite/missing_key_func.sh: New test script.
3271
60e8b3fc
CC
32722013-05-21 Cary Coutant <ccoutant@google.com>
3273
2b64b551
RM
3274 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3275 type of enclosing symbol.
3276 (Relocate_info::location): Check symbol type when describing symbol.
3277 * object.h (Symbol_location_info): Remove unused line_number;
3278 add enclosing_symbol_type.
3279 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 3280
9df9de2c
CC
32812013-05-13 Cary Coutant <ccoutant@google.com>
3282
2b64b551
RM
3283 * configure.ac: Export DEFAULT_TARGET.
3284 * configure: Regenerate.
3285 * Makefile.in: Regenerate.
3286 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3287 * testsuite/Makefile.in: Regenerate.
3288 * testsuite/debug_msg.sh: Delete duplicate tests.
3289 Don't check undef_int error message match for powerpc where the
3290 source file and line number aren't available.
9df9de2c 3291
bbc5ae17
RM
32922013-05-10 Roland McGrath <mcgrathr@google.com>
3293
3294 * options.h (General_options): Add --rosegment-gap option.
3295 * options.cc (finalize): --rosegment-gap implies --rosegment.
3296 * layout.cc (set_segment_offsets): Let user option override
3297 target->rosegment_gap().
3298
0c6e6c39
RM
32992013-05-10 Roland McGrath <mcgrathr@google.com>
3300
3301 * options.h (General_options): Remove leading space from help
3302 messages for -nostdlib and --rosegment.
3303
cde7cb01
MR
33042013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3305
3306 PR ld/15365
3307 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3308
f31ae5b8
AM
33092013-05-03 Alan Modra <amodra@gmail.com>
3310
3311 * merge.cc (Output_merge_string::do_add_input_section): Correct
3312 scan for number of strings. Rename vars to avoid shadowing.
3313 Include missing terminator in input_size_.
3314
d3a7cd45
L
33152013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3316
3317 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3318 Restore empty string handling.
3319
6ad3daba
CC
33202013-05-01 Cary Coutant <ccoutant@google.com>
3321
3322 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3323 uninitialized warning.
3324
e31908b6
CC
33252013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3326
3327 * output.cc (Output_section::add_merge_input_section): Allow
3328 to merge sections if the alignment is more than character size.
3329 * merge.h (Output_merge_string::Output_merge_string): Remove
3330 assert.
3331 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3332 only not-null strings. Check the alignment of strings.
3333 * stringpool.h
3334 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3335 alignment as the argument.
3336 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3337 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3338 Align non-zero length strings according to the addralign_.
3339 (Stringpool_template<Stringpool_char>::set_string_offsets):
3340 Updating offsets according to the given alignment.
3341 * testsuite/Makefile.am (text_section_grouping): Test if string
3342 literals are getting merged.
3343 * testsuite/Makefile.in: Regenerate.
3344 * testsuite/merge_string_literals_1.c: New file.
3345 * testsuite/merge_string_literals_2.c: Ditto.
3346 * testsuite/merge_string_literals.sh: Ditto.
3347
0e804863
ILT
33482013-04-26 Ian Lance Taylor <iant@google.com>
3349
3350 * target-reloc.h (relocate_section): If the reloc offset is out of
3351 range, pass VIEW as NULL to relocate.relocate.
3352 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3353 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3354 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3355 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3356 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3357 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3358
e7c5ea40
CC
33592013-04-26 Geoff Pike <gpike@chromium.org>
3360
3361 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3362 * layout.cc (Hash_task): New class.
3363 (Layout::queue_build_id_tasks): New function.
3364 (Layout::write_build_id): Handle single-thread portion of build ID
3365 computation. (In some cases, all of it is single-threaded.) Replace
3366 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3367 functionality in fewer lines of code.
3368 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3369 * options.h (General_options): make "--build-id" default to tree
3370 rather than sha1. Add two new options related to --build-id=tree:
3371 --build-id-chunk-size-for-treehash and
3372 --build-id-min-file-size-for-treehash.
3373 * Makefile.am: add testing of --build-id=tree and related new options
3374 (these tests will be invoked by "make check").
3375 * Makefile.in: Regenerate.
3376
49926cd0
AM
33772013-04-25 Alan Modra <amodra@gmail.com>
3378
3379 * configure.tgt: Add powerpcle and powerpc64le.
3380
a4034750
AM
33812013-04-22 Alan Modra <amodra@gmail.com>
3382
3383 PR gold/15355
3384 * layout.cc (Layout::segment_precedes): Allow more than one
3385 segment with the same type and flags.
3386
e79c84aa
CC
33872013-04-15 Cary Coutant <ccoutant@google.com>
3388
3389 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3390 allocate space in file for BSS sections.
3391
2199fbe7
CC
33922013-04-15 Cary Coutant <ccoutant@google.com>
3393
3394 * script-sections.cc (Orphan_output_section): Reset address
3395 to zero after each orphaned section for relocatable links.
3396
502e8a84
CC
33972013-04-15 Cary Coutant <ccoutant@google.com>
3398
a4034750
AM
3399 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3400 section starting address for relocatable link.
3401 * testsuite/Makefile.am (script_test_11): New test.
3402 * testsuite/Makefile.in: Regenerate.
3403 * testsuite/script_test_11.c: New source file.
3404 * testsuite/script_test_11.t: New linker script.
502e8a84 3405
0cfdc767
AM
34062013-04-13 Alan Modra <amodra@gmail.com>
3407
3408 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3409 owner when sections are not adjacent and exceed group size.
3410 (Target_powerpc::group_sections): Handle corner case.
3411 (Target_powerpc::Branch_info::make_stub): Handle case where
3412 stub table doesn't exist due to branches in non-exec sections.
3413 (Target_powerpc::Relocate::relocate): Likewise.
3414
6830ee24
AM
34152013-04-11 Alan Modra <amodra@gmail.com>
3416
3417 PR gold/15354
3418 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3419 .branch_lt to match bfd ld. Adjust comments throughout file.
3420
54a3d865
ILT
34212013-04-04 Ian Lance Taylor <iant@google.com>
3422
3423 GCC PR c++/56840
3424 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3425 sections before checking whether they are included in the link.
3426
9993ba11
ST
34272013-03-29 Sriraman Tallam <tmsriram@google.com>
3428
3429 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3430 object before calling the plugin claim_file handler. Pass the elf
3431 object of the archive to the plugin. Delete the elf object if the
3432 plugin claims the file.
3433
ebacd51e
AM
34342013-03-21 Alan Modra <amodra@gmail.com>
3435
3436 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3437 segment when omagic.
3438
117be58f
AM
34392013-03-21 Alan Modra <amodra@gmail.com>
3440
3441 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3442 comparison warning.
3443 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3444 uninitialized" warning.
3445
32e2b61d
AM
34462013-03-20 Alan Modra <amodra@gmail.com>
3447
3448 * symtab.h (Symbol::clear_version): New function.
3449 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3450 is_needed by weak references. Clear version for symbols defined
3451 in as-needed objects that are not needed.
3452
b3ccdeb5
AM
34532013-03-15 Alan Modra <amodra@gmail.com>
3454
3455 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3456 static and public. Add report_err param. Return false for data refs.
3457 (Target_powerpc::rela_dyn_section): New overloaded function.
3458 (Target_powerpc::plt_, iplt_): Elucidate.
3459 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3460 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3461 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3462 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3463 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3464 push_branch and make_plt_entry for ifunc syms when
3465 reloc_needs_plt_for_ifunc.
3466 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3467 for ifunc unless reloc_needs_plt_for_ifunc.
3468
ad3d8a2f
AM
34692013-03-15 Alan Modra <amodra@gmail.com>
3470
3471 * gc.h (gc_process_relocs): Don't look through function descriptors.
3472 * icf.cc (get_section_contents): Do so here instead.
3473
4d9aa155
AM
34742013-03-13 Alan Modra <amodra@gmail.com>
3475
3476 * powerpc.cc (is_branch_reloc): Forward declare.
3477 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3478 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3479 false for 64-bit, true for 32-bit non-branch relocs.
3480 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3481 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3482 nm output.
3483 (icf_safe_test): Generate linker map file as well as nm output.
3484 (icf_safe_so_test): Likewise.
3485 * testsuite/Makefile.in: Regenerate.
3486 * testsuite/icf_test.sh: Parse linker map file to determine
3487 section folding.
3488 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3489 * testsuite/icf_safe_so_test.sh: Likewise.
3490 (X86_32_or_ARM_specific_safe_fold): Merge into..
3491 (arch_specific_safe_fold): ..this.
3492 (X86_64_specific_safe_fold): Delete unused function.
3493
57420c20
AM
34942013-03-12 Alan Modra <amodra@gmail.com>
3495
3496 * gc.h (gc_process_relocs): Look through function descriptors
3497 to determine shndx, symvalue and addend used by ICF. Tidy
3498 variable duplication.
3499
dc3714f3
AM
35002013-03-11 Alan Modra <amodra@gmail.com>
3501
3502 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3503 * layout.cc (Layout_task_runner::run): ..to here.
3504 * symtab.h (struct Symbol_location): Extract from..
3505 (class Symbol_table): ..here.
3506 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3507 * target.h (class Target): Add function_location and
3508 do_function_location functions.
3509 (class Sized_target): Add do_function_location.
3510 * object.h (class Sized_relobj_file): Move find_shdr..
3511 (class Object): ..to here.
3512 * object.cc: Likewise. Update to suit. Instantiate.
3513 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3514 * powerpc.cc (class Powerpc_dynobj): New.
3515 (Target_powerpc::do_function_location): New function.
3516 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3517 (Powerpc_dynobj::do_read_symbols): New function.
3518 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3519
956b03bb
ILT
35202013-03-08 Ian Lance Taylor <iant@google.com>
3521
3522 * options.cc (General_options::string_to_object_format): Accept
3523 "default".
3524
4bead2d5
AM
35252013-03-08 Alan Modra <amodra@gmail.com>
3526
3527 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3528 pointer to Post_fde.
3529 (struct Post_fde): Move definition to here..
3530 * ehframe.cc (struct Post_fde): ..from here.
3531 (Cie::write): Don't alloc Post_fde.
3532 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3533
02e60bf7
AM
35342013-03-07 Alan Modra <amodra@gmail.com>
3535
3536 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3537 relocation referencing .LC0.
3538 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3539
8343f03a
AM
35402013-03-07 Alan Modra <amodra@gmail.com>
3541
3542 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3543 always_inline. Add assembly for powerpc to avoid GOT.
3544
3366d57c
AM
35452013-03-07 Alan Modra <amodra@gmail.com>
3546
3547 * testsuite/script_test_10.sh: Don't test .bss section
3548 header number.
3549
6c77229c
AM
35502013-03-06 Alan Modra <amodra@gmail.com>
3551
3552 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3553 (Target_powerpc::symval_for_branch): Add symtab param. Update
3554 all callers. Handle folded sections.
3555 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3556 to Powerpc_relobj.
3557 (Global_symbol_visitor_opd::operator()): Likewise.
3558
a39e4af6
AM
35592013-03-04 Alan Modra <amodra@gmail.com>
3560
3561 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3562 * testsuite/Makefile.in: Regenerate.
3563
d5834edb
CC
35642013-03-01 Cary Coutant <ccoutant@google.com>
3565
3566 Add dwp support for v2 DWARF package file format.
3567 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3568 tu_length parameter. Adjust all callers.
3569 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3570 * dwp.cc: Include dwarf.h.
3571 (Section_bounds): New struct type.
3572 (Unit_set): New struct type.
3573 (Dwo_file::Dwo_file): Initialize new data member.
3574 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3575 Combine and rename to...
3576 (Dwo_file::read_unit_index): ...this.
3577 (Dwo_file::sized_read_compunit_index)
3578 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3579 (Dwo_file::sized_read_unit_index): ...this.
3580 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3581 parameters; add section_id parameter.
3582 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3583 (Dwo_file::add_unit_set): ...this.
3584 (Dwo_file::shndx_map_): Remove.
3585 (Dwo_file::sect_offsets_): New data member.
3586 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3587 (Dwp_output_file::add_section): Rename to...
3588 (Dwp_output_file::add_contribution): ...this.
3589 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3590 (Dwp_output_file::add_tu_set): Likewise.
3591 (Dwp_output_file::Contribution): New type.
3592 (Dwp_output_file::Section::contributions): New data member.
3593 (Dwp_output_file::Cu_or_tu_set): Remove.
3594 (Dwp_output_file::Section::Section): New ctor.
3595 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3596 (Dwp_output_file::Dwp_index::Section_table): New type.
3597 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3598 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3599 parameter.
3600 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3601 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3602 (Dwp_output_file::Dwp_index::section_table): New member function.
3603 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3604 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3605 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3606 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3607 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3608 (Dwp_output_file::Dwp_index::section_table_): New data member.
3609 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3610 (Dwp_output_file::add_output_section): New member function.
3611 (Dwp_output_file::write_new_section): New member function.
3612 (Dwp_output_file::write_contributions): New member function.
3613 (Dwp_output_file::section_id_map_): New data member.
3614 (class Dwo_id_info_reader): Remove.
3615 (class Unit_reader): New class.
3616 (get_dwarf_section_name): New function.
3617 (Dwo_file::read_executable): Adjust initializations of class data.
3618 (Dwo_file::read): Add support for v2 package file format.
3619 (Dwo_file::read_unit_index): Likewise.
3620 (Dwo_file::sized_read_unit_index): Likewise.
3621 (Dwo_file::copy_section): Likewise.
3622 (Dwo_file::add_unit_set): Likewise.
3623 (Dwp_output_file::add_output_section): Likewise.
3624 (Dwp_output_file::add_contribution): Likewise.
3625 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3626 for empty slot.
3627 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3628 file format.
3629 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3630 slot.
3631 (Dwp_output_file::initialize): Remove unused function.
3632 (Dwp_output_file::finalize): Add support for v2 package file format.
3633 (Dwp_output_file::write_index): Likewise.
3634 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3635 function prototype.
3636
a68a081d
CC
36372013-03-01 Cary Coutant <ccoutant@google.com>
3638
3639 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3640 function into class definition in header file.
3641 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3642 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3643 New function.
3644 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3645
9d5781f8
AM
36462013-02-28 Alan Modra <amodra@gmail.com>
3647
3648 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3649 * target.cc (Target::do_plt_fde_location): New function.
3650 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3651 accessor function, and constructor param.
3652 (struct Post_fde, Post_fdes): Declare.
3653 (Cie::write): Add post_fdes param.
3654 * ehframe.cc (Fde::write): Use plt_fde_location.
3655 (struct Post_fde): Define.
3656 (Cie::write): Stash FDEs added post merge mapping.
3657 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3658 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3659 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3660 other FDEs.
3661 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3662 (Target_powerpc::has_glink): New function.
3663 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3664 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3665 glink_eh_frame_fde_32, default_fde): New data.
3666 (Stub_table::eh_frame_added_): New var.
3667 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3668 Make const.
3669 (Stub_table::add_eh_frame): New function.
3670 (Output_data_glink::add_eh_frame): New function.
3671 (Target_powerpc::make_glink_section): Call add_eh_frame.
3672
214383dd
ILT
36732013-02-15 Ian Lance Taylor <iant@google.com>
3674
3675 * options.h (DEFINE_uint64_alias): Define.
3676 (class General_options): Add -Ttext-segment as an alias for
3677 -Ttext.
3678
91c2b899
AM
36792013-02-15 Alan Modra <amodra@gmail.com>
3680
3681 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3682 (Stub_table::do_write): ..here, two places.
3683 (Stub_table::plt_call_size): Use it here too.
3684
20e2a8aa
ILT
36852013-02-11 Ian Lance Taylor <iant@google.com>
3686
3687 * descriptors.cc (Descriptors::close_all): New function.
3688 * descriptors.h (class Descriptors): Declare close_all.
3689 (close_all_descriptors): New inline function.
3690 * plugin.cc: Include "descriptors.h".
3691 (Plugin_manager::cleanup): Call close_all_descriptors.
3692
8952bc69
AM
36932013-02-06 Alan Modra <amodra@gmail.com>
3694
3695 * README: Update coding style link.
3696
29bd8b6b
CC
36972013-01-28 Cary Coutant <ccoutant@google.com>
3698
a4034750
AM
3699 * dwp.cc (File_list): New typedef.
3700 (Dwo_name_info_reader): New class.
3701 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3702 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3703 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3704 (Dwo_file::read_executable): New function.
3705 (Dwo_file::read): Move common setup code to ...
3706 (Dwo_file::make_object): ... here.
3707 (dwp_options): Add --exec/-e.
3708 (usage): Likewise.
3709 (main): Likewise.
29bd8b6b 3710
c6ac678d
ST
37112013-01-24 Sriraman Tallam <tmsriram@google.com>
3712
3713 * layout.cc (Layout::layout): Check for option text_reorder.
3714 (Layout::make_output_section): Ditto.
3715 * options.h (text_reorder): New option.
3716 * output.cc (Input_section_sort_compare): Remove special ordering
3717 of section names.
3718 (Output_section::
3719 Input_section_sort_section_name_special_ordering_compare::
3720 operator()): New function.
3721 (Output_section::sort_attached_input_sections): Use new sort function
3722 for .text.
3723 * output.h (Input_section_sort_section_name_special_ordering_compare):
3724 New struct.
3725 * testsuite/Makefile.am (text_section_grouping): Test option
3726 --no-text-reorder
3727 * testsuite/Makefile.in: Regenerate.
3728 * testsuite/text_section_grouping.sh: Check order of functions without
3729 default text reordering.
3730
50701cc1
MF
37312013-01-18 Mike Frysinger <vapier@gentoo.org>
3732
3733 * options.h (General_options): Change default to true for new_dtags.
3734
b1b00fcc
MF
37352013-01-18 Mike Frysinger <vapier@gentoo.org>
3736
3737 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3738 when enable_new_dtags is false. Only add DT_RUNPATH when
3739 enable_new_dtags is true.
3740
ec5b8187
AM
37412013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3742
3743 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3744 used in declaration and definition consistent.
3745 (Target_powerpc::symval_for_branch): Ditto.
3746
a880d4c4
ST
37472013-01-16 Sriraman Tallam <tmsriram@google.com>
3748
3749 * testsuite/plugin_final_layout.cc: Fix comment.
3750
7c381248
ST
37512013-01-16 Sriraman Tallam <tmsriram@google.com>
3752
3753 * layout.cc (Layout::layout): Do not do default sorting for
3754 text sections when section ordering is specified.
3755 (make_output_section): Ditto.
3756 * testsuite/plugin_final_layout.cc: Name the function sections
3757 to catch reordering issues.
3758
e2458743
AM
37592013-01-15 Alan Modra <amodra@gmail.com>
3760
3761 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3762 plt-thread-safe.
3763
431ed302
AM
37642013-01-15 Alan Modra <amodra@gmail.com>
3765
3766 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3767 * testsuite/Makefile.in: Regenerate.
3768
0ec6429b
AM
37692013-01-14 Alan Modra <amodra@gmail.com>
3770
3771 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3772 * testsuite/Makefile.in: Regenerate.
3773
0bf402d5
ILT
37742013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3775
36af3926 3776 PR bfd/14430
0bf402d5
ILT
3777 Fix mingw gold build with plugins enabled
3778 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3779 * configure.ac: Export DLOPEN_LIBS and add headers check.
3780 * plugin.cc: Handle non-dlfcn case.
3781 * Makefile.in: Regenerate.
3782 * config.in: Regenerate.
3783 * configure: Regenerate.
3784 * testsuite/Makefile.in: Regenerate.
3785
9e9143bc
ST
37862013-01-09 Sriraman Tallam <tmsriram@google.com>
3787
3788 * output.h (sort_attached_input_sections): Change to be public.
3789 * script-sections.cc
3790 (Output_section_definition::set_section_addresses): Sort
3791 attached input sections according to section order before linker
3792 script assigns section addresses.
3793 (Orphan_output_section::set_section_addresses): Sort
3794 attached input sections according to section order before linker
3795 script assigns section addresses.
3796 * Makefile.am (final_layout.sh): Use a simple linker script to
3797 check if section ordering still works.
3798 * Makefile.in: Regenerate.
3799
679af368
ILT
38002013-01-09 Ben Cheng <bccheng@google.com>
3801
3802 * arm.cc (Target_arm::attributes_accept_div): New function.
3803 (Target_arm::attributes_forbid_div): New function.
3804 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3805 attribute using the same new functions as what bfd/elf32_arm.c
3806 does.
3807
3136a00e
CC
38082013-01-07 Cary Coutant <ccoutant@google.com>
3809
3810 PR gold/14993
3811 * output.cc (Output_section::add_input_section): For incremental
3812 updates, don't track input sections that are allocated from patch
3813 space.
3814
f2a6224b
L
38152013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3816 Ian Lance Taylor <iant@google.com>
3817
3818 PR gold/14897
3819 * configure.ac (--enable-ld): Removed.
3820 (install_as_default): Set to yes only for --enable-gold=default
3821 or --disable-ld.
3822 * configure: Regenerated.
3823
4f46f626
L
38242013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3825
3826 * options.h (General_options): Add -fuse-ld= for GCC linker
3827 option compatibility.
3828
26e4ef59
CC
38292013-01-04 Cary Coutant <ccoutant@google.com>
3830
3831 * configure.ac: Fix typo restoring CXXFLAGS.
3832 * configure: Regenerate.
3833
3d587466
CC
38342013-01-04 Cary Coutant <ccoutant@google.com>
3835
4f46f626
L
3836 * testsuite/Makefile.am (CXXLINK_S): New macro.
3837 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3838 * testsuite/Makefile.in: Regenerate.
3d587466 3839
44db6695
L
38402013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3841
3842 * version.cc (print_version): Update copyright year to 2013.
3843
edcac0c1
ILT
38442012-12-20 Ian Lance Taylor <iant@google.com>
3845
3846 * layout.cc (Layout::special_ordering_of_input_section): New
3847 function.
3848 (Layout::layout): If input section requires special ordering, must
3849 sort input sections.
3850 (Layout::make_output_section): May sort .text input sections.
3851 (Layout::is_section_name_prefix_grouped): Remove.
3852 * layout.h (class Layout): Declare
3853 special_ordering_of_input_section. Don't declare
3854 is_section_name_prefix_grouped.
3855 * output.cc (Output_section::add_input_section): Revert last
3856 change.
3857 (Output_section::Input_section_sort::match_file_name): Don't crash
3858 if called on output section data.
3859 (Output_section::Input_section_sort_compare): Sort based on
3860 special ordering.
3861 (Output_section::Input_section_sort_section_order_index_compare):
3862 Revert last patch.
3863 (Output_section::sort_attached_input_sections): Likewise.
3864
28f2a4ac
ST
38652012-12-18 Sriraman Tallam <tmsriram@google.com>
3866
edcac0c1 3867 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3868 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3869 * output.cc (Output_section::add_input_section): Check if section
3870 name contains special prefix. Keep input sections to sort such
3871 sections.
3872 (Output_section::Input_section_sort_section_order_index_compare
3873 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3874 (Output_section::sort_attached_input_sections): Add condition to
3875 Input_section_entry constructor call.
28f2a4ac
ST
3876 * testsuite/Makefile.am (text_section_grouping): New test.
3877 * testsuite/Makefile.in: Regenerate.
3878 * testsuite/text_section_grouping.cc: New file.
3879 * testsuite/text_section_grouping.sh: New file.
3880
5bf135a7
NC
38812012-12-17 Nick Clifton <nickc@redhat.com>
3882
3883 * Makefile.am: Add copyright notice.
3884 * NEWS: Likewise.
3885 * README: Likewise.
3886 * configure.ac: Likewise.
3887 * ftruncate.c: Likewise.
3888 * Makefile.in: Regenerate.
3889
59965708
CC
38902012-12-14 Cary Coutant <ccoutant@google.com>
3891
a4034750
AM
3892 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3893 --no-as-needed flag.
3894 (exception_separate_shared_12_test): Likewise.
3895 (incremental_copy_test): Likewise.
3896 * testsuite/Makefile.in: Regenerate.
59965708 3897
2a77e2ab
CC
38982012-12-14 Cary Coutant <ccoutant@google.com>
3899
3900 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3901 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3902
e3deeb9c
AM
39032012-12-12 Alan Modra <amodra@gmail.com>
3904
3905 * powerpc.cc (class Track_tls): New.
3906 (class Relocate, class Scan): Inherit Track_tls.
3907 (Target_powerpc::Scan::local, global): Track tls optimization
3908 and avoid creating plt entry for __tls_get_addr if all uses
3909 are optimized away.
3910 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3911
d8f5a274
AM
39122012-12-12 Alan Modra <amodra@gmail.com>
3913
3914 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3915 Replace no_toc_optimize with toc_optimize.
3916 * output.h (Output_section::input_sections): Provide non-const variant.
3917 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3918 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3919 accessors.
3920 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3921 (class Sort_toc_sections): New.
3922 (Target_powerpc::do_finalize_sections): Sort toc sections.
3923 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3924
4c8a1de1
RM
39252012-12-10 Roland McGrath <mcgrathr@google.com>
3926
3927 * testsuite/binary_unittest.cc (read_all): New function.
3928 (Sized_binary_test): Use it instead of ::read.
3929 * fileread.cc (do_read): Don't assume pread always reads the whole
3930 amount in a single call.
3931
edc27beb
AM
39322012-12-10 Alan Modra <amodra@gmail.com>
3933
3934 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3935 Set EM_PPC64 or EM_PPC here.
3936 (Target_selector_powerpc::do_recognize): Delete.
3937
906b9150
AM
39382012-12-10 Alan Modra <amodra@gmail.com>
3939
3940 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3941 stub_table_.
3942 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3943
418c15ae
RM
39442012-12-07 Roland McGrath <mcgrathr@google.com>
3945
3946 * testsuite/binary_unittest.cc (Sized_binary_test):
3947 Use open_descriptor rather than ::open.
3948
decdd3bc
AM
39492012-12-07 Alan Modra <amodra@gmail.com>
3950
3951 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3952 typedef and invalid_address constant.
3953 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3954 instantiate constants.
3955
db399005
ILT
39562012-12-06 Roland McGrath <mcgrathr@google.com>
3957
3958 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3959 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3960 * aclocal.m4: Regenerate.
3961 * configure: Regenerate.
3962 * Makefile.in: Regenerate.
3963 * testsuite/Makefile.in: Regenerate.
3964
aba6bc71
AM
39652012-12-07 Alan Modra <amodra@gmail.com>
3966
3967 * options.h (General_options): Add no_toc_optimize.
3968 * powerpc.cc (ok_lo_toc_insn): New function.
3969 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3970
9e69ed50
AM
39712012-12-06 Alan Modra <amodra@gmail.com>
3972
3973 * options.h (General_options): Add plt_align, plt_static_chain,
3974 plt_thread_safe. Update stub_group_size help text.
3975 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3976 for new plt_thread_safe_ var.
3977 (use_plt_offset): Correct comments.
3978 (Target_powerpc::do_relax): Look for thread creation symbols to
3979 determine default plt_thread_safe value. Clear plt call stubs
3980 as well as branch stubs each iteration.
3981 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3982 insn constants.
3983 (l, hi, ha, write_insn): Move earlier.
3984 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3985 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3986 plt stubs too.
3987 (Stub_table::update_size): Adjust.
3988 (Stub_table::prev_size, set_prev_size): Delete.
3989 (Stub_table::stub_align): Let --plt-align affect result.
3990 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3991 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3992 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3993 (Stub_table::do_write): Support more stub variants.
3994
f43ba157
AM
39952012-12-04 Alan Modra <amodra@gmail.com>
3996
3997 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3998 (Target_powerpc::do_define_standard_symbols): New function.
3999
34171bc5
AM
40002012-12-03 Alan Modra <amodra@gmail.com>
4001
4002 * output.h: Formatting, whitespace.
4003
dc9589e9 40042012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
4005
4006 * layout.h (Layout::get_executable_sections): Declare.
4007 * layout.cc (Layout::get_executable_sections): New function.
4008 * arm.cc (Target_arm::group_sections): Use it.
4009 (Arm_output_section::group_sections): Delete now redundant test.
4010 * output.cc (Output_reloc::Output_reloc): Add is_relative.
4011 param to handle relative relocs.
4012 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
4013 (Output_data_reloc::add_absolute): Adjust.
4014 (Output_data_reloc::add_relative): New function.
4015 (Output_data::reset_data_size): New function.
4016 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
4017 (Output_section::set_addralign): New function.
4018 (Output_section::checkpoint_set_addralign): New function.
4019 (Output_section::clear_section_offsets_need_adjustment): New function.
4020 (Output_section::input_sections): Make public.
4021 * powerpc.cc (class Output_data_brlt_powerpc): New.
4022 (class Stub_table, class Stub_control): New.
4023 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
4024 stub_table_, set_stub_table, stub_table): New vectors and accessor
4025 functions.
4026 (Target_powerpc::do_may_relax, do_relax, push_branch,
4027 new_stub_table, stub_tables, brlt_section, group_sections,
4028 add_branch_lookup_table, find_branch_lookup_table,
4029 write_branch_lookup_table, make_brlt_section): New functions.
4030 (Target_powerpc::struct Sort_sections, class Branch_info): New.
4031 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
4032 branch_info_): New vars.
4033 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
4034 make call stubs here.
4035 (Output_data_glink): Remove all call stub handling from this class.
4036 (Target_powerpc::Scan::local, global): Save interesting branch
4037 relocs and relocs for ifunc. Adjust calls to plt entry functions.
4038 (Target_powerpc::do_finalize_sections): Only make reg save/restore
4039 functions on final link.
4040 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
4041 Handle long branch destinations too.
4042 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
4043 do_plt_address_for_local): Adjust lookup of plt call stubs.
4044
627b30b7
AM
40452012-11-30 Alan Modra <amodra@gmail.com>
4046
4047 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
4048 relocs against protected symbols when building 32-bit shared libs.
4049
40b469d7
AM
40502012-11-30 Alan Modra <amodra@gmail.com>
4051
4052 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
4053 param. Call got_section() to make .got. Update all callers
4054 and their callers and so on.
4055
bb66a627
AM
40562012-11-30 Alan Modra <amodra@gmail.com>
4057
4058 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
4059 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
4060 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
4061 value if it already exists.
4062
d2cf1c6c
L
40632012-11-19 H.J. Lu <hongjiu.lu@intel.com>
4064
4065 PR gold/14858
4066 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
4067
edccdf7c
RM
40682012-11-14 Roland McGrath <mcgrathr@google.com>
4069
4070 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
4071 than bfc instruction for data sandboxing.
4072
6febeb74
AM
40732012-11-08 Alan Modra <amodra@gmail.com>
4074
4075 * po/POTFILES.in: Regenerate.
4076
0a6f1bf2
AM
40772012-11-05 Alan Modra <amodra@gmail.com>
4078
4079 * configure.ac: Apply 2012-09-10 change to config.in here.
4080 * configure: Regenerate.
4081
26a4e9cb
AM
40822012-11-05 Alan Modra <amodra@gmail.com>
4083
4084 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4085 (struct Opd_ent): Use "Address" rather than "Offset".
4086 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4087 (Target_powerpc::got_section): Make public.
4088 (Target_powerpc::scan_relocs): Move code setting symbols..
4089 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4090 Create _SDA_BASE_ only when referenced.
4091
cc928013
RM
40922012-11-02 Roland McGrath <mcgrathr@google.com>
4093
4094 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4095 from last change.
4096
50ed5eb1
RM
40972012-11-01 Roland McGrath <mcgrathr@google.com>
4098
62fe925a
RM
4099 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4100 for offset_in_output_section parameter.
4101 (Sized_target::relocate_special_relocatable): Likewise.
4102 * arm.cc (Target_arm::relocate_relocs): Likewise.
4103 (Target_arm::relocate_special_relocatable): Likewise.
4104 * i386.cc (Target_i386::relocate_relocs): Likewise.
4105 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4106 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4107 * target-reloc.h (relocate_relocs): Likewise.
4108 * testsuite/testfile.cc (Target_test): Likewise.
4109 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4110 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4111
4112 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4113 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4114
4115 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4116 parameter, which is unused in the [!F_SETFD] case.
4117
50ed5eb1
RM
4118 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4119 SYMNDX to off_t before comparing it to this->data_size().
4120 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4121 * incremental.cc (Output_section_incremental_inputs::do_write):
4122 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4123
2cadc0bf
RM
4124 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4125
3bfcb652
NC
41262012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4127
4128 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4129 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4130 in EABI_VER5.
4131
c1a8d56e
CC
41322012-10-29 Cary Coutant <ccoutant@google.com>
4133
4134 * dwp.cc (usage): Add file and exit status parameters;
4135 add --help and --version options.
4136 (print_version): New function.
4137 (main): Add --help and --version options.
4138
b2490a7b
L
41392012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4140
4141 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4142 final_layout_sequence.txt.
4143 * testsuite/Makefile.in: Regenerated.
4144
aa543512
L
41452012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4146
4147 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4148 COMPILE generated by automake.
4149 (LINK1): Likewise.
4150 (CXXCOMPILE1): Likewise.
4151 (CXXLINK1): Likewise.
4152 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4153 (LINK): Likewise.
4154 (CXXCOMPILE): Likewise.
4155 (CXXLINK): Likewise.
4156 * testsuite/Makefile.in: Regenerated.
4157
d361fafb
L
41582012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4159
4160 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4161 on bad fwrite return.
4162
598c7410
L
41632012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4164
4165 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4166 on val.
4167
35c813e2
CC
41682012-10-23 Cary Coutant <ccoutant@google.com>
4169
4170 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4171 * testsuite/Makefile.in: Regenerate.
4172 * testsuite/dwp_test.h: New source file.
4173 * testsuite/dwp_test_1.cc: New source file.
4174 * testsuite/dwp_test_1.s: New source file.
4175 * testsuite/dwp_test_1.sh: New source file.
4176 * testsuite/dwp_test_1b.cc: New source file.
4177 * testsuite/dwp_test_1b.s: New source file.
4178 * testsuite/dwp_test_2.cc: New source file.
4179 * testsuite/dwp_test_2.s: New source file.
4180 * testsuite/dwp_test_2.sh: New source file.
4181 * testsuite/dwp_test_main.cc: New source file.
4182 * testsuite/dwp_test_main.s: New source file.
4183
77429909
CC
41842012-10-23 Cary Coutant <ccoutant@google.com>
4185
4186 * dwp.h: New header file.
4187 * dwp.cc: New source file.
4188 * gold.h: Move shared declarations to system.h.
4189 * system.h: New header file.
4190 * Makefile.am: Add dwp.
4191 * Makefile.in: Regenerate.
4192
ed5d6712
CC
41932012-10-23 Cary Coutant <ccoutant@google.com>
4194
4195 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4196 Dwarf_info_reader::read_from_pointer.
4197 (Dwarf_pubnames_table::read_header): Likewise.
4198 (Dwarf_pubnames_table::next_name): Likewise.
4199 (Dwarf_die::read_attributes): Likewise.
4200 (Dwarf_die::skip_attributes): Likewise.
4201 (Dwarf_info_reader::read_from_pointer): New function template.
4202 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4203 (Dwarf_pubnames_table): Likewise.
4204 (Dwarf_info_reader::read_from_pointer): New function template.
4205 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4206 Dwarf_pubnames_table ctor.
4207
8787852d
CC
42082012-10-23 Cary Coutant <ccoutant@google.com>
4209
4210 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4211 abbrev_shndx.
4212 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4213 abbrev_shndx_.
4214 (Dwarf_info_reader::set_abbrev_shndx): New method.
4215 (Dwarf_info_reader::abbrev_shndx_): New data member.
4216
9fc236f3
CC
42172012-10-23 Cary Coutant <ccoutant@google.com>
4218
4219 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4220 from object, not parameters.
4221 (Dwarf_info_reader::parse): Likewise.
4222 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4223 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4224 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4225 methods.
4226
effe8365
CC
42272012-10-23 Cary Coutant <ccoutant@google.com>
4228
4229 * fileread.cc (Input_file::Input_file): New constructor.
4230 * fileread.h (class Input_file): Add new constructor.
4231
1698990d
AM
42322012-10-18 Alan Modra <amodra@gmail.com>
4233
4234 PR gold/14727
4235 * object.cc (Relobj::is_section_name_included): Also match
4236 .sdata personality section.
4237
168a4726
AM
42382012-10-18 Alan Modra <amodra@gmail.com>
4239
4240 * target-reloc.h (class Default_comdat_behavior): New, package up..
4241 (get_comdat_behaviour): ..this.
4242 (relocate_section): Add Relocate_comdat_behavior template arg,
4243 adjust code to suit.
4244 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4245 (Target_arm::scan_reloc_section): Likewise.
4246 * i386.cc (Target_i386::relocate_section): Likewise.
4247 * sparc.cc (Target_sparc::relocate_section): Likewise.
4248 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4249 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4250 * powerpc.cc (class Relocate_comdat_behavior): New.
4251 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4252 gold::relocate_section with new template arg.
4253
acc276d8
AM
42542012-10-18 Alan Modra <amodra@gmail.com>
4255
4256 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4257 dynamic relocs for GOT_TPREL got entries, without symbol if
4258 resolving locally.
4259 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4260 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4261 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4262
e10f9870
AM
42632012-10-17 Alan Modra <amodra@gmail.com>
4264
4265 PR gold/14726
4266 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4267
ae034989
ST
42682012-10-16 Sriraman Tallam <tmsriram@google.com>
4269
4270 * layout.cc (Layout::include_section): Keep sections marked
4271 SHF_EXCLUDE when doing relocatable links.
4272
f3a0ed29
AM
42732012-10-16 Alan Modra <amodra@gmail.com>
4274
4275 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4276 (Target_powerpc::do_finalize_sections): Call it.
4277 (Output_data_save_res): New class and supporting functions.
4278 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4279 normal symbols defined in object files.
4280
c6de8ed4
AM
42812012-10-12 Alan Modra <amodra@gmail.com>
4282
4283 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4284 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4285 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4286 section if scan_opd_relocs not yet called.
4287 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4288
03e25981
AM
42892012-10-12 Alan Modra <amodra@gmail.com>
4290
4291 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4292 add_local_ifunc_entry): Revert last change.
4293 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4294
c9824451
AM
42952012-10-05 Alan Modra <amodra@gmail.com>
4296
4297 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4298 do_plt_address_for_global): New functions.
4299 (Output_data_got_powerpc::do_write): Don't segfault when linking
4300 statically.
4301 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4302 add_local_ifunc_entry): Return true on adding entry..
4303 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4304 glink->add_entry call. Remove unused symtab param. Adjust calls.
4305 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4306 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4307 set up symbols here.
4308 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4309 syms here. Do so even when no .iplt. Don't segfault when linking
4310 statically.
4311 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4312 new variants without reloc param.
4313 (Glink_sym_ent::Glink_sym_ent): Likewise.
4314 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4315 reloc when refs will resolve to plt call stub.
4316 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4317 R_PPC_PLTREL24 to resolve locally.
4318 (Target_powerpc::Scan::global): Correct ifunc handling.
4319 (Target_powerpc::Relocate::relocate): Correct local sym glink
4320 lookup. Don't destroy "value" when we have a plt call stub,
4321 and when checking plt call validity.
4322 (Target_powerpc::do_dynsym_value): Simplify.
4323
19fec8c1
AM
43242012-10-05 Alan Modra <amodra@gmail.com>
4325
4326 * i386.cc (Output_data_plt_i386::address_for_global,
4327 address_for_local): Add plt offset to returned value. Adjust uses.
4328 * sparc.cc (Output_data_plt_sparc::address_for_global,
4329 address_for_local): Likewise.
4330 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4331 address_for_local): Likewise.
4332 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4333 address_for_local): Likewise.
4334 * target.h (Target::plt_address_for_global, plt_address_for_local):
4335 Update comment.
4336 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4337 (Output_data_got::Got_entry::write): Nor here.
4338 * output.h: Comment fix.
4339
e867b647
WL
43402012-10-02 Jiong Wang <jiwang@tilera.com>
4341
4342 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4343 global_offset_table_ value for larget got.
4344 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4345
e5d5f5ed
AM
43462012-09-29 Alan Modra <amodra@gmail.com>
4347
4348 * powerpc.cc (Target_powerpc::iplt_): New output section.
4349 (Target_powerpc::iplt_section, make_iplt_section,
4350 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4351 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4352 Target_powerpc::plt_entry_count): Count iplt entries too.
4353 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4354 reloc section in constructor. New params.
4355 (Target_powerpc::make_plt_section): Create reloc section here instead.
4356 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4357 functions.
4358 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4359 (Output_data_glink::add_entry, find_entry): New functions to
4360 deal with local syms.
4361 (Glink_sym_ent): Add support for local syms.
4362 (Output_data_glink::do_write): Handle ifunc plt entries.
4363 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4364 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4365 (Target_powerpc::Relocate::relocate): Likewise.
4366 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4367
ec4dbad3
AM
43682012-09-25 Alan Modra <amodra@gmail.com>
4369
4370 * object.h (Sized_relobj_file::adjust_local_symbol,
4371 do_adjust_local_symbol): New functions.
4372 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4373 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4374 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4375 and irregular opd entry spacing.
4376 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4377 (Global_symbol_visitor_opd): New functor.
4378 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4379 on deleted opd entries.
4380
5c0b3823
WL
43812012-09-15 Jiong Wang <jiwang@tilera.com>
4382
4383 * tilegx.cc: New file.
4384 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4385 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4386 * configure.tgt: Add entries for tilegx*.
4387 * configure.ac: Likewise.
4388 * Makefile.in: Rebuild.
4389 * configure: Likewise.
4390 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4391 tilegx.
4392
bfdfa4cd
AM
43932012-09-13 Alan Modra <amodra@gmail.com>
4394
4395 * target-reloc.h (scan_relocs): Call scan.local for relocs
4396 against symbols in discarded sections. Pass is_discarded
4397 param.
4398 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4399 Add is_discarded param.
4400 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4401 is_discarded to flag opd entry as discarded. Don't emit dyn
4402 relocs on such entries.
4403 (Target_powerpc::Scan::global): Similarly detect and handle
4404 such opd entries.
4405 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4406 opd_ent_. Update all uses.
4407 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4408 (Target_powerpc::relocate_section): Zero out discarded opd
4409 entry relocs.
4410
d77a0555
ILT
44112012-09-12 Ian Lance Taylor <iant@google.com>
4412
4413 PR gold/14570
4414 * output.cc: Rename Output_data_got template parameter from size
4415 to got_size for all functions. Compile all variants of
4416 Output_data_got.
4417 (Output_data_got::Got_entry::write): Correct use of size for
4418 symbol value. Use local_is_tls rather than casting to
4419 Sized_relobj_file.
4420 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4421 (class Sized_relobj_file): Add do_local_is_tls.
4422 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4423
815a1205
AM
44242012-09-11 Alan Modra <amodra@gmail.com>
4425
4426 PR gold/14566
4427 * layout.cc (Layout::set_segment_offsets): When using
4428 common-page-size alignment, ensure we are on a new max-page-size
4429 page.
4430 * output.cc (Output_segment::set_section_addresses): Use
4431 abi_pagesize, not common_pagesize for relro boundary.
4432 (Output_segment::set_offset): Likewise.
4433
bd73a62d
AM
44342012-09-11 Alan Modra <amodra@gmail.com>
4435
4436 * output.h (Output_data_got::add_global_tls, add_local_tls,
4437 add_local_tls_pair): New functions.
4438 (Output_data_got::add_local_pair_with_rel): Remove second
4439 reloc param. Expand comment.
4440 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4441 use_plt_or_tls_offset_, similarly for constructor param.
4442 (Output_data_got::Got_entry::write): Add got_index param.
4443 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4444 add_local_tls_pair): New functions.
4445 (Output_data_got::Got_entry::write): Handle tls symbols
4446 with use_plt_or_tls_offset_ set specially.
4447 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4448 (Output_data_got::do_write): Replace iterator with index, pass
4449 index to entry write function.
4450 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4451 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4452 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4453 call.
4454 * i386.cc (Target_i386::Scan::local): Likewise.
4455 * sparc.cc (Target_sparc::Scan::local): Likewise.
4456 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4457 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4458 do_tls_offset_for_global): New functions.
4459 (Target_powerpc::Scan::local): Correct TLS relocations and got
4460 entry values.
4461 (Target_powerpc::Scan::global): Don't emit unnecessary
4462 dynamic relocations on TLS GOT entries.
4463
00716ab1
AM
44642012-09-10 Matthias Klose <doko@ubuntu.com>
4465
4466 * config.in: Disable sanity check for kfreebsd.
4467
c891b3f9
SA
44682012-09-10 Sterling Augustine <saugustine@google.com>
4469
4470 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4471 (Gdb_index::pubtypes_read): New parameter.
4472 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4473 to calls.
4474 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4475 pubtypes_object_.
4476
e81fea4d
AM
44772012-09-09 Alan Modra <amodra@gmail.com>
4478
4479 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4480 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4481 * gc.h (gc_process_relocs): Call target gc_add_reference.
4482 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4483 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4484 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4485 unnecessary cast.
4486 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4487 to cater for when we don't need code offset. Update use.
4488 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4489 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4490 set_opd_valid): New functions.
4491 (Target_powerpc::do_gc_add_reference): New function.
4492 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4493 stashed refs.
4494 (Target_powerpc::do_gc_mark_symbol): New function.
4495
d2d60eef
CC
44962012-09-06 Cary Coutant <ccoutant@google.com>
4497
4498 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4499 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4500 (Dwarf_die::skip_attributes): Likewise.
4501 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4502 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4503 (main): Call it.
4504 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4505
32ed4573
L
45062012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4507
4508 * testsuite/script_test_3.t: Add .got.plt output section
4509 statement.
4510 * testsuite/script_test_4.t: Likewise.
4511
f4baf0d4
AM
45122012-09-05 Alan Modra <amodra@gmail.com>
4513
4514 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4515 update all uses and lose "enum" when using type.
4516
864a1b56
AM
45172012-09-05 Alan Modra <amodra@gmail.com>
4518
4519 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4520 * configure: Regenerate.
4521 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4522 (plugin_final_layout.stdout): Likewise.
4523 (memory_test): Set page sizes to 0x1000.
4524 * testsuite/Makefile.in: Regenerate.
4525 * testsuite/discard_locals_test.sh: Add FIXME comment.
4526 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4527 * testsuite/pr14265.t: Add .got output section statement.
4528 * testsuite/script_test_2.t: Likewise.
4529 * testsuite/script_test_3.t: Likewise.
4530 * testsuite/script_test_4.t: Likewise.
4531 * testsuite/script_test_5.t: Likewise.
4532 * testsuite/script_test_6.t: Likewise.
4533 * testsuite/script_test_7.t: Likewise.
4534 * testsuite/script_test_9.t: Likewise.
4535
3ea0a085
AM
45362012-09-05 Alan Modra <amodra@gmail.com>
4537
4538 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4539 (Powerpc_relocate_functions::Status): New typedef.
4540 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4541 (Target_powerpc::Scan::local): Handle REL64.
4542 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4543 for REL32 and REL64.
4544 (Target_powerpc::symval_for_branch): New function, extracted from..
4545 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4546 checks. Report overflow errors.
4547
7404fe1b
AM
45482012-09-05 Alan Modra <amodra@gmail.com>
4549
4550 * object.h (Sized_relobj_file::emit_relocs): Delete.
4551 (Sized_relobj_file::emit_relocs_reltype): Delete.
4552 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4553 relocate_relocs for --emit-relocs.
4554 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4555 * output.h: Update comment.
4556 (Output_segment::first_section): New function.
4557 (Output_segment::first_section_load_address): Use first_section.
4558 * output.cc (Output_segment::first_section): New function extracted..
4559 (Output_segment::first_section_load_address): ..from here. Delete.
4560 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4561 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4562 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4563 adjust call to target.h function.
4564 * i386.cc (Target_i386): Likewise.
4565 * sparc.cc (Target_sparc): Likewise.
4566 * x86_64.cc (Target_x86_64): Likewise.
4567 * powerpc.cc (Target_powerpc): Likewise.
4568 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4569 first tls section has section symbol for optimised local dynamic
4570 output relocs.
4571 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4572 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4573 optimised tls code.
4574 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4575 Rename to relocate_relocs. Update error message.
4576
957564c9
AS
45772012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4578
4579 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4580 --just-symbols.
4581
dd93cd0a
AM
45822012-08-31 Alan Modra <amodra@gmail.com>
4583
4584 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4585 (Powerpc_relobj::toc_base_offset): New stub function.
4586 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4587 got_mod_index_offset to tlsld_got_offset. Update all refs.
4588 (Target_powerpc::Relocate::enum skip_tls): New.
4589 (Target_powerpc::call_tls_get_addr_): New var.
4590 (Target_powerpc::is_branch_reloc): Move to file scope.
4591 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4592 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4593 New functions.
4594 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4595 (powerpc_info): Correct common_pagesize for ppc64.
4596 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4597 (Powerpc_relocate_functions): Add overflow check enums and functions.
4598 Add non-shift version of rela, rela_ua. Delete all rel public
4599 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4600 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4601 addr16_ha3, addr14 functions.
4602 (Output_data_got_powerpc::add_constant_pair): New function.
4603 (Output_data_got_powerpc::got_base_offset): Likewise.
4604 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4605 (instruction constants): Sort, add some more.
4606 (Output_data_glink::do_write): Add and use Address typedef. Use
4607 object->toc_base_offset() stub for 64-bit.
4608 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4609 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4610 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4611 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4612 Always treat .opd relocs as against locally defined symbol.
4613 Correct condition for RELATIVE relocs.
4614 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4615 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4616 for 32-bit syms with a plt entry. Correct ppc64 toc base
4617 calculations. Handle TLS relocs, and more. Add overflow
4618 checking and adjust for Powerpc_relocate_functions changes.
4619 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4620 Reinstate --emit-relocs code with FIXME.
4621
a1373b60
AM
46222012-08-30 Alan Modra <amodra@gmail.com>
4623
4624 * layout.cc (Layout::set_segment_offsets): Set p_align to
4625 abi_pagesize, not common_pagesize.
4626 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4627 to determine whether file header can go in segment.
4628
703d02da
AM
46292012-08-30 Alan Modra <amodra@gmail.com>
4630
4631 * output.h (Output_reloc::Output_reloc <output section>): Add
4632 is_relative param. Adjust calls.
4633 (Output_reloc::add_output_section_relative): New functions.
4634 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4635 is_relative.
4636 (Output_reloc::symbol_value): Handle SECTION_CODE.
4637
16164a6b
ST
46382012-08-24 Sriraman Tallam <tmsriram@google.com>
4639
4640 * gold.cc (queue_middle_tasks): Call layout again when unique
4641 segments for sections is desired.
4642 * layout.cc (Layout::Layout): Initialize new members.
4643 (Layout::get_output_section_flags): New function.
4644 (Layout::choose_output_section): Call get_output_section_flags.
4645 (Layout::layout): Make output section for mapping to a unique segment.
4646 (Layout::insert_section_segment_map): New function.
4647 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4648 output sections marked so.
16164a6b
ST
4649 (Layout::segment_precedes): Check for unique segments when sorting.
4650 * layout.h (Layout::Unique_segment_info): New struct.
4651 (Layout::Section_segment_map): New typedef.
4652 (Layout::insert_section_segment_map): New function.
4653 (Layout::get_output_section_flags): New function.
4654 (Layout::is_unique_segment_for_sections_specified): New function.
4655 (Layout::set_unique_segment_for_sections_specified): New function.
4656 (Layout::unique_segment_for_sections_specified_): New member.
4657 (Layout::section_segment_map_): New member.
4658 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4659 Rename is_gc_pass_one to is_pass_one.
4660 Rename is_gc_pass_two to is_pass_two.
4661 Rename is_gc_or_icf to is_two_pass.
4662 Check for which pass based on whether symbols data is present.
4663 Make it two pass when unique segments for sections is desired.
4664 * output.cc (Output_section::Output_section): Initialize new
4665 members.
4666 * output.h (Output_section::is_unique_segment): New function.
4667 (Output_section::set_is_unique_segment): New function.
4668 (Output_section::is_unique_segment_): New member.
4669 (Output_section::extra_segment_flags): New function.
4670 (Output_section::set_extra_segment_flags): New function.
4671 (Output_section::extra_segment_flags_): New member.
4672 (Output_section::segment_alignment): New function.
4673 (Output_section::set_segment_alignment): New function.
4674 (Output_section::segment_alignment_): New member.
4675 (Output_segment::Output_segment): Initialize is_unique_segment_.
4676 (Output_segment::is_unique_segment): New function.
4677 (Output_segment::set_is_unique_segment): New function.
4678 (Output_segment::is_unique_segment_): New member.
4679 * plugin.cc (allow_unique_segment_for_sections): New function.
4680 (unique_segment_for_sections): New function.
4681 (Plugin::load): Add new functions to transfer vector.
4682 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4683 * Makefile.in: Regenerate.
4684 * testsuite/plugin_final_layout.sh: Check if unique segment
4685 functionality works.
4686 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4687 are available.
4688 (allow_unique_segment_for_sections): New global.
4689 (unique_segment_for_sections): New global.
4690 (claim_file_hook): Call allow_unique_segment_for_sections.
4691 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4692
1e2bee4f
CC
46932012-08-22 Cary Coutant <ccoutant@google.com>
4694
4695 * layout.cc (Layout::include_section): Don't assert on GROUP
4696 sections with --emit-relocs.
4697
1d5dfe78
CC
46982012-08-21 Cary Coutant <ccoutant@google.com>
4699
4700 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4701 if --export-dynamic-symbol names an undef symbol.
4702
c9269dff
AM
47032012-08-18 Alan Modra <amodra@gmail.com>
4704
4705 * powerpc.cc: Formatting and white space.
4706 (Powerpc_relobj): Rename got2_section_ to special_.
4707 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4708 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4709 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4710 (Target_powerpc): Add Address typedef and invalid_address. Use
4711 throughout.
4712 (Target_powerpc::is_branch_reloc): New function.
4713 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4714 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4715 for dst_mask, value and addend.
4716 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4717 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4718 (Output_data_glink::do_write): Correct toc base. Don't try to use
4719 uint16_t for 24-bit offset. Use get_output_section_offset and
4720 check return.
4721 (Target_powerpc::Scan::local): Handle more relocs.
4722 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4723 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4724 Plug in toc restoring insn after plt calls. Translate branches
4725 to function descriptor symbols to corresponding entry point.
4726 (Target_powerpc::relocate_for_relocatable): Check return from
4727 get_output_section_offset.
4728 * symtab.h: Comment typo.
4729
b1759dce
ILT
47302012-08-14 Ian Lance Taylor <iant@google.com>
4731
4732 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4733 unsupported_relocal_local to call unsupported_reloc_global.
4734
b9b2ae8b
NC
47352012-08-14 Nick Clifton <nickc@redhat.com>
4736
4737 PR ld/14265
4738 * script-sections.cc (Sections_element::output_section_name): Add
4739 keep return parameter.
4740 (Output_section_element::match_name): Add keep return parameter.
4741 Return the value of the keep_ member.
4742 * script-sections.h (class Output_section): Update
4743 output_section_name prototype.
4744 * layout.cc (Layout::keep_input_section): New public member
4745 function.
4746 (Layout::choose_output_section): Pass keep parameter to
4747 output_section_name.
4748 * layout.h (class Layout): Add keep_input_section.
4749 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4750 sections.
4751 * testsuite/Makefile.am: Add a test.
4752 * testsuite/Makefile.in: Regenerate.
4753 * testsuite/pr14265.c: Source file for the test.
4754 * testsuite/pr14265.t: Linker script for the test.
4755 * testsuite/pr14265.sh: Shell script for the test.
4756
921b5322
AM
47572012-08-14 Alan Modra <amodra@gmail.com>
4758
4759 * target.h (Target::output_section_name): New function.
4760 (Target::do_output_section_name): New function.
4761 * layout.cc (Layout::choose_output_section): Call the above.
4762 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4763
6ce78956
AM
47642012-08-14 Alan Modra <amodra@gmail.com>
4765
4766 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4767 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4768 for replace_constant call.
4769 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4770 (Output_data_glink::do_print_to_mapfile): New function.
4771 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4772 (Target_powerpc::Relocate::relocate): Likewise.
4773
d1a8cabd
AM
47742012-08-14 Alan Modra <amodra@gmail.com>
4775
4776 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4777 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4778 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4779 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4780 all references to shndx_. Handle special case for R_PPC_PLTREL24
4781 here.
4782 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4783 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4784 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4785 here.
4786 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4787 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4788
d83ce4e3
AM
47892012-08-12 Alan Modra <amodra@gmail.com>
4790
4791 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4792 (glink insn constants): Use uint32_t.
4793 (Output_data_glink::add_entry): Use insert, not [] operator.
4794
cf43a2fe
AM
47952012-08-11 Alan Modra <amodra@gmail.com>
4796
4797 * object.h (Sized_relobj_file::find_shdr): New function.
4798 (Sized_relobj_file::find_special_sections): New function.
4799 * object.cc (Sized_relobj_file::find_shdr): New function.
4800 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4801 (Sized_relobj_file::find_special_sections): New function, split out..
4802 (Sized_relobj_file::do_read_symbols): ..from here.
4803 * output.h (Output_data_got::replace_constant): New function.
4804 (Output_data_got::num_entries): New function.
4805 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4806 (Output_data_got::got_offset): Protected rather than private.
4807 (Output_data_got::replace_got_entry): New function.
4808 * output.cc (Output_data_got::replace_got_entry): New function.
4809 * powerpc.cc (class Powerpc_relobj): New.
4810 (class Powerpc_relocate_functions): Delete all psymval variants or
4811 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4812 Implement _ha functions using corresponding _hi function.
4813 (Powerpc_relobj::find_special_sections): New function.
4814 (Target_powerpc::do_make_elf_object): New function.
4815 (class Output_data_got_powerpc): New.
4816 (class Output_data_glink): New.
4817 (class Powerpc_scan_relocatable_reloc): New.
4818 Many more changes througout file.
4819
3c892704
NC
48202012-08-09 Nick Clifton <nickc@redhat.com>
4821
4822 * po/vi.po: Updated Vietnamese translation.
4823
82435b3b
ILT
48242012-08-07 Ian Lance Taylor <iant@google.com>
4825
4826 * layout.cc (Layout::add_target_dynamic_tags): If
4827 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4828 plt_rel.
4829
a6dc81d2
NC
48302012-07-30 Nick Clifton <nickc@redhat.com>
4831
4832 * po/gold.pot: Updated template.
4833 * po/es.po: Updated Spanish translation.
4834
f1415016
CC
48352012-07-18 Cary Coutant <ccoutant@google.com>
4836
4837 PR gold/14344
4838 * configure.ac: Add check for -gpubnames support.
4839 * configure: Regenerate.
4840 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4841 support; force -gno-pubnames.
4842 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4843 support.
4844 (gdb_index_test_4): New test.
4845 * testsuite/Makefile.in: Regenerate.
4846 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4847 * testsuite/gdb_index_test_2.sh: Likewise.
4848 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4849 * testsuite/gdb_index_test_4.sh: New script.
4850 * testsuite/gdb_index_test_comm.sh: New script with common code;
4851 don't look for space after colon.
4852
b7fd7c37
ST
48532012-07-16 Sriraman Tallam <tmsriram@google.com>
4854
4855 * gold.cc (queue_middle_tasks): Update function order only after
4856 deferred objects due to plugins are processed.
4857
1f3212db
ILT
48582012-07-11 Ian Lance Taylor <iant@google.com>
4859
4860 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4861 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4862 (Target_arm::scan_reloc_for_stub): Likewise.
4863 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4864 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4865 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4866 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4867 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4868
81c82a68
ILT
48692012-07-10 Dodji Seketeli <dodji@redhat.com>
4870 Ian Lance Taylor <iant@google.com>
4871
4872 PR gold/14309
4873 * configure.ac: Test whether std::tr1::hash<off_t> works.
4874 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4875 needed.
4876 * output.h (class Output_fill): Add virtual destructor.
4877 * configure, config.in: Rebuild.
4878
eabc84f4
RM
48792012-06-22 Roland McGrath <mcgrathr@google.com>
4880
4881 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4882
370e30b6
RÁE
48832012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4884
4885 * plugin.cc (Plugin::load): Handle position independent executables.
4886
fb1b895d
CC
48872012-06-06 Cary Coutant <ccoutant@google.com>
4888
4889 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4890 add .debug_macro.
4891 (lines_only_debug_sections): Likewise.
4892 (gdb_fast_lookup_sections): New static array.
4893 (is_gdb_debug_section): Rename formal parameter.
4894 (is_lines_only_debug_section): Likewise.
4895 (is_gdb_fast_lookup_section): New function.
4896 (Layout::include_section): Check for ".zdebug_" prefix; pass
4897 section name suffix to is_gdb_debug_section, et al.; check for
4898 fast-lookup sections when building .gdb_index.
4899 * options.h (--strip-debug-gdb): Update GDB version number.
4900
7c0640fa
CC
49012012-06-06 Cary Coutant <ccoutant@google.com>
4902
4903 * configure.ac: Add check for fallocate.
4904 * configure: Regenerate.
4905 * config.in: Regenerate.
4906
4907 * options.h (class General_options): Add --mmap-output-file and
4908 --posix-fallocate options.
4909 * output.cc: (posix_fallocate): Remove; replace with...
4910 (gold_fallocate): New function.
4911 (Output_file::map_no_anonymous): Call gold_fallocate.
4912 (Output_file::map): Check --mmap-output-file option.
4913
2a49eb69
DK
49142012-06-05 Jing Yu <jingyu@google.com>
4915
4916 * gold.h (textdomain): Add do {} to empty while(0).
4917 (bindtextdomain): Likewise.
4918
fad072ac
CC
49192012-06-04 Cary Coutant <ccoutant@google.com>
4920
4921 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4922 has_dynsym_index.
4923
8cc69fb6
ST
49242012-05-25 Sriraman Tallam <tmsriram@google.com>
4925
4926 * symtab.cc (Symbol_table::define_special_symbol):
4927 Initialize *poldsym to prevent uninitialized variable errors.
4928
1be75daa
CC
49292012-05-23 Cary Coutant <ccoutant@google.com>
4930
4931 * layout.cc (Layout::section_name_mapping): Add rules to handle
4932 exact match on .data.rel.ro.local or .data.rel.ro.
4933 (Layout::output_section_name): Check for exact matches.
4934
9b689de0
CC
49352012-05-23 Cary Coutant <ccoutant@google.com>
4936
4937 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4938 more carefully.
4939
b24fdbf5
CC
49402012-05-22 Cary Coutant <ccoutant@google.com>
4941
4942 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4943 object before exporting symbol.
4944
e550e1a2
L
49452012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4946
4947 * testsuite/tls_test.cc: Include "config.h" first.
4948 * testsuite/tls_test_c.c: Likewise.
4949
df7b86aa
NC
49502012-05-17 Daniel Richard G. <skunk@iskunk.org>
4951 Nick Clifton <nickc@redhat.com>
4952
4953 PR 14072
4954 * configure.in: Add check that sysdep.h has been included before
4955 any system header files.
4956 * configure: Regenerate.
4957 * config.in: Regenerate.
4958
1007b503
CC
49592012-05-14 Cary Coutant <ccoutant@google.com>
4960
4961 * layout.cc (Layout::make_output_section): Mark .tdata section
4962 as RELRO.
4963 * testsuite/relro_test.cc: Add a TLS variable.
4964
fd885f3a
L
49652012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4966
4967 PR gold/14091
4968 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4969 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4970 R_X86_64_64.
4971
80f5885c
CC
49722012-05-08 Cary Coutant <ccoutant@google.com>
4973
4974 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4975 (lines_only_debug_sections): Likewise.
4976
2e702c99
RM
49772012-05-02 Roland McGrath <mcgrathr@google.com>
4978
4979 * nacl.cc: New file.
4980 * nacl.h: New file.
4981 * Makefile.am (CCFILES, HFILES): Add them.
4982 * Makefile.in: Regenerate.
4983 * i386.cc (Output_data_plt_i386_nacl): New class.
4984 (Output_data_plt_i386_nacl_exec): New class.
4985 (Output_data_plt_i386_nacl_dyn): New class.
4986 (Target_i386_nacl): New class.
4987 (Target_selector_i386_nacl): New class.
4988 (target_selector_i386): Use it instead of Target_selector_i386.
4989 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4990 (Target_x86_64_nacl): New class.
4991 (Target_selector_x86_64_nacl): New class.
4992 (target_selector_x86_64, target_selector_x32): Use it instead of
4993 Target_selector_x86_64.
4994 * arm.cc (Output_data_plt_arm_nacl): New class.
4995 (Target_arm_nacl): New class.
4996 (Target_selector_arm_nacl): New class.
4997 (target_selector_arm, target_selector_armbe): Use it instead of
4998 Target_selector_arm.
4999
5000 * target-select.cc (select_target): Take new Input_file* and off_t
5001 arguments, pass them on to recognize method of selector.
5002 * object.cc (make_elf_sized_object): Update caller.
5003 * parameters.cc (parameters_force_valid_target): Likewise.
5004 * incremental.cc (make_sized_incremental_binary): Likewise.
5005 * target-select.h: Update decl.
5006 (Target_selector::recognize): Take new Input_file* argument,
5007 pass it on to do_recognize.
5008 (Target_selector::do_recognize): Take new Input_file* argument.
5009 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
5010 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
5011 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
5012 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
5013
5014 * target.h (Target::Target_info): New members isolate_execinstr
5015 and rosegment_gap.
5016 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
5017 * arm.cc (Target_arm::arm_info): Update initializer.
5018 * i386.cc (Target_i386::i386_info): Likewise.
5019 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
5020 * sparc.cc (Target_sparc::sparc_info): Likewise.
5021 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5022 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
5023 * layout.cc (Layout::attach_allocated_section_to_segment):
5024 Take new const Target* argument. If target->isolate_execinstr(), act
5025 like --rosegment.
5026 (Layout::find_first_load_seg): Take new const Target* argument;
5027 if target->isolate_execinstr(), reject PF_X segments.
5028 (Layout::relaxation_loop_body): Update caller.
5029 (Layout::set_segment_offsets): If target->isolate_execinstr(),
5030 reset file offset to zero when we hit LOAD_SEG, and then do a second
5031 loop over the segments before LOAD_SEG to reassign offsets after
5032 addresses have been determined. Handle target->rosegment_gap().
5033 (Layout::attach_section_to_segment): Take new const Target* argument;
5034 pass it to attach_allocated_section_to_segment.
5035 (Layout::make_output_section): Update caller.
5036 (Layout::attach_sections_to_segments): Take new const Target* argument;
5037 pass it to attach_section_to_segment.
5038 * gold.cc (queue_middle_tasks): Update caller.
5039 * layout.h (Layout): Update method decls with new arguments.
5040
5041 * arm.cc (Target_arm::Target_arm): Take optional argument for the
5042 Target_info pointer to use.
5043 (Target_arm::do_make_data_plt): New virtual method.
5044 (Target_arm::make_data_plt): New method that calls it.
5045 (Target_arm::make_plt_entry): Use it.
5046 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
5047 for the section alignment.
5048 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
5049 method.
5050 (Output_data_plt_arm::first_plt_entry_offset): Call it.
5051 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
5052 method.
5053 (Output_data_plt_arm::get_plt_entry_size): Call it.
5054 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
5055 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
5056 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
5057 method.
5058 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
5059 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
5060 method instead of sizeof(plt_entry).
5061 (Output_data_plt_arm::add_entry): Likewise.
5062 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
5063 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
5064 than static method.
5065 (Target_arm::plt_entry_size): Likewise.
5066 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
5067 Move to ...
5068 (Output_data_plt_arm_standard): ... here, new class.
5069 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
5070 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
5071 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
5072
5073 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5074 Take additional argument for the PLT entry size.
5075 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
5076 Use get_plt_entry_size method rather than plt_entry_size variable.
5077 (Output_data_plt_x86_64::reserve_slot): Likewise.
5078 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
5079 (Output_data_plt_x86_64::add_entry): Likewise.
5080 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5081 (Output_data_plt_x86_64::address_for_global): Likewise.
5082 (Output_data_plt_x86_64::address_for_local): Likewise.
5083 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5084 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5085 Make method non-static.
5086 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5087 method.
5088 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5089 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5090 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5091 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5092 virtual method.
5093 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5094 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5095 virtual method.
5096 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5097 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5098 virtual method.
5099 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5100 (Output_data_plt_x86_64::plt_entry_size)
5101 (Output_data_plt_x86_64::first_plt_entry)
5102 (Output_data_plt_x86_64::plt_entry)
5103 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5104 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5105 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5106 (Output_data_plt_x86_64_standard): ... here, new class.
5107 (Target_x86_64::Target_x86_64): Take optional argument for the
5108 Target_info pointer to use.
5109 (Target_x86_64::do_make_data_plt): New virtual method.
5110 (Target_x86_64::make_data_plt): New method to call it.
5111 (Target_x86_64::init_got_plt_for_update): Use that.
5112 Call this->plt_->add_eh_frame method here.
5113 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5114 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5115 rather than static method.
5116 (Target_x86_64::plt_entry_size): Likewise.
5117 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5118 rather than plt_entry_size variable. Move guts of PLT filling to...
5119 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5120 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5121 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5122
5123 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5124 additional argument for the section alignment.
5125 Don't do add_eh_frame_for_plt here.
5126 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5127 non-static. Use get_plt_entry_size method rather than plt_entry_size
5128 variable.
5129 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5130 method.
5131 (Output_data_plt_i386::get_plt_entry_size): Call it.
5132 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5133 (Output_data_plt_i386::add_eh_frame): New method to call it.
5134 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5135 method.
5136 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5137 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5138 method.
5139 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5140 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5141 method instead of plt_entry_size.
5142 (Output_data_plt_i386::plt_entry_size)
5143 (Output_data_plt_i386::plt_eh_frame_fde_size)
5144 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5145 (Output_data_plt_i386_standard): ... here, new class.
5146 (Output_data_plt_i386_exec): New class.
5147 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5148 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5149 (Output_data_plt_i386::exec_plt_entry): Move to ...
5150 (Output_data_plt_i386_exec::plt_entry): ... here.
5151 (Output_data_plt_i386_dyn): New class.
5152 (Output_data_plt_i386::first_plt_entry): Move to ...
5153 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5154 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5155 (Output_data_plt_i386_dyn::plt_entry): ... here.
5156 (Target_i386::Target_i386): Take optional argument for the Target_info
5157 pointer to use.
5158 (Target_i386::do_make_data_plt): New virtual method.
5159 (Target_i386::make_data_plt): New method to call it.
5160 (Target_i386::make_plt_section): Use that.
5161 Call this->plt_->add_eh_frame method here.
5162 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5163 rather than plt_entry_size variable.
5164 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5165 (Output_data_plt_i386::address_for_local): Likewise.
5166 (Output_data_plt_i386::do_write): Likewise.
5167 Move guts of PLT filling to...
5168 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5169 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5170 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5171 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5172
b9b9f2ee
CC
51732012-05-01 Cary Coutant <ccoutant@google.com>
5174
5175 * dwarf_reader.cc (Dwarf_die::read_attributes)
5176 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5177 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5178 * reduced_debug_output.cc
5179 (Output_reduced_debug_info_section::get_die_end): Remove
5180 DW_FORM_GNU_ref_index. Add default case.
5181
57923f48
MW
51822012-04-26 Mark Wielaard <mjw@redhat.com>
5183
5184 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5185 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5186 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5187 DW_AT_high_pc as offset from DW_AT_low_pc.
5188
5189 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5190 * testsuite/Makefile.in: Regenerate.
5191 * testsuite/gdb_index_test_3.c: New test source file.
5192 * testsuite/gdb_index_test_3.sh: New test source file.
5193
2c54b4f4
ILT
51942012-04-25 Ian Lance Taylor <iant@google.com>
5195
5196 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5197 pointer.
5198 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5199 as a class, not a struct.
5200 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5201 (Target_arm::apply_cortex_a8_workaround): Likewise.
5202 * gc.h: Declare Reloc_types as a struct, not a class.
5203 * object.h: Declare Symbols_data as a struct.
5204 * reloc.h: Declare Read_relocs_data as a struct.
5205 * target.h: Declare Relocate_info as a struct.
5206
a5a5f7a3
DM
52072012-04-24 David S. Miller <davem@davemloft.net>
5208
5209 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5210 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5211 and R_SPARC_WPLT30.
5212
f038d496
CC
52132012-04-24 Cary Coutant <ccoutant@google.com>
5214
5215 * incremental-dump.cc (find_input_containing_global): Replace
5216 magic number with symbolic constant.
5217 (dump_incremental_inputs): Update version number.
5218 * incremental.cc (Output_section_incremental_inputs): Update version
5219 number; import symbolic constants from Incremental_inputs_reader.
5220 (Incremental_inputs::create_data_sections): Align relocations
5221 section correctly for 64-bit targets.
5222 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5223 constants; add padding.
5224 (Output_section_incremental_inputs::write_header): Add assert for
5225 header_size.
5226 (Output_section_incremental_inputs::write_input_files): Add assert
5227 for input_entry_size.
5228 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5229 add assert for object_info_size, input_section_entry_size,
5230 global_sym_entry_size.
5231 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5232 for data structure sizes; use them.
5233 (Incremental_input_entry_reader): Import symbolic constants from
5234 Incremental_inputs_reader; use them.
5235
a4d85145
DM
52362012-04-23 David S. Miller <davem@davemloft.net>
5237
5238 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5239 and elf_flags_set_.
5240 (Target_sparc::Target_sparc): Initialize new fields.
5241 (Target_sparc::do_make_elf_object): New function.
5242 (Target_sparc::do_adjust_elf_header): New function.
5243
1d509098
CC
52442012-04-23 Cary Coutant <ccoutant@google.com>
5245
5246 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5247 CU range table of gdb index.
5248
7ebeff7f
DM
52492012-04-20 David S. Miller <davem@davemloft.net>
5250
5251 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5252 instead of false.
5253
13cf9988
DM
52542012-04-16 David S. Miller <davem@davemloft.net>
5255
2a1079e8
DM
5256 * sparc.cc (Target_sparc::got_address): New function.
5257 (Sparc_relocate_functions::gdop_hix22): New function.
5258 (Sparc_relocate_functions::gdop_lox10): New function.
5259 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5260 relocs.
5261 (Target_sparc::Scan::local): Likewise if the global symbol is not
5262 preemptible and is not IFUNC.
5263 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5264 transformations for local and non-preemptible non-IFUNC global
5265 symbols.
5266
0bc964fc
DM
5267 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5268 writing out 64-bit part of ranges.
5269
661d7a80
DM
5270 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5271 -fpic and -fpie respectively.
5272 * Makefile.in: Regenerate.
5273
8c2bf391
DM
5274 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5275 (Target_sparc::Target_sparc): Initialize new field.
5276 (Target_sparc::do_plt_section_for_global): New function.
5277 (Target_sparc::do_plt_section_for_local): New function.
5278 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5279 (Target_sparc::make_plt_section): New function, broken out of
5280 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5281 (Target_sparc::make_plt_entry): Call make_plt_section.
5282 (Target_sparc::make_local_ifunc_plt_entry): New function.
5283 (Target_sparc::rela_ifunc_section): New function.
5284 (Target_sparc::plt_section): Remove const.
5285 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5286 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5287 and ifunc_count_ fields.
5288 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5289 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5290 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5291 (Output_data_plt_sparc::rela_ifunc): New function.
5292 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5293 (Output_data_plt_sparc::has_ifunc_section): New function.
5294 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5295 (Output_data_plt_sparc::address_for_global): New function.
5296 (Output_data_plt_sparc::address_for_local): New function.
5297 (Output_data_plt_sparc::plt_index_to_offset): New function.
5298 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5299 and entry_count.
5300 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5301 entry_count.
5302 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5303 R_SPARC_JMP_IREL to switch.
5304 (Target_sparc::Scan::check_non_pic): Likewise.
5305 (Target_sparc::Scan::local): Handle IFUNC symbols.
5306 (Target_sparc::Scan::local): Likewise.
5307 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5308 and plt_address_for_local.
5309 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5310 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5311
13cf9988
DM
5312 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5313 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5314 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5315 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5316 global relocs too.
5317 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5318 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5319 calls.
5320 * sparc.cc (Target_sparc::Scan::global): Likewise.
5321 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5322
31821be0
CC
53232012-04-16 Cary Coutant <ccoutant@google.com>
5324
5325 * archive.cc (Library_base::should_include_member): Check for
5326 --export-dynamic-symbol.
5327 * options.h (class General_options): Add --export-dynamic-symbol.
5328 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5329 --export-dynamic-symbol.
5330 (Symbol_table::gc_mark_undef_symbols): Likewise.
5331 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5332
2615994e
DM
53332012-04-12 David S. Miller <davem@davemloft.net>
5334
5335 * sparc.cc (Reloc::wdisp10): New relocation method.
5336 (Reloc::h34): Likewise.
5337 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5338 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5339 R_SPARC_WDISP10.
5340 (Target_sparc::Scan::local): Likewise.
5341 (Target_sparc::Scan::global): Likewise.
5342 (Target_sparc::Relocate::relocate): Likewise.
5343
6782735d
CC
53442012-04-09 Cary Coutant <ccoutant@google.com>
5345
5346 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5347 low_pc == 0.
5348
8c7a0b00
ILT
53492012-04-06 Ian Lance Taylor <iant@google.com>
5350
5351 * timer.cc: #include <unistd.h>.
5352
58797674
RM
53532012-04-06 Roland McGrath <mcgrathr@google.com>
5354
5355 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5356 * config.in: Regenerate.
5357 * configure: Regenerate.
5358
44350750
NC
53592012-04-05 Nick Clifton <nickc@redhat.com>
5360
5361 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5362 (AM_LC_MESSAGES): Add.
5363 * aclocal.m4: Regenerate.
5364 * config.in: Regenerate.
5365 * configure: Regenerate.
5366
c1027032
CC
53672012-03-21 Cary Coutant <ccoutant@google.com>
5368
5369 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5370 * Makefile.in: Regenerate.
5371 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5372 (Sized_elf_reloc_mapper::symbol_section): New function.
5373 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5374 (make_elf_reloc_mapper): New function.
5375 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5376 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5377 (Dwarf_abbrev_table::do_get_abbrev): New function.
5378 (Dwarf_ranges_table::read_ranges_table): New function.
5379 (Dwarf_ranges_table::read_range_list): New function.
5380 (Dwarf_pubnames_table::read_section): New function.
5381 (Dwarf_pubnames_table::read_header): New function.
5382 (Dwarf_pubnames_table::next_name): New function.
5383 (Dwarf_die::Dwarf_die): New function.
5384 (Dwarf_die::read_attributes): New function.
5385 (Dwarf_die::skip_attributes): New function.
5386 (Dwarf_die::set_name): New function.
5387 (Dwarf_die::set_linkage_name): New function.
5388 (Dwarf_die::attribute): New function.
5389 (Dwarf_die::string_attribute): New function.
5390 (Dwarf_die::int_attribute): New function.
5391 (Dwarf_die::uint_attribute): New function.
5392 (Dwarf_die::ref_attribute): New function.
5393 (Dwarf_die::child_offset): New function.
5394 (Dwarf_die::sibling_offset): New function.
5395 (Dwarf_info_reader::check_buffer): New function.
5396 (Dwarf_info_reader::parse): New function.
5397 (Dwarf_info_reader::do_parse): New function.
5398 (Dwarf_info_reader::do_read_string_table): New function.
5399 (Dwarf_info_reader::lookup_reloc): New function.
5400 (Dwarf_info_reader::get_string): New function.
5401 (Dwarf_info_reader::visit_compilation_unit): New function.
5402 (Dwarf_info_reader::visit_type_unit): New function.
5403 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5404 Sized_elf_reloc_mapper.
5405 (Sized_dwarf_line_info::symbol_section): Remove function.
5406 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5407 (Sized_dwarf_line_info::read_line_mappings): Remove object
5408 parameter, adjust callers.
5409 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5410 * dwarf_reader.h: Include <sys/types.h>.
5411 (class Track_relocs): Remove forward declaration.
5412 (class Elf_reloc_mapper): New class.
5413 (class Sized_elf_reloc_mapper): New class.
5414 (class Dwarf_abbrev_table): New class.
5415 (class Dwarf_range_list): New class.
5416 (class Dwarf_ranges_table): New class.
5417 (class Dwarf_pubnames_table): New class.
5418 (class Dwarf_die): New class.
5419 (class Dwarf_info_reader): New class.
5420 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5421 (Sized_dwarf_line_info::symbol_section): Remove member function.
5422 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5423 base class.
5424 * gdb-index.cc: New source file.
5425 * gdb-index.h: New source file.
5426 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5427 and .debug_types sections, call Layout::add_to_gdb_index.
5428 (Sized_relobj_incr::do_section_name): Implement.
5429 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5430 return type; Implement.
5431 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5432 return type.
5433 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5434 parameter list and return type.
5435 (Sized_incr_dynobj::do_section_contents): Likewise.
5436 * layout.cc: Include gdb-index.h.
5437 (Layout::Layout): Initialize gdb_index_data_.
5438 (Layout::init_fixed_output_section): Check for .gdb_index section.
5439 (Layout::add_to_gdb_index): New function. Instantiate.
5440 * layout.h: Add forward declaration for class Gdb_index.
5441 (Layout::add_to_gdb_index): New member function.
5442 (Layout::gdb_index_data_): New data member.
5443 * main.cc: Include gdb-index.h.
5444 (main): Print statistics for gdb index.
5445 * object.cc (Object::section_contents): Move code into
5446 do_section_contents.
5447 (need_decompressed_section): Check for sections needed when building
5448 gdb index.
5449 (build_compressed_section_map): Likewise.
5450 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5451 gdb index.
5452 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5453 sections; call Layout::add_to_gdb_index.
5454 (Sized_relobj_file::do_decompressed_section_contents): Call
5455 do_section_contents directly.
5456 * object.h (Object::do_section_contents): Adjust parameter list and
5457 return type.
5458 (Object::do_decompressed_section_contents): Call do_section_contents
5459 directly.
5460 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5461 return type.
5462 * options.h (class General_options): Add --gdb-index option.
5463 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5464 list and return type.
5465 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5466 * reloc.h (Track_relocs::checkpoint): New function.
5467 (Track_relocs::reset): New function.
5468
5469 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5470 New test cases.
5471 * testsuite/Makefile.in: Regenerate.
5472 * testsuite/gdb_index_test.cc: New test source file.
5473 * testsuite/gdb_index_test_1.sh: New test source file.
5474 * testsuite/gdb_index_test_2.sh: New test source file.
5475
647f1574
DK
54762012-03-19 Doug Kwan <dougkwan@google.com>
5477
5478 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5479 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5480 __exidx_start and __exidx_end. Make symbol table parameter
5481 anonymous as it is not used.
5482 * gold.cc (queue_middle_tasks): Call target hook to define any
5483 target-specific symbols.
5484 * target.h (Target::define_standard_symbols): New method.
5485 (Target::do_define_standard_symbols): Same.
5486 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5487 * testsuite/Makefile.in: Regenerate.
5488 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5489 and __exidx_end.
5490 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5491 relocations are generated for __exidx_start and __exidx_end.
5492
7c6109da
DK
54932012-03-16 Doug Kwan <dougkwan@google.com>
5494
5495 * testsuite/Makefile.am: Disable test initpri3b.
5496 * testsuite/Makefile.in: Regenerate.
5497
7b8957f8
DK
54982012-03-15 Doug Kwan <dougkwan@google.com>
5499
5500 * arm.cc (Target_arm::got_section): Make .got section read-only
5501 if -z now is given.
5502
14dc9ef7
ILT
55032012-03-15 Ian Lance Taylor <iant@google.com>
5504
5505 PR gold/13850
5506 * layout.cc (Layout::make_output_section): Correctly mark
5507 SHT_INIT_ARRAY, et. al., as relro.
5508
fa40b62a
DK
55092012-03-14 Doug Kwan <dougkwan@google.com>
5510
5511 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5512 dynamic relocations for protected symbols in shared objects.
5513
fd325007
ILT
55142012-03-13 Ian Lance Taylor <iant@google.com>
5515
5516 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5517 keep the larger alignment.
5518
e8dd54e1
CC
55192012-03-12 Cary Coutant <ccoutant@google.com>
5520
5521 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5522 handling of DW_LNE_define_file.
5523
feb5f3b0
CC
55242012-03-12 Cary Coutant <ccoutant@google.com>
5525
5526 * reduced_debug_output.cc
5527 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5528 codes to switch.
5529
a1fb4256
CC
55302012-02-29 Cary Coutant <ccoutant@google.com>
5531
5532 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5533
5dd8762a
CC
55342012-02-29 Cary Coutant <ccoutant@google.com>
5535
5536 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5537 Call Object::decompressed_section_contents.
5538 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5539 New dtor.
5540 (Sized_dwarf_line_info::buffer_start_): New data member.
5541 * merge.cc (Output_merge_data::do_add_input_section): Call
5542 Object::decompressed_section_contents.
5543 (Output_merge_string::do_add_input_section): Likewise.
5544 * object.cc (need_decompressed_section): New function.
5545 (build_compressed_section_map): Decompress sections needed later.
5546 (Sized_relobj_file::do_decompressed_section_contents): New function.
5547 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5548 * object.h (Object::decompressed_section_contents): New function.
5549 (Object::discard_decompressed_sections): New function.
5550 (Object::do_decompressed_section_contents): New function.
5551 (Object::do_discard_decompressed_sections): New function.
5552 (Compressed_section_info): New type.
5553 (Compressed_section_map): Include decompressed section contents.
5554 (Sized_relobj_file::do_decompressed_section_contents): New function.
5555 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5556
7b5de7ee
CC
55572012-02-16 Cary Coutant <ccoutant@google.com>
5558
5559 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5560 * testsuite/Makefile.in: Regenerate.
5561
f9fa4a63
CC
55622012-02-14 Cary Coutant <ccoutant@google.com>
5563
5564 * options.cc (General_options::finalize): Disallow -pie and -static.
5565
2c175ebc
DK
55662012-02-03 Doug Kwan <dougkwan@google.com>
5567
5568 * arm.cc (Arm_relocate_functions::abs8,
5569 Arm_relocate_functions::abs16): Use
5570 Bits::has_signed_unsigned_overflow32.
5571 (Arm_relocate_functions::thm_abs8): Correct range of
5572 overflow check.
5573 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5574 in assertions.
5575
90cff06f
DK
55762012-02-02 Doug Kwan <dougkwan@google.com>
5577
5578 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5579 position independent outputs, not just shared objects.
5580
63887f3d
L
55812012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5582
5583 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5584 * configure: Regenerated.
5585
bef2b434
ILT
55862012-01-27 Ian Lance Taylor <iant@google.com>
5587
5588 * reloc.h (Bits): New class with static functions, copied from
5589 namespace utils in arm.cc.
5590 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5591 instead.
5592
c335b55d
L
55932012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5594
5595 * incremental.cc (write_info_blocks): Correct relocation offset.
5596
41194d9f
L
55972012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5598
5599 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5600 (Relocate::tls_gd_to_le): Likewise.
5601
1bae613c
L
56022012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5603
5604 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5605
24482ca0
L
56062012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5607
5608 * configure.ac: Check if -mcmodel=medium works.
5609 * configure: Regenerated.
5610
c2c7840a
CC
56112012-01-24 Cary Coutant <ccoutant@google.com>
5612
5613 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5614 definition and ...
5615 (read_unsigned_LEB_128_x): ... this new function.
5616 (read_signed_LEB_128): Replaced with inline definition and ...
5617 (read_signed_LEB_128_x): ... this new function.
5618 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5619 (read_unsigned_LEB_128): Add inline definition.
5620 (read_signed_LEB_128_x): New function.
5621 (read_signed_LEB_128): Add inline definition.
5622 * testsuite/Makefile.am (leb128_unittest): New unit test.
5623 * testsuite/Makefile.in: Regenerate.
5624 * testsuite/leb128_unittest.cc: New unit test.
5625
833de760 56262012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5627
5628 PR gold/13617
5629 * i386.cc (Target_i386::do_code_fill): When using a jmp
5630 instruction, pad with nop instructions.
5631 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5632
618d6666
L
56332012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5634
5635 * x86_64.cc (gc_process_relocs): Add typename on types used in
5636 template.
5637 (scan_relocs): Likewise.
5638 (relocate_section): Likewise.
5639 (apply_relocation): Likewise.
5640
3660ff06
L
56412012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5642
5643 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5644 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5645 under x32.
5646
fc51264f
L
56472012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5648
5649 * x86_64.cc: Initial support for x32.
5650
dd74ae06
CC
56512012-01-03 Cary Coutant <ccoutant@google.com>
5652
5653 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5654 Use abstract base class for GOT.
5655 * gold/output.h (class Output_data_got_base): New abstract base class.
5656 (class Output_data_got): Derive from new base class, adjust ctors.
5657 (Output_data_got::reserve_slot): Make virtual; rename to
5658 do_reserve_slot; Adjust callers.
5659 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5660 pointer to abstract base class.
5661 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5662
83896202
ILT
56632011-12-18 Ian Lance Taylor <iant@google.com>
5664
5665 * object.h (Relobj::local_symbol_value): New function.
5666 (Relobj::local_plt_offset): New function.
5667 (Relobj::local_has_got_offset): New function.
5668 (Relobj::local_got_offset): New function.
5669 (Relobj::set_local_got_offset): New function.
5670 (Relobj::do_local_symbol_value): New pure virtual function.
5671 (Relobj::do_local_plt_offset): Likewise.
5672 (Relobj::do_local_has_got_offset): Likewise.
5673 (Relobj::do_local_got_offset): Likewise.
5674 (Relobj::do_set_local_got_offset): Likewise.
5675 (Sized_relobj::do_local_has_got_offset): Rename from
5676 local_has_got_offset.
5677 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5678 (Sized_relobj::do_set_local_got_offset): Rename from
5679 set_local_got_offset.
5680 (Sized_relobj_file::do_local_plt_offset): Rename from
5681 local_plt_offset.
5682 (Sized_relobj_file::do_local_symbol_value): New function.
5683 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5684 local_plt_offset.
5685 * output.cc (Output_data_got::Got_entry::write): Change object to
5686 Relobj. Use local_symbol_value.
5687 (Output_data_got::add_global_with_rel): Change rel_dyn to
5688 Output_data_reloc_generic*. Use add_global_generic.
5689 (Output_data_got::add_global_with_rela): Remove. Change all
5690 callers to use add_global_with_rel.
5691 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5692 Output_data_reloc_generic*. Use add_global_generic.
5693 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5694 callers to use add_global_pair_with_rel.
5695 (Output_data_got::add_local): Change object to Relobj*.
5696 (Output_data_got::add_local_plt): Likewise.
5697 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5698 change rel_dyn to Output_data_reloc_generic*. Use
5699 add_local_generic.
5700 (Output_data_got::add_local_with_rela): Remove. Change all
5701 callers to use all_local_with_rel.
5702 (Output_data_got::add_local_pair_with_rel): Change object to
5703 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5704 add_output_section_generic.
5705 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5706 callers to use add_local_pair_with_rel.
5707 (Output_data_got::reserve_local): Change object to Relobj*.
5708 * output.h: (class Output_data_reloc_generic): Add pure virtual
5709 declarations for add_global_generic, add_local_generic,
5710 add_output_section_generic.
5711 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5712 functions for Output_data_reloc_generic. Update declarations for
5713 changes listed in output.cc.
5714 (class Output_data_got): Change template parameter to got_size.
5715 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5716 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5717 function.
5718 (Sized_relobj_incr::do_local_plt_offset): New function.
5719 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5720 add_global_generic.
5721
76677ad0
CC
57222011-12-17 Cary Coutant <ccoutant@google.com>
5723
5724 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5725 * resolve.cc (Symbol_table::resolve): Likewise.
5726 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5727 arrays.
5728 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5729
8b8dd8d5
ILT
57302011-12-16 Ian Lance Taylor <iant@google.com>
5731
5732 * output.h (Output_data_reloc_generic::add): Only call
5733 add_dynamic_reloc if this is a dynamic reloc section.
5734
d55525b9
L
57352011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5736
5737 PR gold/13505
5738 * target-reloc.h (apply_relocation): Replace <64, false> with
5739 <size, big_endian>.
5740
ff81c7c1
NC
57412011-11-25 Nick Clifton <nickc@redhat.com>
5742
5743 * po/it.po: New Italian translation.
5744
628f39be
SA
57452011-11-17 Sterling Augustine <saugustine@google.com>
5746
5747 * script.cc (script_include_directive): Implement.
5748 (read_script_file): New local variables name and search_path. Update
5749 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5750 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5751 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5752
98ef3ea4
SA
57532011-11-11 Sterling Augustine <saugustine@google.com>
5754
5755 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5756 (file_or_sections_cmd): Likewise.
5757
f4a8b6d7
DK
57582011-11-11 Doug Kwan <dougkwan@google.com>
5759
5760 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5761 if --just-symbols is given.
5762
29ab395d
DK
57632011-11-10 Doug Kwan <dougkwan@google.com>
5764
5765 PR gold/13362
5766 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5767 when processing data relocs.
5768 * reloc.h (Relocate_functions::rel_unaligned): New method.
5769 (Relocate_functions::pcrel_unaligned): Ditto.
5770 (Relocate_functions::rel32_unaligned): Ditto.
5771 (Relocate_functions::pcrel32_unaligned): Ditto.
5772
2c339f71
DK
57732011-11-09 Doug Kwan <dougkwan@google.com>
5774
5775 PR gold/13362
5776 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5777 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5778 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5779 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5780 (Relocate_functions::rel_unaligned): New.
5781 (Relocate_functions::rel32_unaligned): New.
5782 * target-reloc.h (relocate_for_relocatable): Add code to handle
5783 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5784 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5785 arm_unaligned_reloc_r): New targets.
5786 * testsuite/Makefile.in: Regenerate.
5787 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5788 linking.
5789
3f3cddf1
ILT
57902011-11-02 Ian Lance Taylor <iant@google.com>
5791
5792 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5793 NATIVE_LINKER.
5794 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5795 * options.cc (General_options::finalize): Use library search path
5796 from configure script if specified. If not native and no sysroot,
5797 only search TOOLLIBDIR.
5798 * options.h (Search_directory::Search_directory): Change name to
5799 const std::string&.
5800 (General_options::add_to_library_path_with_sysroot): Change arg to
5801 const std::string&.
5802 * configure, Makefile.in, config.in: Rebuild.
5803
a8e2273b
ILT
58042011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5805
5806 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5807 we are working around the ARM1176 Erratum.
5808 * options.h (General_options::fix_arm1176): Add option.
5809 * testsuite/Makefile.am: Add testcases, and keep current ones
5810 working.
5811 * testsuite/Makefile.in: Regenerate.
5812 * testsuite/arm_fix_1176.s: New file.
5813 * testsuite/arm_fix_1176.sh: Likewise.
5814
cd6eab1c
ILT
58152011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5816
5817 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5818 may_use_blx_.
5819 (Target_arm::may_use_blx): Remove method.
5820 (Target_arm::set_may_use_blx): Likewise.
5821 (Target_arm::may_use_v4t_interworking): New method.
5822 (Target_arm::may_use_v5t_interworking): Likewise.
5823 (Target_arm::may_use_blx_): Remove member variable.
5824 (Arm_relocate_functions::arm_branch_common): Check for v5T
5825 interworking.
5826 (Arm_relocate_functions::thumb_branch_common): Likewise.
5827 (Reloc_stub::stub_type_for_reloc): Likewise.
5828 (Target_arm::do_finalize_sections): Correct interworking checks.
5829 * testsuite/Makefile.am: Add new tests.
5830 * testsuite/Makefile.in: Regenerate.
5831 * testsuite/arm_farcall_arm_arm.s: New test.
5832 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5833 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5834 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5835 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5836 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5837 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5838 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5839
286adcf4
CC
58402011-10-31 Cary Coutant <ccoutant@google.com>
5841
5842 PR gold/13023
5843 * expression.cc (Expression::eval_with_dot): Add
5844 is_section_dot_assignment parameter.
5845 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5846 absolute and assigning to dot within a section.
5847 * script-sections.cc
5848 (Output_section_element_assignment::set_section_addresses): Pass
5849 dot_section to set_if_absolute.
5850 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5851 as is_section_dot_assignment flag to eval_with_dot.
5852 (Output_section_element_dot_assignment::set_section_addresses):
5853 Likewise.
5854 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5855 parameter. Also set value if relative to dot_section; set the
5856 symbol's output_section.
5857 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5858 parameter. Adjust all callers.
5859 (Expression::eval_maybe_dot): Likewise.
5860 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5861 Adjust all callers.
5862 * testsuite/script_test_2.t: Test assignment of an absolute value
5863 to dot within an output section element.
5864
9634ed06
CC
58652011-10-31 Cary Coutant <ccoutant@google.com>
5866
5867 * options.h (class General_options): Add --[no-]gnu-unique options.
5868 * symtab.cc (Symbol_table::sized_write_globals): Convert
5869 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5870
de4101c7
CC
58712011-10-31 Cary Coutant <ccoutant@google.com>
5872
5873 PR gold/13359
5874 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5875 unnecessary assertion.
5876 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5877
7257cc92
ST
58782011-10-31 Sriraman Tallam <tmsriram@google.com>
5879
5880 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5881 gc_mark_symbol.
5882 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5883 gc_mark_symbol.
5884 Change to just keep the section associated with symbol.
5885 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5886 they are externally visible and --export-dynamic is turned on.
5887 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5888
bfc34b3f
ILT
58892011-10-19 Ian Lance Taylor <iant@google.com>
5890
5891 PR gold/13163
5892 * script-sections.cc
5893 (Output_section_element_dot_assignment::needs_output_section): New
5894 function.
5895
ea0d8c47
ILT
58962011-10-19 Ian Lance Taylor <iant@google.com>
5897
5898 PR gold/13204
5899 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5900 --section-start option was seen.
5901 * options.h (General_options::any_section_start): New function.
5902
abd242a9
DM
59032011-10-18 David S. Miller <davem@davemloft.net>
5904
5905 PR binutils/13301
5906 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5907 member to track relocation locations that have moved during TLS
5908 reloc optimizations.
5909 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5910 (Target_sparc::Relocate::relocate): Adjust view down by 4
5911 bytes if it matches reloc_adjust_addr_.
5912 (Target_sparc::Relocate::relocate_tls): Always move the
5913 __tls_get_addr call delay slot instruction forward 4 bytes when
5914 performing relaxation.
5915
bab9090f
CC
59162011-10-18 Cary Coutant <ccoutant@google.com>
5917
5918 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5919 (Output_file::map_no_anonymous): Check for non-zero
5920 return code from posix_fallocate.
5921
f7c5b166
CC
59222011-10-17 Cary Coutant <ccoutant@google.com>
5923
5924 PR gold/13245
5925 * plugin.cc (is_visible_from_outside): Check for symbols
5926 referenced from dynamic objects.
5927 * resolve.cc (Symbol_table::resolve): Don't count references
5928 from dynamic objects as references from real ELF files.
5929 * testsuite/plugin_test_2.sh: Adjust expected result.
5930
b490c0bb
CC
59312011-10-17 Cary Coutant <ccoutant@google.com>
5932
5933 * gold.cc: Include timer.h.
5934 (queue_middle_tasks): Stamp time.
5935 (queue_final_tasks): Likewise.
5936 * main.cc (main): Store timer in parameters. Print timers
5937 for each pass.
5938 * parameters.cc (Parameters::Parameters): Initialize timer_.
5939 (Parameters::set_timer): New function.
5940 (set_parameters_timer): New function.
5941 * parameters.h (Parameters::set_timer): New function.
5942 (Parameters::timer): New function.
5943 (Parameters::timer_): New data member.
5944 (set_parameters_timer): New function.
5945 * timer.cc (Timer::stamp): New function.
5946 (Timer::get_pass_time): New function.
5947 * timer.h (Timer::stamp): New function.
5948 (Timer::get_pass_time): New function.
5949 (Timer::pass_times_): New data member.
5950
f475cf7b
CC
59512011-10-17 Cary Coutant <ccoutant@google.com>
5952
5953 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5954 task for members of lib groups.
5955
cdd7e244
CC
59562011-10-17 Cary Coutant <ccoutant@google.com>
5957
5958 PR gold/13288
4f95c8b4 5959 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5960 (File_read::make_view): Move bounds check (replace with assert)...
5961 (File_read::find_or_make_view): ... to here.
5962
dfb45471
CC
59632011-10-12 Cary Coutant <ccoutant@google.com>
5964
4f95c8b4 5965 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5966 ::read returns less than requested size.
5967
53bbcc1b
CC
59682011-10-10 Cary Coutant <ccoutant@google.com>
5969
4f95c8b4 5970 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5971 Initialize defined_count_.
5972 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5973 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5974 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5975 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5976 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5977 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5978 member.
5979 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5980 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5981 Return zeroes instead of internal error.
5982
397b129b
CC
59832011-10-10 Cary Coutant <ccoutant@google.com>
5984
5985 PR gold/13249
4f95c8b4 5986 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5987 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5988 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5989 (Output_reloc::type_): Adjust size of bit field.
5990 (Output_reloc::use_plt_offset_): New bit field.
5991 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5992 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5993 flag. Adjust all callers.
4f95c8b4 5994 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5995 creating RELATIVE relocations.
5996
d5698657
NC
59972011-10-10 Nick Clifton <nickc@redhat.com>
5998
5999 * po/es.po: Updated Spanish translation.
6000 * po/fi.po: Updated Finnish translation.
6001
6a59a5c2
DN
60022011-10-03 Diego Novillo <dnovillo@google.com>
6003
6004 * options.cc (parse_uint): Fix dereference of RETVAL.
6005
f0558624
ST
60062011-09-29 Sriraman Tallam <tmsriram@google.com>
6007
6008 * layout.h (section_order_map_): New member.
6009 (get_section_order_map): New member function.
6010 * output.cc (Output_section::add_input_section): Check for patterns
6011 only when --section-ordering-file is specified.
6012 * gold.cc (queue_middle_tasks): Delay updating order of sections till
6013 output_sections have been formed.
6014 * layout.cc (Layout_Layout): Initialize section_order_map_.
6015 * plugin.cc (update_section_order): Store order in order_map. Do not
6016 update the order.
6017 * testsuite/Makefile.am: Add test case for plugin_final_layout.
6018 * testsuite/Makefile.in: Regenerate.
6019 * testsuite/plugin_section_order.c: New file.
6020 * testsuite/plugin_final_layout.cc: New file.
6021 * testsuite/plugin_final_layout.sh: New file.
6022
a7dac153
CC
60232011-09-29 Cary Coutant <ccoutant@google.com>
6024
4f95c8b4 6025 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 6026 Check for NULL.
4f95c8b4 6027 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
6028 symbols during incremental update.
6029 (Symbol_table::add_from_dynobj): Likewise.
6030
eebd87a5
ILT
60312011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6032 Ian Lance Taylor <iant@google.com>
6033
6034 * symtab.cc (Symbol_table::define_special_symbol): Always
6035 canonicalize version string.
6036
403a3331
CC
60372011-09-26 Cary Coutant <ccoutant@google.com>
6038
4f95c8b4
CC
6039 * gold.cc (queue_initial_tasks): Move option checks ...
6040 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
6041 some options; make others fatal.
6042
235061c2
CC
60432011-09-26 Cary Coutant <ccoutant@google.com>
6044
6045 gcc PR lto/47247
6046 * plugin.cc (get_symbols_v2): New function.
6047 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
6048 (is_referenced_from_outside): New function.
6049 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
6050 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
6051 (get_symbols): Pass version parameter.
6052 (get_symbols_v2): New function.
6053 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
6054 parameter.
6055 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
6056 (onload): Add LDPT_GET_SYMBOLS_V2.
6057 (all_symbols_read_hook): Use get_symbols_v2; check for
6058 LDPR_PREVAILING_DEF_IRONLY_EXP.
6059 * testsuite/plugin_test_3.sh: Update expected results.
6060
dc87f620
ILT
60612011-09-23 Simon Baldwin <simonb@google.com>
6062
6063 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
6064 configuration options.
6065 * configure: Regenerate.
6066 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
6067 * Makefile.in: Regenerate.
6068 * testsuite/Makefile.in: Regenerate.
6069
a8279f82
ST
60702011-09-19 Sriraman Tallam <tmsriram@google.com>
6071
6072 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
6073
0c9350c8
CC
60742011-09-19 Cary Coutant <ccoutant@google.com>
6075
6076 * incremental.cc (can_incremental_update): Fix typo in comment.
6077 * incremental.h (can_incremental_update): Likewise.
6078
aa06ae28
CC
60792011-09-18 Cary Coutant <ccoutant@google.com>
6080
6081 * incremental.cc (can_incremental_update): New function.
6082 * incremental.h (can_incremental_update): New function.
6083 * layout.cc (Layout::init_fixed_output_section): Call it.
6084 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6085 * object.cc (Sized_relobj_file::do_layout): Call
6086 can_incremental_update.
6087
ebb300b2
CC
60882011-09-13 Cary Coutant <ccoutant@google.com>
6089
6090 * configure.ac: Check for glibc support for gnu_indirect_function
6091 support with static linking, setting automake conditional
6092 IFUNC_STATIC.
6093 * Makefile.in: Regenerate.
6094 * configure: Regenerate.
6095
6096 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6097 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6098 for IFUNC_STATIC.
6099 * testsuite/Makefile.in: Regenerate.
6100
1206d0d5
CC
61012011-09-13 Cary Coutant <ccoutant@google.com>
6102
6103 * incremental.cc (Sized_relobj_incr::do_layout): Call
6104 report_comdat_group for kept comdat sections.
6105 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6106 * testsuite/Makefile.in: Regenerate.
6107 * testsuite/incr_comdat_test_1.cc: New source file.
6108 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6109 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6110 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6111
40b29874
ILT
61122011-09-13 Ian Lance Taylor <iant@google.com>
6113
6114 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6115 variable external_symbols_offset.
6116
1b045aac
ILT
61172011-09-12 Ian Lance Taylor <iant@google.com>
6118
6119 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6120 triggered if object has no symbols.
6121
24c6c55a
DM
61222011-09-09 David S. Miller <davem@davemloft.net>
6123
6124 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6125 (Output_fill_debug_line::do_write): Likewise.
6126
66570254
CC
61272011-08-29 Cary Coutant <ccoutant@google.com>
6128
6129 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6130 casts to match formatting specs.
6131 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6132
8ea8cd50
CC
61332011-08-26 Cary Coutant <ccoutant@google.com>
6134
6135 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6136 remaining hole size when allocating.
6137 (Layout::make_output_section): Set fill methods for debug sections.
6138 * layout.h (Free_list::Free_list_node): Move from private to
6139 public.
6140 (Free_list::set_min_hole_size): New function.
6141 (Free_list::begin, Free_list::end): New functions.
6142 (Free_list::min_hole_): New data member.
6143 * output.cc: Include dwarf.h.
6144 (Output_fill_debug_info::do_minimum_hole_size): New function.
6145 (Output_fill_debug_info::do_write): New function.
6146 (Output_fill_debug_line::do_minimum_hole_size): New function.
6147 (Output_fill_debug_line::do_write): New function.
6148 (Output_section::Output_section): Initialize new data member.
6149 (Output_section::set_final_data_size): Ensure patch space is larger
6150 than minimum hole size.
6151 (Output_section::do_write): Fill holes in debug sections.
6152 * output.h (Output_fill): New class.
6153 (Output_fill_debug_info): New class.
6154 (Output_fill_debug_line): New class.
6155 (Output_section::set_free_space_fill): New function.
6156 (Output_section::free_space_fill_): New data member.
6157 * testsuite/Makefile.am (incremental_test_3): Add
6158 --incremental-patch option.
6159 (incremental_test_4): Likewise.
6160 (incremental_test_5): Likewise.
6161 (incremental_test_6): Likewise.
6162 (incremental_copy_test): Likewise.
6163 (incremental_common_test_1): Likewise.
6164 * testsuite/Makefile.in: Regenerate.
6165
7cf80422
NC
61662011-08-26 Nick Clifton <nickc@redhat.com>
6167
6168 * po/es.po: Updated Spanish translation.
6169
c3f7b0e5
CC
61702011-08-01 Cary Coutant <ccoutant@google.com>
6171
6172 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6173 * gold/testsuite/Makefile.in: Regenerate.
6174 * gold/testsuite/justsyms_exec.c: New source file.
6175 * gold/testsuite/justsyms_lib.c: New source file.
6176
9590bf25
CC
61772011-08-01 Cary Coutant <ccoutant@google.com>
6178
6179 * layout.cc (Layout::set_segment_offsets): Don't realign text
6180 segment if -Ttext was specified.
6181 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6182 file type.
6183 * object.h (Sized_relobj_file::e_type): New function.
6184 (Sized_relobj_file::e_type_): New data member.
6185 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6186 base address for ET_EXEC files.
6187 * target.cc (Target::do_make_elf_object_implementation): Allow
6188 ET_EXEC files with --just-symbols option.
6189
dcd8d12e
CC
61902011-07-28 Cary Coutant <ccoutant@google.com>
6191
6192 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6193 Add thread_number parameter.
6194 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6195 * workqueue-threads.cc
6196 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6197 current thread if its thread number is greater than desired thread
6198 count.
6199 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6200 Add thread_number parameter.
6201 (Workqueue::should_cancel_thread): Likewise.
6202 (Workqueue::find_runnable_or_wait): Pass thread_number to
6203 should_cancel_thread.
6204 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6205 parameter.
6206
804eb480
ST
62072011-07-22 Sriraman Tallam <tmsriram@google.com>
6208
6209 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6210 only after checking if it cannot be forced local.
6211 * symtab.h (is_externally_visible): Check if the symbol is not forced
6212 local.
6213
f1ddb600
ILT
62142011-07-15 Ian Lance Taylor <iant@google.com>
6215
6216 * options.h (class General_options): Add --print-output-format.
6217 Move -EL next to -EB, for better --help output.
6218 * target-select.cc: Include <cstdio>, "options.h", and
6219 "parameters.h".
6220 (Target_selector::do_target_bfd_name): New function.
6221 (print_output_format): New function.
6222 * target-select.h (class Target_selector): Update declarations.
6223 (Target_selector::target_bfd_name): New function.
6224 (print_output_format): Declare.
6225 * main.cc: Include "target-select.h".
6226 (main): Handle --print-output-format.
6227 * gold.cc: Include "target-select.h".
6228 (queue_initial_tasks): Handle --print-output-format when there are
6229 no input files.
6230 * parameters.cc (parameters_force_valid_target): Give a better
6231 error message if -EB/-EL does not match target.
6232 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6233 function.
6234
7d172687
ILT
62352011-07-15 Ian Lance Taylor <iant@google.com>
6236
6237 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6238 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6239 (Output_data_plt_i386::do_write): Write address of .dynamic
6240 section to first entry in .got.plt section.
6241 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6242 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6243 Initialize layout_.
6244 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6245 section to first entry in .got.plt section.
6246 * layout.h (Layout::dynamic_section): New function.
6247
e9552f7e
ST
62482011-07-13 Sriraman Tallam <tmsriram@google.com>
6249
6250 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6251 to claim_file call.
6252 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6253 input_section_position_, and input_section_glob_.
6254 (read_layout_from_file): Call function section_ordering_specified.
6255 * layout.h (is_section_ordering_specified): New function.
6256 (section_ordering_specified): New function.
6257 (section_ordering_specified_): New boolean member.
6258 * main.cc(main): Call load_plugins after layout object is defined.
6259 * output.cc (Output_section::add_input_section): Use
6260 function section_ordering_specified to check if section ordering is
6261 needed.
6262 * output.cc (Output_section::add_relaxed_input_section): Use
6263 function section_ordering_specified to check if section ordering is
6264 needed.
6265 (Output_section::update_section_layout): New function.
6266 (Output_section::sort_attached_input_sections): Check if input section
6267 must be reordered.
6268 * output.h (Output_section::update_section_layout): New function.
6269 * plugin.cc (get_section_count): New function.
6270 (get_section_type): New function.
6271 (get_section_name): New function.
6272 (get_section_contents): New function.
6273 (update_section_order): New function.
58797674 6274 (allow_section_ordering): New function.
e9552f7e
ST
6275 (Plugin::load): Add the new interfaces to the transfer vector.
6276 (Plugin_manager::load_plugins): New parameter.
6277 (Plugin_manager::all_symbols_read): New parameter.
6278 (Plugin_manager::claim_file): New parameter. Save the elf object for
6279 unclaimed objects.
6280 (Plugin_manager::get_elf_object): New function.
6281 (Plugin_manager::get_view): Change to directly use the bool to check
6282 if get_view is called from claim_file_hook.
6283 * plugin.h (input_objects): New function
6284 (Plugin__manager::load_plugins): New parameter.
6285 (Plugin_manager::claim_file): New parameter.
6286 (Plugin_manager::get_elf_object): New function.
6287 (Plugin_manager::in_claim_file_handler): New function.
6288 (Plugin_manager::in_claim_file_handler_): New member.
6289 (layout): New function.
6290 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6291 handler with an extra parameter. Make the elf object before calling
6292 claim_file handler.
6293 * testsuite/plugin_test.c (get_section_count): New function pointer.
6294 (get_section_type): New function pointer.
6295 (get_section_name): New function pointer.
6296 (get_section_contents): New function pointer.
6297 (update_section_order): New function pointer.
6298 (allow_section_ordering): New function pointer.
6299 (onload): Check if the new interfaces exist.
6300
9446efde
ILT
63012011-07-13 Ian Lance Taylor <iant@google.com>
6302
6303 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6304 relro section.
6305 * x86_64.cc (Target_x86_64::got_section): Likewise.
6306 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6307 (relro_now_test_SOURCES): New variable.
6308 (relro_now_test_DEPENDENCIES): New variable.
6309 (relro_now_test_LDFLAGS): New variable.
6310 (relro_now_test_LDADD): New variable.
6311 (relro_now_test.so): New target.
6312 * testsuite/Makefile.in: Rebuild.
6313
07aa62f2
ILT
63142011-07-12 Ian Lance Taylor <iant@google.com>
6315
6316 PR gold/12980
6317 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6318 GLOB_DAT relocation rather than a RELATIVE relocation for a
6319 protected symbol when creating a shared library.
6320 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6321 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6322 * testsuite/protected_main_1.cc (main): Test that protected
6323 function has same address.
6324
e2153196
ILT
63252011-07-11 Ian Lance Taylor <iant@google.com>
6326
6327 PR gold/12979
6328 * options.h (class General_options): Add -Bgroup.
6329 * options.cc (General_options::finalize): If -Bgroup is set,
6330 default to --unresolved-symbols=report-all.
6331 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6332 * target-reloc.h (issue_undefined_symbol_error): Handle
6333 --unresolved-symbols=report-all.
6334
6daf5215
ILT
63352011-07-08 Ian Lance Taylor <iant@google.com>
6336
6337 PR gold/11985
6338 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6339 if linker script discards key sections.
6340 (Layout::create_dynamic_symtab): Likewise.
6341 (Layout::assign_local_dynsym_offsets): Likewise.
6342 (Layout::sized_create_version_sections): Likewise.
6343 (Layout::create_interp): Likewise.
6344 (Layout::finish_dynamic_section): Likewise.
6345 (Layout::set_dynamic_symbol_size): Likewise.
6346
beabb2c6
ILT
63472011-07-08 Ian Lance Taylor <iant@google.com>
6348
6349 PR gold/12386
6350 * options.h (class General_options): Add --unresolved-symbols.
6351 * target-reloc.h (issue_undefined_symbol_error): Check
6352 --unresolved-symbols. Add comments.
6353
9c16daf1
ILT
63542011-07-08 Ian Lance Taylor <iant@google.com>
6355
6356 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6357 expression more complex.
6358
191f1a2d
ILT
63592011-07-08 Ian Lance Taylor <iant@google.com>
6360
6361 PR gold/11317
6362 * target-reloc.h (issue_undefined_symbol_error): New inline
6363 function, broken out of relocate_section.
6364 (relocate_section): Call issue_undefined_symbol_error.
6365 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6366 there is no TLS segment if we are about to issue an undefined
6367 symbol error.
6368 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6369
62855347
ILT
63702011-07-08 Ian Lance Taylor <iant@google.com>
6371
6372 PR gold/12279
6373 * resolve.cc (Symbol_table::should_override): Add fromtype
6374 parameter. Change all callers. Give error when linking together
6375 TLS and non-TLS symbol.
6376 (Symbol_table::should_override_with_special): Add fromtype
6377 parameter. Change all callers.
6378 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6379 there is no TLS segment if we have reported some errors.
6380 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6381
67181c72
ILT
63822011-07-08 Ian Lance Taylor <iant@google.com>
6383
6384 PR gold/12372
6385 * target.h (Target::plt_address_for_global): New function.
6386 (Target::plt_address_for_local): New function.
6387 (Target::plt_section_for_global): Remove.
6388 (Target::plt_section_for_local): Remove.
6389 (Target::do_plt_address_for_global): New virtual function.
6390 (Target::do_plt_address_for_local): New virtual function.
6391 (Target::do_plt_section_for_global): Remove.
6392 (Target::do_plt_section_for_local): Remove.
6393 (Target::register_global_plt_entry): Add Symbol_table and Layout
6394 parameters.
6395 * output.cc (Output_data_got::Got_entry::write): Use
6396 plt_address_for_global and plt_address_for_local.
6397 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6398 address of output section.
6399 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6400 got_irelative_, and irelative_count_ fields. Update
6401 declarations.
6402 (Output_data_plt_i386::has_irelative_section): New function.
6403 (Output_data_plt_i386::entry_count): Add irelative_count_.
6404 (Output_data_plt_i386::set_final_data_size): Likewise.
6405 (class Target_i386): Add got_irelative_ and rel_irelative_
6406 fields. Update declarations.
6407 (Target_i386::Target_i386): Initialize new fields.
6408 (Target_i386::do_plt_address_for_global): New function replacing
6409 do_plt_section_for_global.
6410 (Target_i386::do_plt_address_for_local): New function replacing
6411 do_plt_section_for_local.
6412 (Target_i386::got_section): Create got_irelative_.
6413 (Target_i386::rel_irelative_section): New function.
6414 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6415 fields. Don't define __rel_iplt_{start,end}.
6416 (Output_data_plt_i386::add_entry): Add symtab and layout
6417 parameters. Change all callers. Use different PLT and GOT for
6418 IFUNC symbols.
6419 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6420 layout parameters. Change all callers. Use different PLT and
6421 GOT.
6422 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6423 (Output_data_plt_i386::rel_irelative): New function.
6424 (Output_data_plt_i386::address_for_global): New function.
6425 (Output_data_plt_i386::address_for_local): New function.
6426 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6427 IRELATIVE GOT when changing IFUNC GOT entries.
6428 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6429 reloc.
6430 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6431 if we didn't create an IRELATIVE GOT.
6432 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6433 plt_address_for_local.
6434 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6435 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6436 got_irelative_, and irelative_count_ fields. Update
6437 declarations.
6438 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6439 Initialize new fields. Remove symtab parameter. Change all
6440 callers.
6441 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6442 irelative_count_.
6443 (Output_data_plt_x86_64::has_irelative_section): New function.
6444 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6445 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6446 fields. Update declarations.
6447 (Target_x86_64::Target_x86_64): Initialize new fields.
6448 (Target_x86_64::do_plt_address_for_global): New function replacing
6449 do_plt_section_for_global.
6450 (Target_x86_64::do_plt_address_for_local): New function replacing
6451 do_plt_section_for_local.
6452 (Target_x86_64::got_section): Create got_irelative_.
6453 (Target_x86_64::rela_irelative_section): New function.
6454 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6455 all callers. Don't create __rel_iplt_{start,end}.
6456 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6457 parameters. Change all callers. Use different PLT and GOT for
6458 IFUNC symbols.
6459 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6460 layout parameters. Change all callers. Use different PLT and
6461 GOT.
6462 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6463 parameters. Change all callers. Use different PLT and GOT for
6464 IFUNC symbols.
6465 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6466 (Output_data_plt_x86_64::rela_irelative): New function.
6467 (Output_data_plt_x86_64::address_for_global): New function.
6468 (Output_data_plt_x86_64::address_for_local): New function.
6469 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6470 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6471 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6472 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6473 parameters.
6474 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6475 reloc.
6476 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6477 symbols if we didn't create an IRELATIVE GOT.
6478 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6479 plt_address_for_local.
6480 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6481 * testsuite/ifuncvar1.c: New test file.
6482 * testsuite/ifuncvar2.c: New test file.
6483 * testsuite/ifuncvar3.c: New test file.
6484 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6485 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6486 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6487 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6488 * testsuite/Makefile.in: Rebuild.
6489
33c15b45
CC
64902011-07-07 Cary Coutant <ccoutant@google.com>
6491
6492 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6493 (two_file_test_1_ndebug.o): Likewise.
6494 (two_file_test_1b_ndebug.o): Likewise.
6495 (two_file_test_2_ndebug.o): Likewise.
6496 (two_file_test_main_ndebug.o): Likewise.
6497 (incremental_test_2): Link with no-debug versions.
6498
f48b5fb7
CC
64992011-07-06 Cary Coutant <ccoutant@google.com>
6500
6501 * gold/incremental.cc
6502 (Output_section_incremental_inputs::write_info_blocks): Check for
6503 hidden and internal symbols.
6504
221597a5
CC
65052011-07-06 Cary Coutant <ccoutant@google.com>
6506
6507 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6508 Check disposition for startup file.
6509 (Incremental_inputs::report_command_line): Ignore
6510 --incremental-startup-unchanged option.
6511 * options.cc (General_options::parse_incremental_startup_unchanged):
6512 New function.
6513 (General_options::General_options): Initialize new data member.
6514 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6515 (General_options): Add --incremental-startup-unchanged option.
6516 (General_options::incremental_startup_disposition): New function.
6517 (General_options::incremental_startup_disposition_): New data member.
6518
e24719f6
CC
65192011-07-06 Cary Coutant <ccoutant@google.com>
6520
6521 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6522 input file index to Script_info ctor.
6523 (Sized_incremental_binary::do_file_has_changed): Find the
6524 command-line argument for files named in scripts.
6525 * incremental.h (Script_info::Script_info): New ctor
6526 with input file index.
6527 (Script_info::input_file_index): New function.
6528 (Script_info::input_file_index_): New data member.
6529 (Incremental_binary::get_library): Add const.
6530 (Incremental_binary::get_script_info): Add const.
6531 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6532 * testsuite/Makefile.am (incremental_test_5): New test case.
6533 (incremental_test_6): New test case.
6534 * testsuite/Makefile.in: Regenerate.
6535
8f7c81e8
CC
65362011-07-06 Cary Coutant <ccoutant@google.com>
6537
6538 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6539 debug output when command lines differ.
6540
9fbd3822
CC
65412011-07-06 Cary Coutant <ccoutant@google.com>
6542
6543 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6544 --incremental-patch option.
6545 * layout.cc (Free_list::allocate): Extend allocation beyond original
6546 end if enabled.
6547 (Layout::make_output_section): Mark sections that should get
6548 patch space.
6549 * options.cc (parse_percent): New function.
6550 * options.h (parse_percent): New function.
6551 (DEFINE_percent): New macro.
6552 (General_options): Add --incremental-patch option.
6553 * output.cc (Output_section::Output_section): Initialize new data
6554 members.
6555 (Output_section::add_input_section): Print section name when out
6556 of patch space.
6557 (Output_section::add_output_section_data): Likewise.
6558 (Output_section::set_final_data_size): Add patch space when
6559 doing --incremental-full.
6560 (Output_section::do_reset_address_and_file_offset): Remove patch
6561 space.
6562 (Output_segment::set_section_list_addresses): Print debug output
6563 only if --incremental-update.
6564 * output.h (Output_section::set_is_patch_space_allowed): New function.
6565 (Output_section::is_patch_space_allowed_): New data member.
6566 (Output_section::patch_space_): New data member.
6567 * parameters.cc (Parameters::incremental_full): New function.
6568 * parameters.h (Parameters::incremental_full): New function
6569 * testsuite/Makefile.am (incremental_test_2): Add test for
6570 --incremental-patch option.
6571 * testsuite/Makefile.in: Regenerate.
6572 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6573 (t18): Remove function body.
6574
f6cccc2c
DK
65752011-07-05 Doug Kwan <dougkwan@google.com>
6576
6577 PR gold/12771
6578 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6579 Arm_Address type for relocation result.
6580 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6581 overflow check.
6582 (Arm_relocate_functions::abs32): Use unaligned access.
6583 (Arm_relocate_functions::rel32): Ditto.
6584 (Arm_relocate_functions::prel31): Ditto.
6585 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6586 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6587 static data relocations.
6588 * testsuite/Makefile.in: Regnerate.
6589 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6590
28a13fec
ILT
65912011-07-05 Ian Lance Taylor <iant@google.com>
6592
6593 PR gold/12392
6594 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6595 symbols if necessary.
6596 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6597
24d47b34
ILT
65982011-07-05 Ian Lance Taylor <iant@google.com>
6599
6600 PR gold/12952
6601 * resolve.cc (Symbol::override_base_with_special): Simply override
6602 version with special symbol version, ignoring previous version.
6603
41f9cbbe
ILT
66042011-07-05 Ian Lance Taylor <iant@google.com>
6605
6606 * object.cc (Sized_relobj_file::include_section_group): Add
6607 information to comment about signature location.
6608
886288f1
ILT
66092011-07-02 Ian Lance Taylor <iant@google.com>
6610
6611 PR gold/12957
6612 * options.h (class General_options): Add -f and -F.
6613 * options.cc (General_options::finalize): Fatal error if -f/-F
6614 are used without -shared.
6615 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6616
ae3a6d4f
ILT
66172011-07-02 Ian Lance Taylor <iant@google.com>
6618
6619 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6620
21131061
ILT
66212011-07-01 Ian Lance Taylor <iant@google.com>
6622
6623 PR gold/12525
6624 PR gold/12952
6625 * resolve.cc (Symbol::override_base_with_special): Don't override
6626 the version if the overriding symbol has a different name.
6627 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6628 all callers. If we give an error about an undefined version,
6629 define the base version if necessary.
6630 * dynobj.h (class Versions): Update declaration.
6631 * testsuite/weak_alias_test_5.cc: New file.
6632 * testsuite/weak_alias_test.script: New file.
6633 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6634 and versioned_alias have the right value, and call t2.
6635 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6636 weak_alias_test_5.so.
6637 (weak_alias_test_LDADD): Likewise.
6638 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6639 * testsuite/Makefile.in: Rebuild.
6640
611062c0
ILT
66412011-07-01 Ian Lance Taylor <iant@google.com>
6642
6643 PR gold/12525
6644 * options.h (class General_options): Support -z notext.
6645 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6646 -Wl,-z,notext.
6647 (two_file_shared_nonpic.so): Likewise.
6648 (two_file_shared_mixed.so): Likewise.
6649 (two_file_shared_mixed_1.so): Likewise.
6650 (weak_undef_lib_nonpic.so): Likewise.
6651 (alt/weak_undef_lib_nonpic.so): Likewise.
6652 (tls_test_shared_nonpic.so): Likewise.
6653 * testsuite/Makefile.in: Rebuild.
6654
328c7c2f
ILT
66552011-07-01 Ian Lance Taylor <iant@google.com>
6656
6657 PR gold/12525
6658 * configure.ac: Test whether static linking works, setting
6659 the automake conditional HAVE_STATIC.
6660 * testsuite/Makefile.am: Disable tests using -static if
6661 HAVE_STATIC is not true.
6662 * configure, testsuite/Makefile.in: Rebuild.
6663
02d7cd44
ILT
66642011-07-01 Ian Lance Taylor <iant@google.com>
6665
6666 PR gold/12525
6667 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6668 Assert if we see DW_EH_PE_indirect.
6669 * target.h (Target::ehframe_datarel_base): New function.
6670 (Target::do_ehframe_datarel_base): New target function.
6671 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6672 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6673 function.
6674
07a60597
ILT
66752011-07-01 Ian Lance Taylor <iant@google.com>
6676
6677 PR gold/12571
6678 * options.h (class General_options): Add
6679 --ld-generated-unwind-info.
6680 * ehframe.cc (Fde::write): Add address parameter. Change all
6681 callers. If associated with PLT, fill in address and size.
6682 (Cie::set_output_offset): Only add merge mapping if there is an
6683 object.
6684 (Cie::write): Add address parameter. Change all callers.
6685 (Eh_frame::add_ehframe_for_plt): New function.
6686 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6687 input_offset_ fields into union u_, with new plt field.
6688 (Fde::Fde): Adjust for new union field.
6689 (Fde::Fde) [Output_data version]: New constructor.
6690 (Fde::add_mapping): Only add merge mapping if there is an object.
6691 (class Cie): Update declarations.
6692 (class Eh_frame): Declare add_ehframe_for_plt.
6693 * layout.cc (Layout::layout_eh_frame): Break out code into
6694 make_eh_frame_section, and call it.
6695 (Layout::make_eh_frame_section): New function.
6696 (Layout::add_eh_frame_for_plt): New function.
6697 * layout.h (class Layout): Update declarations.
6698 * merge.cc (Merge_map::add_mapping): Add assertion.
6699 * i386.cc: Include "dwarf.h".
6700 (class Output_data_plt_i386): Make first_plt_entry,
6701 dyn_first_plt_entry, exec_plt_entry, and dyn_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_i386::Output_data_plt_i386): Align to 16-byte
6705 boundary. Call add_eh_frame_for_plt if appropriate.
6706 * x86_64.cc: Include "dwarf.h".
6707 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6708 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6709 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6710 and plt_eh_frame_fde.
6711 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6712 appropriate.
6713
14788a3f
ILT
67142011-06-29 Ian Lance Taylor <iant@google.com>
6715
6716 PR gold/12629
6717 * object.cc (Sized_relobj_file::layout_section): Change shdr
6718 parameter to be const.
6719 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6720 out of do_layout.
6721 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6722 appropriate. Call layout_eh_frame_section.
6723 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6724 sections.
6725 * object.h (class Sized_relobj_file): Update declarations.
6726
6c21fce1
ILT
67272011-06-29 Ian Lance Taylor <iant@google.com>
6728
37e41b03 6729 PR gold/12652
6c21fce1
ILT
6730 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6731 modifier.
6732 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6733
4d5e4e62
ILT
67342011-06-29 Ian Lance Taylor <iant@google.com>
6735
6736 PR gold/12675
6737 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6738 SHT_X86_64_UNWIND.
6739 * layout.cc (Layout::layout_eh_frame): Likewise.
6740
886f533a
ILT
67412011-06-29 Ian Lance Taylor <iant@google.com>
6742
6743 PR gold/12695
6744 * layout.cc (Layout::symtab_section_shndx): New function.
6745 * layout.h (class Layout): Declare symtab_section_shndx.
6746 * output.cc (Output_section::write_header): Call it.
6747
f3ae1b28
ILT
67482011-06-29 Ian Lance Taylor <iant@google.com>
6749
6750 PR gold/12818
6751 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6752 symbols which are not used in a relocation.
6753
aecf301f
ILT
67542011-06-28 Ian Lance Taylor <iant@google.com>
6755
6756 PR gold/12898
6757 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6758 script create indistinguishable segments.
6759 (Layout::set_segment_offsets): Use stable_sort when sorting
6760 segments. Pass this to Compare_segments constructor.
6761 * layout.h (class Layout): Make segment_precedes non-static.
6762 (class Compare_segments): Change from struct to class. Add
6763 layout_ field. Add constructor.
6764 * script-sections.cc
6765 (Script_sections::attach_sections_using_phdrs_clause): Rename
6766 local orphan to is_orphan. Don't report failure to put empty
6767 section in segment. On attachment failure, report name of
6768 section, and attach to first PT_LOAD segment.
6769
03ef7571
ILT
67702011-06-28 Ian Lance Taylor <iant@google.com>
6771
6772 PR gold/12934
6773 * target-select.cc (Target_selector::Target_selector): Add
6774 emulation parameter. Change all callers.
6775 (select_target_by_bfd_name): Rename from select_target_by_name.
6776 Change all callers.
6777 (select_target_by_emulation): New function.
6778 (supported_emulation_names): New function.
6779 * target-select.h (class Target_selector): Add emulation_ field.
6780 Update declarations.
6781 (Target_selector::recognize_by_bfd_name): Rename from
6782 recognize_by_name. Change all callers.
6783 (Target_selector::supported_bfd_names): Rename from
6784 supported_names. Change all callers.
6785 (Target_selector::recognize_by_emulation): New function.
6786 (Target_selector::supported_emulations): New function.
6787 (Target_selector::emulation): New function.
6788 (Target_selector::do_recognize_by_bfd_name): Rename from
6789 do_recognize_by_name. Change all callers.
6790 (Target_selector::do_supported_bfd_names): Rename from
6791 do_supported_names. Change all callers.
6792 (Target_selector::do_recognize_by_emulation): New function.
6793 (Target_selector::do_supported_emulations): New function.
6794 (select_target_by_bfd_name): Change name in declaration.
6795 (select_target_by_emulation): Declare.
6796 (supported_emulation_names): Declare.
6797 * parameters.cc (parameters_force_valid_target): Try to find
6798 target based on emulation from -m option.
6799 * options.h (class General_options): Change doc string for -m.
6800 * options.cc (help): Print emulations.
6801 (General_options::parse_V): Likewise.
6802 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6803 Add emulation parameter. Change all callers.
6804
200b2bb9
ILT
68052011-06-28 Ian Lance Taylor <iant@google.com>
6806
6807 * target.h (class Target): Add osabi_ field.
6808 (Target::osabi): New function.
6809 (Target::set_osabi): New function.
6810 (Target::Target): Initialize osabi_.
6811 (Target::do_adjust_elf_header): Make pure virtual.
6812 (Sized_target::do_adjust_elf_header): Declare.
6813 * target.cc (Sized_target::do_adjust_elf_header): New function.
6814 (class Sized_target): Instantiate all versions.
6815 * freebsd.h (class Target_freebsd): Remove.
6816 (Target_selector_freebsd::do_recognize): Call set_osabi on
6817 Target.
6818 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6819 (Target_selector_freebsd::set_osabi): Remove.
6820 * i386.cc (class Target_i386): Inherit from Sized_target rather
6821 than Target_freebsd.
6822 * x86_64.cc (class Target_x86_64): Likewise.
6823
b3ce541e
ILT
68242011-06-28 Ian Lance Taylor <iant@google.com>
6825
6826 * target.h (Target::can_check_for_function_pointers): Rewrite.
6827 Make non-virtual.
6828 (Target::can_icf_inline_merge_sections): Likewise.
6829 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6830 (Target::Target_info): Add can_icf_inline_merge_sections field.
6831 (Target::do_can_check_for_function_pointers): New virtual
6832 function.
6833 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6834 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6835 from can_check_for_function_pointers, move in file.
6836 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6837 section_may_have_icf_unsafe_poineters, move in file.
6838 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6839 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6840 Rename from can_check_for_function_pointers, move in file.
6841 (Target_i386::can_icf_inline_merge_sections): Remove.
6842 (Target_i386::i386_info): Initialize
6843 can_icf_inline_merge_sections.
6844 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6845 Initialize can_icf_inline_merge_sections.
6846 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6847 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6848 Rename from can_check_for_function_pointers, move in file.
6849 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6850 (Target_x86_64::x86_64_info): Initialize
6851 can_icf_inline_merge_sections.
6852 * testsuite/testfile.cc (Target_test::test_target_info):
6853 Likewise.
6854 * icf.cc (get_section_contents): Correct formatting.
6855
6d1c4efb
ILT
68562011-06-27 Ian Lance Taylor <iant@google.com>
6857
6858 * symtab.cc (Symbol::versioned_name): New function.
6859 (Symbol_table::add_to_final_symtab): Use versioned_name when
6860 appropriate.
6861 (Symbol_table::sized_write_symbol): Likewise.
6862 * symtab.h (class Symbol): Declare versioned_name.
6863 * stringpool.h (class Stringpool_template): Add variant of add
6864 which takes a std::basic_string.
6865 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6866 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6867 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6868 (ver_test_12.o): New target.
6869 * testsuite/Makefile.in: Rebuild.
6870
57eb9b50
DK
68712011-06-27 Doug Kwan <dougkwan@google.com>
6872
6873 * arm.cc (Arm_relocate_functions::thm_jump8,
6874 Arm_relocate_functions::thm_jump11): Use a wider signed
6875 type to compute offset.
6876 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6877 arm_thm_jump8.
6878 * testsuite/Makefile.in: Regenerate.
6879 * testsuite/arm_branch_in_range.sh: Check test results of
6880 arm_thm_jump11 and arm_thm_jump8.
6881 * testsuite/arm_thm_jump11.s: New test source file.
6882 * testsuite/arm_thm_jump11.t: New linker script.
6883 * testsuite/arm_thm_jump8.s: New test source file.
6884 * testsuite/arm_thm_jump8.t: New linker script.
6885
487b39df
ILT
68862011-06-24 Ian Lance Taylor <iant@google.com>
6887
6888 * layout.cc: Include "object.h".
6889 (ctors_sections_in_init_array): New static variable.
6890 (Layout::is_ctors_in_init_array): New function.
6891 (Layout::layout): Add entry to ctors_sections_in_init_array if
6892 appropriate.
6893 * layout.h (class Layout): Declare is_ctors_in_init_array.
6894 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6895 is_ctors_reverse_view is set.
6896 (Sized_relobj_file::write_sections): Add layout parameter. Change
6897 all callers. Set is_ctors_reverse_view field of View_size.
6898 (Sized_relobj_file::reverse_words): New function.
6899 * object.h (Sized_relobj_file::View_size): Add
6900 is_ctors_reverse_view field.
6901 (class Sized_relobj_file): Update declarations.
6902 * testsuite/initpri3.c: New test.
6903 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6904 initpri3b.
6905 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6906 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6907 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6908 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6909 * testsuite/Makefile.in: Rebuild.
6910
472076e4
CC
69112011-06-24 Cary Coutant <ccoutant@google.com>
6912
6913 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6914 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6915 (debug_msg_cdebug.err): New targets.
6916 * testsuite/Makefile.in: Regenerate.
6917 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6918 Fix checks for link with shared library.
6919
a60af0db
DK
69202011-06-24 Doug Kwan <dougkwan@google.com>
6921
6922 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6923 skip empty text sections.
6924 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6925
5393d741
ILT
69262011-06-22 Ian Lance Taylor <iant@google.com>
6927
6928 PR gold/12910
6929 * options.h (class General_options): Add --ctors-in-init-array.
6930 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6931 friends as SHT_PROGBITS for merging sections.
6932 (Layout::layout): Remove special handling of .init_array and
6933 friends. Don't sort if doing relocatable link. Sort for .ctors
6934 and .dtors if ctors_in_init_array.
6935 (Layout::make_output_section): Force correct section types for
6936 .init_array and friends. Don't sort if doing relocatable link,
6937 Don't sort .ctors and .dtors if ctors_in_init_array.
6938 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6939 (Layout::output_section_name): Add relobj parameter. Change all
6940 callers. Handle .ctors. and .dtors. in code rather than table.
6941 Handle .ctors and .dtors if ctors_in_init_array.
6942 (Layout::match_file_name): New function, moved from output.cc.
6943 * layout.h (class Layout): Update declarations.
6944 * output.cc: Include "layout.h".
6945 (Input_section_sort_entry::get_priority): New function.
6946 (Input_section_sort_entry::match_file_name): Just call
6947 Layout::match_file_name.
6948 (Output_section::Input_section_sort_init_fini_compare::operator()):
6949 Handle .ctors and .dtors. Sort by explicit priority rather than
6950 by name.
6951 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6952 * testsuite/initpri2.c: New test.
6953 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6954 (check_PROGRAMS): Add initpri2.
6955 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6956 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6957 * configure, testsuite/Makefile.in: Rebuild.
6958
e1f74f98
ILT
69592011-06-19 Ian Lance Taylor <iant@google.com>
6960
6961 PR gold/12880
6962 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6963 .interp section to a PT_INTERP segment even if we have seen a
6964 --dynamic-linker option. Don't do it if we have seen a PHDRS
6965 clause in a linker script.
6966 (Layout::finalize): Don't create a .interp section if we've
6967 already create a PT_INTERP segment.
6968 (Layout::create_interp): Always call choose_output_section (revert
6969 patch of 2011-06-17). Don't create PT_INTERP segment.
6970 * script-sections.cc
6971 (Script_sections::create_note_and_tls_segments): Add a .interp
6972 section to a PT_INTERP segment even if we have seen a
6973 --dynamic-linker option.
6974
766f91bb
ILT
69752011-06-18 Ian Lance Taylor <iant@google.com>
6976
6977 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6978 merely because a non-PT_LOAD segment has a dynamic reloc.
6979
0d212c3a
ILT
69802011-06-18 Ian Lance Taylor <iant@google.com>
6981
6982 * layout.cc (Layout::finish_dynamic_section): Don't create
6983 DT_FLAGS entry if not needed.
6984
911a5072
ILT
69852011-06-18 Ian Lance Taylor <iant@google.com>
6986
6987 PR gold/12745
6988 * layout.cc (Layout::layout_eh_frame): Correct handling of
6989 writable .eh_frame section.
6990
534b4e5f
ILT
69912011-06-17 Ian Lance Taylor <iant@google.com>
6992
6993 PR gold/12893
6994 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6995 symbol is redefined with the exact same object and value.
6996
10b4f102
ILT
69972011-06-17 Ian Lance Taylor <iant@google.com>
6998
6999 PR gold/12880
7000 * layout.h (class Layout): Add interp_segment_ field.
7001 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
7002 (Layout::attach_allocated_section_to_segment): If making shared
7003 library, put .interp section in PT_INTERP segment.
7004 (Layout::finalize): Also call create_interp if -dynamic-linker
7005 option was used.
7006 (Layout::create_interp): Assert that there is no PT_INTERP
7007 segment. If not using a SECTIONS clause, use make_output_section.
7008 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
7009 * script-sections.cc
7010 (Script_sections::create_note_and_tls_segments): If making shared
7011 library, put .interp section in PT_INTERP segment.
7012
a29b0dad
ILT
70132011-06-17 Ian Lance Taylor <iant@google.com>
7014
e588ea8d
ILT
7015 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
7016 when making a shared library.
7017
70182011-06-17 Ian Lance Taylor <iant@google.com>
7019
7020 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
7021 parameter. Change all callers. Don't issue warning about PC32
7022 against locally defined symbol.
a29b0dad 7023
9d3b0698
ILT
70242011-06-16 Ian Lance Taylor <iant@google.com>
7025
7026 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
7027 occurs in same object.
7028
85b0f90c
AM
70292011-06-14 Alan Modra <amodra@gmail.com>
7030
7031 * po/POTFILES.in: Regenerate.
7032
a94907d9
ILT
70332011-06-09 Ian Lance Taylor <iant@google.com>
7034
7035 * script-sections.cc
7036 (Orphan_output_section::set_section_addresses): For a relocatable
7037 link set address to 0.
7038
4fb3a1c3
CC
70392011-06-09 Cary Coutant <ccoutant@google.com>
7040
7041 PR gold/12804
7042 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
7043 used with --compress-debug-sections.
7044 * gold/object.cc (Sized_relobj_file::do_layout): Report
7045 uncompressed size of compressed input sections.
7046
61220854
CC
70472011-06-08 Cary Coutant <ccoutant@google.com>
7048
7049 PR gold/12804
7050 * testsuite/two_file_test_2_v1.cc: Change initialization of
7051 v2 to keep it in .data.
7052
e6455dfb
CC
70532011-06-07 Cary Coutant <ccoutant@google.com>
7054
7055 * common.cc (Symbol_table::do_allocate_commons_list): Call
7056 gold_fallback.
7057 * errors.cc (Errors::fatal): Adjust call to gold_exit.
7058 (Errors::fallback): New function.
7059 (gold_fallback): New function.
7060 * errors.h (Errors::fallback): New function.
7061 * gold.cc (gold_exit): Change status parameter to enum; adjust
7062 all callers.
7063 (queue_initial_tasks): Call gold_fallback.
7064 * gold.h: Include cstdlib.
7065 (Exit_status): New enum type.
7066 (gold_exit): Change status parameter to enum.
7067 (gold_fallback): New function.
7068 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
7069 (Layout::create_symtab_sections): Likewise.
7070 (Layout::create_shdrs): Likewise.
7071 * main.cc (main): Adjust call to gold_exit.
7072 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
7073 (Output_data_got::add_got_entry_pair): Likewise.
7074 (Output_section::add_input_section): Likewise.
7075 (Output_section::add_output_section_data): Likewise.
7076 (Output_segment::set_section_list_addresses): Likewise.
7077 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
7078
fb0e076f
CC
70792011-06-07 Cary Coutant <ccoutant@google.com>
7080
7081 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7082 for incremental links.
7083 * output.cc (Output_segment::set_section_list_addresses): Remove
7084 FIXME and test for TLS or BSS.
7085
a5ee4d5d
CC
70862011-06-07 Cary Coutant <ccoutant@google.com>
7087
7088 * testsuite/Makefile.am: Add incremental_copy_test,
7089 incremental_common_test_1.
7090 * testsuite/Makefile.in: Regenerate.
7091 * testsuite/common_test_1_v1.c: New source file.
7092 * testsuite/common_test_1_v2.c: New source file.
7093 * testsuite/copy_test_v1.cc: New source file.
7094
5146f448
CC
70952011-06-07 Cary Coutant <ccoutant@google.com>
7096
7097 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7098 update, allocate common from bss section's free list.
7099 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7100 linker-defined symbols.
7101 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7102 Skip GOT and PLT entries that are no longer referenced.
7103 (Output_section_incremental_inputs::write_info_blocks): Mark
7104 linker-defined symbols.
7105 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7106 * output.cc (Output_section::allocate): New function.
7107 * output.h (Output_section::allocate): New function.
7108 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7109 linker-defined symbols.
7110 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7111 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7112 (Symbol::init_base_output_data): Likewise.
7113 (Symbol::init_base_output_segment): Likewise.
7114 (Symbol::init_base_constant): Likewise.
7115 (Sized_symbol::init_output_data): Likewise.
7116 (Sized_symbol::init_output_segment): Likewise.
7117 (Sized_symbol::init_constant): Likewise.
7118 (Symbol_table::do_define_in_output_data): Likewise.
7119 (Symbol_table::do_define_in_output_segment): Likewise.
7120 (Symbol_table::do_define_as_constant): Likewise.
7121 * symtab.h (Symbol::is_predefined): New function.
7122 (Symbol::init_base_output_data): Add is_predefined parameter.
7123 (Symbol::init_base_output_segment): Likewise.
7124 (Symbol::init_base_constant): Likewise.
7125 (Symbol::is_predefined_): New data member.
7126 (Sized_symbol::init_output_data): Add is_predefined parameter.
7127 (Sized_symbol::init_output_segment): Likewise.
7128 (Sized_symbol::init_constant): Likewise.
7129 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7130
26d3c67d
CC
71312011-06-07 Cary Coutant <ccoutant@google.com>
7132
7133 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7134 instead of emit_copy_reloc.
7135 (Copy_relocs::emit_copy_reloc): Refactor.
7136 (Copy_relocs::make_copy_reloc): New function.
7137 (Copy_relocs::add_copy_reloc): Remove.
7138 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7139 section.
7140 (Copy_relocs::make_copy_reloc): New function.
7141 (Copy_relocs::add_copy_reloc): Remove.
7142 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7143 unchanged input files.
7144 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7145 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7146 Reserve BSS space for COPY relocations.
7147 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7148 (Output_section_incremental_inputs::write_info_blocks): Record
7149 whether a symbol is copied from a shared object.
7150 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7151 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7152 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7153 (Incremental_input_entry_reader::get_output_symbol_index): Add
7154 is_copy parameter.
7155 (Incremental_binary::emit_copy_relocs): New function.
7156 (Incremental_binary::do_emit_copy_relocs): New function.
7157 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7158 new data member.
7159 (Sized_incremental_binary::add_copy_reloc): New function.
7160 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7161 (Sized_incremental_binary::Copy_reloc): New struct.
7162 (Sized_incremental_binary::Copy_relocs): New typedef.
7163 (Sized_incremental_binary::copy_relocs_): New data member.
7164 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7165 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7166 * target.h (Sized_target::emit_copy_reloc): New function.
7167 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7168
7cdb37d9
CC
71692011-06-02 Cary Coutant <ccoutant@google.com>
7170
7171 PR gold/12163
7172 * gold/archive.cc (Archive::Archive): Initialize new data member.
7173 (Archive::include_all_members): Return if archive has already been
7174 included.
7175 * gold/archive.h (Archive::include_all_members_): New data member.
7176
cc643b88
NC
71772011-06-02 Nick Clifton <nickc@redhat.com>
7178
7179 * dynobj.h: Fix spelling mistake in comment.
7180 * output.cc: Likewise.
7181
f62a3ca7 71822011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 7183 Asier Llano
f62a3ca7
DK
7184
7185 PR gold/12826
cc643b88 7186 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
7187 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7188 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7189 redundant arm_exidx_test.so.
7190 * testsuite/Makefile.in: Regenerate.
7191 (check_SCRIPTS): Add pr12826.sh
7192 (check_DATA): Add pr12826.stdout
7193 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7194 * testsuite/pr12826.sh: New file.
7195 * testsuite/pr12826_1.s: Ditto.
7196 * testsuite/pr12826_1.s: Ditto.
7197
8dbe1edc
ILT
71982011-05-30 Ian Lance Taylor <iant@google.com>
7199
7200 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7201 sections.
7202
c49875be
ILT
72032011-05-29 Ian Lance Taylor <iant@google.com>
7204
7205 PR gold/12804
7206 * testsuite/Makefile.am: Use different file name for two_file_test
7207 temporary file for each incremental test.
7208 * testsuite/Makefile.in: Rebuild.
7209
69d53f7a
ILT
72102011-05-29 Ian Lance Taylor <iant@google.com>
7211
7212 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7213 binary input file is empty.
7214
41d0ab5f
ILT
72152011-05-27 Ian Lance Taylor <iant@google.com>
7216
7217 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7218 (ver_test_9.so): Likewise.
7219 * testsuite/Makefile.in: Rebuild.
7220
89d8a36b
CC
72212011-05-26 Cary Coutant <ccoutant@google.com>
7222
7223 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7224 * incremental.cc (Incremental_inputs::report_input_section): Fix
7225 comment, indentation.
7226 (Incremental_inputs::report_comdat_group): New function.
7227 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7228 of data for incremental input file entry.
7229 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7230 group count, COMDAT group signatures.
7231 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7232 an unchanged input file.
7233 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7234 Initialize new data member.
7235 (Incremental_object_entry::add_comdat_group): New function.
7236 (Incremental_object_entry::get_comdat_group_count): New function.
7237 (Incremental_object_entry::get_comdat_signature_key): New function.
7238 (Incremental_object_entry::groups_): New data member.
7239 (Incremental_inputs::report_comdat_group): New function.
7240 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7241 data for incremental input file entry.
7242 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7243 (Incremental_input_entry_reader::get_input_section): Adjust size of
7244 data for incremental input file entry.
7245 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7246 (Incremental_input_entry_reader::get_comdat_group_signature): New
7247 function.
7248 * object.cc (Sized_relobj::include_section_group): Report kept
7249 COMDAT groups for incremental links.
7250
1706a06f
ILT
72512011-05-24 David Meyer <pdox@google.com>
7252
7253 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7254 with name parameter. Add found_name parameter.
7255 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7256 * dirsearch.h (class Dirsearch): Update declaration.
7257
a10ae760
ILT
72582011-05-24 Ian Lance Taylor <iant@google.com>
7259
7260 * archive.cc (Library_base::should_include_member): Pull in object
7261 from archive if it defines the entry symbol.
7262 * parameters.cc (Parameters::entry): New function.
7263 * parameters.h (class Parameters): Declare entry.
7264 * output.h (class Output_file_header): Remove entry_ field.
7265 * output.cc (Output_file_header::Output_file_header): Remove entry
7266 parameter. Change all callers.
7267 (Output_file_header::entry): Use parameters->entry.
7268 * gold.cc (queue_middle_tasks): Likewise.
7269 * plugin.cc (Plugin_hook::run): Likewise.
7270
aa92d6ed
CC
72712011-05-24 Cary Coutant <ccoutant@google.com>
7272
7273 * gold.cc (queue_initial_tasks): Pass incremental base filename
7274 to Output_file::open_base_file; don't print error message.
7275 * incremental-dump.cc (main): Adjust call to
7276 Output_file::open_for_modification.
7277 * incremental-dump.cc (main): Likewise.
7278 * incremental.cc (Incremental_inputs::report_command_line):
7279 Ignore --incremental-base option when comparing command lines.
7280 Ignore parameter when given as separate argument.
7281 * options.h (class General_options): Add --incremental-base.
7282 * output.cc (Output_file::Output_file):
7283 (Output_file::open_base_file): Add base_name and writable parameters;
7284 read base file into new file; print error message here.
7285 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7286 callers.
7287 * output.h (Output_file::open_for_modification): Rename to...
7288 (Output_file::open_base_file): ...this; add base_name and
7289 writable parameters; adjust all callers.
7290 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7291 callers.
7292 * testsuite/Makefile.am (incremental_test_4): Test
7293 --incremental-base.
7294 * testsuite/Makefile.in: Regenerate.
7295
2eedd706
CC
72962011-05-24 Cary Coutant <ccoutant@google.com>
7297
7298 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7299 incremental_test_4.
7300 * testsuite/Makefile.in: Regenerate.
7301 * testsuite/two_file_test_1_v1.cc: New test source file.
7302 * testsuite/two_file_test_1b_v1.cc: New test source file.
7303 * testsuite/two_file_test_2_v1.cc: New test source file.
7304
0f1c85a6
CC
73052011-05-24 Cary Coutant <ccoutant@google.com>
7306
7307 * dynobj.h (Dynobj::do_dynobj): New function.
7308 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7309 flag and soname for shared objects.
7310 * incremental.cc (Incremental_inputs::report_object): Make
7311 either Incremental_object_entry or Incremental_dynobj_entry; add
7312 soname to string table.
7313 (Incremental_inputs::report_input_section): Add assertion.
7314 (Output_section_incremental_inputs::set_final_data_size): Adjust
7315 type of input file entry for shared libraries; adjust size of
7316 shared library info entry.
7317 (Output_section_incremental_inputs::write_input_files): Write
7318 as_needed flag for shared libraries.
7319 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7320 of input file entry for shared libraries; write soname.
7321 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7322 soname from incremental info.
7323 * incremental.h (enum Incremental_input_flags): Add
7324 INCREMENTAL_INPUT_AS_NEEDED.
7325 (Incremental_input_entry::Incremental_input_entry): Initialize new
7326 data member.
7327 (Incremental_input_entry::set_as_needed): New function.
7328 (Incremental_input_entry::as_needed): New function.
7329 (Incremental_input_entry::do_dynobj_entry): New function.
7330 (Incremental_input_entry::as_needed_): New data member.
7331 (Incremental_object_entry::Incremental_object_entry): Don't check
7332 for shared library.
7333 (Incremental_object_entry::do_type): Likewise.
7334 (class Incremental_dynobj_entry): New class.
7335 (Incremental_input_entry_reader::as_needed): New function.
7336 (Incremental_input_entry_reader::get_soname): New function.
7337 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7338 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7339 size of shared library info entry.
58797674 7340 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7341 incremental link when adding DT_NEEDED entries.
7342 * object.h (Object::Object): Initialize new data member.
7343 (Object::dynobj): New function.
7344 (Object::set_as_needed): New function.
7345 (Object::as_needed): New function.
7346 (Object::do_dynobj): New function.
7347 (Object::as_needed_): New data member.
7348
6fa2a40b
CC
73492011-05-24 Cary Coutant <ccoutant@google.com>
7350
7351 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7352 info; adjust display of GOT entries.
7353 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7354 vector of input objects; remove file_status_.
7355 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7356 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7357 got_plt reader; call target hooks to reserve GOT entries.
7358 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7359 of input file info header and GOT info entry.
7360 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7361 relocation info.
7362 (Got_plt_view_info::got_descriptor): Remove.
7363 (Got_plt_view_info::sym_index): New data member.
7364 (Got_plt_view_info::input_index): New data member.
7365 (Local_got_offset_visitor::visit): Write input file index.
7366 (Global_got_offset_visitor::visit): Write 0 for input file index.
7367 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7368 with sym_index and input_index.
7369 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7370 incremental info GOT entry; replace got_descriptor with input_index.
7371 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7372 map from input file index to object.
7373 (Sized_relobj_incr::do_layout): Replace direct data member reference
7374 with accessor function.
7375 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7376 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7377 Adjust size of input file info header.
7378 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7379 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7380 (Incremental_input_entry_reader::get_input_section): Adjust size of
7381 input file info header.
7382 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7383 of incremental info GOT entry.
7384 (Incremental_got_plt_reader::get_got_desc): Remove.
7385 (Incremental_got_plt_reader::get_got_symndx): New function.
7386 (Incremental_got_plt_reader::get_got_input_index): New function.
7387 (Sized_incremental_binary::Sized_incremental_binary): Remove
7388 file_status_; add input_objects_.
7389 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7390 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7391 (Sized_incremental_binary::file_is_unchanged): Remove.
7392 (Sized_incremental_binary::set_input_object): New function.
7393 (Sized_incremental_binary::input_object): New function.
7394 (Sized_incremental_binary::file_status_): Remove.
7395 (Sized_incremental_binary::input_objects_): New data member.
7396 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7397 references.
7398 (Sized_relobj_incr::invalid_address): Move to base class.
7399 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7400 class.
7401 (Sized_relobj_incr::do_output_section_offset): Likewise.
7402 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7403 (Sized_relobj_incr::section_offsets_): Likewise.
7404 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7405 function.
7406 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7407 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7408 with accessor function.
7409 (Sized_relobj_file::do_layout): Likewise.
7410 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7411 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7412 (Sized_relobj_file::compute_final_local_value): Replace refs to
7413 section_offsets_ with accessor function.
7414 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7415 * object.h (Relobj::Relobj): Initialize new data members.
7416 (Relobj::add_dyn_reloc): New function.
7417 (Relobj::first_dyn_reloc): New function.
7418 (Relobj::dyn_reloc_count): New function.
7419 (Relobj::first_dyn_reloc_): New data member.
7420 (Relobj::dyn_reloc_count_): New data member.
7421 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7422 references.
7423 (Sized_relobj::Address): New typedef.
7424 (Sized_relobj::invalid_address): Move here from child class.
7425 (Sized_relobj::Sized_relobj): Initialize new data members.
7426 (Sized_relobj::sized_relobj): New function.
7427 (Sized_relobj::is_output_section_offset_invalid): Move here from
7428 child class.
7429 (Sized_relobj::get_output_section_offset): Likewise.
7430 (Sized_relobj::local_has_got_offset): Likewise.
7431 (Sized_relobj::local_got_offset): Likewise.
7432 (Sized_relobj::set_local_got_offset): Likewise.
7433 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7434 (Sized_relobj::clear_got_offsets): New function.
7435 (Sized_relobj::section_offsets): Move here from child class.
7436 (Sized_relobj::do_output_section_offset): Likewise.
7437 (Sized_relobj::do_set_section_offset): Likewise.
7438 (Sized_relobj::Local_got_offsets): Likewise.
7439 (Sized_relobj::local_got_offsets_): Likewise.
7440 (Sized_relobj::section_offsets_): Likewise.
7441 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7442 references.
7443 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7444 class.
7445 (Sized_relobj_file::sized_relobj): New function
7446 (Sized_relobj_file::local_has_got_offset): Move to base class.
7447 (Sized_relobj_file::local_got_offset): Likewise.
7448 (Sized_relobj_file::set_local_got_offset): Likewise.
7449 (Sized_relobj_file::get_output_section_offset): Likewise.
7450 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7451 (Sized_relobj_file::do_output_section_offset): Likewise.
7452 (Sized_relobj_file::do_set_section_offset): Likewise.
7453 (Sized_relobj_file::Local_got_offsets): Likewise.
7454 (Sized_relobj_file::local_got_offsets_): Likewise.
7455 (Sized_relobj_file::section_offsets_): Likewise.
7456 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7457 (all constructors).
7458 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7459 (Output_reloc::get_symbol_index): Likewise.
7460 (Output_reloc::local_section_offset): Likewise.
7461 (Output_reloc::get_address): Likewise.
7462 (Output_reloc::symbol_value): Likewise.
7463 (Output_data_got::reserve_slot): Move to class definition.
7464 (Output_data_got::reserve_local): New function.
7465 (Output_data_got::reserve_slot_for_global): Remove.
7466 (Output_data_got::reserve_global): New function.
7467 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7468 (all constructors, two instantiations).
7469 (Output_reloc::get_relobj): New function (two instantiations).
7470 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7471 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7472 (Output_data_reloc::add_global): Adjust type of relobj.
7473 (Output_data_reloc::add_global_relative): Likewise.
7474 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7475 (Output_data_reloc::add_local): Likewise.
7476 (Output_data_reloc::add_local_relative): Likewise.
7477 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7478 (Output_data_reloc::add_local_section): Likewise.
7479 (Output_data_reloc::add_output_section): Likewise.
7480 (Output_data_reloc::add_absolute): Likewise.
7481 (Output_data_reloc::add_target_specific): Likewise.
7482 (Output_data_got::reserve_slot): Move definition here.
7483 (Output_data_got::reserve_local): New function.
7484 (Output_data_got::reserve_global): New function.
7485 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7486 section_offsets_ with accessor function.
7487 (Sized_relobj_file::write_sections): Likewise.
7488 (Sized_relobj_file::do_relocate_sections): Likewise.
7489 * target.h (Sized_target::reserve_local_got_entry): New function.
7490 (Sized_target::reserve_global_got_entry): New function.
7491 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7492 (Target_x86_64::reserve_global_got_entry): New function.
7493 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7494
4829d394
CC
74952011-05-23 Cary Coutant <ccoutant@google.com>
7496
7497 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7498 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7499 bit when checking got_type.
7500 * incremental.cc (Sized_incremental_binary::setup_readers):
7501 Store symbol table and string table locations; initialize bit vector
7502 of file status flags.
7503 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7504 unchanged files.
7505 (Sized_incremental_binary::do_process_got_plt): New function.
7506 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7507 (Output_section_incremental_inputs::set_final_data_size): Record
7508 file index for each input file.
7509 (Output_section_incremental_inputs::write_got_plt): Store file index
7510 instead of input entry offset for each GOT entry.
7511 * incremental.h
7512 (Incremental_input_entry::Incremental_input_entry): Initialize new
7513 data member.
7514 (Incremental_input_entry::set_offset): Store file index.
7515 (Incremental_input_entry::get_file_index): New function.
7516 (Incremental_input_entry::file_index_): New data member.
7517 (Incremental_binary::process_got_plt): New function.
7518 (Incremental_binary::do_process_got_plt): New function.
7519 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7520 data members.
7521 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7522 (Sized_incremental_binary::set_file_is_unchanged): New function.
7523 (Sized_incremental_binary::file_is_unchanged): New function.
7524 (Sized_incremental_binary::do_process_got_plt): New function.
7525 (Sized_incremental_binary::file_status_): New data member.
7526 (Sized_incremental_binary::main_symtab_loc_): New data member.
7527 (Sized_incremental_binary::main_strtab_loc_): New data member.
7528 * output.cc (Output_data_got::Got_entry::write): Add case
7529 RESERVED_CODE.
7530 (Output_data_got::add_global): Call add_got_entry.
7531 (Output_data_got::add_global_plt): Likewise.
7532 (Output_data_got::add_global_with_rel): Likewise.
7533 (Output_data_got::add_global_with_rela): Likewise.
7534 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7535 (Output_data_got::add_global_pair_with_rela): Likewise.
7536 (Output_data_got::add_local): Call add_got_entry.
7537 (Output_data_got::add_local_plt): Likewise.
7538 (Output_data_got::add_local_with_rel): Likewise.
7539 (Output_data_got::add_local_with_rela): Likewise.
7540 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7541 (Output_data_got::add_local_pair_with_rela): Likewise.
7542 (Output_data_got::reserve_slot): New function.
7543 (Output_data_got::reserve_slot_for_global): New function.
7544 (Output_data_got::add_got_entry): New function.
7545 (Output_data_got::add_got_entry_pair): New function.
7546 (Output_section::add_output_section_data): Edit FIXME.
7547 * output.h
7548 (Output_section_data_build::Output_section_data_build): New
7549 constructor with size parameter.
7550 (Output_data_space::Output_data_space): Likewise.
7551 (Output_data_got::Output_data_got): Initialize new data member; new
7552 constructor with size parameter.
7553 (Output_data_got::add_constant): Call add_got_entry.
7554 (Output_data_got::reserve_slot): New function.
7555 (Output_data_got::reserve_slot_for_global): New function.
7556 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7557 (Output_data_got::add_got_entry): New function.
7558 (Output_data_got::add_got_entry_pair): New function.
7559 (Output_data_got::free_list_): New data member.
7560 * target.h (Sized_target::init_got_plt_for_update): New function.
7561 (Sized_target::register_global_plt_entry): New function.
7562 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7563 Initialize new data member; call init; add constructor with PLT count.
7564 (Output_data_plt_x86_64::init): New function.
7565 (Output_data_plt_x86_64::add_relocation): New function.
7566 (Output_data_plt_x86_64::reserve_slot): New function.
7567 (Output_data_plt_x86_64::free_list_): New data member.
7568 (Target_x86_64::init_got_plt_for_update): New function.
7569 (Target_x86_64::register_global_plt_entry): New function.
7570 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7571 incremental updates.
7572 (Output_data_plt_x86_64::add_relocation): New function.
7573 * testsuite/object_unittest.cc (Object_test): Set default options.
7574
ec69d6da
ILT
75752011-05-16 Ian Lance Taylor <iant@google.com>
7576
7577 * options.h (class General_options): Make -i a synonym for -r.
7578
732e31de
ILT
75792011-05-16 Ian Lance Taylor <iant@google.com>
7580
7581 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7582
403676b5
CC
75832011-05-10 Cary Coutant <ccoutant@google.com>
7584
7585 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7586 strip_all (-s).
7587
5b7b7d6e
ILT
75882011-05-06 Ian Lance Taylor <iant@google.com>
7589
7590 * layout.cc (Layout::layout): If the output section flags change,
7591 update the ordering.
7592
f0f9babf
CC
75932011-04-25 Cary Coutant <ccoutant@google.com>
7594
7595 * incremental-dump.cc (dump_incremental_inputs): Print local
7596 symbol info for each input file.
7597 * incremental.cc
7598 (Output_section_incremental_inputs::set_final_data_size): Add local
7599 symbol info to input file entries in incremental info.
7600 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7601 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7602 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7603 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7604 implementation.
7605 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7606 (Sized_incr_relobj::do_relocate): Write the local symbols.
7607 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7608 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7609 Adjust size of input file header.
7610 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7611 (Incremental_inputs_reader::get_local_symbol_count): New function.
7612 (Incremental_inputs_reader::get_input_section): Adjust size of input
7613 file header.
7614 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7615 (Sized_incr_relobj::This): New typedef.
7616 (Sized_incr_relobj::sym_size): New const data member.
7617 (Sized_incr_relobj::Local_symbol): New struct.
7618 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7619 (Sized_incr_relobj::do_local_symbol_offset): New function.
7620 (Sized_incr_relobj::local_symbol_count_): New data member.
7621 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7622 (Sized_incr_relobj::local_symbol_index_): New data member.
7623 (Sized_incr_relobj::local_symbol_offset_): New data member.
7624 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7625 (Sized_incr_relobj::local_symbols_): New data member.
7626 * object.h (Relobj::output_local_symbol_count): New function.
7627 (Relobj::local_symbol_offset): New function.
7628 (Relobj::do_output_local_symbol_count): New function.
7629 (Relobj::do_local_symbol_offset): New function.
7630 (Sized_relobj::do_output_local_symbol_count): New function.
7631 (Sized_relobj::do_local_symbol_offset): New function.
7632
d0a9ace3
ILT
76332011-04-22 Vladimir Simonov <sv@sw.ru>
7634
7635 * descriptors.cc (set_close_on_exec): New function.
7636 (Descriptors::open): Use set_close_on_exec.
7637 * output.cc (S_ISLNK): Define if not defined.
7638
94a3fc8b
CC
76392011-04-22 Cary Coutant <ccoutant@google.com>
7640
7641 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7642 global symbol map.
7643 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7644 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7645 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7646 relocations.
7647 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7648 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7649 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7650 * incremental.h
7651 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7652 function.
7653 (Incremental_binary::apply_incremental_relocs): New function.
7654 (Incremental_binary::do_apply_incremental_relocs): New function.
7655 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7656 data member.
7657 (Sized_incremental_binary::add_global_symbol): New function.
7658 (Sized_incremental_binary::global_symbol): New function.
7659 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7660 (Sized_incremental_binary::symbol_map_): New data member.
7661 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7662 * target.h (Sized_target::apply_relocation): New function.
7663 * target-reloc.h (apply_relocation): New function.
7664 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7665
c87e4302
DK
76662011-04-22 Doug Kwan <dougkwan@google.com>
7667
7668 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7669 flag of a SHT_ARM_EXIDX section.
2e702c99 7670 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7671 * testsuite/Makefile.in: Regenerate.
7672 * testsuite/arm_exidx_test.s: New file.
7673 * testsuite/arm_exidx_test.sh: Same.
7674
e7782cf6
CC
76752011-04-20 Cary Coutant <ccoutant@google.com>
7676
7677 PR gold/12689
7678 * archive.h (Incremental_archive_entry::Archive_member):
7679 Initialize arg_serial_ (second constructor).
7680
308ecdc7
ILT
76812011-04-17 Ian Lance Taylor <iant@google.com>
7682
7683 * object.cc (Relocate_info::location): Simplify location string.
7684 * errors.cc (Errors::error_at_location): Don't print program
7685 name.
7686 (Errors::warning_at_location): Likewise.
7687 (Errors::undefined_symbol): Likewise.
7688 * testsuite/debug_msg.sh: Update accordingly.
7689
bec5b579
CC
76902011-04-14 Cary Coutant <ccoutant@google.com>
7691
7692 * gold/layout.cc (Layout::symtab_section_offset): New function.
7693 * gold/layout.h (Layout::symtab_section_offset): New function.
7694 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7695
88597d34
ILT
76962011-04-12 Ian Lance Taylor <iant@google.com>
7697
7698 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7699 with MREMAP_MAYMOVE.
7700 * output.h (class Output_file): Add map_is_allocated_ field.
7701 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7702 not available, provide stubs. If mremap is not available, #define
7703 it to gold_mremap.
7704 (MREMAP_MAYMOVE): Define if not defined.
7705 (Output_file::Output_file): Initialize map_is_allocated_.
7706 (Output_file::resize): Check map_is_allocated_.
7707 (Output_file::map_anonymous): If mmap fails, use malloc.
7708 (Output_file::unmap): Don't do anything for an anonymous map.
7709 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7710 is not available, provide stubs.
7711 (File_read::View::~View): Use free rather than delete[].
7712 (File_read::make_view): Use malloc rather than new[]. If mmap
7713 fails, use malloc.
7714 (File_read::find_or_make_view): Use malloc rather than new[].
7715 * gold.h: Remove HAVE_REMAP code.
7716 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7717 exists. Rename mremap to gold_mremap. If mmap is not available
7718 don't do anything.
7719 * configure, config.in: Rebuild.
7720
11e361bc
ILT
77212011-04-11 Ian Lance Taylor <iant@google.com>
7722
7723 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7724 initialize local variable v.
7725
cdc29364
CC
77262011-04-11 Cary Coutant <ccoutant@google.com>
7727
7728 * archive.cc (Archive::include_member): Adjust call to
7729 report_object.
7730 (Add_archive_symbols::run): Track argument serial numbers.
7731 (Lib_group::include_member): Likewise.
7732 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7733 * archive.h (Incremental_archive_entry::Archive_member):
7734 Initialize arg_serial_.
7735 (Archive_member::arg_serial_): New data member.
7736 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7737 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7738 incremental link.
7739 (Sized_dynobj::do_for_all_local_got_entries): New function.
7740 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7741 function.
7742 * fileread.cc (get_mtime): New function.
7743 * fileread.h (get_mtime): New function.
7744 * gold.cc (queue_initial_tasks): Check for incremental update.
7745 (process_incremental_input): New function.
7746 (queue_middle_tasks): Don't force valid target for incremental
7747 update.
7748 * incremental-dump.cc (find_input_containing_global): Adjust
7749 size of symbol info entry.
7750 (dump_incremental_inputs): Dump argument serial number and
7751 in_system_directory flag; bias shndx by 1; print symbol names
7752 when dumping per-file symbol lists; use new symbol info readers.
7753 * incremental.cc
7754 (Output_section_incremental_inputs:update_data_size): New function.
7755 (Sized_incremental_binary::setup_readers): Setup input readers
7756 for each input file; build maps for files added from libraries
7757 and scripts.
7758 (Sized_incremental_binary::check_input_args): New function.
7759 (Sized_incremental_binary::do_check_inputs): Build map of argument
7760 serial numbers to input arguments.
7761 (Sized_incremental_binary::do_file_has_changed): Rename
7762 do_file_is_unchanged to this; compare file modification times.
7763 (Sized_incremental_binary::do_init_layout): New function.
7764 (Sized_incremental_binary::do_reserve_layout): New function.
7765 (Sized_incremental_binary::do_get_input_reader): Remove.
7766 (Sized_incremental_binary::get_symtab_view): New function.
7767 (Incremental_checker::can_incrementally_link_output_file): Remove.
7768 (Incremental_inputs::report_command_line): Exclude --debug options.
7769 (Incremental_inputs::report_archive_begin): Add parameter; track
7770 argument serial numbers; don't put input file entry for archive
7771 before archive members.
7772 (Incremental_inputs::report_archive_end): Put input file entry
7773 for archive after archive members.
7774 (Incremental_inputs::report_object): Add parameter; track argument
7775 serial numbers and in_system_directory flag.
7776 (Incremental_inputs::report_script): Add parameter; track argument
7777 serial numbers.
7778 (Output_section_incremental_inputs::set_final_data_size): Adjust
7779 size of symbol info entry; check for forwarding symbols.
7780 (Output_section_incremental_inputs::write_input_files): Write
7781 in_system_directory flag and argument serial number.
7782 (Output_section_incremental_inputs::write_info_blocks): Map section
7783 indices between incremental info and original input file; store
7784 input section index for each symbol.
7785 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7786 change operator() to visit().
7787 (class Global_got_offset_visitor): Likewise.
7788 (class Global_symbol_visitor_got_plt):
7789 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7790 classes.
7791 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7792 (Sized_incr_relobj::do_read_symbols): New function.
7793 (Sized_incr_relobj::do_layout): New function.
7794 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7795 (Sized_incr_relobj::do_add_symbols): New function.
7796 (Sized_incr_relobj::do_should_include_member): New function.
7797 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7798 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7799 (Sized_incr_relobj::do_section_size): New function.
7800 (Sized_incr_relobj::do_section_name): New function.
7801 (Sized_incr_relobj::do_section_contents): New function.
7802 (Sized_incr_relobj::do_section_flags): New function.
7803 (Sized_incr_relobj::do_section_entsize): New function.
7804 (Sized_incr_relobj::do_section_address): New function.
7805 (Sized_incr_relobj::do_section_type): New function.
7806 (Sized_incr_relobj::do_section_link): New function.
7807 (Sized_incr_relobj::do_section_info): New function.
7808 (Sized_incr_relobj::do_section_addralign): New function.
7809 (Sized_incr_relobj::do_initialize_xindex): New function.
7810 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7811 (Sized_incr_relobj::do_read_relocs): New function.
7812 (Sized_incr_relobj::do_gc_process_relocs): New function.
7813 (Sized_incr_relobj::do_scan_relocs): New function.
7814 (Sized_incr_relobj::do_count_local_symbols): New function.
7815 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7816 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7817 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7818 (Sized_incr_relobj::do_relocate): New function.
7819 (Sized_incr_relobj::do_set_section_offset): New function.
7820 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7821 (Sized_incr_dynobj::do_read_symbols): New function.
7822 (Sized_incr_dynobj::do_layout): New function.
7823 (Sized_incr_dynobj::do_add_symbols): New function.
7824 (Sized_incr_dynobj::do_should_include_member): New function.
7825 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7826 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7827 (Sized_incr_dynobj::do_section_size): New function.
7828 (Sized_incr_dynobj::do_section_name): New function.
7829 (Sized_incr_dynobj::do_section_contents): New function.
7830 (Sized_incr_dynobj::do_section_flags): New function.
7831 (Sized_incr_dynobj::do_section_entsize): New function.
7832 (Sized_incr_dynobj::do_section_address): New function.
7833 (Sized_incr_dynobj::do_section_type): New function.
7834 (Sized_incr_dynobj::do_section_link): New function.
7835 (Sized_incr_dynobj::do_section_info): New function.
7836 (Sized_incr_dynobj::do_section_addralign): New function.
7837 (Sized_incr_dynobj::do_initialize_xindex): New function.
7838 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7839 (make_sized_incremental_object): New function.
7840 (Incremental_library::copy_unused_symbols): New function.
7841 (Incremental_library::do_for_all_unused_symbols): New function.
7842 * incremental.h (enum Incremental_input_flags): New type.
7843 (class Incremental_checker): Remove.
7844 (Incremental_input_entry::Incremental_input_entry): Add argument
7845 serial number.
7846 (Incremental_input_entry::arg_serial): New function.
7847 (Incremental_input_entry::set_is_in_system_directory): New function.
7848 (Incremental_input_entry::is_in_system_directory): New function.
7849 (Incremental_input_entry::arg_serial_): New data member.
7850 (Incremental_input_entry::is_in_system_directory_): New data member.
7851 (class Script_info): Move here from script.h.
7852 (Script_info::Script_info): Add filename parameter.
7853 (Script_info::filename): New function.
7854 (Script_info::filename_): New data member.
7855 (Incremental_script_entry::Incremental_script_entry): Add argument
7856 serial number.
7857 (Incremental_object_entry::Incremental_object_entry): Likewise.
7858 (Incremental_object_entry::add_input_section): Build list of input
7859 sections with map to original shndx.
7860 (Incremental_object_entry::get_input_section_index): New function.
7861 (Incremental_object_entry::shndx_): New data member.
7862 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7863 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7864 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7865 serial number.
7866 (Incremental_inputs::report_archive_begin): Likewise.
7867 (Incremental_inputs::report_object): Likewise.
7868 (Incremental_inputs::report_script): Likewise.
7869 (class Incremental_global_symbol_reader): New class.
7870 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7871 and store flags and input file type.
7872 (Incremental_input_entry_reader::arg_serial): New function.
7873 (Incremental_input_entry_reader::type): Extract type from flags.
7874 (Incremental_input_entry_reader::is_in_system_directory): New function.
7875 (Incremental_input_entry_reader::get_input_section_count): Call
7876 accessor function for type.
7877 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7878 function for type; adjust size of global symbol entry.
7879 (Incremental_input_entry_reader::get_global_symbol_count): Call
7880 accessor function for type.
7881 (Incremental_input_entry_reader::get_object_count): Likewise.
7882 (Incremental_input_entry_reader::get_object_offset): Likewise.
7883 (Incremental_input_entry_reader::get_member_count): Likewise.
7884 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7885 (Incremental_input_entry_reader::get_member_offset): Likewise.
7886 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7887 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7888 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7889 (Incremental_input_entry_reader::get_global_symbol_reader): New
7890 function.
7891 (Incremental_input_entry_reader::get_output_symbol_index): New
7892 function.
7893 (Incremental_input_entry_reader::type_): Remove.
7894 (Incremental_input_entry_reader::flags_): New data member.
7895 (Incremental_inputs_reader::input_file_offset): New function.
7896 (Incremental_inputs_reader::input_file_index): New function.
7897 (Incremental_inputs_reader::input_file): Call input_file_offset.
7898 (Incremental_inputs_reader::input_file_at_offset): New function.
7899 (Incremental_relocs_reader::get_r_type): Reformat.
7900 (Incremental_relocs_reader::get_r_shndx): Reformat.
7901 (Incremental_relocs_reader::get_r_offset): Reformat.
7902 (Incremental_relocs_reader::data): New function.
7903 (Incremental_binary::Incremental_binary): Initialize new data members.
7904 (Incremental_binary::check_inputs): Add cmdline parameter.
7905 (Incremental_binary::file_is_unchanged): Remove.
7906 (Input_reader::arg_serial): New function.
7907 (Input_reader::get_unused_symbol_count): New function.
7908 (Input_reader::get_unused_symbol): New function.
7909 (Input_reader::do_arg_serial): New function.
7910 (Input_reader::do_get_unused_symbol_count): New function.
7911 (Input_reader::do_get_unused_symbol): New function.
7912 (Incremental_binary::input_file_count): New function.
7913 (Incremental_binary::get_input_reader): Change signature to use
7914 index instead of filename.
7915 (Incremental_binary::file_has_changed): New function.
7916 (Incremental_binary::get_input_argument): New function.
7917 (Incremental_binary::get_library): New function.
7918 (Incremental_binary::get_script_info): New function.
7919 (Incremental_binary::init_layout): New function.
7920 (Incremental_binary::reserve_layout): New function.
7921 (Incremental_binary::output_file): New function.
7922 (Incremental_binary::do_check_inputs): New function.
7923 (Incremental_binary::do_file_is_unchanged): Remove.
7924 (Incremental_binary::do_file_has_changed): New function.
7925 (Incremental_binary::do_init_layout): New function.
7926 (Incremental_binary::do_reserve_layout): New function.
7927 (Incremental_binary::do_input_file_count): New function.
7928 (Incremental_binary::do_get_input_reader): Change signature.
7929 (Incremental_binary::input_args_map_): New data member.
7930 (Incremental_binary::library_map_): New data member.
7931 (Incremental_binary::script_map_): New data member.
7932 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7933 new data members.
7934 (Sized_incremental_binary::output_section): New function.
7935 (Sized_incremental_binary::inputs_reader): Add const.
7936 (Sized_incremental_binary::symtab_reader): Add const.
7937 (Sized_incremental_binary::relocs_reader): Add const.
7938 (Sized_incremental_binary::got_plt_reader): Add const.
7939 (Sized_incremental_binary::get_symtab_view): New function.
7940 (Sized_incremental_binary::Inputs_reader): New typedef.
7941 (Sized_incremental_binary::Input_entry_reader): New typedef.
7942 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7943 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7944 (Sized_incremental_binary::do_file_has_changed): New function.
7945 (Sized_incremental_binary::do_init_layout): New function.
7946 (Sized_incremental_binary::do_reserve_layout): New function.
7947 (Sized_input_reader::Inputs_reader): Remove.
7948 (Sized_input_reader::Input_entry_reader): Remove.
7949 (Sized_input_reader::do_arg_serial): New function.
7950 (Sized_input_reader::do_get_unused_symbol_count): New function.
7951 (Sized_input_reader::do_get_unused_symbol): New function.
7952 (Sized_incremental_binary::do_input_file_count): New function.
7953 (Sized_incremental_binary::do_get_input_reader): Change signature;
7954 use index instead of filename.
7955 (Sized_incremental_binary::section_map_): New data member.
7956 (Sized_incremental_binary::input_entry_readers_): New data member.
7957 (class Sized_incr_relobj): New class.
7958 (class Sized_incr_dynobj): New class.
7959 (make_sized_incremental_object): New function.
7960 (class Incremental_library): New class.
7961 * layout.cc (Free_list::num_lists): New static data member.
7962 (Free_list::num_nodes): New static data member.
7963 (Free_list::num_removes): New static data member.
7964 (Free_list::num_remove_visits): New static data member.
7965 (Free_list::num_allocates): New static data member.
7966 (Free_list::num_allocate_visits): New static data member.
7967 (Free_list::init): New function.
7968 (Free_list::remove): New function.
7969 (Free_list::allocate): New function.
7970 (Free_list::dump): New function.
7971 (Free_list::print_stats): New function.
7972 (Layout_task_runner::run): Resize output file for incremental updates.
7973 (Layout::Layout): Initialize new data members.
7974 (Layout::set_incremental_base): New function.
7975 (Layout::init_fixed_output_section): New function.
7976 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7977 incremental updates.
7978 (Layout::create_gold_note): Do not create gold note section for
7979 incremental updates.
7980 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7981 for incremental updates.
7982 (Layout::set_section_offsets): For incremental updates, allocate space
7983 from free list.
7984 (Layout::create_symtab_sections): Layout with offsets relative to
7985 start of section; for incremental updates, allocate space from free
7986 list.
7987 (Layout::create_shdrs): For incremental updates, allocate space from
7988 free list.
7989 (Layout::finish_dynamic_section): For incremental updates, do not
7990 check --as-needed (fixed in subsequent patch).
7991 * layout.h (class Free_list): New class.
7992 (Layout::set_incremental_base): New function.
7993 (Layout::incremental_base): New function.
7994 (Layout::init_fixed_output_section): New function.
7995 (Layout::allocate): New function.
7996 (Layout::incremental_base_): New data member.
7997 (Layout::free_list_): New data member.
7998 * main.cc (main): Print Free_list statistics.
7999 * object.cc (Relobj::finalize_incremental_relocs): Add
8000 clear_counts parameter; clear counts only when clear_counts is set.
8001 (Sized_relobj::Sized_relobj): Initialize new base class.
8002 (Sized_relobj::do_layout): Don't report special sections.
8003 (Sized_relobj::do_for_all_local_got_entries): New function.
8004 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
8005 symtab_off to all symbol table offsets.
8006 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
8007 * object.h (class Got_offset_list): Move to top of file.
8008 (Object::Object): Allow case where input_file == NULL.
8009 (Object::~Object): Likewise.
8010 (Object::input_file): Assert that input_file != NULL.
8011 (Object::lock): Allow case where input_file == NULL.
8012 (Object::unlock): Likewise.
8013 (Object::is_locked): Likewise.
8014 (Object::token): Likewise.
8015 (Object::release): Likewise.
8016 (Object::is_incremental): New function.
8017 (Object::get_mtime): New function.
8018 (Object::for_all_local_got_entries): New function.
8019 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
8020 (Object::set_is_in_system_directory): New function.
8021 (Object::is_in_system_directory): New function.
8022 (Object::do_is_incremental): New function.
8023 (Object::do_get_mtime): New function.
8024 (Object::do_for_all_local_got_entries): New function.
8025 (Object::is_in_system_directory_): New data member.
8026 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
8027 (class Sized_relobj_base): New class.
8028 (class Sized_relobj): Derive from Sized_relobj_base.
8029 (class Sized_relobj::Symbols): Redeclare from base class.
8030 (class Sized_relobj::local_got_offset_list): Remove.
8031 (class Sized_relobj::Output_sections): Redeclare from base class.
8032 (class Sized_relobj::do_for_all_local_got_entries): New function.
8033 (class Sized_relobj::write_local_symbols): Add offset parameter.
8034 (class Sized_relobj::local_symbol_offset_): Update comment.
8035 (class Sized_relobj::local_dynsym_offset_): Update comment.
8036 * options.cc (Input_arguments::add_file): Remove const.
8037 * options.h (Input_file_argument::Input_file_argument):
8038 Initialize arg_serial_ (all constructors).
8039 (Input_file_argument::set_arg_serial): New function.
8040 (Input_file_argument::arg_serial): New function.
8041 (Input_file_argument::arg_serial_): New data member.
8042 (Input_arguments::Input_arguments): Initialize file_count_.
8043 (Input_arguments::add_file): Remove const.
8044 (Input_arguments::number_of_input_files): New function.
8045 (Input_arguments::file_count_): New data member.
8046 (Command_line::number_of_input_files): Call
8047 Input_arguments::number_of_input_files.
8048 * output.cc (Output_segment_headers::Output_segment_headers):
8049 Set current size.
8050 (Output_section::Input_section::current_data_size): New function.
8051 (Output_section::Output_section): Initialize new data members.
8052 (Output_section::add_input_section): Don't do merge sections for
8053 an incremental link; allocate space from free list for an
8054 incremental update.
8055 (Output_section::add_output_section_data): Allocate space from
8056 free list for an incremental update.
8057 (Output_section::update_data_size): New function.
8058 (Output_section::set_fixed_layout): New function.
8059 (Output_section::reserve): New function.
8060 (Output_segment::set_section_addresses): Remove const.
8061 (Output_segment::set_section_list_addresses): Remove const; allocate
8062 space from free list for an incremental update.
8063 (Output_segment::set_offset): Adjust size of RELRO segment for an
8064 incremental update.
8065 * output.h (Output_data::current_data_size): Move here from
8066 child classes.
8067 (Output_data::pre_finalize_data_size): New function.
8068 (Output_data::update_data_size): New function.
8069 (Output_section_headers::update_data_size): new function.
8070 (Output_section_data_build::current_data_size): Move to Output_data.
8071 (Output_data_strtab::update_data_size): New function.
8072 (Output_section::current_data_size): Move to Output_data.
8073 (Output_section::set_fixed_layout): New function.
8074 (Output_section::has_fixed_layout): New function.
8075 (Output_section::reserve): New function.
8076 (Output_section::update_data_size): New function.
8077 (Output_section::has_fixed_layout_): New data member.
8078 (Output_section::free_list_): New data member.
8079 (Output_segment::set_section_addresses): Remove const.
8080 (Output_segment::set_section_list_addresses): Remove const.
8081 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8082 New function.
8083 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8084 New function.
8085 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8086 parameter when calling Add_symbols constructor; store argument
8087 serial number for members of a lib group.
8088 (Add_symbols::locks): Allow case where token == NULL.
8089 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8090 (Read_member::~Read_member): New function.
8091 (Read_member::is_runnable): New function.
8092 (Read_member::locks): New function.
8093 (Read_member::run): New function.
8094 (Check_script::~Check_script): New function.
8095 (Check_script::is_runnable): New function.
8096 (Check_script::locks): New function.
8097 (Check_script::run): New function.
8098 (Check_library::~Check_library): New function.
8099 (Check_library::is_runnable): New function.
8100 (Check_library::locks): New function.
8101 (Check_library::run): New function.
8102 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8103 (Add_symbols::library_): New data member.
8104 (class Read_member): New class.
8105 (class Check_script): New class.
8106 (class Check_library): New class.
8107 * reloc.cc (Read_relocs::is_runnable): Allow case where
8108 token == NULL.
8109 (Read_relocs::locks): Likewise.
8110 (Scan_relocs::locks): Likewise.
8111 (Relocate_task::locks): Likewise.
8112 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8113 to clear counters.
8114 (Sized_relobj::incremental_relocs_scan): Fix comment.
8115 (Sized_relobj::do_relocate): Pass output file offset to
8116 write_local_symbols.
8117 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8118 from class declaration.
8119 * script.cc (read_input_script): Allocate Script_info; pass
8120 argument serial number to report_script.
8121 * script.h (class Script_info): Move to incremental.h.
8122 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8123 * symtab.h (Symbol_table::add_from_incrobj): New function.
8124 (Symbol_table::set_file_offset): New function.
8125
b961d0d7
CC
81262011-04-05 Cary Coutant <ccoutant@google.com>
8127
8128 * incremental-dump.cc (dump_incremental_inputs): Change signature
8129 to take a Sized_incremental_binary; change caller. Use readers
8130 in Sized_incremental_binary.
8131 * incremental.cc
8132 (Sized_incremental_binary::find_incremental_inputs_sections):
8133 Rename do_find_incremental_inputs_sections to this.
8134 (Sized_incremental_binary::setup_readers): New function.
8135 (Sized_incremental_binary::do_check_inputs): Check
8136 has_incremental_info_ flag; move setup code to setup_readers;
8137 use input readers.
8138 (Sized_incremental_binary::do_file_is_unchanged): New function.
8139 (Sized_incremental_binary::do_get_input_reader): New function.
8140 * incremental.h (class Incremental_binary): Move to end of file.
8141 (Incremental_binary::file_is_unchanged): New function.
8142 (Incremental_binary::do_file_is_unchanged): New function.
8143 (Incremental_binary::Input_reader): New class.
8144 (Incremental_binary::get_input_reader): New function.
8145 (class Sized_incremental_binary): Move to end of file.
8146 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8147 input section reader classes.
8148 (Sized_incremental_binary::has_incremental_info): New function.
8149 (Sized_incremental_binary::inputs_reader): New function.
8150 (Sized_incremental_binary::symtab_reader): New function.
8151 (Sized_incremental_binary::relocs_reader): New function.
8152 (Sized_incremental_binary::got_plt_reader): New function.
8153 (Sized_incremental_binary::do_file_is_unchanged): New function.
8154 (Sized_incremental_binary::Sized_input_reader): New class.
8155 (Sized_incremental_binary::get_input_reader): New function.
8156 (Sized_incremental_binary::find_incremental_inputs_sections):
8157 Rename do_find_incremental_inputs_sections to this.
8158 (Sized_incremental_binary::setup_readers): New function.
8159 (Sized_incremental_binary::has_incremental_info_): New data member.
8160 (Sized_incremental_binary::inputs_reader_): New data member.
8161 (Sized_incremental_binary::symtab_reader_): New data member.
8162 (Sized_incremental_binary::relocs_reader_): New data member.
8163 (Sized_incremental_binary::got_plt_reader_): New data member.
8164 (Sized_incremental_binary::current_input_file_): New data member.
8165
a869183f
PP
81662011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8167
8168 PR gold/12640
8169 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8170 violation.
8171
81722011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
8173
8174 * archive.cc (Archive::include_member): Adjust call to report_object.
8175 (Add_archive_symbols::run): Add script_info to call to
8176 report_archive_begin.
8177 (Lib_group::include_member): Adjust call to report_object.
8178 (Add_lib_group_symbols::run): Adjust call to report_object.
8179 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8180 blocks. Add object count for script input files.
8181 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8182 script_info parameter; change all callers.
8183 (Incremental_inputs::report_object): Add script_info parameter;
8184 change all callers.
8185 (Incremental_inputs::report_script): Store backpointer to
8186 incremental info entry.
8187 (Output_section_incremental_inputs::set_final_data_size): Record
8188 additional information for scripts.
8189 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8190 * incremental.h (Incremental_script_entry::add_object): New function.
8191 (Incremental_script_entry::get_object_count): New function.
8192 (Incremental_script_entry::get_object): New function.
8193 (Incremental_script_entry::objects_): New data member; adjust
8194 constructor.
8195 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8196 (Incremental_inputs::report_object): Add script_info parameter.
8197 (Incremental_inputs_reader::get_object_count): New function.
8198 (Incremental_inputs_reader::get_object_offset): New function.
8199 * options.cc (Input_arguments::add_file): Return reference to
8200 new input argument.
8201 * options.h (Input_argument::set_script_info): New function.
8202 (Input_argument::script_info): New function.
8203 (Input_argument::script_info_): New data member; adjust all
8204 constructors.
8205 (Input_file_group::add_file): Return reference to new input argument.
8206 (Input_file_lib::add_file): Likewise.
8207 (Input_arguments::add_file): Likewise.
8208 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8209 * script.cc (Parser_closure::Parser_closure): Add script_info
8210 parameter; adjust all callers.
8211 (Parser_closure::script_info): New function.
8212 (Parser_closure::script_info_): New data member.
8213 (read_input_script): Report scripts earlier to incremental info.
8214 (script_add_file): Set script_info in Input_argument.
8215 (script_add_library): Likewise.
8216 * script.h (Script_options::Script_info): Rewrite class.
8217
a869183f 82182011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
8219
8220 * archive.cc (Library_base::should_include_member): Move
8221 method here from class Archive.
8222 (Archive::Archive): Initialize base class.
8223 (Archive::should_include_member): Move to base class.
8224 (Archive::do_for_all_unused_symbols): New function.
8225 (Add_archive_symbols::run): Remove redundant access to
8226 incremental_inputs.
8227 (Lib_group::Lib_group): Initialize base class.
8228 (Lib_group::do_filename): New function.
8229 (Lib_group::include_member): Pass pointer to Lib_group to
8230 report_object.
8231 (Lib_group::do_for_all_unused_symbols): New function.
8232 (Add_lib_group_symbols::run): Report archive information for
8233 incremental links.
8234 * archive.h (class Library_base): New base class.
8235 (class Archive): Derive from Library_base.
8236 (Archive::filename): Move to base class.
8237 (Archive::set_incremental_info): Likewise.
8238 (Archive::incremental_info): Likewise.
8239 (Archive::Should_include): Likewise.
8240 (Archive::should_include_member): Likewise.
8241 (Archive::Armap_entry): Remove.
8242 (Archive::Unused_symbol_iterator): Remove.
8243 (Archive::unused_symbols_begin): Remove.
8244 (Archive::unused_symbols_end): Remove.
8245 (Archive::do_filename): New function.
8246 (Archive::do_get_mtime): New function.
8247 (Archive::do_for_all_unused_symbols): New function.
8248 (Archive::task_): Move to base class.
8249 (Archive::incremental_info_): Likewise.
8250 (class Lib_group): Derive from Library_base.
8251 (Lib_group::do_filename): New function.
8252 (Lib_group::do_get_mtime): New function.
8253 (Lib_group::do_for_all_unused_symbols): New function.
8254 (Lib_group::task_): Move to base class.
8255 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8256 function.
8257 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8258 function.
8259 * incremental.cc (Incremental_inputs::report_archive_begin):
8260 Use Library_base; call library's get_mtime; add incremental inputs
8261 entry before members.
8262 (class Unused_symbol_visitor): New class.
8263 (Incremental_inputs::report_archive_end): Use Library_base; use
8264 visitor class to record unused symbols; don't add incremental inputs
8265 entry after members.
8266 (Incremental_inputs::report_object): Use Library_base.
8267 * incremental.h
8268 (Incremental_archive_entry::Incremental_archive_entry): Remove
8269 unused Archive parameter.
8270 (Incremental_inputs::report_archive_begin): Use Library_base.
8271 (Incremental_inputs::report_archive_end): Likewise.
8272 (Incremental_inputs::report_object): Likewise.
8273 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8274 function.
8275 * object.h (Object::for_all_global_symbols): New function.
8276 (Object::do_for_all_global_symbols): New function.
8277 (Sized_relobj::do_for_all_global_symbols): New function.
8278 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8279 function.
8280 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8281 function.
8282
61ab3e40
ILT
82832011-03-27 Ian Lance Taylor <iant@google.com>
8284
8285 * archive.cc (Archive::interpret_header): Return -1 if something
8286 goes wrong. Change callers accordingly.
8287
30e1f9e6
CC
82882011-03-25 Cary Coutant <ccoutant@google.com>
8289
8290 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8291 * testsuite/Makefile.in: Regenerate.
8292
9370ce59 82932011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8294
8295 * plugin.cc (get_view): New.
8296 (Plugin::load): Pass get_view to the plugin.
8297 (Plugin_manager::get_view): New.
8298
9312bb0a
ILT
82992011-03-21 Ian Lance Taylor <iant@google.com>
8300
8301 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8302 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8303
7e12ba9e
ST
83042011-03-21 Sriraman Tallam <tmsriram@google.com>
8305
8306 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8307 Change == to -eq.
8308 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8309 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8310 Change == to -eq.
8311 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8312 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8313
fd7a005d
ILT
83142011-03-14 Ian Lance Taylor <iant@google.com>
8315
8316 * script-sections.cc (Sort_output_sections::script_compare):
8317 Rename from is_before, change return type.
8318 (Sort_output_sections::operator()): Adjust accordingly.
8319
ed16fd1b
ILT
83202011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8321
8322 PR gold/12572
8323 * testsuite/odr_violation2.cc: Add comment to make all error line
8324 numbers double digits.
8325 * testsuite/debug_msg.sh: Adjust expected errors.
8326
71ff8986
ILT
83272011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8328
8329 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8330 but mark earlier ones as non-canonical
8331 (offset_to_iterator): Update search target and example
8332 (do_addr2line): Return extra lines in a vector*
8333 (format_file_lineno): Extract from do_addr2line
8334 (one_addr2line): Add vector* out-param
8335 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8336 when a lineno entry appeared last for its instruction
8337 (Dwarf_line_info): Add vector* out-param
8338 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8339 * symtab.cc (Odr_violation_compare): Include the lineno in the
8340 comparison again.
8341 (linenos_from_loc): New. Combine the canonical line for an
8342 address with its other lines.
8343 (True_if_intersect): New. Helper functor to make
8344 std::set_intersection a query.
8345 (detect_odr_violations): Compare sets of lines instead of just
8346 one line for each function. This became less deterministic, but
8347 has fewer false positives.
8348 * symtab.h: Declarations.
8349 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8350 mix an optimized and non-optimized object in the same binary
8351 (odr_violation2.so): Same.
8352 * testsuite/Makefile.in: Regenerate from Makefile.am.
8353 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8354 * testsuite/debug_msg.sh: Update line numbers and add
8355 assertions.
8356 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8357 non-optimized context.
8358 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8359 isn't inlined, and use OdrDerived in an optimized context.
8360 * testsuite/odr_header1.h: Defines OdrDerived, where
8361 optimization will change the
8362 first-instruction-in-the-destructor's file and line number.
8363 * testsuite/odr_header2.h: Defines OdrBase.
8364
a19fefdc
ILT
83652011-03-09 Ian Lance Taylor <iant@google.com>
8366
8367 * fileread.cc (File_read::clear_views): Don't delete the whole
8368 file view.
8369
ecb351e9
ILT
83702011-03-08 Ian Lance Taylor <iant@google.com>
8371
8372 PR gold/12525
8373 * fileread.cc: #include <climits>.
8374 (GOLD_IOV_MAX): Define.
8375 (File_read::read_multiple): Limit number of entries by iov_max.
8376 * fileread.h (class File_read): Always set max_readv_entries to
8377 128.
8378
b821d13c
ILT
83792011-03-07 Ian Lance Taylor <iant@google.com>
8380
8381 PR gold/12525
8382 * options.h (class General_options): Add -dy and -dn.
8383
89243142
CC
83842011-03-02 Cary Coutant <ccoutant@google.com>
8385
8386 * testsuite/script_test_9.t: Add TLS segment.
8387
d0773f31
ILT
83882011-03-02 Simon Baldwin <simonb@google.com>
8389
8390 * configure.ac: Add check for gnu_indirect_function support in
8391 the toolchain building binutils.
8392 * configure: Rebuild.
8393
9370ce59 83942011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8395
8396 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8397 plugin only symbols.
8398 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8399 in plugin files as not needed in the symbol table.
8400
4cf7a849
ST
84012011-02-11 Sriraman Tallam <tmsriram@google.com>
8402
8403 * output.cc (Output_section::add_input_section): Delay fill
8404 generation for section ordering.
8405
b578bd7d
ILT
84062011-02-09 Ian Lance Taylor <iant@google.com>
8407
8408 PR gold/12316
8409 * object.h (class Sized_relobj): Remove clear_local_symbols.
8410 * reloc.cc (Sized_relobj::do_relocate): Don't call
8411 clear_local_symbols.
8412
9370ce59 84132011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8414
8415 * plugin.cc (is_visible_from_outside): Return true for symbols
8416 in the -u option.
8417
55382fb7
ILT
84182011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8419
8420 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8421 filename.
8422
4e271fff
ST
84232011-02-02 Sriraman Tallam <tmsriram@google.com>
8424
8425 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8426 to std::string.
4e271fff 8427 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8428 section_name to be std::string.
4e271fff
ST
8429 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8430
d433c3ac
ILT
84312011-01-25 Ian Lance Taylor <iant@google.com>
8432
8433 * script.cc (script_add_extern): Rewrite to use
8434 add_symbol_reference.
8435
880473a6
DK
84362011-01-25 Doug Kwan <dougkwan@google.com>
8437
d433c3ac 8438 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8439
f30f86fa
ILT
84402011-01-24 Ian Lance Taylor <iant@google.com>
8441
8442 * options.h (class General_options): Accept
8443 --no-detect-odr-violations.
8444
8e51a0b9
ILT
84452011-01-24 Ian Lance Taylor <iant@google.com>
8446
8447 * version.cc (version_string): Bump to 1.11.
8448
0f3b89d8
ILT
84492011-01-24 Ian Lance Taylor <iant@google.com>
8450
8451 * plugin.cc (class Plugin_rescan): Define new class.
8452 (Plugin_manager::claim_file): Set any_claimed_.
8453 (Plugin_manager::save_archive): New function.
8454 (Plugin_manager::save_input_group): New function.
8455 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8456 necessary.
8457 (Plugin_manager::new_undefined_symbol): New function.
8458 (Plugin_manager::rescan): New function.
8459 (Plugin_manager::rescannable_defines): New function.
8460 (Plugin_manager::add_input_file): Set any_added_.
8461 * plugin.h (class Plugin_manager): define new fields rescannable_,
8462 undefined_symbols_, any_claimed_, and any_added_. Declare
8463 Plugin_rescan as friend. Declare new functions.
8464 (Plugin_manager::Rescannable): Define type.
8465 (Plugin_manager::Rescannable_list): Define type.
8466 (Plugin_manager::Undefined_symbol_list): Define type.
8467 (Plugin_manager::Plugin_manager): Initialize new fields.
8468 * archive.cc (Archive::defines_symbol): New function.
8469 (Add_archive_symbols::run): Pass archive to plugins if any.
8470 * archive.h (class Archive): Declare defines_symbol.
8471 * readsyms.cc (Input_group::~Input_group): New function.
8472 (Finish_group::run): Pass input_group to plugins if any.
8473 * readsyms.h (class Input_group): Declare destructor.
8474 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8475 any.
8476
3bb951e5
ILT
84772011-01-10 Ian Lance Taylor <iant@google.com>
8478
8479 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8480 section as relro.
8481 (Layout::set_segment_offsets): Reset increase_relro before calling
8482 set_section_addresses a second time.
8483
0aa45fac
CC
84842011-01-04 Cary Coutant <ccoutant@google.com>
8485
8486 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8487 sections before NOBITS sections.
8488
0db46eb4
L
84892011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8490
8491 * version.cc (print_version): Update copyright to 2011.
8492
829c9745
CC
84932010-12-23 Cary Coutant <ccoutant@google.com>
8494
8495 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8496 of OS to this->add. Add OD parameter to second form of the function.
8497
7500420b
ILT
84982010-12-20 Ian Lance Taylor <iant@google.com>
8499
8500 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8501 second of two consecutive entries with same offset.
8502
f8e9a930
RW
85032010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8504
8505 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8506 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8507 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8508 to avoid unneeded links against $(LDADD).
8509 * testsuite/Makefile.in: Regenerate.
8510
2fbb4320
ILT
85112010-12-15 Ian Lance Taylor <iant@google.com>
8512
8513 PR gold/12324
8514 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8515 for R_X86_64_32 and R_X86_64_PC32.
8516 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8517 ver_matching_def_pic.o.
8518 (ver_matching_def_pic.o): New target.
8519
fedb228d
RW
85202010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8521
8522 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8523 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8524 Move definition before File_read::View member definitions.
8525 (File_read::View::~View): Initialize and hold lock before
8526 updating current_mapped_bytes.
8527
9b547ce6
RW
85282010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8529
8530 * dwarf_reader.cc: Remove outdated comment.
8531 * gold-threads.cc: Fix typo in error message.
8532 * archive.cc: Fix typos in comments.
8533 * archive.h: Likewise.
8534 * arm-reloc-property.cc: Likewise.
8535 * arm-reloc-property.h: Likewise.
8536 * arm-reloc.def: Likewise.
8537 * arm.cc: Likewise.
8538 * attributes.h: Likewise.
8539 * cref.cc: Likewise.
8540 * ehframe.cc: Likewise.
8541 * fileread.h: Likewise.
8542 * gold.h: Likewise.
8543 * i386.cc: Likewise.
8544 * icf.cc: Likewise.
8545 * incremental.h: Likewise.
8546 * int_encoding.cc: Likewise.
8547 * layout.h: Likewise.
8548 * main.cc: Likewise.
8549 * merge.h: Likewise.
8550 * object.cc: Likewise.
8551 * object.h: Likewise.
8552 * options.cc: Likewise.
8553 * readsyms.cc: Likewise.
8554 * reduced_debug_output.cc: Likewise.
8555 * reloc.cc: Likewise.
8556 * script-sections.cc: Likewise.
8557 * sparc.cc: Likewise.
8558 * symtab.h: Likewise.
8559 * target-reloc.h: Likewise.
8560 * target.cc: Likewise.
8561 * target.h: Likewise.
8562 * timer.cc: Likewise.
8563 * timer.h: Likewise.
8564 * x86_64.cc: Likewise.
8565
83e17bd5
CC
85662010-12-09 Cary Coutant <ccoutant@google.com>
8567
8568 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8569 stack.
8570 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8571 parameter; change all callers.
8572 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8573 * options.h (warn_execstack): New option.
8574
017257f8
DK
85752010-12-07 Doug Kwan <dougkwan@google.com>
8576
8577 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8578 like function call relocations.
8579
c20cbc06
ILT
85802010-12-07 Ian Lance Taylor <iant@google.com>
8581
8582 * archive.cc (Archive::get_elf_object_for_member): Permit
8583 punconfigured to be NULL.
8584 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8585 (Archive::include_member): Pass NULL to get_elf_object_for_member
8586 if we searched for the archive and this is the first included
8587 object.
8588
4dbfafcc
ILT
85892010-12-01 Ian Lance Taylor <iant@google.com>
8590
8591 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8592 track_relocs_type_ field.
8593 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8594 Set track_relocs_type_.
8595 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8596 contents when using RELA relocs.
8597 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8598 reloc_map_.
8599 * reloc.cc (Track_relocs::next_addend): New function.
8600 * reloc.h (class Track_relocs): Declare next_addend.
8601
e5e19edd
ILT
86022010-12-01 Ian Lance Taylor <iant@google.com>
8603
8604 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8605 virtual destructor.
8606
9a5ce24c
ILT
86072010-12-01 Ian Lance Taylor <iant@google.com>
8608
8609 * README: Update compilers known to work and fail.
8610
c7791212
NC
86112010-11-23 Matthias Klose <doko@ubuntu.com>
8612
8613 * configure.in: For --enable-gold, handle value `default' instead of
8614 `both*'. Always install ld as ld.bfd, install as ld if gold is
8615 not the default.
8616 * configure: Regenerate.
8617
0ad220c9
DK
86182010-11-18 Doug Kwan <dougkwan@google.com>
8619
8620 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8621 and right_alignment to be zero. Store result alignment only if it is
8622 greater than existing alignment.
8623
ab8056e0
CC
86242010-11-16 Cary Coutant <ccoutant@google.com>
8625
8626 PR gold/12220
8627 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8628 Check for ".zdebug_line".
8629
fd064a5b
CC
86302010-11-16 Doug Kwan <dougkwan@google.com>
8631 Cary Coutant <ccoutant@google.com>
8632
8633 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8634 by reference; adjust all callers.
8635 * output.cc (Output_segment::set_section_addresses): Adjust references
8636 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8637 list is empty.
8638 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8639 end at page boundary.
8640
6fc6ea19
CC
86412010-11-16 Cary Coutant <ccoutant@google.com>
8642
8643 PR gold/12220
8644 * layout.cc (Layout::choose_output_section): Transform names of
8645 compressed sections even when using a script with a SECTIONS clause.
8646 (Layout::output_section_name): Remove code to transform
8647 compressed debug section names.
8648 * output.cc (Output_section::add_input_section): Use uncompressed
8649 section size when tracking input sections.
8650
95a2c8d6
RS
86512010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8652
8653 * symtab.h (Symbol::NON_PIC_REF): Remove.
8654 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8655 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8656 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8657 (Symbol::use_plt_offset): Take a flags argument and pass it
8658 directly to needs_dynamic_reloc. Restrict check for undefined
8659 weak symbols to function calls.
8660 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8661 (Target_arm::Scan::global): Use it.
8662 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8663 (Target_arm::Relocate::relocate): Likewise.
8664 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8665 parameter with an r_type parameter. Use get_reference_flags
8666 to get the flags.
8667 (Target_arm::Relocate::relocate): Update accordingly.
8668 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8669 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8670 (Target_i386::Scan::global): Likewise.
8671 (Target_i386::Relocate::relocate): Likewise.
8672 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8673 parameter with an r_type parameter. Use get_reference_flags
8674 to get the flags.
8675 (Target_i386::Relocate::relocate): Update accordingly.
8676 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8677 (Target_powerpc::Scan::global): Use it.
8678 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8679 (Target_powerpc::Relocate::relocate): Likewise.
8680 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8681 (Target_sparc::Scan::global): Use it.
8682 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8683 (Target_sparc::Relocate::relocate): Likewise.
8684 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8685 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8686 (Target_x86_64::Scan::global): Likewise.
8687 (Target_x86_64::Relocate::relocate): Likewise.
8688
f625ae50
DK
86892010-11-08 Doug Kwan <dougkwan@google.com>
8690 Cary Coutant <ccoutant@google.com>
8691
8692 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8693 (Arm_exidx_merge_section::section_contents_): New data member.
8694 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8695 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8696 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8697 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8698 in parameters instead of calling Object::section_contents without
8699 locking.
8700 (Arm_output_section::group_section): New parameter TASK. Pass it
8701 to callees that need locking objects.
8702 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8703 to lock EXIDX input sections. Fix a formatting issue. Call
8704 Arm_exidx_merged_section::build_contents to create merged section
8705 contents.
8706 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8707 to lock object of stub table owner.
8708 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8709 TEXT_SIZE to initialize data member TEXT_SIZE_.
8710 (Arm_exidx_input_section::addralign): Fix typo in comment.
8711 (Arm_exidx_input_section::text_size): New method.
8712 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8713 that require locking objects. Lock objects before scanning for stubs
8714 and updating local symbols.
8715 (Arm_input_section<big_endian>::init): Copy contents of original
8716 input section.
2e702c99 8717 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8718 original input section instead of calling Object::section_contents
8719 without locking.
8720 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8721 size without calling Object::section_size().
8722 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8723 for size. Allocate a buffer for merged EXIDX entries.
8724 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8725 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8726 building code to Arm_exidx_merged_section::build_contetns. Write
8727 out contetns in buffer instead of building it on the fly.
8728 (Arm_relobj::make_exidx_input_section): Also pass text section size
8729 to Arm_exidx_input_section constructor.
8730 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8731 (Arm_dynobj::do_read_symbols): Fix memory leak.
8732 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8733 * target.h: (class Task): Add forward declaration.
8734 (Target::relax): Add new parameter TASK and pass it to
8735 Target::do_relax().
8736 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8737
5f9bcf58
CC
87382010-11-05 Cary Coutant <ccoutant@google.com>
8739
8740 PR gold/10708
8741 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8742 object when reading from the file.
8743 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8744 second layout pass.
8745 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8746 when reading section contents.
8747 (get_section_contents): Likewise.
8748 (icf::find_identical_sections): Likewise.
8749 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8750 object when reading from the file.
8751 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8752 the object when doing deferred section layout.
8753
e597fa08
NC
87542010-11-03 Nick Clifton <nickc@redhat.com>
8755
8756 PR gold/12001
8757 * script.h (class Symbol_assignment: name): New member. Returns
8758 the name of the symbol.
8759 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8760 Returns true if the given symbol name is on the list of
8761 assignments wating to be processed.
8762 * archive.cc (should_incldue_member): If the symbol is undefined,
8763 check to see if it is on the list of symbols pending assignment.
8764
3f9a3278
ILT
87652010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8766
8767 * script-sections.cc (Script_sections::find_memory_region): Check
8768 for a NULL output section pointer.
8769
d06fb4d1
DK
87702010-10-29 Doug Kwan <dougkwan@google.com>
8771
8772 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8773 Output_section::add_relaxed_input_section.
8774 * output.cc (Output_section::add_relaxed_input_section): Add new
8775 arguments LAYOUT and NAME. Set section order index.
8776 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8777 Copy section order index.
8778 * output.h (Output_section::add_relaxed_input_section): Add new
8779 arguments LAYOUT and NAME.
8780
90e24de5
ILT
87812010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8782
8783 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8784 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8785 * testsuite/Makefile.in: Regenerate.
8786
c9484ea5
DK
87872010-10-20 Doug Kwan <dougkwan@google.com>
8788
8789 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8790 without SHF_LINK_ORDER flags.
8791 * layout.cc (Layout::choose_output_section): Do not filter
8792 SHF_LINK_ORDER flag in a relocatable link.
8793
5bc2f5be
CC
87942010-10-17 Cary Coutant <ccoutant@google.com>
8795
8796 * output.h (Output_segment::set_section_addresses): Change function
8797 signature. Update all callers.
8798 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8799 sections.
8800 (Output_segment::set_section_addresses): Align after last TLS
8801 section. Add padding before last relro section instead of after.
8802
0c91cf04
DK
88032010-10-17 Doug Kwan <dougkwan@google.com>
8804
8805 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8806 GOT output section to be writable.
8807
8c21d9d3
CC
88082010-10-14 Cary Coutant <ccoutant@google.com>
8809
8810 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8811 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8812 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8813 mode.
8814 * incremental.cc (report_command_line): Ignore all forms of
8815 --incremental.
8816 * layout.cc (Layout::Layout): Check parameters for incremental link
8817 mode.
8818 * options.cc (General_options::parse_incremental): New function.
8819 (General_options::parse_no_incremental): New function.
8820 (General_options::parse_incremental_full): New function.
8821 (General_options::parse_incremental_update): New function.
8822 (General_options::incremental_mode_): New data member.
8823 (General_options::finalize): Check incremental_mode_.
8824 * options.h (General_options): Update help text for --incremental.
8825 Add --no-incremental, --incremental-full, --incremental-update.
8826 (General_options::Incremental_mode): New enum type.
8827 (General_options::incremental_mode): New function.
8828 (General_options::incremental_mode_): New data member.
8829 * parameters.cc (Parameters::incremental_mode_): New data member.
8830 (Parameters::set_options): Set incremental_mode_.
8831 (Parameters::set_incremental_full): New function.
8832 (Parameters::incremental): New function.
8833 (Parameters::incremental_update): New function.
8834 (set_parameters_incremental_full): New function.
8835 * parameters.h (Parameters::set_incremental_full): New function.
8836 (Parameters::incremental): New function.
8837 (Parameters::incremental_update): New function.
8838 (Parameters::incremental_mode_): New data member.
8839 (set_parameters_incremental_full): New function.
8840 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8841 incremental link mode.
8842 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8843 (Sized_relobj::do_relocate_sections): Likewise.
8844 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8845 option.
8846 * testsuite/Makefile.in: Regenerate.
8847 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8848
bb32aa18 88492010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8850
8851 * script-sections.h (class Script_sections): Make
8852 Sections_elements typedef public.
8853 * script-sections.cc (class Sort_output_sections): Add elements_
8854 field. Add constructor which sets it; change all callers.
8855 (Sort_output_sections::is_before): New function.
8856 (Sort_output_sections::operator()): Call is_before.
8857 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8858 conditional.
8859 * testsuite/script_test_10.sh: New test. Test script section
8860 order.
8861 * testsuite/script_test_10.t: Likewise.
8862 * testsuite/script_test_10.s: Likewise.
8863 * testsuite/Makefile.am: Wrap the cross linker tests and the
8864 common tests into NATIVE_OR_CROSS_LINKER.
8865 (check_SCRIPTS): Add script_test_10.sh.
8866 (check_DATA): Add script_test_10.stdout.
8867 (script_test_10.o, script_test_10): New targets.
8868 (script_test_10.stdout): New target.
8869 * configure, testsuite/Makefile.in: Regenerate.
8870
3cef7179
ILT
88712010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8872
8873 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8874 error for the deprecated relocations.
8875 (Target_arm::Scan::global): Likewise.
8876 (Target_arm::Relocate::relocate): Likewise.
8877
7411e9a8
RS
88782010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8879
8880 * fileread.cc (Input_file::find_file): Initialize *found_name
8881 and *namep when using the fallback search for case 4.
8882
6a9da32a
CC
88832010-10-11 Cary Coutant <ccoutant@google.com>
8884
8885 * options.h (class General_options): Redefine -z lazy as an alias for
8886 the negation of -z now.
8887
ac897c20
ILT
88882010-10-11 Ian Lance Taylor <iant@google.com>
8889
8890 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8891 binding.
8892
ea5cae92
NC
88932010-10-06 Nick Clifton <nickc@redhat.com>
8894
8895 * script-sections.cc(class Memory_region): Remove
8896 current_lma_offset_ field. Rename current_vma_offset_ to
8897 current_offset_. Add last_section_ field.
8898 (Memory_region::get_current_vma_address): Rename to
8899 get_current_address.
8900 (Memory_region::get_current_lma_address): Delete.
8901 (Memory_region::increment_vma_offset): Rename to
8902 increment_offset.
8903 (Memory_region::increment_lma_offset): Delete.
8904 (Memory_region::attributes_compatible): New method. Returns
8905 true if the provided section is compatible with the region.
8906 (Memory_region::get_last_section): New method. Returns the last
8907 section to use the region.
8908 (Memory_region::set_last_section): New method. Stores the last
8909 section to use the region.
8910 (Script_sections::block_in_region): New method. Returns true if
8911 a block of memory is contained within a region.
8912 (Script_sections::find_memory_region): New method. Locates a
8913 memory region to be used to set a VMA or LMA address.
8914 (Output_section_definition::set_section_addresses): Add code to
8915 check for addresses set by memory regions.
8916 (Output_segment::set_section_addresses): Remove memory region
8917 walking code.
8918 (Script_sections::create_segment): Add a warning if a header
8919 segment is created outside of any region.
8920 * script-sections.h (class Script_sections): Add prototypes for
8921 find_memory_region and block_in_region methods.
8922 * testsuite/memory_test.s: Use .long instead of .word.
8923 * testsuite/memory_test.t: Add some more output sections.
8924 * testsuite/memory_test.sh: Update expected output.
8925
a9bfd952
DK
89262010-10-02 Doug Kwan <dougkwan@google.com>
8927
8928 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8929 defintion to symtab.h
8930 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8931 declaration to defintion.
8932
bacff3ab
NC
89332010-10-01 Nick Clifton <nickc@redhat.com>
8934
8935 * expression.cc (eval): Replace dummy argument with NULL.
8936 (eval_maybe_dot): Check for a NULL result section pointer.
8937 (Symbol_expression::value): Likewise.
8938 (Dot_expression::value): Likewise.
8939 (BINARY_EXPRESSION): Likewise.
8940 (Max_expression::value): Likewise.
8941 (Min_expression::value): Likewise.
8942 (Absolute_expression::value): Likewise.
8943 (Addr_expression::value_from_output_section): Likewise.
8944 (Loaddddr_expression::value_from_output_section): Likewise.
8945 (Segment_start_expression::value): Likewise.
8946 * script-sections.cc
8947 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8948 argument with NULL.
8949 (Sections_elememt_dot_assignment::set_section_addresses):
8950 Likewise.
8951 (Output_data_expression::do_write_to_buffer): Likewise.
8952 (Output_section_definition::finalize_symbols): Likewise.
8953 (Output_section_definition::set_section_addresses): Likewise.
8954
f81bc8b5
DK
89552010-09-30 Doug Kwan <dougkwan@google.com>
8956
8957 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8958
c95e9f27
ST
89592010-09-28 Sriraman Tallam <tmsriram@google.com>
8960
8961 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8962 function.
c95e9f27
ST
8963 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8964 virtual function.
8965 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8966 virtual function.
8967 * icf.cc (get_section_contents): Inline merge sections only when
8968 target allows it.
8969
3cac54d2
RW
89702010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8971
8972 * configure: Regenerate.
8973
2904037a
ILT
89742010-09-17 Ian Lance Taylor <iant@google.com>
8975
8976 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8977 * testsuite/Makefile.am (memory_test.o): New target.
8978 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8979 memory_test.t.
8980 * testsuite/Makefile.in: Rebuild.
2904037a 8981
bca7fb63
DK
89822010-09-17 Doug Kwan <dougkwan@google.com>
8983
8984 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8985 defintion if relocation uses GOT entries of the symbol.
8986 * testsuite/icf_safe_test.sh: Fix test.
8987 * testsuite/icf_safe_so_test.sh: Fix test.
8988
4ef28648
CC
89892010-09-16 Cary Coutant <ccoutant@google.com>
8990
8991 * script_sections.cc (class Memory_region): Remove "NULL" from
8992 vector initializations.
8993
793990de
CC
89942010-09-15 Cary Coutant <ccoutant@google.com>
8995
8996 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8997 Resolve forwarding symbols.
8998
81e015e2
DK
89992010-09-15 Doug Kwan <dougkwan@google.com>
9000
9001 * gold/testsuite/script_test_3.t: Add ARM special sections.
9002 * gold/testsuite/script_test_4.t: Same.
9003 * gold/testsuite/script_test_5.t: Same.
9004 * gold/testsuite/script_test_6.t: Same.
9005 * gold/testsuite/script_test_7.t: Same.
9006 * gold/testsuite/script_test_7.t: Same.
9007 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
9008
36171d64
CC
90092010-09-14 Cary Coutant <ccoutant@google.com>
9010
9011 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
9012 (Target_x86_64::Relocate::relocate_tls): Replace check for
9013 saw_tls_block_reloc_ with test for executable section.
9014
d89051bd
CC
90152010-09-12 Cary Coutant <ccoutant@google.com>
9016
9017 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
9018 position-independent executables to shared libraries need dynamic
9019 relocations.
9020 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
9021 position-independent executables.
9022 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
9023 * testsuite/Makefile.in: Regenerate.
9024
fca41f0f
NC
90252010-09-10 Nick Clifton <nickc@redhat.com>
9026
9027 PR gold/11997
9028 * testsuite/memory_test.t: Discard any sections that are not
9029 needed.
9030
6695e4b3
L
90312010-09-09 H.J. Lu <hongjiu.lu@intel.com>
9032
9033 PR gold/11996
9034 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
9035 "This::" to work around a bug in gcc 4.2.
9036
9037 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
9038
0f72bf6f
RÁE
90392010-09-09 Rafael Espindola <espindola@google.com>
9040
9041 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
9042 sections with different PF_X flags in the same segment.
9043 (Layout::find_first_load_seg): Search all segments to find the first
9044 one.
9045 * options.h (rosegment): New.
9046
90472010-09-08 Rafael Espindola <espindola@google.com>
a6577478 9048
05a79166 9049 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 9050
aa98ff75
DK
90512010-09-08 Doug Kwan <dougkwan@google.com>
9052
9053 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
9054 (Arm_relobj::do_relocate_sections): Add new parameter for output
9055 file to match the parent.
9056 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
9057 of local symbols instead of input values. Update code to track
9058 changes in gold::relocate_section.
9059 * object.cc (Sized_relobj::compute_final_local_value): New methods.
9060 (Sized_relobj::compute_final_local_value_internal): New methods.
9061 (Sized_relobj::do_finalize_local_symbols): Move code from loop
9062 body into private version of Sized_relobj::compute_final_local_value.
9063 Call the inline method.
9064 * object.h (Symbol_value::Symbol_value): Define destructor. Free
9065 merged symbol value if there is one.
9066 (Symbol_value::has_output_value): New method defintiion.
9067 (Sized_relobj::Compute_final_local_value_status): New enum type.
9068 (Sized_relobj::compute_final_local_value): New methods.
9069 (Sized_relobj::compute_final_local_value_internal): New methods.
9070 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
9071 and arm_cortex_a8.sh.
9072 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
9073 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
9074 New tests.
9075 * Makefile.in: Regenerate.
9076 * testsuite/arm_bl_out_of_range.s: Update test.
9077 * testsuite/thumb_bl_out_of_range.s: Ditto.
9078 * testsuite/thumb_blx_out_of_range.s: Ditto.
9079 * testsuite/arm_branch_out_of_range.sh: New file.
9080 * testsuite/arm_cortex_a8.sh: Ditto.
9081 * testsuite/arm_cortex_a8_b.s: Ditto.
9082 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9083 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9084 * testsuite/arm_cortex_a8_bl.s: Ditto.
9085 * testsuite/arm_cortex_a8_blx.s: Ditto.
9086 * testsuite/arm_cortex_a8_local.s: Ditto.
9087 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9088 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9089
05a79166
L
90902010-09-08 Rafael Espindola <espindola@google.com>
9091
9092 * Makefile.am (memory_test.stdout): Run readelf with -W.
9093 * Makefile.in: Regenerate.
9094 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9095 64 bit output.
9096
33dbc701
RÁE
90972010-09-08 Rafael Espindola <espindola@google.com>
9098
9099 * script-sections.cc (Script_sections::add_memory_region): Convert
9100 field precision to int.
9101 * script.cc (script_set_section_region, script_set_section_region):
9102 Convert field precision to int.
9103
731ca54a
RÁE
91042010-09-08 Rafael Espindola <espindola@google.com>
9105
9106 * arm.cc (do_finalize_sections): Create the __exidx_start and
9107 __exdix_end symbols even when the section is missing.
9108
7f8cd844
NC
91092010-09-08 Nick Clifton <nickc@redhat.com>
9110
9111 * README: Remove claim that MEMORY is not supported.
9112 * expression.cc (script_exp_function_origin)
9113 (script_exp_function_length): Move from here to ...
9114 * script.cc: ... here.
9115 (script_set_section_region, script_add_memory)
9116 (script_parse_memory_attr, script_include_directive): New
9117 functions.
9118 * script-sections.cc
9119 (class Memory_region): New class.
9120 (class Output_section_definition): Add set_memory_region,
9121 set_section_vma, set_section_lma and get_section_name methods.
9122 (class Script_Sections): Add add_memory_region,
9123 find_memory_region, find_memory_region_origin,
9124 find_memory_region_length and set_memory_region methods.
9125 Have set_section_addresses method walk the list of set memory
9126 regions.
9127 Extend the print methos to display memory regions.
9128 * script-sections.h: Add prototypes for new methods.
9129 Add enum for MEMORY region attributes.
9130 * yyscript.y: Add support for parsing MEMORY regions.
9131 * script-c.h: Add prototypes for new functions.
9132 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9133 * testsuite/Makefile.in: Regenerate.
9134 * testsuite/memory_test.sh: New script.
9135 * testsuite/memory_test.s: New assembler source file.
9136 * testsuite/memory_test.t: New linker script.
9137
a4649286
DK
91382010-08-27 Doug Kwan <dougkwan@google.com>
9139
9140 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9141 reference override an existing dynamic weak reference.
9142 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9143 * testsuite/Makefile.in: Regenerate.
9144 * testsuite/dyn_weak_ref.sh: New file.
9145 * testsuite/dyn_weak_ref_1.c: Ditto.
9146 * testsuite/dyn_weak_ref_2.c: Ditto.
9147
b56648ad
ILT
91482010-08-27 Ian Lance Taylor <iant@google.com>
9149
9150 * incremental.h (class Incremental_input_entry): Add virtual
9151 destructor.
9152
809313cb
ILT
91532010-08-27 Ian Lance Taylor <iant@google.com>
9154
9155 * testsuite/start_lib_test_3.c: Mark t3 as used.
9156
11e32464
NC
91572010-08-27 Nick Clifton <nickc@redhat.com>
9158
9159 * options.cc (version_script): Fix small typo in previous
9160 whitespace tidyup.
9161
ca09d69a
NC
91622010-08-25 Nick Clifton <nickc@redhat.com>
9163
9164 * archive.cc: Formatting fixes: Remove whitespace between
9165 typename and following asterisk. Remove whitespace between
9166 function name and opening parenthesis.
9167 * archive.h: Likewise.
9168 * arm.cc: Likewise.
9169 * attributes.cc: Likewise.
9170 * attributes.h: Likewise.
9171 * common.cc: Likewise.
9172 * copy-relocs.cc: Likewise.
9173 * dirsearch.h: Likewise.
9174 * dynobj.cc: Likewise.
9175 * ehframe.cc: Likewise.
9176 * ehframe.h: Likewise.
9177 * expression.cc: Likewise.
9178 * fileread.cc: Likewise.
9179 * fileread.h: Likewise.
9180 * gc.h: Likewise.
9181 * gold-threads.cc: Likewise.
9182 * gold.cc: Likewise.
9183 * i386.cc: Likewise.
9184 * icf.h: Likewise.
9185 * incremental-dump.cc: Likewise.
9186 * incremental.cc: Likewise.
9187 * layout.cc: Likewise.
9188 * layout.h: Likewise.
9189 * main.cc: Likewise.
9190 * merge.cc: Likewise.
9191 * merge.h: Likewise.
9192 * object.cc: Likewise.
9193 * object.h: Likewise.
9194 * options.cc: Likewise.
9195 * options.h: Likewise.
9196 * output.cc: Likewise.
9197 * output.h: Likewise.
9198 * plugin.cc: Likewise.
9199 * plugin.h: Likewise.
9200 * powerpc.cc: Likewise.
9201 * reloc.cc: Likewise.
9202 * script-c.h: Likewise.
9203 * script-sections.cc: Likewise.
9204 * script.cc: Likewise.
9205 * stringpool.cc: Likewise.
9206 * symtab.cc: Likewise.
9207 * symtab.h: Likewise.
9208 * target.cc: Likewise.
9209 * timer.cc: Likewise.
9210 * timer.h: Likewise.
9211 * version.cc: Likewise.
9212 * x86_64.cc: Likewise.
9213
b8fa8750
NC
92142010-08-24 Nick Clifton <nickc@redhat.com>
9215
9216 PR 11899
9217 * layout.cc (segment_precedes): Sort segments by their physical
9218 addresses, if they have been set.
9219
9919d93b
CC
92202010-08-23 Cary Coutant <ccoutant@google.com>
9221
9222 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9223 symbols data.
9224 (Lib_group::include_member): Unlock object after deleting its
9225 symbols data.
9226 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9227 the bug fixed here.
9228
97b4be1c
CC
92292010-08-19 Neil Vachharajani <nvachhar@google.com>
9230 Cary Coutant <ccoutant@google.com>
9231
9232 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9233 constructor, and set_blocker.
9234 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9235 readsyms_blocker_.
9236 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9237 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9238 * testsuite/Makefile.am (start_lib_test): New test case.
9239 * testsuite/Makefile.in: Regenerate.
9240 * testsuite/start_lib_test_main.c: New file.
9241 * testsuite/start_lib_test_1.c: New file.
9242 * testsuite/start_lib_test_2.c: New file.
9243 * testsuite/start_lib_test_3.c: New file.
9244
dd0b1884
ILT
92452010-08-19 Ian Lance Taylor <iant@google.com>
9246
9247 * Makefile.in: Rebuild with automake 1.11.1.
9248 * aclocal.m4: Likewise.
9249 * testsuite/Makefile.in: Likewise.
9250
7223e9ca
ILT
92512010-08-19 Ian Lance Taylor <iant@google.com>
9252
9253 PR 10893
9254 * i386.cc (class Output_data_plt_i386): Update declarations.
9255 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9256 local_ifuncs_ fields.
9257 (Target_i386::do_plt_section_for_global): New function.
9258 (Target_i386::do_plt_section_for_local): New function.
9259 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9260 parameter; change all callers. Initialize global_ifuncs_ and
9261 local_ifuncs_. If doing a static link define __rel_iplt_start and
9262 __rel_iplt_end.
9263 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9264 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9265 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9266 symbols.
9267 (Target_i386::make_plt_section): New function, broken out of
9268 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9269 (Target_i386::make_plt_entry): Call make_plt_section.
9270 (Target_i386::make_local_ifunc_plt_entry): New function.
9271 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9272 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9273 R_386_IRELATIVE to switch.
9274 (Target_i386::Scan::global): Likewise.
9275 (Target_i386::Relocate::relocate): Likewise.
9276 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9277 switch.
9278 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9279 (Target_x86_64::do_plt_section_for_global): New function.
9280 (Target_x86_64::do_plt_section_for_local): New function.
9281 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9282 parameter; change all callers. If doing a static link define
9283 __rela_iplt_start and __rela_iplt_end.
9284 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9285 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9286 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9287 to point to .plt.
9288 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9289 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9290 switch.
9291 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9292 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9293 R_X86_64_IRELATIVE to switch.
9294 (Target_x86_64::Scan::global): Likewise.
9295 (Target_x86_64::Relocate::relocate): Likewise.
9296 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9297 switch.
9298 * target.h (class Target): Add plt_section_for_global and
9299 plt_section_for_local functions. Add do_plt_section_for_global
9300 and do_plt_section_for_local virtual functions.
9301 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9302 clarifying comments.
9303 (Symbol::use_plt_offset): Handle IFUNC symbol.
9304 * object.cc (Sized_relobj::Sized_relobj): Initialize
9305 local_plt_offsets_.
9306 (Sized_relobj::local_has_plt_offset): New function.
9307 (Sized_relobj::local_plt_offset): New function.
9308 (Sized_relobj::set_local_plt_offset): New function.
9309 (Sized_relobj::do_count): Handle IFUNC symbol.
9310 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9311 a bit away from input_shndx_ field. Add set_is_func_symbol and
9312 is_ifunc_symbol functions.
9313 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9314 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9315 local_plt_offsets_ field.
9316 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9317 * output.h (class Output_section_data): Add non-const
9318 output_section function.
9319 (class Output_data_got): Update declarations.
9320 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9321 Add use_plt_offset parameter to global and local constructors.
9322 Change all callers. Change local_sym_index_ field to 31 bits.
9323 Change GSYM_CODE and CONSTANT_CODE accordingly.
9324 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9325 doing a static link don't set sh_link field.
9326 (Output_data_got::Got_entry::write): Use PLT offset if
9327 appropriate.
9328 (Output_data_got::add_global_plt): New function.
9329 (Output_data_got::add_local_plt): New function.
9330 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9331 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9332 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9333 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9334 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9335 IFUNC conditional.
9336 * testsuite/ifunc-sel.h: New file.
9337 * testsuite/ifuncmain1.c: New file.
9338 * testsuite/ifuncmain1vis.c: New file.
9339 * testsuite/ifuncmod1.c: New file.
9340 * testsuite/ifuncdep2.c: New file.
9341 * testsuite/ifuncmain2.c: New file.
9342 * testsuite/ifuncmain3.c: New file.
9343 * testsuite/ifuncmod3.c: New file.
9344 * testsuite/ifuncmain4.c: New file.
9345 * testsuite/ifuncmain5.c: New file.
9346 * testsuite/ifuncmod5.c: New file.
9347 * testsuite/ifuncmain6pie.c: New file.
9348 * testsuite/ifuncmod6.c: New file.
9349 * testsuite/ifuncmain7.c: New file.
9350 * configure, testsuite/Makefile.in: Rebuild.
9351
56f75c03
ILT
93522010-08-18 Ian Lance Taylor <iant@google.com>
9353
9354 * incremental.cc
9355 (Output_section_incremental_inputs::write_input_files): Add cast
9356 to avoid signed/unsigned comparison warning.
9357 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9358
55455f89
CC
93592010-08-12 Cary Coutant <ccoutant@google.com>
9360
9361 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9362
e2054bcb
ILT
93632010-08-13 Ian Lance Taylor <iant@google.com>
9364
9365 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9366
74f67560
DK
93672010-08-12 Cary Coutant <ccoutant@google.com>
9368 Doug Kwan <dougkwan@google.com>
9369
9370 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9371 defintion overrides non-weak undef, remember that the original undef
9372 is not weak.
9373 * symtab.cc (Symbol_table::sized_write_global): For undef without
9374 an original weak binding, set binding to global in output.
9375 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9376 * testsuite/Makefile.in: Regenerate.
9377 * testsuite/strong_ref_weak_def.sh: New file.
9378 * testsuite/strong_ref_weak_def_1.c: Ditto.
9379 * testsuite/strong_ref_weak_def_2.c: Ditto.
9380
d1238d12
CC
93812010-08-12 Cary Coutant <ccoutant@google.com>
9382
9383 * testsuite/incremental_test.sh: Rewrite.
9384 * testsuite/incremental_test_1.c: Rewrite.
9385 * testsuite/incremental_test_2.c: Rewrite.
9386
0e70b911
CC
93872010-08-12 Cary Coutant <ccoutant@google.com>
9388
9389 * arm.cc (Target_arm::got_size): Add const.
9390 (Target_arm::got_entry_count): New function.
9391 (Target_arm::plt_entry_count): New function.
9392 (Target_arm::first_plt_entry_offset): New function.
9393 (Target_arm::plt_entry_size): New function.
9394 (Output_data_plt_arm::entry_count): New function.
9395 (Output_data_plt_arm::first_plt_entry_offset): New function.
9396 (Output_data_plt_arm::get_plt_entry_size): New function.
9397 * i386.cc (Target_i386::got_size): Add const.
9398 (Target_i386::got_entry_count): New function.
9399 (Target_i386::plt_entry_count): New function.
9400 (Target_i386::first_plt_entry_offset): New function.
9401 (Target_i386::plt_entry_size): New function.
9402 (Output_data_plt_i386::entry_count): New function.
9403 (Output_data_plt_i386::first_plt_entry_offset): New function.
9404 (Output_data_plt_i386::get_plt_entry_size): New function.
9405 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9406 find_incremental_inputs_sections. Dump incremental_got_plt section.
9407 * incremental.cc: Include target.h.
9408 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9409 parameter. Adjust all callers. Find incremental_got_plt section.
9410 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9411 section.
9412 (Output_section_incremental_inputs::set_final_data_size): Calculate
9413 size of incremental_got_plt section.
9414 (Output_section_incremental_inputs::do_write): Write the
9415 incremental_got_plt section.
9416 (Got_plt_view_info): New struct.
9417 (Local_got_offset_visitor): New class.
9418 (Global_got_offset_visitor): New class.
9419 (Global_symbol_visitor_got_plt): New class.
9420 (Output_section_incremental_inputs::write_got_plt): New function.
9421 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9422 Add parameter. Adjust all callers.
9423 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9424 (Incremental_inputs::got_plt_section): New function.
9425 (Incremental_inputs::got_plt_section_): New data member.
9426 (Incremental_got_plt_reader): New class.
9427 * layout.cc (Layout::create_incremental_info_sections): Add the
9428 incremental_got_plt section.
9429 * object.h (Got_offset_list::get_list): New function.
9430 (Got offset_list::for_all_got_offsets): New function.
9431 (Sized_relobj::local_got_offset_list): New function.
9432 * powerpc.cc (Target_powerpc::got_size): Add const.
9433 (Target_powerpc::got_entry_count): New function.
9434 (Target_powerpc::plt_entry_count): New function.
9435 (Target_powerpc::first_plt_entry_offset): New function.
9436 (Target_powerpc::plt_entry_size): New function.
9437 (Output_data_plt_powerpc::entry_count): New function.
9438 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9439 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9440 * sparc.cc (Target_sparc::got_size): Add const.
9441 (Target_sparc::got_entry_count): New function.
9442 (Target_sparc::plt_entry_count): New function.
9443 (Target_sparc::first_plt_entry_offset): New function.
9444 (Target_sparc::plt_entry_size): New function.
9445 (Output_data_plt_sparc::entry_count): New function.
9446 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9447 (Output_data_plt_sparc::get_plt_entry_size): New function.
9448 * symtab.h (Symbol::got_offset_list): New function.
9449 (Symbol_table::for_all_symbols): New function.
9450 * target.h (Sized_target::got_entry_count): New function.
9451 (Sized_target::plt_entry_count): New function.
9452 (Sized_target::plt_entry_size): New function.
9453 * x86_64.cc (Target_x86_64::got_size): Add const.
9454 (Target_x86_64::got_entry_count): New function.
9455 (Target_x86_64::plt_entry_count): New function.
9456 (Target_x86_64::first_plt_entry_offset): New function.
9457 (Target_x86_64::plt_entry_size): New function.
9458 (Output_data_plt_x86_64::entry_count): New function.
9459 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9460 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9461
09ec0418
CC
94622010-08-12 Cary Coutant <ccoutant@google.com>
9463
9464 * archive.cc: Include incremental.h.
9465 (Archive::Archive): Initialize incremental_info_.
9466 (Archive::include_member): Record archive members in incremental info.
9467 (Add_archive_symbols::run): Record begin and end of an archive in
9468 incremental info.
9469 (Lib_group::include_member): Record objects in incremental info.
9470 * archive.h (Incremental_archive_entry): Forward declaration.
9471 (Archive::set_incremental_info): New member function.
9472 (Archive::incremental_info): New member function.
9473 (Archive::Unused_symbol_iterator): New class.
9474 (Archive::unused_symbols_begin): New member function.
9475 (Archive::unused_symbols_end): New member function.
9476 (Archive::incremental_info_): New data member.
9477 * incremental-dump.cc (find_input_containing_global): New function.
9478 (dump_incremental_inputs): Dump new incremental info sections.
9479 * incremental.cc: Include symtab.h.
9480 (Output_section_incremental_inputs): New class.
9481 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9482 new incremental info sections.
9483 (Sized_incremental_binary::do_check_inputs): Likewise.
9484 (Incremental_inputs::report_archive): Remove.
9485 (Incremental_inputs::report_archive_begin): New function.
9486 (Incremental_inputs::report_archive_end): New function.
9487 (Incremental_inputs::report_object): New function.
9488 (Incremental_inputs::finalize_inputs): Remove.
9489 (Incremental_inputs::report_input_section): New function.
9490 (Incremental_inputs::report_script): Rewrite.
9491 (Incremental_inputs::finalize): Do nothing but finalize string table.
9492 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9493 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9494 (Incremental_inputs::create_data_sections): New function.
9495 (Incremental_inputs::relocs_entsize): New function.
9496 (Output_section_incremental_inputs::set_final_data_size): New function.
9497 (Output_section_incremental_inputs::do_write): New function.
9498 (Output_section_incremental_inputs::write_header): New function.
9499 (Output_section_incremental_inputs::write_input_files): New function.
9500 (Output_section_incremental_inputs::write_info_blocks): New function.
9501 (Output_section_incremental_inputs::write_symtab): New function.
9502 * incremental.h (Incremental_script_entry): Forward declaration.
9503 (Incremental_object_entry): Forward declaration.
9504 (Incremental_archive_entry): Forward declaration.
9505 (Incremental_inputs): Forward declaration.
9506 (Incremental_inputs_header_data): Remove.
9507 (Incremental_inputs_header): Remove.
9508 (Incremental_inputs_header_write): Remove.
9509 (Incremental_inputs_entry_data): Remove.
9510 (Incremental_inputs_entry): Remove.
9511 (Incremental_inputs_entry_write): Remove.
9512 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9513 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9514 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9515 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9516 Likewise.
9517 (Incremental_input_entry): New class.
9518 (Incremental_script_entry): New class.
9519 (Incremental_object_entry): New class.
9520 (Incremental_archive_entry): New class.
9521 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9522 (Incremental_inputs::report_inputs): Remove.
9523 (Incremental_inputs::report_archive): Remove.
9524 (Incremental_inputs::report_archive_begin): New function.
9525 (Incremental_inputs::report_archive_end): New function.
9526 (Incremental_inputs::report_object): Change prototype.
9527 (Incremental_inputs::report_input_section): New function.
9528 (Incremental_inputs::report_script): Change prototype.
9529 (Incremental_inputs::get_reloc_count): New function.
9530 (Incremental_inputs::set_reloc_count): New function.
9531 (Incremental_inputs::create_data_sections): New function.
9532 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9533 (Incremental_inputs::inputs_section): New function.
9534 (Incremental_inputs::symtab_section): New function.
9535 (Incremental_inputs::relocs_section): New function.
9536 (Incremental_inputs::get_stringpool): Add const.
9537 (Incremental_inputs::command_line): Add const.
9538 (Incremental_inputs::inputs): Remove.
9539 (Incremental_inputs::command_line_key): New function.
9540 (Incremental_inputs::input_file_count): New function.
9541 (Incremental_inputs::input_files): New function.
9542 (Incremental_inputs::relocs_entsize): New function.
9543 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9544 (Incremental_inputs::finalize_inputs): Remove.
9545 (Incremental_inputs::Input_info): Remove.
9546 (Incremental_inputs::lock_): Remove.
9547 (Incremental_inputs::inputs_): Change type.
9548 (Incremental_inputs::inputs_map_): Remove.
9549 (Incremental_inputs::current_object_entry_): New data member.
9550 (Incremental_inputs::inputs_section_): New data member.
9551 (Incremental_inputs::symtab_section_): New data member.
9552 (Incremental_inputs::relocs_section_): New data member.
9553 (Incremental_inputs::reloc_count_): New data member.
9554 (Incremental_inputs_reader): New class.
9555 (Incremental_symtab_reader): New class.
9556 (Incremental_relocs_reader): New class.
9557 * layout.cc (Layout::finalize): Move finalization of incremental info
9558 and creation of incremental info sections to follow finalization of
9559 symbol table. Set offsets for postprocessing sections.
9560 (Layout::create_incremental_info_sections): Call
9561 Incremental_inputs::create_data_sections. Add incremental symtab
9562 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9563 sections to layout after input sections.
9564 * layout.h (struct Timespec): Forward declaration.
9565 (Layout::incremental_inputs): Add const.
9566 (Layout::create_incremental_info_sections): Add parameter.
9567 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9568 * object.cc: Include incremental.h.
9569 (Relobj::finalize_incremental_relocs): New function.
9570 (Sized_relobj::do_layout): Record input sections in incremental info.
9571 * object.h (Object::output_section): New function.
9572 (Object::output_section_offset): Moved from Relobj.
9573 (Object::get_incremental_reloc_base): New function.
9574 (Object::get_incremental_reloc_count): New function.
9575 (Object::do_output_section): New function.
9576 (Object::do_output_section_offset): Moved from Relobj.
9577 (Object::do_get_incremental_reloc_base): New function.
9578 (Object::do_get_incremental_reloc_count): New function.
9579 (Object::Object): Initialize new data members.
9580 (Relobj::output_section): Renamed do_output_section and moved to
9581 protected.
9582 (Relobj::output_section_offset): Moved to Object.
9583 (Relobj::do_get_incremental_reloc_base): New function.
9584 (Relobj::do_get_incremental_reloc_count): New function.
9585 (Relobj::allocate_incremental_reloc_counts): New function.
9586 (Relobj::count_incremental_reloc): New function.
9587 (Relobj::finalize_incremental_relocs): New function.
9588 (Relobj::next_incremental_reloc_index): New function.
9589 (Relobj::reloc_counts_): New data member.
9590 (Relobj::reloc_bases_): New data member.
9591 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9592 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9593 (Sized_relobj::incremental_relocs_scan): New function.
9594 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9595 (Sized_relobj::incremental_relocs_write): New function.
9596 (Sized_relobj::incremental_relocs_write_reltype): New function.
9597 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9598 incremental link.
9599 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9600 archives and object files elsewhere.
9601 (Add_symbols::run): Report object files here.
9602 (Finish_group::run): Report end of archive at end of group.
9603 * reloc.cc: Include layout.h, incremental.h.
9604 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9605 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9606 (Sized_relobj::incremental_relocs_scan): New function.
9607 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9608 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9609 (Sized_relobj::incremental_relocs_write): New function.
9610 (Sized_relobj::incremental_relocs_write_reltype): New function.
9611 * script.cc (read_input_script): Rewrite test for incremental link.
9612 Change call to Incremental_inputs::report_script.
9613 * symtab.h (Symbol_table::first_global_index): New function.
9614 (Symbol_table::output_count): New function.
9615
ce0d1972
DK
96162010-08-12 Doug Kwan <dougkwan@google.com>
9617
9618 * arm.cc (Target_arm::merge_object_attributes): Check command line
9619 options --no-wchar-size-warning and --no-enum-size-warning.
9620 * options.h (General_options): Add ld-compatible options
9621 --no-enum-size-warning and --no-wchar-size-warning.
9622
6e5710ce
ILT
96232010-08-04 Ian Lance Taylor <iant@google.com>
9624
9625 * x86_64.cc (Target_x86_64::Scan::local): Use
9626 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9627 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9628 (Target_x86_64::Scan::global): Likewise.
9629 (Target_x86_64::Relocate::relocate): Likewise.
9630 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9631 Likewise.
9632
fef830db
CC
96332010-08-03 Cary Coutant <ccoutant@google.com>
9634
9635 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9636 to reserve space in merged_strings vector. Keep total input size
9637 for stats.
9638 (Output_merge_string::do_print_merge_stats): Print total input size.
9639 * merge.h (Output_merge_string): Add input_size_ field.
9640 * stringpool.cc (Stringpool_template::string_length): Move
9641 implementations out of Stringpool_template class and place in
9642 stringpool.h.
9643 * stringpool.h (string_length): Move out of Stringpool_template.
9644
1e3811b0
ILT
96452010-08-03 Ian Lance Taylor <iant@google.com>
9646
9647 PR 11712
9648 * layout.cc (relaxation_loop_body): If address of load segment is
9649 set, adjust address to include headers if possible.
9650
7af0c620
ILT
96512010-08-03 Ian Lance Taylor <iant@google.com>
9652
9653 * version.cc (version_string): Bump to 1.10.
9654
22f0da72
ILT
96552010-08-03 Ian Lance Taylor <iant@google.com>
9656
9657 PR 11805
9658 * layout.h (enum Output_section_order): Define.
9659 (class Layout): Update declarations.
9660 * layout.cc (Layout::get_output_section): Add order parameter.
9661 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9662 is_first_non_relro parameters. Change all callers.
9663 (Layout::choose_output_section): Likewise.
9664 (Layout::add_output_section_data): Likewise.
9665 (Layout::make_output_section): Likewise. Set order.
9666 (Layout::default_section_order): New function.
9667 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9668 * output.cc (Output_section::Output_section): Initialize order_.
9669 Don't initialize deleted fields.
9670 (Output_segment::Output_segment): Don't initialize deleted
9671 fields.
9672 (Output_segment::add_output_section_to_load): New function
9673 replacing add_output_section. Change all callers to call this or
9674 add_output_section_to_nonload.
9675 (Output_segment::add_output_section_to_nonload): New function.
9676 (Output_segment::remove_output_section): Rewrite.
9677 (Output_segment::add_initial_output_data): Likewise.
9678 (Output_segment::has_any_data_sections): Likewise.
9679 (Output_segment::is_first_section_relro): Likewise.
9680 (Output_segment::maximum_alignment): Likewise.
9681 (Output_segment::has_dynamic_reloc): New function replacing
9682 dynamic_reloc_count. Change all callers.
9683 (Output_segment::has_dynamic_reloc_list): New function replacing
9684 dynamic_reloc_count_list. Change all callers.
9685 (Output_segment::set_section_addresses): Rewrite.
9686 (Output_segment::set_offset): Rewrite.
9687 (Output_segment::find_first_and_last_list): Remove.
9688 (Output_segment::set_tls_offsets): Rewrite.
9689 (Output_segment::first_section_load_address): Likewise.
9690 (Output_segment::output_section_count): Likewise.
9691 (Output_segment::section_with_lowest_load_address): Likewise.
9692 (Output_segment::write_section_headers): Likewise.
9693 (Output_segment::print_sections_to_map): Likewise.
9694 * output.h (class Output_data): Remove dynamic_reloc_count_
9695 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9696 (Output_data::add_dynamic_reloc): Rewrite.
9697 (Output_data::has_dynamic_reloc): New function.
9698 (Output_data::dynamic_reloc_count): Remove.
9699 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9700 is_last_relro_, is_first_non_relro_, is_interp_,
9701 is_dynamic_linker_section_ fields. Add order and set_order
9702 functions. Remove is_relro_local, set_is_relro_local,
9703 is_last_relro, set_is_last_relro, is_first_non_relro,
9704 set_is_first_non_relro functions, is_interp, set_is_interp,
9705 is_dynamic_linker_section, and set_is_dynamic_linker_section
9706 functions.
9707 (class Output_segment): Change Output_data_list from std::list to
9708 std:;vector. Add output_lists_ field. Remove output_data_ and
9709 output_bss_ fields. Update declarations.
9710
3ff2ccb0
ILT
97112010-08-02 Ian Lance Taylor <iant@google.com>
9712
9713 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9714 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9715 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9716
88a4108b
ILT
97172010-08-02 Ian Lance Taylor <iant@google.com>
9718
9719 PR 11855
9720 * script.cc (Script_options::Script_options): Initialize
9721 symbol_definitions_ and symbol_references_.
9722 (Script_options::add_symbol_assignment): Update
9723 symbol_definitions_ and symbol_references_.
9724 (Script_options::add_symbol_reference): New function.
9725 (script_symbol): New function.
9726 * script.h (class Script_options): Add symbol_definitions_ and
9727 symbol_references_ fields.
9728 (Script_options::referenced_const_iterator): New type.
9729 (Script_options::referenced_begin): New function.
9730 (Script_options::referenced_end): New function.
9731 (Script_options::is_referenced): New function.
9732 (Script_options::any_unreferenced): New function.
9733 * script-c.h (script_symbol): Declare.
9734 * yyscript.y (exp): Call script_symbol.
9735 * symtab.cc: Include "script.h".
9736 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9737 Change all callers. Check symbols referenced by scripts.
9738 (Symbol_table::add_undefined_symbols_from_command_line): Add
9739 layout parameter. Change all callers.
9740 (Symbol_table::do_add_undefined_symbols_from_command_line):
9741 Likewise. Break out loop body. Check symbols referenced by
9742 scripts.
9743 (Symbol_table::add_undefined_symbol_from_command_line): New
9744 function broken out of
9745 do_add_undefined_symbols_from_command_line.
9746 * symtab.h (class Symbol_table): Update declarations.
9747 * archive.cc: Include "layout.h".
9748 (Archive::should_include_member): Add layout parameter. Change
9749 all callers. Check for symbol mentioned in expression.
9750 * archive.h (class Archive): Update declaration.
9751 * object.cc (Sized_relobj::do_should_include_member): Add layout
9752 parameter.
9753 * object.h (Object::should_include_member): Add layout parameter.
9754 Change all callers.
9755 (Object::do_should_include_member): Add layout parameter.
9756 (class Sized_relobj): Update declaration.
9757 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9758 parameter.
9759 * dynobj.h (class Sized_dynobj): Update declaration.
9760 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9761 layout parameter.
9762 * plugin.h (class Sized_pluginobj): Update declaration.
9763
5f1ab67a
ILT
97642010-08-02 Ian Lance Taylor <iant@google.com>
9765
9766 PR 11866
9767 * output.cc (Output_segment::set_offset): Search for the first and
9768 last sections rather than assuming that the list is in order.
9769 (Output_segment::find_first_and_last_list): New function.
9770 * output.h (class Output_segment): Update declarations.
9771 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9772 (relro_strip_test_SOURCES): New variable.
9773 (relro_strip_test_DEPENDENCIES): New variable.
9774 (relro_strip_test_LDFLAGS): New variable.
9775 (relro_strip_test_LDADD): New variable.
9776 (relro_strip_test.so): New target.
9777
a8df5856
ILT
97782010-08-02 Ian Lance Taylor <iant@google.com>
9779
9780 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9781 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9782 (Target_i386::got_tlsdesc_section): New function.
9783 (Target_i386::got_section): Create space for GOT entries for
9784 TLSDESC relocations.
9785 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9786 R_386_TLS_GOTDESC.
9787 (Target_i386::Scan::global): Likewise.
9788 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9789 using TLSDESC GOT.
9790 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9791 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9792 (Target_x86_64::got_tlsdesc_section): New function.
9793 (Target_x86_64::got_section): Create space for GOT entries for
9794 TLSDESC relocations.
9795 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9796 R_386_TLS_GOTDESC.
9797 (Target_x86_64::Scan::global): Likewise.
9798 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9799 using TLSDESC GOT.
9800
0c10a0a6
ILT
98012010-08-02 Ian Lance Taylor <iant@google.com>
9802
9803 * testsuite/final_layout.sh: Use dc to convert from hex to
9804 decimal.
9805
41cbeecc
ST
98062010-07-29 Sriraman Tallam <tmsriram@google.com>
9807
9808 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9809 paramter to the call to gold::gc_process_relocs.
9810 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9811 paramter to the call to gold::gc_process_relocs.
9812 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9813 parameter to the call to gold::gc_process_relocs.
9814 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9815 template parameter to the call to gold::gc_process_relocs.
9816 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9817 paramter to the call to gold::gc_process_relocs.
9818 * gc.h (get_embedded_addend_size): New function.
9819 (gc_process_relocs): Save the size of the reloc for use by ICF.
9820 * icf.cc (get_section_contents): Get the addend from the text section
9821 for SHT_REL relocation sections.
9822 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9823 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9824 * int_encoding.h (read_from_pointer): New overloaded function.
9825 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9826 * testsuite/icf_sht_rel_addend_test.sh: New file.
9827 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9828 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9829
6ea55b82
RW
98302010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9831
9832 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9833 * Makefile.in: Regenerate.
9834 * testsuite/Makefile.in: Regenerate.
9835
9691462b
ILT
98362010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9837
9838 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9839 * gold/testsuite/debug_msg.cc: Likewise.
9840 * gold/testsuite/odr_violation1.cc
9841 * gold/testsuite/odr_violation2.cc
9842
76897331
CC
98432010-07-21 Cary Coutant <ccoutant@google.com>
9844
9845 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9846 string, and length fields.
9847 (Output_merge_string::Merged_strings_list): New type.
9848 (Output_merge_string::Merged_strings_lists): New typedef.
9849 (Output_merge_string): Replace merged_strings_ with
9850 merged_strings_lists_.
9851 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9852 Merged_strings_list per input object and section. Don't store pointer
9853 to the string. Don't store length with each merged string entry.
9854 (Output_merge_string::finalize_merged_data): Loop over list of merged
9855 strings lists. Recompute length of each merged string.
9856
78384e8f
CC
98572010-07-15 Cary Coutant <ccoutant@google.com>
9858
9859 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9860 here.
9861
783659f9
ILT
98622010-07-14 Ian Lance Taylor <iant@google.com>
9863
9864 * descriptors.cc (Descriptors::open): Report correct name in error
9865 message.
9866
131687b4
DK
98672010-07-13 Doug Kwan <dougkwan@google.com>
9868
9869 * arm.cc (Arm_input_section::Arm_input_section): For a
9870 SHT_ARM_EXIDX section, always keeps the input sections.
9871 (Arm_input_section::set_exidx_section_link): New method.
9872 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9873 has_errors_ to false.
9874 (Arm_exidx_input_section::has_errors,
9875 Arm_exidx_input_section::set_has_errors): New methods.
9876 (Arm_exidx_input_section::has_errors_): New data member.
9877 (Arm_relobj::get_exidx_shndx_list): New method.
9878 (Arm_output_section::append_text_sections_to_list): Do not skip
9879 section without SHF_EXECINSTR.
9880 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9881 errors.
2e702c99 9882 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9883 section header. Make error messages more verbose. Check for
9884 a non-executable section linked to an EXIDX section.
9885 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9886 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9887 check that there is no deferred EXIDX section if we exit early.
9888 Instead of not making an EXIDX section in case of an error, make one
9889 and set the has_errors flag of it.
9890 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9891 in a relocatable link.
9892 (Target_arm::do_relax): Look for the EXIDX output section instead of
9893 assuming that it is called .ARM.exidx.
2e702c99 9894 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9895 section list. Do not check for SHF_EXECINSTR section flags but
9896 skip any input section with errors.
9897 * output.cc (Output_section::Output_section): Initialize
9898 always_keeps_input_sections_ to false.
9899 (Output_section::add_input_section): Check for
9900 always_keeps_input_sections_.
9901 * output.h (Output_section::always_keeps_input_sections,
9902 Output_section::set_always_keeps_input_sections): New methods.
9903 (Output_section::always_keeps_input_sections): New data member.
9904
69517287
RÁE
99052010-07-13 Rafael Espindola <espindola@google.com>
9906
9907 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9908 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9909
82742395
ILT
99102010-07-13 Philip Herron <herron.philip@googlemail.com>
9911 Ian Lance Taylor <iant@google.com>
9912
9913 * output.h (Output_section_lookup_maps::add_merge_section):
9914 Correct check of whether value was inserted.
9915 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9916 (Output_section_lookup_maps::add_relaxed_input_section):
9917 Likewise.
9918 * arm.cc (Target_arm::got_section): Remove used local os.
9919 * i386.cc (Target_i386::got_section): Likewise.
9920 * x86_64.cc (Target_x86_64::got_section): Likewise.
9921 * sparc.cc (Target_sparc::got_section): Likewise.
9922 (Target_sparc::relocate): Remove unused local have_got_offset.
9923 * powerpc.cc (Target_powerpc::relocate): Likewise.
9924
f2d707b5
ILT
99252010-07-13 Ian Lance Taylor <iant@google.com>
9926
241531d6
ILT
9927 * compressed_output.cc (zlib_decompress): Fix signature in
9928 !HAVE_ZLIB_H case.
9929
f2d707b5
ILT
9930 * archive.cc (Archive::include_member): Unlock an external member
9931 of a thin archive. Don't bother to delete an object we know is
9932 NULL.
9933
a2e47362
CC
99342010-07-12 Cary Coutant <ccoutant@google.com>
9935
9936 * compressed_output.cc (zlib_decompress): New function.
9937 (get_uncompressed_size): New function.
9938 (decompress_input_section): New function.
9939 * compressed_output.h (get_uncompressed_size): New function.
9940 (decompress_input_section): New function.
9941 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9942 Handle compressed debug sections.
9943 * layout.cc (is_compressed_debug_section): New function.
9944 (Layout::output_section_name): Map compressed section names to
9945 canonical names.
9946 * layout.h (is_compressed_debug_section): New function.
9947 (is_debug_info_section): Recognize compressed debug sections.
9948 * merge.cc: Include compressed_output.h.
9949 (Output_merge_data::do_add_input_section): Handle compressed
9950 debug sections.
9951 (Output_merge_string::do_add_input_section): Handle compressed
9952 debug sections.
9953 * object.cc: Include compressed_output.h.
9954 (Sized_relobj::Sized_relobj): Initialize new data members.
9955 (build_compressed_section_map): New function.
9956 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9957 * object.h (Object::section_is_compressed): New method.
9958 (Object::do_section_is_compressed): New method.
9959 (Sized_relobj::Compressed_section_map): New type.
9960 (Sized_relobj::do_section_is_compressed): New method.
9961 (Sized_relobj::compressed_sections_): New data member.
9962 * output.cc (Output_section::add_input_section): Handle compressed
9963 debug sections.
9964 * reloc.cc: Include compressed_output.h.
9965 (Sized_relobj::write_sections): Handle compressed debug sections.
9966
ce279a62
CC
99672010-07-08 Cary Coutant <ccoutant@google.com>
9968
9969 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9970 weak when resolving to a dynamic def.
9971 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9972 for weak undef/dynamic def cases. Adjust callers.
9973 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9974 undef_binding_weak_.
9975 (Symbol_table::sized_write_globals): Adjust symbol binding.
9976 (Symbol_table::sized_write_symbol): Add binding parameter.
9977 * symtab.h (Symbol::set_undef_binding): New method.
9978 (Symbol::is_undef_binding_weak): New method.
9979 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9980 (Symbol_table::should_override): Add new parameter.
9981 (Symbol_table::sized_write_symbol): Add new parameter.
9982
9983 * testsuite/weak_undef_file1.cc: Add new test case.
9984 * testsuite/weak_undef_file2.cc: Fix header comment.
9985 * testsuite/weak_undef_test.cc: Add new test case.
9986
b2286c10
DK
99872010-06-29 Doug Kwan <dougkwan@google.com>
9988
9989 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9990 Initialize USE_SYMBOL_.
9991 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9992 definition.
9993 (Arm_reloc_property::uses_symbol_): New data member declaration.
9994 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9995 uses symbol value and symbol is undefined but not weakly undefined.
9996
4802450a
RÁE
99972010-06-28 Rafael Espindola <espindola@google.com>
9998
9999 * plugin.cc (Plugin::load): Use dlerror.
10000
e5ca47ba
ILT
100012010-06-26 Jeffrey Yaskin <jyasskin@google.com>
10002
10003 * symtab.cc (detect_odr_violations): When reporting an ODR
10004 violation, report an object where the symbol is defined.
10005
8a75a161
DK
100062010-06-25 Doug Kwan <dougkwan@google.com>
10007
10008 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
10009 (Target_arm::section_may_have_icf_unsafe_pointers): New method
10010 definition.
10011 (Target_arm::Scan::local_reloc_may_be_function_pointer,
10012 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
10013 target hook to detect function points.
10014 (Target_arm::Scan::possible_function_pointer_reloc): New method.
10015 * icf.h (Icf::check_section_for_function_pointers): Change type of
10016 parameter SECTION_NAME to const reference to std::string. Use
10017 target hook to determine if section may have unsafe pointers.
10018 * target.h (Target::section_may_have_icf_unsafe_pointers): New
10019 method definition.
10020
42218b9f
RÁE
100212010-06-21 Rafael Espindola <espindola@google.com>
10022
10023 * fileread.cc (Input_file::find_fie): New
10024 (Input_file::open): Use Input_file::find_fie.
10025 * fileread.h (Input_file::find_fie): New
10026 * plugin.cc (set_extra_library_path): New.
10027 (Plugin::load): Add set_extra_library_path to the transfer vector.
10028 (Plugin_manager::set_extra_library_path): New.
10029 (Plugin_manager::add_input_file): Use the extra search path if set.
10030 (set_extra_library_path(): New.
10031 * plugin.h (Plugin_manager): Add set_extra_library_path and
10032 extra_search_path_.
10033
a0506cca
CC
100342010-06-19 Cary Coutant <ccoutant@google.com>
10035
10036 * layout.cc (gdb_sections): Add .debug_types.
10037 (lines_only_debug_sections): Likewise.
10038
6508b958
RÁE
100392010-06-18 Rafael Espindola <espindola@google.com>
10040
10041 * plugin.cc (add_input_file,add_input_library)
10042 (Plugin_manager::add_input_file): Make filename arguments const.
10043 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
10044 const.
10045
3e235302
DK
100462010-06-16 Doug Kwan <dougkwan@google.com>
10047
10048 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
10049 .ARM.attributes section if we have not merged any input
10050 attributes sections.
10051
106e8a6c
DK
100522010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10053
10054 * arm.cc: Allow combining objects with no EABI version
10055 information.
10056
91ff43fe
RÁE
100572010-06-15 Rafael Espindola <espindola@google.com>
10058
10059 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
10060
68ed838c
ILT
100612010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10062
10063 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
10064 (struct iovec): Correct !HAVE_READV definition.
10065
f3a2388f
CC
100662010-06-10 Cary Coutant <ccoutant@google.com>
10067
10068 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
10069 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
10070 reloc sections.
10071 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
10072
10073 PR 11683
10074 * symtab.h (Symbol::is_placeholder): New member function.
10075 * target-reloc.h (relocate_section): Check for placeholder symbols.
10076
10077 * testsuite/Makefile.am (plugin_test_8): New test.
10078 (plugin_test_9): New test.
10079 * testsuite/Makefile.in: Regenerate.
10080
e1df38aa
NC
100812010-06-09 Nick Clifton <nickc@redhat.com>
10082
10083 * yyscript.y (input_list_element): Allow strings prefixed with
10084 the '-' character. Treat these as libraries.
10085 * script.cc (script_add_library): New function. Adds a library
10086 specified by "-l<name>" found in an input script.
10087 * script-c.h: Add prototype for script_add_library.
10088
25bbe950
DK
100892010-06-07 Doug Kwan <dougkwan@google.com>
10090
10091 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10092 Restrict stub-group size to be within long conditional branch
10093 range when working around cortex-A8 erratum.
10094
0f32ea4c
ILT
100952010-06-07 Damien Diederen <dd@crosstwine.com>
10096
10097 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10098 #ifdef typo.
10099
8fe2a369
ST
101002010-06-03 Sriraman Tallam <tmsriram@google.com>
10101
10102 PR gold/11658
10103 * output.cc
10104 (Output_section::Input_section_sort_entry::compare_section_ordering):
10105 Change to return non-zero correctly.
10106 (Output_section::Input_section_sort_section_order_index_compare
10107 ::operator()): Change to fix ambiguity in comparisons.
10108
6e9ba2ca
ST
101092010-06-01 Sriraman Tallam <tmsriram@google.com>
10110
10111 * gold.h (is_wildcard_string): New function.
10112 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10113 (Layout::layout_eh_frame): Ditto.
10114 (Layout::find_section_order_index): New method.
10115 (Layout::read_layout_from_file): New method.
10116 * layout.h (Layout::find_section_order_index): New method.
10117 (Layout::read_layout_from_file): New method.
10118 (Layout::input_section_position_): New private member.
10119 (Layout::input_section_glob_): New private member.
10120 * main.cc (main): Call read_layout_from_file here.
10121 * options.h (--section-ordering-file): New option.
10122 * output.cc (Output_section::input_section_order_specified_): New
10123 member.
10124 (Output_section::Output_section): Initialize new member.
10125 (Output_section::add_input_section): Add new parameter.
10126 Keep input sections when --section-ordering-file is used.
10127 (Output_section::set_final_data_size): Sort input sections when
10128 section ordering file is specified.
10129 (Output_section::Input_section_sort_entry): Add new parameter.
10130 Check sorting type.
10131 (Output_section::Input_section_sort_entry::compare_section_ordering):
10132 New method.
10133 (Output_section::Input_section_sort_compare::operator()): Change to
10134 consider section_order_index.
10135 (Output_section::Input_section_sort_init_fini_compare::operator()):
10136 Change to consider section_order_index.
10137 (Output_section::Input_section_sort_section_order_index_compare
10138 ::operator()): New method.
10139 (Output_section::sort_attached_input_sections): Change to sort
10140 according to section order when specified.
e1df38aa
NC
10141 (Output_section::add_input_section<32, true>): Add new parameter.
10142 (Output_section::add_input_section<64, true>): Add new parameter.
10143 (Output_section::add_input_section<32, false>): Add new parameter.
10144 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
10145 * output.h (Output_section::add_input_section): Add new parameter.
10146 (Output_section::input_section_order_specified): New
10147 method.
10148 (Output_section::set_input_section_order_specified): New method.
10149 (Input_section::Input_section): Initialize section_order_index_.
10150 (Input_section::section_order_index): New method.
10151 (Input_section::set_section_order_index): New method.
10152 (Input_section::section_order_index_): New member.
10153 (Input_section::Input_section_sort_section_order_index_compare): New
10154 struct.
10155 (Output_section::input_section_order_specified_): New member.
10156 * script-sections.cc (is_wildcard_string): Delete and move modified
10157 method to gold.h.
10158 (Output_section_element_input::Output_section_element_input): Modify
10159 call to is_wildcard_string.
10160 (Output_section_element_input::Input_section_pattern
10161 ::Input_section_pattern): Ditto.
10162 (Output_section_element_input::Output_section_element_input): Ditto.
10163 * testsuite/Makefile.am (final_layout): New test case.
10164 * testsuite/Makefile.in: Regenerate.
10165 * testsuite/final_layout.cc: New file.
10166 * testsuite/final_layout.sh: New file.
10167
3537c84b
RÁE
101682010-06-01 Rafael Espindola <espindola@google.com>
10169
10170 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10171
105b6afd
RÁE
101722010-06-01 Rafael Espindola <espindola@google.com>
10173
10174 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10175 visibility of symbols.
10176
29e11421
DK
101772010-05-27 Doug Kwan <dougkwan@google.com>
10178
10179 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10180 from start of output section instead of address for a local symbol
10181 in a merged or relaxed section when doing a relocatable link.
10182
5e0f337e
RÁE
101832010-05-26 Rafael Espindola <espindola@google.com>
10184
703d02da 10185 PR 11604
5e0f337e
RÁE
10186 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10187 adding sections the garbage collector removed.
10188 * gold/testsuite/Makefile.am: Add test.
10189 * gold/testsuite/Makefile.in: Regenerate.
10190 * gold/testsuite/plugin_test_7.sh: New.
10191 * gold/testsuite/plugin_test_7_1.c: New.
10192 * gold/testsuite/plugin_test_7_2.c: New.
10193
f4187277
RÁE
101942010-05-26 Rafael Espindola <espindola@google.com>
10195
10196 * script-sections.cc (Output_section_definition::set_section_addresses):
10197 Check for --section-start.
10198
5c388529
DK
101992010-05-26 Doug Kwan <dougkwan@google.com>
10200
10201 * arm.cc (Arm_scan_relocatable_relocs): New class.
10202 (Target_arm::relocate_special_relocatable): New method.
10203 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10204 (Arm_relocate_functions::thumb_branch_common): Same.
10205 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10206 instead of Default_scan_relocatable_relocs.
10207 * target-reloc.h (relocate_for_relocatable): Let target handle
10208 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10209 * target.h (Sized_target::relocate_special_relocatable): New method.
10210
bca1c3ae
ILT
102112010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10212
10213 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10214
0439c796
DK
102152010-05-23 Doug Kwan <dougkwan@google.com>
10216
10217 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10218 instead of a cast.
10219 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10220 with a direct branch, not a conditional branch, to a stub.
10221 * merge.cc (Output_merge_base::record_input_section): New method
10222 defintion.
10223 (Output_merge_data::do_add_input_section): Record input section if
10224 keeps-input-sections flag is set.
10225 (Output_merge_string::do_add_input_section): Ditto.
10226 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10227 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10228 INPUT_SECTIONS_.
10229 (Output_merge_base::keeps_input_sections,
10230 Output_merge_base::set_keeps_input_sections,
10231 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10232 method definitions.
10233 (Output_merge_base::Input_sections): New type declaration.
10234 (Output_merge_base::input_sections_begin,
10235 Output_merge_base::input_sections_end,
10236 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10237 (Output_merge_base::bool keeps_input_sections_,
10238 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10239 Output_merge_base::input_sections_): New data members.
10240 (Output_merge_data::do_set_keeps_input_sections): New method
10241 defintion.
10242 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10243 * output.cc (Output_section::Input_section::relobj): Move method
10244 defintion from class declaration to here and handle merge sections.
10245 (Output_section::Input_section::shndx): Ditto.
10246 (Output_section::Output_section): Remove initializations of removed
10247 data members and initialize new data member LOOKUP_MAPS_.
10248 (Output_section::add_input_section): Set keeps-input-sections flag
10249 for a newly created merge output section as appropriate. Adjust code
10250 to use Output_section_lookup_maps class.
10251 (Output_section::add_relaxed_input_section): Adjst code for lookup
10252 maps code refactoring.
2e702c99 10253 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
10254 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10255 class. If adding input section to a newly created merge output
10256 section fails, remove the new merge section.
10257 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 10258 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 10259 (Output_section::find_merge_section): Ditto.
0439c796 10260 (Output_section::build_lookup_maps): New method defintion.
2e702c99 10261 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
10262 Output_section_lookup_maps class.
10263 (Output_section::get_input_sections): Export merge sections. Adjust
10264 code to use Output_section_lookup_maps class.
10265 (Output_section:::add_script_input_section): Adjust code to use
10266 Output_section_lookup_maps class. Update lookup maps for merge
10267 sections also.
10268 (Output_section::discard_states): Use Output_section_lookup_maps.
10269 (Output_section::restore_states): Same.
10270 * output.h (Merge_section_properties): Move class defintion out of
10271 Output_section.
10272 (Output_section_lookup_maps): New class.
10273 (Output_section::Input_section::is_merge_section): New method
10274 defintion.
10275 (Output_section::Input_section::relobj): Move defintion out of class
10276 defintion. Declare method only.
10277 (Output_section::Input_section::shndx): Ditto.
10278 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 10279 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
10280 (Output_section::Merge_section_by_properties_map,
10281 Output_section::Output_section_data_by_input_section_map,
10282 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10283 Remove types.
2e702c99 10284 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
10285 KEEPS_INPUT_SECTIONS.
10286 (Output_section::build_lookup_maps): New method declaration.
10287 (Output_section::merge_section_map_,
10288 Output_section::merge_section_by_properties_map_,
10289 Output_section::relaxed_input_section_map_,
10290 Output_section::is_relaxed_input_section_map_valid_): Remove data
10291 members.
10292 (Output_section::lookup_maps_): New data member.
10293
76295588
L
102942010-05-21 Doug Kwan <dougkwan@google.com>
10295
10296 PR gold/11619
10297 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10298 avoid a compilation error.
10299
d103a984
RÁE
103002010-05-19 Rafael Espindola <espindola@google.com>
10301
10302 * script-sections.cc (Output_section_definition::allocate_to_segment):
10303 Update the phdrs_list even when the output section is NULL.
10304 * testsuite/Makefile.am: Add test.
10305 * testsuite/Makefile.in: Regenerate.
10306 * testsuite/script_test_9.cc: New.
10307 * testsuite/script_test_9.sh: New.
10308 * testsuite/script_test_9.t: New.
10309
6625d24e
DK
103102010-05-19 Doug Kwan <dougkwan@google.com>
10311
10312 * arm.cc (Arm_input_section::original_size): New method.
10313 (Arm_input_section::do_addralign): Add a cast.
10314 (Arm_input_section::do_output_offset): Remove static cast.
10315 (Arm_input_section::original_addralign,
10316 Arm_input_section::original_size_): Change type to uint32_t.
10317 (Arm_input_section::init): Add safe casts for section alignment
10318 and size.
10319 (Arm_input_section::set_final_data_size): Do not set address and
10320 offset of stub table.
10321 (Arm_output_section::fix_exidx_coverage): Change use of of
10322 Output_section::Simple_input_section to that of
10323 Output_section::Input_section.
10324 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10325 except for the first pass.
10326 * output.cc (Output_section::get_input_sections): Change type of
10327 input_sections to std::list<Input_section>.
10328 (Output_section::add_script_input_section): Rename from
10329 Output_section::add_simple_input_section. Change type of SIS
10330 parameter from Simple_input_section to Input_section.
10331 * output.h (Output_section::Simple_input_section): Remove class.
10332 (Output_section::Input_section): Change class visibility to public.
10333 (Output_section::Input_section::addralign): Use stored alignments
10334 for special input sections if set.
10335 (Output_section::Input_section::set_addralign): New method.
10336 (Output_section::get_input_sections): Change parameter type from
10337 list of Simple_input_section to list of Input_section.
10338 (Output_section::add_script_input_section): Rename from
10339 Output_section::add_simple_input_section. Change first parameter's
10340 type from Simple_input_section to Input_section and remove the
10341 second and third parameters.
10342 * script-sections.cc (Input_section::Input_section_list): Change
10343 type to list of Output_section::Input_section/
10344 (Input_section_info::Input_section_info): Change parameter type of
10345 INPUT_SECTION to Output_section::Input_section.
10346 (Input_section_info::input_section): Change return type.
10347 (Input_section_info::input_section_): Change type to
10348 Output_section::Input_section.
10349 (Output_section_element_input::set_section_addresses): Adjust code
10350 to use Output_section::Input_section instead of
10351 Output_section::Simple_input_section. Adjust code for renaming
10352 of Output_section::add_simple_input_section.
10353 (Orphan_output_section::set_section_addresses): Ditto.
10354
e1e82ea4
RW
103552010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10356
10357 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10358 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10359
91e75c8a
RÁE
103602010-05-18 Rafael Espindola <espindola@google.com>
10361
10362 * options.cc (General_options::finalize): Handle -nostdlib.
10363 * options.h (nostdlib): New option.
10364 * script.cc (script_add_search_dir): Handle -nostdlib.
10365
da59ad79
DK
103662010-05-12 Doug Kwan <dougkwan@google.com>
10367
10368 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10369 attributes section only if there no attributes section after merging.
10370 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10371 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10372 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10373 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10374 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10375 and arm_attr_merge_7.stdout.
10376 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10377 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10378 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10379 arm_attr_merge_7b.o): New rules.
10380 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10381 arm_attr_merge_7
10382 * testsuite/Makefile.in: Regenerate.
10383 * testsuite/arm_attr_merge.sh: New file.
10384 * testsuite/arm_attr_merge_[67][ab].s: Same.
10385
3e01a7fd
NC
103862010-05-05 Nick Clifton <nickc@redhat.com>
10387
10388 * po/es.po: Updated Spanish translation.
10389
7ad2014a
L
103902010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10391
10392 * Makefile.am (install-exec-local): Properly install gold as
10393 default cross linker.
10394 * Makefile.in: Regenerated.
10395
4fda8867
NC
103962010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10397 Nick Clifton <nickc@redhat.com>
10398
10399 * configure.ac (install_as_default): Define and set to false
10400 unless --enable-gold or --enable-gold=both/gold has been
10401 specified.
10402 * configure: Regenerate.
10403
10404 * Makefile.am (install-exec-local): Install the executable as
10405 'ld.gold'. If install_as_default is true then also install it as
10406 'ld'.
10407 * Makefile.in: Regenerated.
10408
bd288ea2
ILT
104092010-04-24 Ian Lance Taylor <iant@google.com>
10410
10411 * layout.cc (Layout::layout_reloc): In relocatable link don't
10412 combine reloc sections for grouped sections.
10413
ef38fd8a
ST
104142010-04-23 Sriraman Tallam <tmsriram@google.com>
10415
10416 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10417 sections that are not ordinary to icf.
10418 * icf.cc (get_section_contents): Handle relocation pointing to section
10419 with no object or shndx information.
10420 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10421 * testsuite/Makefile.in: Regenerate.
10422 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10423 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10424
f6973bdc
ILT
104252010-04-22 Ian Lance Taylor <iant@google.com>
10426
10427 * expression.cc (Expression::Expression_eval_info): Add
10428 result_alignment_pointer field.
10429 (Expression::eval_with_dot): Add result_alignment_pointer
10430 parameter. Change all callers.
10431 (Expression::eval_maybe_dot): Likewise.
10432 (class Binary_expression): Add alignment_pointer parameter to
10433 left_value and right_value. Change all callers.
10434 (BINARY_EXPRESSION): Set result alignment.
10435 (class Trinary_expression): Add alignment_pointer parameter to
10436 arg2_value and arg3_value. Change all callers.
10437 (Trinary_cond::value): Set result alignment.
10438 (Max_expression::value, Min_expression::value): Likewise.
10439 (Align_expression::value): Likewise.
10440 * script-sections.cc (class Sections_element): Add dot_alignment
10441 parameter to set_section_addresses virtual function. Update
10442 instantiations.
10443 (class Output_section_element): Likewise.
10444 (Script_sections::create_segments): Add dot_alignment parameter.
10445 Change all callers.
10446 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10447 (Script_sections::set_phdrs_clause_addresses): Likewise.
10448 * script-sections.h: Update declarations.
10449 * script.h: Update declarations.
10450 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10451 min_p_align.
10452 * testsuite/script_test_3.t: Set large alignment.
10453 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10454 segment has expected alignment.
10455
9c9c98a5
NC
104562010-04-22 Nick Clifton <nickc@redhat.com>
10457
10458 * po/gold.pot: Updated by the Translation project.
10459 * po/vi.po: Updated Vietnamese translation.
10460
2253bfba
L
104612010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10462
10463 * testsuite/Makefile.am (check_PROGRAMS): Add
10464 icf_virtual_function_folding_test.
10465 * testsuite/Makefile.in: Regenerated.
10466
85fdf906
AH
104672010-04-15 Andrew Haley <aph@redhat.com>
10468
10469 * options.h (merge_exidx_entries): New option.
10470 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10471 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10472 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10473 (Target_arm::merge_exidx_entries): New function.
10474 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10475 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10476 to Arm_exidx_fixup constructor.
10477 Add new arg, merge_exidx_entries.
10478 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10479 Arm_output_section::fix_exidx_coverage.
10480
ce97fa81
ST
104812010-04-18 Sriraman Tallam <tmsriram@google.com>
10482
10483 * icf.cc (get_section_contents): Check for preemptible functions.
10484 Ignore addend when appropriate.
10485 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10486 section folded.
10487 (add_from_relobj): Check for section folded.
10488 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10489 * symtab.h (should_add_dynsym_entry): Add new parameter.
10490 * target-reloc.h (scan_relocs): Check for section folded.
10491 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10492 Check reloc types for function pointers in shared objects.
10493 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10494 case.
10495 (icf_preemptible_functions_test): New test case.
10496 (icf_string_merge_test): New test case.
10497 * testsuite.Makefile.in: Regenerate.
10498 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10499 bar_glob. Refactor code.
10500 * testsuite/icf_preemptible_functions_test.cc: New file.
10501 * testsuite/icf_preemptible_functions_test.sh: New file.
10502 * testsuite/icf_string_merge_test.cc: New file.
10503 * testsuite/icf_string_merge_test.sh: New file.
10504 * testsuite/icf_virtual_function_folding_test.cc: New file.
10505 * testsuite/icf_virtual_function_folding_test.sh: New file.
10506
04ceb17c
DK
105072010-04-14 Doug Kwan <dougkwan@google.com>
10508
10509 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10510 for local symbol recounting if we remove a section due to ICF.
10511 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10512 there are no regular objects in input.
10513
153e7da4
DK
105142010-04-13 Doug Kwan <dougkwan@google.com>
10515
10516 * arm.cc (Arm_input_section::set_final_data_size): Compute
10517 accurate final data size instead of using current data size.
10518
4dbd9faf
DK
105192010-04-09 Doug Kwan <dougkwan@google.com>
10520
10521 * layout.cc (Layout::choose_output_section): Handle script section
10522 types.
10523 (Layout::make_output_section_for_script): Add section type parameter.
10524 Handle script section types.
10525 * layout.h (Layout::make_output_section_for_script): Add section
10526 type parameter.
10527 * output.cc (Output_section::Output_section): Initialize data member
10528 is_noload_.
10529 (Output_section::do_reset_address_and_file_offset): Do not set address
10530 to 0 if section is a NOLOAD section.
10531 * output.h (Output_section::is_noload): New method.
10532 (Output_section::set_is_noload): Ditto.
10533 (Output_section::is_noload_): New data member.
10534 * script-c.h (Script_section_type): New enum type.
10535 (struct Parser_output_section_header): Add new file section_type.
10536 * script-sections.cc (Sections_element::output_section_name): Add
10537 parameter for returning script section type.
10538 (Output_section_definition::output_section_name): Ditto.
10539 (Output_section_definition::section_type)P; New method.
10540 (Output_section_definiton::script_section_type_name): Ditto.
10541 (Output_section_definition::script_section_type_): New data member.
10542 (Output_section_definition::Output_section_definition): Initialize
10543 data member Output_section_definition::script_section_type_.
10544 (Output_section_definition::create_sections): Pass script section type
10545 to Layout::make_output_section_for_script.
10546 (Output_section_definition::output_section_name): Return script
10547 section type to caller.
10548 (Output_section_definition::set_section_address): Do not advance
10549 dot value and load address if section type is NOLOAD. Set address
10550 of NOLOAD sections regardless of section flags.
10551 (Output_section_definition::print): Print section type if it is
10552 not SCRIPT_SECTION_TYPE_NONE.
10553 (Output_section_definition::section_type): New method.
10554 (Output_section_definition::script_section_type_name): Ditto.
10555 (Script_sections::output_section_name): Add new parameter
10556 PSECTION_TYPE for returning script section type. Pass it to
10557 section elements. Handle discard sections.
10558 (Sort_output_sections::operator()): Handle NOLOAD sections.
10559 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10560 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10561 returning script section type.
10562 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10563 INFO and NOLOAD.
10564 * yyscript.y (union): Add new field SECTION_TYPE.
10565 (COPY, DSECT, INFO, NOLOAD): New tokens.
10566 (opt_address_and_section_type): Change type to output_section_header.
10567 (section_type): New non-terminal
10568 (section_header): Handle section type.
2253bfba 10569 (opt_address_and_section_type): Return section type value.
4dbd9faf 10570
721ea635
L
105712010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10572
10573 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10574 * testsuite/plugin_common_test_2.c (foo): Likewise.
10575
6bf924b0
DK
105762010-04-08 Doug Kwan <dougkwan@google.com>
10577
10578 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10579 Output_merge_data.
10580 * output.cc (Output_section::add_merge_input_section): Simplify
10581 code and return status of Output_merge_base::add_input_section.
e1df38aa 10582 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10583 returns true.
10584
24af6f92
DK
105852010-04-07 Doug Kwan <dougkwan@google.com>
10586
10587 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10588 if section is marked as containing instructions but has no mapping
10589 symbols.
10590 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10591 correct section index.
10592 (Arm_relobj::find_linked_text_section): Ditto.
10593
00698fc5
CC
105942010-04-07 Cary Coutant <ccoutant@google.com>
10595
10596 * archive.cc (include_member): Destroy Read_symbols_data object before
10597 releasing file.
10598 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10599 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10600 (Read_symbols_data::~Read_symbols_data) New destructor.
10601 (Section_relocs::Section_relocs) New constructor.
10602 (Section_relocs::~Section_relocs) New destructor.
10603 (Read_relocs_data::Read_relocs_data) New constructor.
10604 (Read_relocs_data::~Read_relocs_data) New destructor.
10605 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10606 pointers to NULL after deleting.
10607
7296d933
DK
106082010-04-07 Doug Kwan <dougkwan@google.com>
10609
10610 * arm.cc: Replace "endianity" with "endianness" in comments.
10611 (Arm_exidx_cantunwind): Ditto.
10612 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10613 (Arm_relobj::merge_flags_and_attributes): New method.
10614 (Arm_relobj::merge_flags_and_attributes_): New data member.
10615 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10616 (Arm_relobj::scan_sections_for_stubs): Ditto.
10617 (Arm_relobj::do_read_symbols): Check to see if we really want to
10618 merge processor-specific flags and attributes. Exit early if
10619 an object is empty except for section names and the undefined symbol.
10620 (Target_arm::do_finalize_sections): Move check for ELF format to
10621 Arm_relobj::do_read_symbols. Merge processor specific flags and
10622 attributes from a regular object only when we have determined that
10623 it is aapropriate. Do not create an .ARM.attributes section in
10624 output if there is no regular input object.
10625 (Target_arm::merge_processor_specific_flags): Check
10626 --warn-mismatch before printing any error.
10627 (Target_arm::merge_object_attributes): Ditto.
10628 * gold.cc (queue_middle_tasks): Handle the case in which there is
10629 no regular object in input.
10630 * options.cc (General_options::parse_EB): New method.
10631 (General_options::parse_EL): Same.
10632 (General_options::General_options): Initialize endianness_.
10633 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10634 New options.
10635 (General_options::Endianness): New enum.
10636 (General_options::endianness): New method.
10637 (General_options::endianness_): New data member.
10638 * parameters.cc (Parameters::set_options): Check target endianness.
10639 (Parameters::set_target_once): Ditto.
10640 (Parameters::check_target_endianness): New method.
10641 (parameters_force_valid_target): If either -EL or -EB is specified,
10642 use it to define endianness of default target.
10643 * parameters.h (Parameters::check_target_endianness): New method
10644 declaration.
10645 * target.h (class Target): Change "endianity" to "endianness"
10646 in comments.
10647
efc8d4f2
RW
106482010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10649
10650 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10651 * configure: Regenerate.
10652 * Makefile.in: Regenerate.
10653 * testsuite/Makefile.in: Regenerate.
10654
be234d88
CC
106552010-04-06 Cary Coutant <ccoutant@google.com>
10656
10657 gcc PR lto/42757
10658 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10659 prevailing definitions of common symbols.
10660 * testsuite/plugin_test_6.sh: New test case.
10661 * testsuite/plugin_common_test_1.c: New test case.
10662 * testsuite/plugin_common_test_2.c: New test case.
10663 * testsuite/Makefile.am (plugin_test_6): New test case.
10664 * testsuite/Makefile.in: Regenerate.
10665
bd32c6bd
NC
106662010-04-06 Nick Clifton <nickc@redhat.com>
10667
10668 * po/vi.po: New Vietnamese translation.
10669
323c532f
DK
106702010-03-30 Doug Kwan <dougkwan@google.com>
10671
10672 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10673
4fcd97eb
DK
106742010-03-25 Doug Kwan <dougkwan@google.com>
10675
10676 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10677 to avoid a conversion warning on a 32-bit host.
10678
4ebf39db
ILT
106792010-03-24 Ian Lance Taylor <iant@google.com>
10680
10681 * testsuite/script_test_3.t: Add a TLS segment.
10682 * testsuite/Makefile.am (check_PROGRAMS): Add
10683 tls_phdrs_script_test.
10684 (tls_phdrs_script_test_SOURCES): Define.
10685 (tls_phdrs_script_test_DEPENDENCIES): Define.
10686 (tls_phdrs_script_test_LDFLAGS): Define.
10687 (tls_phdrs_script_test_LDADD): Define.
10688 * testsuite/Makefile.in: Rebuild.
10689
4a599bdd
CC
106902010-03-23 Cary Coutant <ccoutant@google.com>
10691
10692 * fileread.cc (find_or_make_view): Fix comment.
10693
6c93b22c
ILT
106942010-03-23 Ian Lance Taylor <iant@google.com>
10695
10696 * script-sections.cc (class Orphan_section_placement): Define
10697 PLACE_TLS and PLACE_TLS_BSS.
10698 (Orphan_section_placement::Orphan_section_placement): Initialize
10699 new places.
10700 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10701 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10702 (tls_script_test_SOURCES): Define.
10703 (tls_script_test_DEPENDENCIES): Define.
10704 (tls_script_test_LDFLAGS): Define.
10705 (tls_script_test_LDADD): Define.
10706 * testsuite/Makefile.in: Rebuild.
10707
a2c7281b
DK
107082010-03-22 Doug Kwan <dougkwan@google.com>
10709
10710 * arm.cc (Arm_relocate_functions::abs8,
10711 Arm_relocate_functions::abs16): Use correct check for overflow
10712 specified in the ARM ELF specs.
10713 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10714 target of a BLX instruction specially.
10715 (Reloc_stub::stub_type_for_reloc): Ditto.
10716 (Relocate::relocate): Use symbolic names instead of numeric relocation
10717 codes to report error.
10718 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10719 workaround.
10720 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10721 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10722 thumb2_blx_out_of_range.stdout
10723 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10724 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10725 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10726 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10727 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10728 thumb2_blx_in_range, thumb2_blx_in_range.o,
10729 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10730 thumb2_blx_out_of_range.o): New rules.
2e702c99 10731 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10732 thumb2_blx_in_range and thumb2_blx_out_of_range.
10733 * testsuite/Makefile.in: Regenerate.
10734 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10735 * testsuite/thumb_blx_in_range.s: New file.
10736 * testsuite/thumb_blx_out_of_range.s: New file.
10737
b0193076
RÁE
107382010-03-22 Rafael Espindola <espindola@google.com>
10739
10740 * archive.cc (Should_include): Move to archive.h.
10741 (should_include_member): Make it a member of Archive.
10742 (Lib_group): New.
10743 (Add_lib_group_symbols): New.
10744 * archive.h: Include options.h.
10745 (Archive_member): Moved from Archive.
10746 (Should_include): Moved from archive.cc.
10747 (Lib_group): New.
10748 (Add_lib_group_symbols): New.
10749 * dynobj.cc (do_should_include_member): New.
10750 * dynobj.h (do_should_include_member): New.
10751 * gold.cc (queue_initial_tasks): Update call to queue.
10752 * main.cc (main): Print lib group stats.
10753 * object.cc (do_should_include_member): New.
10754 * object.h: Include archive.h.
10755 (Object::should_include_member): New.
10756 (Object::do_should_include_member): New.
10757 (Sized_relobj::do_should_include_member): New.
10758 * options.cc (General_options::parse_start_lib): New.
10759 (General_options::parse_end_lib): New.
10760 (Input_arguments::add_file): Handle lib groups.
10761 (Input_arguments::start_group): Check we are not in a lib.
10762 (Input_arguments::start_lib): New.
10763 (Input_arguments::end_lib): New.
10764 * options.h (General_options): Add start_lib and end_lib.
10765 (Input_argument::lib_): New.
10766 (Input_argument::lib): New.
10767 (Input_argument::is_lib): New.
10768 (Input_file_lib): New.
10769 (Input_arguments::in_lib_): New.
10770 (Input_arguments::in_lib): New.
10771 (Input_arguments::start_lib): New.
10772 (Input_arguments::end_lib_): New.
10773 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10774 in unused members as preempted.
10775 (Sized_pluginobj::do_should_include_member): New.
10776 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10777 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10778 return the blocker.
10779 (Read_symbols::do_whole_lib_group): New.
10780 (Read_symbols::do_lib_group): New.
10781 (Read_symbols::do_read_symbols): Handle lib groups.
10782 (Read_symbols::get_name): Handle lib groups.
10783 * readsyms.h (Read_symbols): Add an archive member pointer.
10784 (Read_symbols::do_whole_lib_group): New.
10785 (Read_symbols::do_lib_group): New.
10786 (Read_symbols::member_): New.
10787 * script.cc (read_input_script): Update call to queue_soon.
10788
d099120c
DK
107892010-03-19 Doug Kwan <dougkwan@google.com>
10790
10791 * arm.cc (Stub_table::Stub_table): Initialize new data members
10792 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10793 (Stub_table::add_reloc_stub): Assign stub offset and update
10794 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10795 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10796 New data members.
2e702c99 10797 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10798 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10799 instead of going over all reloc stubs.
2e702c99 10800 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10801 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10802 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10803 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10804 Stringpool_template::offset_.
10805 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10806 Stringpool_template::offset_ to zero.
10807
1aa37384
DK
108082010-03-15 Doug Kwan <dougkwan@google.com>
10809
10810 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10811 offset_.
10812 (Stringpool_template::new_key_offset): New method.
10813 (Stringpool_template::add_string): Assign offsets when adding new
10814 strings.
10815 (Stringpool_template::set_string_offsets): Do not set string offsets
10816 when not optimizing.
10817 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10818 member size_.
2e702c99
RM
10819 (Chunked_vector::clear): Clear size_.
10820 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10821 (Chunked_vector::size): Return size_.
10822 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10823 (Chunked_vector::size_): New data member.
1aa37384
DK
10824 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10825 (Stringpool_template::new_key_offset): New method declaration.
10826 (Stringpool_template::offset_): New data member.
10827
b672b057
RÁE
108282010-03-15 Rafael Espindola <espindola@google.com>
10829
10830 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10831 Add_symbols' constructor.
10832 * readsyms.h (Add_symbols): Remove the input_group member.
10833
b6848d3c
ILT
108342010-03-10 Ian Lance Taylor <iant@google.com>
10835
10836 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10837 target to ask whether a reference to a symbol requires a stack
10838 split.
10839 * target.h (Target::is_call_to_non_split): New function.
10840 (Target::do_is_call_to_non_split): Declare virtual function.
10841 * target.cc: Include "symtab.h".
10842 (Target::do_is_call_to_non_split): New function.
10843 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10844
a2a5469e
CC
108452010-03-10 Cary Coutant <ccoutant@google.com>
10846
10847 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10848 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10849 (File_read::open[2]): Add whole_file_view_ to list of views.
10850 (File_read::make_view): Remove test of whole_file_view_.
10851 (File_read::find_or_make_view): Create whole_file_view_ if
10852 necessary.
10853 (File_read::clear_views): Replace bool parameter with enum;
10854 adjust all callers. Don't delete views with permanent data;
10855 do delete cached views and views from archives if
10856 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10857 if clearing the corresponding view.
10858 * fileread.h (File_read::Clear_views_mode): New enum.
10859 (File_read::View::is_permanent_view): New method.
10860 (File_read::clear_views): Replace bool parameter
10861 with enum; adjust all callers.
10862 * options.h (General_options): Change keep_files_mapped option;
10863 add map_whole_files.
10864 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10865 releasing the file.
10866 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10867 the file.
10868
8861f32b
DM
108692010-03-10 David S. Miller <davem@davemloft.net>
10870
10871 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10872
d62d0f5f
ST
108732010-03-09 Sriraman Tallam <tmsriram@google.com>
10874
10875 * icf.cc (get_section_contents): Add '@' marker after processing the
10876 merge reloc.
10877
9177756d
DK
108782010-03-08 Doug Kwan <dougkwan@google.com>
10879
10880 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10881 due to a conversion warning.
10882 (Arm_relobj::update_output_local_symbol_count): Check for local
10883 symbol with unset output index.
10884
9e9e071b
ILT
108852010-03-05 Ian Lance Taylor <iant@google.com>
10886
10887 * options.h (class General_options): Add --spare-dynamic-tags.
10888 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10889 --spare-dynamic-tags.
10890
a81ee015
ILT
108912010-03-05 Ian Lance Taylor <iant@google.com>
10892
10893 * incremental.cc: Include "libiberty.h".
10894
44ec90b9
RO
108952010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10896
10897 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10898 function, is_info_ member.
10899 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10900 (Versions::Versions): Update caller.
10901 (Versions::define_base_version): Likewise.
10902 (Versions::add_def): Likewise.
10903
0897ed3b
ST
109042010-03-03 Sriraman Tallam <tmsriram@google.com>
10905
10906 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10907 (Scan::possible_function_pointer_reloc): New function.
10908 (Scan::local_reloc_may_be_function_pointer): Change to call
10909 possible_function_pointer_reloc.
10910 (Scan::global_reloc_may_be_function_pointer): Ditto.
10911 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10912 relocations in ".data.rel.ro._ZTV" section.
10913 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10914 * testsuite/icf_safe_so_test.cc: Ditto.
10915 * testsuite/icf_safe_test.cc: Ditto.
10916 * testsuite/icf_safe_test.sh: Ditto.
10917
d3bbad62
ILT
109182010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10919 Ian Lance Taylor <iant@google.com>
10920
10921 * target-reloc.h (relocate_section): Check the symbol table index
10922 for -1U before setting the local symbol index.
10923 (scan_relocatable_relocs): If copying the relocation, record that
10924 the local symbol is required.
10925 * object.h (Symbol_value::is_output_symtab_index_set): New
10926 function.
10927 (Symbol_value::may_be_discarded_from_output_symtab): New
10928 function.
10929 (Symbol_value::has_output_symtab_entry): New function.
10930 (Symbol_value::needs_output_symtab_entry): Remove.
10931 (Symbol_value::output_symtab_index): Make sure the symbol index is
10932 set.
10933 (Symbol_value::set_output_symtab_index): Make sure the symbol
10934 index is not set. Make sure the new index is valid.
10935 (Symbol_value::set_must_have_output_symtab_entry): New function.
10936 (Symbol_value::has_output_dynsym_entry): New function.
10937 (Symbol_value::set_output_dynsym_index): Make sure the new index
10938 is valid.
10939 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10940 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10941 local symbol if permitted.
10942 (Sized_relobj::do_finalize_local_symbols): Call
10943 is_output_symtab_index_set rather than needs_output_symtab_entry.
10944 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10945 rather than needs_output_symtab_entry. Call
10946 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10947 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10948 is_output_symtab_index_set rather than needs_output_symtab_entry.
10949 * testsuite/discard_locals_relocatable_test.c: New file.
10950 * testsuite/discard_locals_test.sh: Test -r.
10951 * testsuite/Makefile.am (check_DATA): Add
10952 discard_locals_relocatable_test1.syms,
10953 discard_local_relocatable_test2.syms.
10954 (MOSTLYCLEANFILES): Likewise. Also add
10955 discard_locals_relocatable_test1.lout and
10956 discard_locals_relocatable_test2.out.
10957 (discard_locals_relocatable_test1.syms): New target.
10958 (discard_locals_relocatable_test.o): New target.
10959 (discard_locals_relocatable_test1.out): New target.
10960 (discard_locals_relocatable_test2.syms): New target.
10961 (discard_locals_relocatable_test2.out): New target.
10962 (various): Add missing ../ld-new dependencies.
10963 * testsuite/Makefile.in: Rebuild.
10964
7e8ccf26
NC
109652010-03-03 Nick Clifton <nickc@redhat.com>
10966
10967 * po/fi.po: New Finnish translation.
10968
2a0ff005
DK
109692010-03-01 Doug Kwan <dougkwan@google.com>
10970
10971 * layout.cc (Layout::Layout): Force section types of .init_array*,
10972 .preinit_array* and .fini_array* sections.
10973 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10974 Fix check of return value of std::string::find.().
10975 (Output_section::Input_section_sort_compare::operator()): Remove
10976 comment about .init_array.
10977 (Output_section::Input_section_sort_init_fini_compare::operator()):
10978 New method.
10979 (Output_section::sort_attached_input_sections): Handle .init_array
10980 and .fini_array specially.
10981 * output.h (Output_section::Inut_section_sort_compare): Update
10982 comment.
10983 (Output_section::Input_section_sort_init_fini_compare): New struct.
10984
c3e4ae29
DK
109852010-02-26 Doug Kwan <dougkwan@google.com>
10986
10987 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10988 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10989 * testsuite/debug_msg.sh: Avoid matching source line number for
10990 use of global variable undef_int.
10991
2fd9ae7a
DK
109922010-02-26 Doug Kwan <dougkwan@google.com>
10993
10994 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10995 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10996 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10997 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10998 * options.cc (General_options::General_options): Initialize member
10999 fix_v4bx_.
11000 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
11001 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
11002 and rm_no_fix_v4bx.stdout
11003 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
11004 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
11005 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
11006 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
11007 and arm_no_fix_v4bx.
11008 * Makefile.in: Regenerate.
11009 * testsuite/arm_fix_v4bx.s: New file.
11010 * testsuite/arm_fix_v4bx.sh: Ditto.
11011
67ec7d0b
DK
110122010-02-24 Doug Kwan <dougkwan@google.com>
11013
11014 * arm.cc (Target_arm::got_section): Make the .got section the first
11015 non RELRO section in the data segment.
11016 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
11017 suffixes of section names.
11018
10165461
DK
110192010-02-24 Doug Kwan <dougkwan@google.com>
11020
11021 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
11022 flags and attributes merging if an input file is a binary file.
11023 * fileread.cc (Input_file::open): Record format of original file.
11024 * fileread.h (Input_file::Format): New enum type.
2e702c99 11025 (Input_file::Input_file): Initialize data member format_.
10165461
DK
11026 (Input_file::format): New method definition.
11027 (Input_file::format_):: New data member.
11028
4a54abbb
DK
110292010-02-24 Doug Kwan <dougkwan@google.com>
11030
11031 * arm.cc (Arm_output_data_got): New class.
11032 (ARM_TCB_SIZE): New constant
11033 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
11034 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
11035 If user uses a script with a SECTIONS clause, issue only a warning
11036 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 11037 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
11038 garbage collection.
11039 (Target_arm::got_mode_index_entry): Handle static linking.
11040 (Target_arm::Scan::local): Ditto.
11041 (Target_arm::Scan::global): Ditto.
11042 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
11043 all incorrectly implemented relocations.
e1df38aa 11044 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
11045 Arm_output_section::fix_exidx_coverage.
11046 * layout.cc (Layout::section_name_mapping): Remove trailing dots
11047 from ".ARM.exidx." and ".ARM.extab.".
11048
ca419a6f
ILT
110492010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11050
11051 * arm.cc (Target_arm::do_finalize_sections): Create attribute
11052 section if it does not already exist.
11053 * attributes.cc (Attributes_section_data::Attributes_section_data):
11054 Don't crash if size is zero.
11055
135b9c78
ILT
110562010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11057 Ian Lance Taylor <iant@google.com>
11058
11059 * gold.cc (queue_middle_tasks): If no input files were opened,
11060 exit.
11061 * workqueue.h (Task_function::Task_function): Assert that there is
11062 a blocker.
11063
bb0bfe4f
DK
110642010-02-22 Doug Kwan <dougkwan@google.com>
11065
11066 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
11067 * icf.cc (get_section_contents): Cast snprintf arguments to long long
11068 types to avoid warnings due to different uint64_t implementations
11069 on different hosts.
11070
2a2b6d42
DK
110712010-02-21 Doug Kwan <dougkwan@google.com>
11072
11073 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
11074 handling of the maximum backward branch offset.
2e702c99 11075 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
11076 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
11077 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 11078 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
11079 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11080 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11081 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11082 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11083 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11084 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11085 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11086 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11087 thumb2_bl_out_of_range.o): New rules.
11088 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11089 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11090 thumb2_bl_out_of_range
11091 * testsuite/Makefile.in: Regenerate.
11092 * testsuite/arm_bl_in_range.s: New file.
11093 * testsuite/arm_bl_out_of_range.s: Ditto.
11094 * testsuite/arm_branch_in_range.sh: Ditto.
11095 * testsuite/arm_branch_range.t: Ditto.
11096 * testsuite/thumb2_branch_range.t: Ditto.
11097 * testsuite/thumb_bl_in_range.s: Ditto.
11098 * testsuite/thumb_bl_out_of_range.s: Ditto.
11099 * testsuite/thumb_branch_range.t: Ditto.
11100
b487ad64
ST
111012010-02-20 Sriraman Tallam <tmsriram@google.com>
11102
11103 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11104 Add reloc offset information.
11105 * icf.cc (get_section_contents): Change iterators to point to the new
11106 vectors. Add reloc offset information to the contents.
11107 * icf.h (Icf::Sections_reachable_info): New typedef.
11108 (Icf::Sections_reachable_list): New typedef.
11109 (Icf::Offset_info): New typedef.
11110 (Icf::Reloc_info): New struct typedef.
11111 (Icf::Reloc_info_list): New typedef.
11112 (Icf::symbol_reloc_list): Delete method.
11113 (Icf::addend_reloc_list): Delete method.
11114 (Icf::section_reloc_list): Delete method.
11115 (Icf::reloc_info_list): New method.
11116 (Icf::reloc_info_list_): New member.
11117
f96accdf
DK
111182010-02-19 Doug Kwan <dougkwan@google.com>
11119
11120 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11121 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11122 * arm.cc (Arm_relocation_functions): New forward declaration.
11123 (Target_arm::Target_arm): Initialize new data members
11124 got_mod_index_offset_ and tls_base_symbol_defined_.
11125 (Target_arm::Relocate::relocate_tls): New method.
11126 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11127 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11128 New methods.
2e702c99 11129 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
11130 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11131 (Target_arm::got_mod_index_offset_,
11132 Target_arm::tls_base_symbol_defined_): New data members.
11133 (Target_arm::Scan::local, Target::Scan::global,
11134 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11135 relocations.
11136
c8761b9a
DK
111372010-02-18 Doug Kwan <dougkwan@google.com>
11138
11139 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11140 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11141 text section as a parameter becuase some broken tools may not set
11142 the link in section header.
11143 (Target_arm::has_got_section): New method.
11144 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11145 without any mapping symbol as data only. Remove warning.
11146 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11147 link in its section header, try to discover the link by inspecting the
11148 REL31 relocation at the beginning of the section.
11149 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11150 in error message.
11151 (Target_arm::Scan::global): Treat any reference to the symbol
11152 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11153
21bb3914
ST
111542010-02-12 Sriraman Tallam <tmsriram@google.com>
11155
11156 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11157 (Scan::global_reloc_may_be_function_pointer): New function.
11158 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11159 (Scan::global_reloc_may_be_function_pointer): New function.
11160 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11161 (Scan::global_reloc_may_be_function_pointer): New function.
11162 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11163 (Scan::global_reloc_may_be_function_pointer): New function.
11164 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11165 (Scan::global_reloc_may_be_function_pointer): New function.
11166 (Scan::possible_function_pointer_reloc): New function.
11167 (Target_x86_64::can_check_for_function_pointers): New function.
11168 * gc.h (gc_process_relocs): Scan relocation types to determine if
11169 function pointers were taken for targets that support it.
11170 * icf.cc (Icf::find_identical_sections): Include functions for
11171 folding in safe ICF whose pointer is not taken.
11172 * icf.h (Secn_fptr_taken_set): New typedef.
11173 (fptr_section_id_): New member.
11174 (section_has_function_pointers): New function.
11175 (set_section_has_function_pointers): New function.
11176 (check_section_for_function_pointers): New function.
11177 * options.h: Fix comment for safe ICF option.
11178 * target.h (can_check_for_function_pointers): New function.
11179 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11180 Modify icf_safe_test for X86-64.
11181 * testsuite/Makefile.in: Regenerate.
11182 * testsuite/icf_safe_so_test.cc: New file.
11183 * testsuite/icf_safe_so_test.sh: New file.
11184 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11185 (main): Change to take pointer to function kept_func_3.
11186 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11187 folding is done correctly for X86-64.
11188
0da6fa6c
DM
111892010-02-12 David S. Miller <davem@davemloft.net>
11190
11191 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11192 is_symbolless parameter.
11193 (Output_reloc<SHT_REL>::is_symbolless): New.
11194 (Output_reloc<SHT_REL>::is_symbolless_): New.
11195 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11196 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11197 (Output_reloc<SHT_RELA>::is_symbolless): New.
11198 (Output_data_reloc::add_global): Handle is_symbolless.
11199 (Output_data_reloc::add_global_relative): Likewise.
11200 (Output_data_reloc::add_local): Likewise.
11201 (Output_data_reloc::add_local_relative): Likewise.
11202 (Output_data_reloc::add_symbolless_global_addend): New.
11203 (Output_data_reloc::add_symbolless_local_addend): New.
11204 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11205 is_symbolless.
11206 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11207 instead of ->is_relative_
11208 (Output_reloc::write): Likewise.
11209 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11210 (Output_reloc::write_rel): Simplify.
11211
11212 * sparc.cc (Target_sparc::Scan::local): Use
11213 ->add_symbolless_local_addend as needed.
11214 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11215 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11216 based upon relocation offset.
11217
e4782e83
DK
112182010-02-11 Doug Kwan <dougkwan@google.com>
11219
11220 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11221 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11222 beginning of function.
11223 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11224 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11225 parameter is_32bit in calls to should_apply_static_reloc.
11226 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11227 (check_DATA): Add arm_abs_global.stdout.
11228 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11229 arm_abs_global.stdout): New rules.
11230 (MOSTLLYCLEANFILES): Add arm_abs_global
11231 * Makefile.in: Regenerate.
11232 * testsuite/arm_abs_global.s: New file.
11233 * testsuite/arm_abs_global.sh: Ditto.
11234 * testsuite/arm_abs_lib.s: Ditto.
11235
93ceb764
ILT
112362010-02-11 Ian Lance Taylor <iant@google.com>
11237
11238 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11239 Read_relocs task.
11240 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11241 Allocate_commons_task first.
11242 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11243 task, rather than symtab_lock_.
11244 (Gc_process_relocs::~Gc_process_relocs): New function.
11245 (Gc_process_relocs::is_runnable): Check this_blocker_.
11246 (Gc_process_relocs::locks): Use next_blocker_ rather than
11247 blocker_.
11248 (Scan_relocs::~Scan_relocs): New function.
11249 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11250 symtab_lock_.
11251 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11252 next_blocker_.
11253 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11254 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11255 constructor accordingly.
11256 (class Gc_process_relocs): Likewise.
11257 (class Scan_relocs): Likewise.
11258 * common.h (class Allocate_commons_task): Remove symtab_lock_
11259 field, and corresponding constructor parameter.
11260 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11261 symtab_lock_.
11262 (Allocate_commons_task::locks): Likewise.
11263
114dfbe1
ILT
112642010-02-11 Ian Lance Taylor <iant@google.com>
11265
11266 * gold-threads.h (class Once): Define.
11267 (class Initialize_lock): Rewrite as child of Once.
11268 * gold-threads.cc (class Once_initialize): Define.
11269 (once_pointer_control): New static variable.
11270 (once_pointer, once_arg): New static variables.
11271 (c_run_once): New static function.
11272 (Once::Once, Once::run_once, Once::internal_run): New functions.
11273 (class Initialize_lock_once): Remove.
11274 (initialize_lock_control): Remove.
11275 (initialize_lock_pointer): Remove.
11276 (initialize_lock_once): Remove.
11277 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11278 (Initialize_lock::initialize): Rewrite.
11279 (Initialize_lock::do_run_once): New function.
11280 * archive.cc (Archive::interpret_header): Only clear name if it is
11281 not already empty.
11282 * fileread.cc: Include "gold-threads.h"
11283 (file_counts_lock): New static variable.
11284 (file_counts_initialize_lock): Likewise.
11285 (File_read::release): Only increment counts when using --stats.
11286 Use a lock around the increment.
11287 * parameters.cc (class Set_parameters_target_once): Define.
11288 (set_parameters_target_once): New static variable.
11289 (Parameters::Parameters): Move here from parameters.h.
11290 (Parameters::set_target): Rewrite.
11291 (Parameters::set_target_once): New function.
11292 (Parameters::clear_target): Move here and rewrite.
11293 * parameters.h (class Parameters): Update declarations. Add
11294 set_parameters_target_once_ field.
11295 (Parameters::Parameters): Move to parameters.cc.
11296 (Parameters::clear_target): Likewise.
11297 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11298 task.
11299 (Start_group::~Start_group): New function.
11300 (Start_group::is_runnable): New function.
11301 (Start_group::locks, Start_group::run): New functions.
11302 (Finish_group::run): Change saw_undefined to size_t.
11303 * readsyms.h (class Start_group): Define.
11304 (class Finish_group): Change saw_undefined_ field to size_t.
11305 (Finish_group::Finish_group): Remove saw_undefined and
11306 this_blocker parameters. Change all callers.
11307 (Finish_group::set_saw_undefined): New function.
11308 (Finish_group::set_blocker): New function.
11309 * symtab.h (class Symbol_table): Change saw_undefined to return
11310 size_t. Change saw_undefined_ field to size_t.
11311 * target-select.cc (Set_target_once::do_run_once): New function.
11312 (Target_selector::Target_selector): Initialize set_target_once_
11313 field. Don't initialize lock_ and initialize_lock_ fields.
11314 (Target_selector::instantiate_target): Rewrite.
11315 (Target_selector::set_target): New function.
11316 * target-select.h (class Set_target_once): Define.
11317 (class Target_selector): Update declarations. Make
11318 Set_target_once a friend. Remove lock_ and initialize_lock_
11319 fields. Add set_target_once_ field.
11320
fa17a3f4
ILT
113212010-02-10 Ian Lance Taylor <iant@google.com>
11322
11323 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11324 queueing any tasks.
11325 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11326 (queue_middle_tasks): Add all blockers before queueing any tasks.
11327 (queue_final_tasks): Likewise.
11328 * token.h (Task_token::add_blockers): New function.
11329 * object.h (Input_objects::number_of_relobjs): New function.
11330
c7177d31
ILT
113312010-02-10 Ian Lance Taylor <iant@google.com>
11332
5de0e392
ILT
11333 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11334 shared, not if not position independent.
11335 * x86_64.cc (Relocate::relocate_tls): Likewise.
11336 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11337 (tls_pie_pic_test): New target.
11338 * testsuite/Makefile.in: Rebuild.
11339
c7177d31
ILT
11340 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11341 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11342 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11343 * testsuite/Makefile.in: Rebuild.
11344
684b268a
DM
113452010-02-09 David S. Miller <davem@davemloft.net>
11346
11347 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11348 R_SPARC_RELATIVE using ->add_local_relative().
11349 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11350
612a8d3d
DM
11351 * output.h (Output_data_dynamic::add_section_size): New method
11352 that takes two Output_data objects.
11353 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11354 entry param. Handle it in initializers.
11355 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11356 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11357 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11358 arg.
11359 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11360 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11361 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11362 for dynrel_includes_plt.
11363 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11364 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11365 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11366 before .rela.plt
11367 (Target_sparc::do_finalize_sections): Update to pass true for
11368 dynrel_includes_plt.
11369 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11370 output before .rela.plt
11371 (Target_powerpc::do_finalize_sections): Update to pass true for
11372 dynrel_includes_plt when 32-bit.
11373
cb1be87e
DK
113742010-02-08 Doug Kwan <dougkwan@google.com>
11375
11376 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11377 method.
11378 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11379 Arm_relobj::scan_section_for_cortex_a8_stubs,
11380 Arm_relobj::do_relocation_section): Instead of calling
11381 Output_section::output_address, use faster
11382 Arm_relobj::simple_input_section_output_address.
11383
705b5121
DM
113842010-02-08 David S. Miller <davem@davemloft.net>
11385
11386 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11387 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11388 relocation helper function.
11389
024c4466
DM
11390 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11391 just like R_SPARC_GOT{10,13,22}.
11392 (Target_sparc::Scan::local): Likewise.
11393 (Target_sparc::Relocate:relocate): Likewise.
11394
9109c078
ILT
113952010-02-06 Ian Lance Taylor <iant@google.com>
11396
11397 * configure.ac: Rewrite targetobjs duplicate removal code to use
11398 only shell constructs.
11399 * configure: Rebuild.
11400
cf846138
DK
114012010-02-05 Doug Kwan <dougkwan@google.com>
11402
11403 PR 11247
11404 * arm.cc (Arm_relobj::section_is_scannable): New method.
11405 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11406 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11407
6cfaf60b
DK
114082010-02-04 Doug Kwan <dougkwan@google.com>
11409
11410 PR 11247
11411 * arm-reloc-property.cc (cstdio): Include.
11412 * configure.ac (targetobjs): Remove duplicates.
11413 * configure: Regenerate.
11414 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11415 big and little endian version for a given address size.
11416
5c57f1be
DK
114172010-02-03 Doug Kwan <dougkwan@google.com>
11418
11419 * arm-reloc-property.cc
11420 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11421 definition.
11422 * arm-reloc-property.h
11423 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11424 New method definition.
11425 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11426 declaration.
11427 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11428 overflow to N.
11429 (GOT_PREL): Change implemented to Y.
11430 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11431 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11432 (Arm_relocate_functions::movw_abs_nc): Remove method.
11433 (Arm_relocate_functions::movt_abs): Ditto.
11434 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11435 (Arm_relocate_functions::thm_movt_abs): Ditto.
11436 (Arm_relocate_functions::movw_rel_nc): Ditto.
11437 (Arm_relocate_functions::movw_rel): Ditto.
11438 (Arm_relocate_functions::movt_rel): Ditto.
11439 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11440 (Arm_relocate_functions:thm_movw_rel): Ditto.
11441 (Arm_relocate_functions:thm_movt_rel): Ditto.
11442 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11443 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11444 New method definitions.
11445 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11446 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11447 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11448 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11449 (Target_arm::Relocate::relocate): Check for non-static or
11450 unimplemented relocation code and exit early. Change calls to
11451 Target_arm::reloc_uses_thumb_bit and
11452 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11453 instead. Refactor code to handle similar relocations to increase
11454 code sharing. Remove check for unsupported relocation code in switch
11455 statement.
11456 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11457 relocation property table to find out size. Change error message to
11458 print out the name of a relocation code instead of the numeric value.
11459 (Target_arm::scan_reloc_for_stub): Use relocation property table
11460 instead of calling Target_arm::reloc_uses_thumb_bit().
11461
218c5831
DK
114622010-02-02 Doug Kwan <dougkwan@google.com>
11463
11464 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11465 types of relaxed input section.
11466
0d31c79d
DK
114672010-02-02 Doug Kwan <dougkwan@google.com>
11468
11469 * Makefile.am (HFILES): Add arm-reloc-property.h.
11470 (DEFFILES): New.
2e702c99
RM
11471 (TARGETSOURCES): Add arm-reloc-property.cc
11472 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11473 (libgold_a_SOURCES): $(DEFFILES)
11474 * Makefile.in: Regenerate.
11475 * arm-reloc-property.cc: New file.
11476 * arm-reloc-property.h: New file.
11477 * arm-reloc.def: New file.
11478 * arm.cc: Update comments.
11479 (arm-reloc-property.h): New included header.
11480 (arm_reloc_property_table): New global variable.
11481 (Target_arm::do_select_as_default_target): New method definition.
11482 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11483 arm-reloc-property to targ_extra_obj.
11484 * parameters.cc (set_parameters_target): Call
11485 Target::select_as_default_target().
11486 * target.h (Target::select_as_default_target): New method definition.
11487 (Target::do_select_as_default_target): Same.
11488
546c7457
DK
114892010-02-01 Doug Kwan <dougkwan@google.com>
11490
11491 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11492 first_output_text_section_.
11493 (Arm_exidx_fixup::first_output_text_section): New method definition.
11494 (Arm_exidx_fixup::first_output_text_section_): New data member.
11495 (Arm_exidx_fixup::process_exidx_section): Record the first text
11496 output section seen.
11497 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11498 and entsize in output section header.
11499
11b861d5
DK
115002010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11501
11502 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11503 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11504 (Arm_relocate_functions::thm_alu11): New Method.
11505 (Arm_relocate_functions::thm_pc8): New Method.
11506 (Arm_relocate_functions::thm_pc12): New Method.
11507 (Target_arm::Scan::local): Handle the relocations.
11508 (Target_arm::Scan::global): Likewise.
11509 (Target_arm::Relocate::relocate): Likewise.
11510 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11511
c9a2c125
DK
115122010-01-29 Doug Kwan <dougkwan@google.com>
11513
11514 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11515 of relocation types as ld.
11516
1521477a
DK
115172010-01-29 Doug Kwan <dougkwan@google.com>
11518
11519 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11520 to public.
11521 (Arm_relocate_functions::thumb_branch_common): Ditto.
11522 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11523 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11524 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11525 Arm_relocate_functions::jump24): Remove.
11526 (Target_arm::Relocate::relocate): Adjust code to call
11527 Arm_relocation_functions::arm_branch_common and
11528 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11529 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11530
e7eca48c
DK
115312010-01-29 Doug Kwan <dougkwan@google.com>
11532
11533 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11534 output_local_symbol_count_needs_update_.
11535 (Arm_relobj::output_local_symbol_count_needs_update,
11536 Arm_relobj::set_output_local_symbol_count_needs_update,
11537 Arm_relobj::update_output_local_symbol_count): New methods.
11538 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11539 member.
11540 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11541 of pointed function as in a R_ARM_PREL31 relocation.
11542 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11543 for output local symbol count updating.
11544 (Target_arm::do_relax): Update output local symbol counts in objects
11545 if necessary.
11546 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11547
02961d7e
ILT
115482010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11549
11550 * arm.cc: Added support for the ARM relocations:
11551 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11552 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11553 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11554 movw_prel_nc).
11555 (Arm_relocate_functions::movw_rel): New method.
11556 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11557 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11558 thm_movw_prel_nc).
11559 (Arm_relocate_functions::thm_movw_rel): New method.
11560 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11561 thm_movt_prel).
11562 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11563 relocations.
11564 (Target_arm::Scan::global): Likewise.
11565 (Target_arm::Relocate::relocate): Likewise.
11566 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11567 Likewise.
11568
b10d2873
ILT
115692010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11570
11571 * arm.cc: Added support for ARM group relocations.
11572 (Target_arm::reloc_needs_sym_origin): New method.
11573 (Arm_relocate_functions::calc_grp_kn): New method.
11574 (Arm_relocate_functions::calc_grp_residual): New method.
11575 (Arm_relocate_functions::calc_grp_gn): New method.
11576 (Arm_relocate_functions::arm_grp_alu): New Method.
11577 (Arm_relocate_functions::arm_grp_ldr): New Method.
11578 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11579 (Arm_relocate_functions::arm_grp_ldc): New Method.
11580 (Target_arm::Scan::local): Handle the ARM group relocations.
11581 (Target_arm::Scan::global): Likewise.
11582 (Target_arm::Relocate::relocate): Likewise.
11583 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11584 Likewise.
11585
2b328d4e
DK
115862010-01-26 Doug Kwan <dougkwan@google.com>
11587
11588 * arm.cc (set): Include.
11589 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11590 pointer type.
2e702c99 11591 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11592 (Arm_output_section::append_text_sections_to_list): New method.
11593 (Arm_output_section::fix_exidx_coverage): Ditto.
11594 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11595 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11596 Relobj::set_section_offset() instead of
11597 Sized_relobj::invalidate_section_offset().
2e702c99 11598 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11599 parameter for section headers. Ignore relocation sections for
11600 unallocated sections and EXIDX sections.
11601 (Target_arm::fix_exidx_coverage): New method.
11602 (Target_arm::output_section_address_less_than): New type.
11603 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11604 linked text section instead of the EXIDX section.
11605 (Arm_output_section::create_stub_group): Add an assertion to check
11606 that this is not an EXIDX output section.
11607 (Arm_output_section::append_text_sections_to_list): New method.
11608 (Arm_output_section::fix_exidx_coverage): Ditto.
11609 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11610 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11611 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11612 first pass.
11613 (Target_arm::fix_exidx_coverage): New method.
11614 * object.h (Relobj::set_output_section): New method.
11615 (Sized_relobj::invalidate_section_offset): Remove method.
11616 (Sized_relobj::do_invalidate_section_offset): Remove method.
11617 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11618
c7f3c371
DK
116192010-01-25 Doug Kwan <dougkwan@google.com>
11620
11621 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11622 Fix warning due to signed and unsigned comparison on a 32-bit host.
11623
8923b24c
DK
116242010-01-22 Doug Kwan <dougkwan@google.com>
11625
11626 * arm.cc (Target_arm::do_relax): Record an output section for section
11627 offset adjustment it contains any stub table that has changed.
11628 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11629 offsets in an output section if necessary.
11630 * output.cc (Output_section::Output_section): Initialize
11631 section_offsets_need_adjustments_.
11632 (Output_section::add_input_section_for_script): Renamed to
11633 Output_section::add_simple_input_section.
11634 (Output_section::save_states): Add a comment.
11635 (Output_section::discard_states): New method defintion.
11636 (Output_section::adjust_section_offsets): Same.
11637 * output.h (Output_section::add_input_section_for_script): Renamed to
11638 Output_section::add_simple_input_section.
11639 (Output_section::discard_states): New method declaration.
11640 (Output_section::adjust_section_offsets): Same.
11641 (Output_section::section_offsets_need_adjustment,
11642 Output_section::set_section_offsets_need_adjustment): New method
11643 definitions.
11644 (Output_section::section_offsets_need_adjustment_): New data member.
11645 * script-sections.cc
11646 (Output_section_element_input::set_section_address): Adjust code for
11647 renaming of Output_section::add_input_section_for_script.
11648 (Orphan_output_section::set_section_address): Same.
11649
9b2fd367
DK
116502010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11651
11652 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11653 Fix_v4bx enum values .
11654 * gold/options.h (General_options): New option definitions.
11655 (General_options::fix_v4bx): New method.
11656 (General_options::Fix_v4bx): New enum.
11657 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11658 (General_options::parse_fix_v4bx_interworking): New method.
11659
80d0d023
DK
116602010-01-22 Doug Kwan <dougkwan@google.com>
11661
11662 * arm.cc (Arm_exidx_fixup): New class.
11663
af2cdeae
DK
116642010-01-21 Doug Kwan <dougkwan@google.com>
11665
11666 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11667 classes.
11668 (Arm_exidx_section_offset_map): New type.
11669
993d07c1
DK
116702010-01-21 Doug Kwan <dougkwan@google.com>
11671
11672 * arm.cc (Arm_exidx_input_section): New class.
11673 (Arm_relobj::exidx_input_section_by_link,
11674 Arm_relobj::exidx_input_section_by_shndx,
11675 Arm_relobj::make_exidx_input_section): New methods.
11676 (read_arm_attributes_section): Remove.
11677 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11678 information about them.
11679 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11680 to here.
11681
5ac169d4
DK
116822010-01-20 Doug Kwan <dougkwan@google.com>
11683
11684 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11685 Input_section_specifier to Section_id.
11686 (Target_arm::new_arm_input_section: Adjust code for change of key
11687 type.
11688 (Target_arm::find_arm_input_section): Ditto.
11689 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11690 (Section_id): Remove.
11691 (Garbage_collection::Section_id_hash): Remove.
11692 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11693 (Section_id): Remove.
11694 (Icf::Section_id_hash): Remove.
11695 * object.h (Section_id, Const_section_id, Section_id_hash,
11696 Const_section_id_hash): New type definitions.
11697 * output.cc (Output_section::add_relaxed_input_section): Change to
11698 use Const_section_id instead of Input_section_specifier as key type.
11699 (Output_section::add_merge_input_section): Ditto.
11700 (Output_section::build_relaxation_map): Change to use Section_id
11701 instead of Input_section_specifier as key type.
2e702c99 11702 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11703 Ditto.
11704 (Output_section::convert_input_sections_to_relaxed_sections): Change
11705 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11706 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11707 (Output_section::find_relaxed_input_section): Ditto.
11708 * output.h (Input_section_specifier): Remove class.
11709 (Output_section::Output_section_data_by_input_section_map): Change
11710 key type to Const_section_id.
11711 (Output_section::Output_relaxed_input_section_by_input_section_map):
11712 Ditto.
11713 (Output_section::Relaxation_map): Change key type to Section_id.
11714
a2162063
ILT
117152010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11716
11717 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11718 (class Arm_v4bx_stub): New class.
11719 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11720 (Stub_factory::make_arm_v4bx_stub): New method.
11721 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11722 (Stub_table::empty): Handle v4bx stubs.
11723 (Stub_table::add_arm_v4bx_stub): New method.
11724 (Stub_table::find_arm_v4bx_stub): New method.
11725 (Arm_relocate_functions::v4bx): New method.
11726 (Target_arm::fix_v4bx): New method.
11727 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11728 (Stub_table::relocate_stubs): Likewise.
11729 (Stub_table::do_write): Likewise.
11730 (Stub_table::update_data_size_and_addralign): Likewise.
11731 (Stub_table::finalize_stubs): Likewise.
11732 (Target_arm::Scan::local): Likewise.
11733 (Target_arm::Scan::global): Likewise.
11734 (Target_arm::do_finalize_sections): Likewise.
11735 (Target_arm::Relocate::relocate): Likewise.
11736 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11737 Likewise.
11738 (Target_arm::scan_reloc_for_stub): Likewise.
11739 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11740
5696ab0b
ILT
117412010-01-19 Ian Lance Taylor <iant@google.com>
11742
11743 * output.cc (Output_section_headers::do_sized_write): Write large
11744 segment count to sh_info field.
11745 (Output_file_header::do_sized_write): For large segment count,
11746 write PN_XNUM to e_phnum field.
11747
800d0f56
ILT
117482010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11749
11750 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11751 (Arm_relocate_functions::thm_jump8): New function.
11752 (Arm_relocate_functions::thm_jump11): New function.
11753 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11754 R_ARM_THM_JUMP11.
11755 (Target_arm::Scan::global): Likewise.
11756 (Target_arm::Relocate::relocate): Likewise.
11757 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11758 Likewise.
11759
41263c05
DK
117602010-01-14 Doug Kwan <dougkwan@google.com>
11761
11762 * arm.cc (map, utility): Include headers.
11763 (Target_arm::apply_cortex_a8_workaround): New method.
11764 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11765 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11766 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11767 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11768 the --[no-]fix-cortex-a8 command line options.
11769 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11770 (Target_arm::relocate_stub): Use addend in instruction template.
11771 * options.h (DEFINE_bool): Set the user-set flag.
11772 (General_options): Add --[no-]-fix-cortex options.
11773 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11774 : Update fast look-up map after conversion.
41263c05 11775
459e9b03
ST
117762010-01-14 Sriraman Tallam <tmsriram@google.com>
11777
11778 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11779 in the first pass of do_layout.
11780
b521dfe4
DK
117812010-01-13 Doug Kwan <dougkwan@google.com>
11782
11783 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11784 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11785 apparent compiler problem of not folding static constant integral
11786 data members of elfcpp::Elf_sizes<32>.
11787
44272192
DK
117882010-01-13 Doug Kwan <dougkwan@google.com>
11789
11790 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11791 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11792 Arm_relobj::scan_section_for_cortex_a8_erratum,
11793 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11794 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11795 sections to scan for relocation stubs into a new method
11796 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11797 relocation and Cortex-A8 stub scanning.
11798 (Target_arm::do_relax): Force stubs to be after stubbed sections
11799 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11800 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11801 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11802
44b71ece
ILT
118032010-01-12 Ian Lance Taylor <iant@google.com>
11804
11805 * target-reloc.h (visibility_error): New inline function.
11806 (relocate_section): Call visibility_error.
11807 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11808 (MOSTLYCLEANFILES): Likewise.
11809 (protected_4_pic.o, protected_3.err): New targets.
11810 * testsuite/protected_4.cc: New file.
11811
a120bc7f
DK
118122010-01-12 Doug Kwan <dougkwan@google.com>
11813
11814 * arm.cc (Cortex_a8_reloc): New class.
11815 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11816 and cortex_a8_relocs_info_.
11817 (Target_arm::fix_cortex_a8): New method definition.
11818 (Target_arm::Cortex_a8_relocs_info): New type.
11819 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11820 New data member declarations.
11821 (Target_arm::scan_reloc_for_stub): Record information about
11822 relocations for THUMB branches that might be exempted from the
11823 Cortex-A8 workaround.
11824 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11825 at the beginning of a relaxation pass.
11826
20138696
DK
118272010-01-12 Doug Kwan <dougkwan@google.com>
11828
11829 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11830 (Arm_relobj::Mapping_symbol_position,
11831 Arm_reloj::Mapping_symbol_position_less,
11832 Arm_relobj::Mapping_symbols_info): New types.
11833 (Target_arm::is_mapping_symbol_name): New method definition.
11834 (Arm_relobj::do_count_local_symbols): Save information about mapping
11835 symbols.
11836
089d69dc
DK
118372010-01-11 Doug Kwan <dougkwan@google.com>
11838
11839 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11840 Arm_relocate_functions::thumb32_branch_upper,
11841 Arm_relocate_functions::thumb32_branch_lower,
11842 Arm_relocate_functions::thumb32_cond_branch_offset,
11843 Arm_relocate_functions::thumb32_cond_branch_upper,
11844 Arm_relocate_functions::thumb32_cond_branch_lower,
11845 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11846 branch offset encoding.
11847 (Arm_relocate_functions::thumb_branch_common): Use new branch
11848 offset encoding methods to avoid code duplication.
11849 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11850 (Stub_addend_reader::operator()): Use new branch encoding method
11851 to avoid code duplication.
11852
99e5bff2
DK
118532010-01-11 Doug Kwan <dougkwan@google.com>
11854
11855 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11856 (Target_arm::do_finalize_sections): Define special EXIDX section
11857 symbols only if referenced.
11858 * gc.h (Garbage_collection::add_reference): New method.
11859 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11860 code duplication.
11861
98e090bd
ILT
118622010-01-11 Ian Lance Taylor <iant@google.com>
11863
d0a91bd8
ILT
11864 * script.cc (Version_script_info::build_expression_list_lookup):
11865 Change complaing about duplicate wildcard match from error to
11866 warning.
11867
98e090bd
ILT
11868 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11869 of 2009-12-30.
11870 (Version_script_info::Version_script_info): Initialize globs_,
11871 default_version_, default_is_global_, and exact_. Don't
11872 initialize globals_ or locals_.
11873 (Version_script_info::build_lookup_tables): Build local symbols
11874 first.
11875 (Version_script_info::unquote): New function.
11876 (Version_script_info::add_exact_match): New function.
11877 (Version_script_info::build_expression_list_lookup): Remove lookup
11878 parameter. Add is_global parameter. Change all callers. Handle
11879 wildcard pattern specially. Unquote pattern. Call
11880 add_exact_match.
11881 (Version_script_info::get_name_to_match): New function.
11882 (Version_script_info::get_symbol_version): New function.
11883 (Version_script_info::get_symbol_version_helper): Remove.
11884 (Version_script_info::check_unmatched_names): Call unquote.
11885 * script.h (class Version_script_info): Change get_symbol_version
11886 to be non-inline and add is_global parameter; change all callers.
11887 Rewrite symbol_is_local. Update declarations. Define struct
11888 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11889 Remove globals_ and locals_ members. Add exact_, globs_,
11890 default_version_, is_global_.
11891 (Version_script_info::Glob): Remove pattern, add expression and
11892 is_global. Update constructor. Change all callers.
11893 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11894 default version.
11895 (Versions::symbol_section_contents): If a symbol is undefined, or
11896 defined in a dynamic object, set the version index to
11897 VER_NDX_LOCAL.
11898 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11899 symbol_is_local.
11900 (Symbol_table::add_from_pluginobj): Likewise.
11901 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11902
d56962d3
DK
119032010-01-11 Doug Kwan <dougkwan@google.com>
11904
11905 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11906 (incremental_dump_LDADD): Add linking option for libintl.
11907 * Makefile.in: Regenerate.
11908
94e6ee91
L
119092010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11910
11911 PR gold/11144
11912 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11913 instead of -Ds.
11914 * testsuite/Makefile.in: Regenerated.
11915
e96c574b
DK
119162010-01-10 Doug Kwan <dougkwan@google.com>
11917
11918 * options.h (DEFINE_var): Use parentheses around argument varname__
11919 in macro body to avoid any unintended subsequent substitutions.
11920
7198066b
ILT
119212010-01-10 Ian Lance Taylor <iant@google.com>
11922
ba4d53bf
ILT
11923 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11924 candidates before doing symbol resolution.
11925
7198066b
ILT
11926 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11927 ODR candidates if only one is weak.
11928
a2beed37
ILT
119292010-01-08 Ian Lance Taylor <iant@google.com>
11930
11931 * script.cc (Version_script_info::build_expression_list_lookup):
11932 Don't warn about ambiguous version, just record the ambiguity.
11933 (Version_script_info::get_symbol_version_helper): Give error if
11934 version is ambiguous.
11935
2fb7225c
DK
119362010-01-08 Doug Kwan <dougkwan@google.com>
11937
11938 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11939 prev_data_size_ and prev_addralign_. Remove initializer for
11940 deleted data member has_been_changed_.
11941 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11942 to determine if the table is empty.
11943 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11944 Remove.
11945 (Stub_table::add_reloc_stub): Define method in class definition
11946 instead of just declaring it there.
11947 (Stub_table::add_cortex_a8_stub): New method definition.
11948 (Stub_table::update_data_size_and_addralign): Ditto.
11949 (Stub_table::finalize_stubs): Ditto.
11950 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11951 (Stub_table::do_addralign_): Return address alignment in the
11952 (Stub_table::do_reset_address_and_file_offset): Define method in
11953 class definition instead of declaring it there. Set current data
11954 size to be the data size of the previous pass.
11955 (Stub_table::set_final_data_size): Use current data size as the
11956 final data size.
11957 (Stub_table::relocate_stub): Change parameter type of stub from
11958 Reloc_stub pointer to Stub pointer.
11959 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11960 (Stub_table::Cortex_a8_stub_list): New typedef.
11961 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11962 Stub_table::prev_addralign_): New data member.
11963 (Arm_relobj::Arm_relobj): Initialize data member
11964 section_has_cortex_a8_workaround_.
11965 (Arm_relobj::section_has_cortex_a8_workaround,
11966 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11967 definitions.
11968 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11969 declarations.
11970 (Target_arm::relocate_stub): Change parameter type of stub from
11971 Reloc_stub pointer to Stub pointer.
11972 (Insn_template::size, Insn_template::alignment): Handle
11973 THUMB16_SPECIAL_TYPE.
11974 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11975 Stub_table::update_data_size_and_addralign,
11976 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11977 definitions.
11978 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11979 (Stub_table::do_write): Ditto.
11980 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11981
880cd20d
ILT
119822010-01-08 Ian Lance Taylor <iant@google.com>
11983
11984 PR 11108
11985 * symtab.h (class Symbol): Remove fields is_target_special_ and
11986 has_plt_offset_. Add field is_defined_in_discarded_section_.
11987 (Symbol::is_defined_in_discarded_section): New function.
11988 (Symbol::set_is_defined_in_discarded_section): New function.
11989 (Symbol::has_plt_offset): Rewrite.
11990 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11991 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11992 Don't initialize is_target_special_ or has_plt_offset_.
11993 Initialize is_defined_in_discarded_section_.
11994 (Symbol_table::add_from_relobj): If appropriate, set
11995 is_defined_in_discarded_section.
11996 * resolve.cc (Symbol::override_base_with_special): Don't test
11997 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11998 * target-reloc.h (relocate_section): Do special handling for
11999 symbols defined in discarded sections for global symbols as well
12000 as local symbols.
12001
2703e3eb
ILT
120022010-01-08 Ian Lance Taylor <iant@google.com>
12003
12004 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
12005 the SHT_SYMTAB case.
12006
339d40a3
ILT
120072010-01-08 Ian Lance Taylor <iant@google.com>
12008
12009 * object.cc (Sized_relobj::do_layout): Don't get confused if
12010 layout_eh_frame returns NULL.
12011
abecea76
ILT
120122010-01-08 Ian Lance Taylor <iant@google.com>
12013
12014 PR 11084
12015 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
12016 dynamic symbol table, use the normal symbol table.
12017 (Sized_dynobj::do_read_symbols): Remove assertion about type of
12018 symbol table.
12019
6b7dd3f3
ILT
120202010-01-08 Ian Lance Taylor <iant@google.com>
12021
12022 PR 11072
12023 * layout.cc (Layout::include_section): Remove .gnu_debuglink
12024 sections.
12025
36c50e63
L
120262010-01-08 H.J. Lu <hongjiu.lu@intel.com>
12027
12028 * version.cc (print_version): Change to "Copyright 2010".
12029
e291e7b9
ILT
120302010-01-08 Ian Lance Taylor <iant@google.com>
12031
12032 PR 10287
12033 PR 11063
12034 * i386.cc (class Target_i386): Change return type of plt_section
12035 to be non-const.
12036 (class Output_data_plt_i386): Add tls_desc_rel_ field.
12037 (Output_data_plt_i386::Output_data_plt_i386): Initialize
12038 tls_desc_rel_ field.
12039 (Output_data_plt_i386::rel_tls_desc): New function.
12040 (Target_i386::rel_tls_desc_section): New function.
12041 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
12042 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
12043 R_386_TLS_DESC reloc in rel_tls_desc_section.
12044 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
12045 Define struct Tlsdesc_info.
12046 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
12047 (Target_x86_64::do_reloc_symbol_index): New function.
12048 (Target_x86_64::add_tlsdesc_info): New function.
12049 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
12050 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
12051 tlsdesc_rel_ field.
12052 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
12053 all callers.
12054 (Output_data_plt_x86_64::rela_tlsdesc): New function.
12055 (Target_x86_64::rela_tlsdesc_section): New function.
12056 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
12057 handling.
12058 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
12059 (Target_x86_64::do_reloc_addend): New function.
12060 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
12061 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
12062 declarations. Define TARGET_CODE. Add arg field to u1_ union.
12063 (Output_reloc::type): New function.
12064 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
12065 (Output_reloc::is_target_specific): New function.
12066 (Output_reloc::target_arg): New function.
12067 (class Output_reloc) [SHT_RELA]: Add four new constructors for
12068 absolute relocs and target specific relocs.
12069 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
12070 add_target_specific.
12071 (class Output_data_reloc) [SHT_RELA]: Likewise.
12072 * output.cc (Output_reloc::Output_reloc): Add four new versions
12073 for absolute relocs and target specific relocs.
12074 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
12075 (Output_reloc::get_symbol_index): Likewise.
12076 (Output_reloc::local_section_offset): Check that local_sym_index_
12077 is not TARGET_CODE or 0.
12078 (Output_reloc::symbol_value): Likewise.
12079 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12080 reloc.
12081 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12082 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12083 functions.
12084 * layout.cc (add_target_dynamic_tags): Use output section for
12085 DT_PLTRELSZ and DT_JMPREL.
12086
3a44184e
ILT
120872010-01-07 Ian Lance Taylor <iant@google.com>
12088
12089 PR 11061
12090 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12091 function.
12092 (class Output_data_reloc_generic): Define.
12093 (class Output_data_reloc_base): Change base class to
12094 Output_data_reloc_generic. Change add() method to call
12095 bump_relative_reloc_count for a relative reloc. Remove
12096 sort_relocs_ field.
12097 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12098 to sort_relocs().
12099 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12100 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12101 appropriate.
12102 * layout.h (class Layout): Update declaration.
12103
ea715a34
ILT
121042010-01-07 Ian Lance Taylor <iant@google.com>
12105
12106 * output.h (class Output_data): Add const version of
12107 output_section and do_output_section.
12108 (class Output_section_data): Add const version of
12109 do_output_section.
12110 (class Output_section): Likewise.
12111 * layout.cc (Layout::add_target_dynamic_tags): New function.
12112 * layout.h (class Layout): Update declarations.
12113 * arm.cc (Target_arm::do_finalize_sections): Use
12114 add_target_dynamic_tags.
12115 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12116 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12117 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12118 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12119
659948a4
ILT
121202010-01-07 Ian Lance Taylor <iant@google.com>
12121
12122 PR 11042
12123 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12124 object as needed.
12125
9d3b86f6
ILT
121262010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12127 Ian Lance Taylor <iant@google.com>
12128
12129 PR 11019
12130 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12131 Xindex::read_symtab_xindex.
12132
bb0d3eb0
DK
121332010-01-07 Doug Kwan <dougkwan@google.com>
12134
12135 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12136 (Insn_template::thumb16_bcond_insn): New method declaration.
12137 (Insn_template): Fix spelling.
12138 (Stub::thumb16_special): New method declaration.
12139 (Stub::do_write): Define virtual method which was previously pure
12140 virtual.
12141 (Stub::do_thumb16_special): New method declaration.
12142 (Stub::do_fixed_endian_write): New template member.
12143 (Reloc_stub::do_write): Remove.
12144 (Reloc_stub::do_fixed_endian_write): Remove.
12145 (Cortex_a8_stub): New class definition.
12146 (Stub_factory::make_cortex_a8_stub): New method definition.
12147 (Stub_factory::Stub_factory): Add missing static storage class
12148 qualifier for elf32_arm_stub_a8_veneer_blx.
12149
ffeef7df
ILT
121502010-01-07 Ian Lance Taylor <iant@google.com>
12151
dc3f80fe
ILT
12152 PR 10980
12153 * options.h (class General_options): Add --warn-unresolved-symbols
12154 and --error-unresolved-symbols.
12155 * errors.cc (Errors::undefined_symbol): Implement
12156 --warn-unresolved-symbols.
12157
ffeef7df
ILT
12158 * options.h (class General_options): Add -z text and -z textoff.
12159 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12160
f1ec9ded
ST
121612010-01-06 Sriraman Tallam <tmsriram@google.com>
12162
12163 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12164 (Garbage_collection::cident_sections): New function.
12165 (Garbage_collection::add_cident_section): New function.
12166 (Garbage_collection::cident_sections_): New member.
12167 (gc_process_relocs): Add references to sections whose names are C
12168 identifiers.
12169 * gold.h (cident_section_start_prefix): New constant.
12170 (cident_section_stop_prefix): New constant.
12171 (is_cident): New function.
12172 * layout.cc (Layout::define_section_symbols): Replace string constants
12173 with the newly defined constants.
12174 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12175 C identifiers.
12176 * testsuite/Makefile.am: Add gc_orphan_section_test.
12177 * testsuite/Makefile.in: Regenerate.
12178 * testsuite/gc_orphan_section_test.cc: New file.
12179 * testsuite/gc_orphan_section_test.sh: New file.
12180
6eda8c29
ILT
121812010-01-06 Ian Lance Taylor <iant@google.com>
12182
b9674e17
ILT
12183 PR 10980
12184 * options.h (class General_options): Add --warn-shared-textrel.
12185 * layout.cc (Layout::finish_dynamic_section): Implement
12186 --warn-shared-textrel.
12187
6eda8c29
ILT
12188 PR 10980
12189 * options.h (class General_options): Add --warn-multiple-gp.
12190
32dcd44e
ILT
121912010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12192
12193 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12194 $(THREADSLIB) and $(LIBDL).
12195 * Makefile.in: Rebuild.
12196
a192ba05
ILT
121972010-01-06 Ian Lance Taylor <iant@google.com>
12198
12199 PR 10980
12200 * options.cc (General_options::parse_section_start): New function.
12201 (General_options::section_start): New function.
12202 (General_options::General_options): Initialize all members.
12203 * options.h: Include <map>
12204 (class General_options): Add --section-start. Add section_starts_
12205 member.
12206 * layout.cc (Layout::attach_allocated_section_to_segment): If
12207 --section-start was used, set the address of the segment. Remove
12208 local sort_sections.
12209 (Layout::relaxation_loop_body): If the address of the load segment
12210 has been set by --section-start, don't use it.
12211 * output.h (Output_segment::update_flags_for_output_section): New
12212 function.
12213 * output.cc (Output_segment::add_output_section): Call
12214 update_flags_for_output_section.
12215
dde3f402
ILT
122162010-01-05 Ian Lance Taylor <iant@google.com>
12217
62dfdd4d
ILT
12218 PR 10980
12219 * options.h (class General_options): Add --undefined-version.
12220 * script.cc (struct Version_expression): Add was_matched_by_symbol
12221 field.
12222 (Version_script_info::matched_symbol): New function.
12223 (Version_script_info::get_symbol_version_helper): Call
12224 matched_symbol.
12225 (Version_script_info::check_unmatched_names): New function.
12226 * script.h (class Version_script_info): Update declarations.
12227 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12228
9c4ae156
ILT
12229 * options.h (class General_options): Use DEFINE_bool_alias for
12230 allow_multiple_definition.
12231 * resolve.cc (Symbol_table::should_override): Don't test
12232 allow_multiple_definition.
12233
dde3f402
ILT
12234 PR 10980
12235 * options.h (class General_options): Add --cref.
12236 * main.cc (main): Print cref table if --cref. Don't close mapfile
12237 until after printing cref table.
12238 * cref.cc: Include "symtab.h".
12239 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12240 (Cref_table_compare::operator()): New function.
12241 (Cref_inputs::gather_cref): New function.
12242 (filecol): New static const.
12243 (Cref_inputs::print_cref): New function.
12244 (Cref::print_cref): New function.
12245 * cref.h: Include <cstdio>.
12246 (class Cref): Update declarations.
12247 * mapfile.h (Mapfile::file): New function.
12248 * object.h (class Object): Define Symbols. Declare virtual
12249 do_get_global_symbols.
12250 (Object::get_global_symbols): New function.
12251 * object.cc (Input_objects::add_object): Pass object to cref_ if
12252 --cref.
12253 (Input_objects::archive_start): Likewise.
12254 (Input_objects::archive_stop): Likewise.
12255 (Input_objects::print_cref): New function.
12256 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12257 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12258 --cref.
12259 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12260 function.
12261 * plugin.h (class Sized_pluginobj): Update declarations.
12262
8781f709
ILT
122632010-01-05 Ian Lance Taylor <iant@google.com>
12264
12265 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12266 to is_default_version. Rename insdef to insdefault.
12267 (Symbol_table::add_from_relobj): Rename def to is_default_version
12268 and local to is_forced_local.
12269 (Symbol_table::add_from_pluginobj): Likewise.
12270 (Symbol_table::add_from_dynobj): Likewise.
12271 (Symbol_table::define_special_symbol): Rename insdef to
12272 insdefault.
12273
fe35d28d
ILT
122742010-01-04 Ian Lance Taylor <iant@google.com>
12275
30bc8c46
ILT
12276 PR 10980
12277 * options.h (class General_options): Add
12278 --allow-multiple-definition and -z muldefs.
12279 * resolve.cc (Symbol_table::should_override): Don't warn about a
12280 multiple symbol definition if --allow-multiple-definition or -z
12281 muldefs.
12282
7eaea549
ILT
12283 PR 10980
12284 * options.h (class General_options): Add --add-needed and
12285 --copy-dt-needed-entries. Tweak --as-needed help entry.
12286 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12287 error if --copy-dt-needed-entries aka --add-needed is used and
12288 would cause a change in behaviour.
12289
fe35d28d
ILT
12290 PR 10980
12291 * options.h (class General_options): Add -G as a short version of
12292 --shared. Add no-op options -assert, -g, and -i.
12293
55a2bb35
ST
122942010-01-04 Sriraman Tallam <tmsriram@google.com>
12295
12296 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12297 check for .text or .gnu.linkonce.t sections.
12298 * icf.cc (Icf::find_identical_sections): Ditto.
12299 Change the detection for mangled function name within the section
12300 name.
12301 * icf.h (is_section_foldable_candidate): New function.
12302
719328e1
ILT
123032009-12-30 Ian Lance Taylor <iant@google.com>
12304
12305 PR 10980
12306 * options.h (class General_options): Permit two dashes with
12307 --retain-symbols-file.
12308
d7bb5745
ILT
123092009-12-30 Ian Lance Taylor <iant@google.com>
12310
403a15dd
ILT
12311 PR 10979
12312 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12313 don't put the file header and segment headers in the text
12314 segment.
12315
eda294df
ILT
12316 PR 10979
12317 * common.cc (Sort_commons::operator()): Stabilize sort when both
12318 entries are NULL.
12319 (Symbol_table::do_allocate_commons_list): When allocating common
12320 symbols, skip a symbol which is no longer common.
12321 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12322 an object before checking its type.
12323 * testsuite/common_test_2.c: New file.
12324 * testsuite/common_test_3.c: New file.
12325 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12326 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12327 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12328 (common_test_2_pic.o, common_test_2.so): New targets.
12329 (common_test_3_pic.o, common_test_3.so): New targets.
12330 * testsuite/Makefile.in: Rebuild.
12331
d7bb5745
ILT
12332 PR 10979
12333 * script.cc (read_input_script): If we see a new SECTIONS clause,
12334 and we have added an input section, give an error.
12335 * layout.h (class Layout): Add have_added_input_section function.
12336 Add have_added_input_section_ field.
12337 * layout.cc (Layout::Layout): Initialize
12338 have_added_input_section_.
12339 (Layout::layout): Set have_added_input_section_.
12340 (Layout::layout_eh_frame): Likewise.
12341
fc59c572
ILT
123422009-12-30 Ian Lance Taylor <iant@google.com>
12343
12344 PR 10931
12345 * options.h (class General_options): Add --sort-common option.
12346 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12347 * common.cc (Sort_common): Add sort_order parameter to
12348 constructor. Add sort_order_ field.
12349 (Sort_commons::operator): Check sort_order_.
12350 (Symbol_table::allocate_commons): Determine the sort order.
12351 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12352 Change all callers.
12353 (Symbol_table::do_allocate_commons_list): Likewise.
12354
1c74fab0
ILT
123552009-12-30 Ian Lance Taylor <iant@google.com>
12356
12357 PR 10916
12358 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12359 symbols from this object, don't change the visibility of an
12360 undefined symbol.
12361 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12362
6affe781
ILT
123632009-12-30 Ian Lance Taylor <iant@google.com>
12364
12365 PR 10861
12366 * script.h (class Version_script_info): Define Language enum.
12367 Update declarations. Define Glob, Exact, and Lookup types. Add
12368 new fields globals_, locals_, and is_finalized_.
12369 * script.cc: Various formatting fixes.
12370 (class Parser_closure): Change language_stack_ from a vector of
12371 std::string to one of Version_script_info::Language. Adjust all
12372 uses accordingly.
12373 (class Lazy_demangler): Remove.
12374 (struct Version_expression): Change language from std::string to
12375 Version_script_info::Language.
12376 (Version_script_info::Version_script_info): New function.
12377 (Version_script_info::~Version_script_info): Don't call clear.
12378 (Version_script_info::finalize): New function.
12379 (Version_script_info::build_lookup_tables): New function.
12380 (Version_script_info::build_expression_list_lookup): New
12381 function.
12382 (Version_script_info::get_symbol_version_helper): Rewrite to use
12383 lookup tables.
12384 (Version_script_info::print_expression_list): Adjust to use
12385 Version_script_info::Language.
12386 (script_push_lex_into_version_mode): Check that the version script
12387 has not been finalized.
12388 (version_script_push_lang): Change language string to
12389 Version_script_info::Language.
12390 * options.cc (Command_line::version_script): New function.
12391 * options.h (class General_options): Add finalize_dynamic_list
12392 function. Change version_script from declaration to definition.
12393 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12394 * testsuite/version_script.map: Remove duplicate def of foo.
12395 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12396 version_script.map.
12397 * testsuite/Makefile.in: Rebuild.
12398
818bf354
ILT
123992009-12-30 Ian Lance Taylor <iant@google.com>
12400
12401 PR 10843
12402 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12403 if the input symbol index is 0, make the output symbol index 0.
12404
ebcc8304
ILT
124052009-12-30 Ian Lance Taylor <iant@google.com>
12406
12407 PR 10670
12408 * options.h (class General_options): Add -x/--discard-all.
12409 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12410 --discard-all. If the local symbol needs a dynamic entry, check
12411 that before handling --discard-locals.
12412
176fe33f
ILT
124132009-12-30 Ian Lance Taylor <iant@google.com>
12414
bb321bb1
ILT
12415 PR 10450
12416 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12417 flags to PF_R.
12418 (Output_segment::add_output_section): Don't change the flags if
12419 the type is PT_TLS.
12420
176fe33f
ILT
12421 PR 10450
12422 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12423 GNU hash table if they need a dynamic value. Otherwise, don't add
12424 them if they are defined in a dynamic object or are forced local.
12425
e8cd95c7
ILT
124262009-12-29 Ian Lance Taylor <iant@google.com>
12427
1b81fb71
ILT
12428 PR 10450
12429 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12430 .gnu.hash table for a 32-bit target.
12431
8d6d383d
ILT
12432 PR 10450
12433 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12434 regular and a dynamic object only needs a dynamic symbol table
12435 entry if it is externally visible.
12436
e785ec03
ILT
12437 PR 10450
12438 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12439 constructor. Add global_offset_table_ field.
12440 (Target_i386::got_section): Set global_offset_table_.
12441 (Target_i386::do_finalize_sections): Set global_offset_table_
12442 size.
12443 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12444 in constructor. Add global_offset_table_ field.
12445 (Target_x86_64::got_section): Set global_offset_table_.
12446 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12447 size.
12448
1a2dff53
ILT
12449 * layout.cc (Layout::Layout): Initialize increase_relro_.
12450 (Layout::get_output_section): Add is_relro, is_last_relro, and
12451 is_first_non_relro parameters. Change all callers.
12452 (Layout::choose_output_section): Likewise.
12453 (Layout::add_output_section_data): Likewise.
12454 (Layout::make_output_section): Likewise.
12455 (Layout::set_segment_offsets): Clear increase_relro when using a
12456 linker script.
12457 * layout.h (class Layout): Add increase_relro method. Add
12458 increase_relro_ field. Update declarations.
12459 * output.cc (Output_section::Output_section): Initialize
12460 is_last_relro_ and is_first_non_relro_.
12461 (Output_segment::add_output_section): Group relro sections is
12462 do_sort is true. Handle is_last_relro and is_first_non_relro.
12463 (Output_segment::maximum_alignment): Remove relro handling.
12464 (Output_segment::set_section_addresses): Add increase_relro
12465 parameter. Change all callers. Add initial alignment to align
12466 relro sections on separate page. Remove old relro handling.
12467 (Output_segment::set_section_list_addresses): Remove in_relro
12468 parameter. Change all callers.
12469 (Output_segment::set_offset): Add increase parameter. Change all
12470 callers. Remove old relro handling.
12471 * output.h (class Output_section): Add new methods: is_last_relro,
12472 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12473 Add is_last_relro_ and is_first_non_relro_ fields.
12474 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12475 Create separate .got.plt section. Call increase_relro.
12476 * x86_64.cc (Target_x86_64::got_section): Likewise.
12477 * testsuite/relro_script_test.t: Add .got.plt.
12478
f0ba79e2
ILT
12479 PR 10450
12480 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12481 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12482 (Layout::finalize): Call set_dynamic_symbol_size.
12483 (Layout::set_dynamic_symbol_size): New function.
12484 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12485 set_dynamic_symbol_size.
12486
e8cd95c7
ILT
12487 PR 10450
12488 * output.h (class Output_section): Add is_entsize_zero_ field.
12489 * output.cc (Output_section::Output_section): Initialize
12490 is_entsize_zero_.
12491 (Output_section::set_entsize): If two different entsizes are
12492 requested, force it to zero.
12493 (Output_section::add_input_section): Set flags for .debug_str
12494 before updating section flags. Set entsize.
12495 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12496 and SHF_STRING if all input sections have those flags.
12497
3e1b9a8a
RÁE
124982009-12-29 Rafael Espindola <espindola@google.com>
12499
12500 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12501 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12502 reporting.
3e1b9a8a 12503
3dcad376
ST
125042009-12-29 Sriraman Tallam <tmsriram@google.com>
12505
12506 * options.cc (General_options::parse_version): Allow -v to exit
12507 without an error if there is nothing to link.
12508
084e2665
ILT
125092009-12-29 Ian Lance Taylor <iant@google.com>
12510
12511 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12512 using a version of gcc before 4.1.
12513 * configure: Rebuild.
12514
250acde3
CD
125152009-12-28 Chris Demetriou <cgd@google.com>
12516
12517 * attributes.cc (Output_attributes_section_data::do_write): Use
12518 std::vector::front rather than std::vector::data.
12519
99fff23b
ILT
125202009-12-28 Ian Lance Taylor <iant@google.com>
12521
12522 * symtab.h (class Symbol_table): Add enum Defined.
12523 * resolve.cc (Symbol_table::should_override): Add defined
12524 parameter. Change all callers. Test whether object is NULL
12525 before calling a method on it.
12526 (Symbol_table::report_resolve_problem): Add defined parameter.
12527 Change all callers.
12528 (Symbol_table::should_override_with_special): Likewise.
12529 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12530 parameter. Change all callers.
12531 (Symbol_table::do_define_in_output_data): Likewise.
12532 (Symbol_table::define_in_output_segment): Likewise.
12533 (Symbol_table::do_define_in_output_segment): Likewise.
12534 (Symbol_table::define_as_constant): Likewise.
12535 (Symbol_table::do_define_as_constant): Likewise.
12536 * script.h (class Symbol_assignment): Add is_defsym parameter to
12537 constructor; change all callers.
12538 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12539 parameter. Change all callers. Add is_defsym_ field.
12540 (class Parser_closure): Add parsing_defsym parameter to
12541 constructor; change all callers. Add parsing_defsym accessor
12542 function. Add parsing_defsym_ field.
12543
556bd683
ILT
125442009-12-28 Ian Lance Taylor <iant@google.com>
12545
12546 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12547 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12548
1782c879
ILT
125492009-12-23 Ian Lance Taylor <iant@google.com>
12550
12551 * i386.cc (Target_i386::do_calls_non_split): Recognize
12552 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12553 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12554 -fsplit-stack prologue when using %r11.
1782c879 12555
329ca2b1
ST
125562009-12-21 Sriraman Tallam <tmsriram@google.com>
12557
12558 * options.cc (General_options::parse_version): Make -v continue and do
12559 the link like GNU ld does.
12560
d675ff46
RÁE
125612009-12-17 Rafael Avila de Espindola <espindola@google.com>
12562
12563 * Makefile.am (CCFILES): Add timer.cc.
12564 (HFILES): Add timer.h.
12565 * configure.ac: Check for sysconf and times.
12566 * main.cc: include timer.h.
12567 (main): Use Timer instead of get_run_time.
12568 * timer.cc: New.
12569 * timer.h: New.
12570 * workqueue.cc: include timer.h.
12571 (Workqueue::find_and_run_task):
12572 Report user, sys and wall time.
12573 * Makefile.in: Regenerate.
12574 * config.in: Regenerate.
12575 * configure: Regenerate.
12576
d6344fb5
DK
125772009-12-16 Doug Kwan <dougkwan@google.com>
12578
12579 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12580 sections.
12581 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12582 relaxed input sections.
12583 * output.cc (Output_section::find_relaxed_input_section): Change
12584 return type to Output_relaxed_input_section pointer. Adjust code
12585 for new type of relaxed_input_section_map_.
12586 * output.h (Output_section::find_relaxed_input_section): Change
12587 return type to Output_relaxed_input_section pointer.
12588 (Output_section::Output_relaxed_input_section_by_input_section_map):
12589 New type.
12590 (Output_section::relaxed_input_section_map_): Change type to
12591 Output_section::Output_relaxed_input_section_by_input_section_map.
12592 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12593 input section.
12594
0e0d5469
ILT
125952009-12-15 Ian Lance Taylor <iant@google.com>
12596
12597 * layout.cc (Layout::create_shstrtab): Only write out after input
12598 sections if we are compressing debug sections.
12599
0649a889
ILT
126002009-12-15 Ian Lance Taylor <iant@google.com>
12601
12602 * archive.cc (Archive::add_symbols): Only look up a symbol without
12603 a version if there is, in fact, a version.
12604
2ea97941
ILT
126052009-12-14 Ian Lance Taylor <iant@google.com>
12606
12607 Revert -Wshadow changes, all changes from:
12608 2009-12-11 Doug Kwan <dougkwan@google.com>
12609 2009-12-11 Nick Clifton <nickc@redhat.com>
12610 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12611
b0eec2cc
DK
126122009-12-11 Doug Kwan <dougkwan@google.com>
12613
12614 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12615 due to -Wshadow.
12616 * attributes.cc (Object_attribute::size): Ditto.
12617 (Attributes_section_data::size): Ditto.
12618 (Attributes_section_data::Attributes_section_data): Ditto.
12619 (Output_attributes_section_data::do_write): Ditto.
12620 * attributes.h (Object_attribute::set_type): Ditto.
12621 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12622
91d6fa6a
NC
126232009-12-11 Nick Clifton <nickc@redhat.com>
12624
12625 * archive.cc: Fix shadowed variable warnings.
12626 * arm.cc: Likewise.
12627 * compressed_output.cc: Likewise.
12628 * compressed_output.h: Likewise.
12629 * configure: Likewise.
12630 * dwarf_reader.cc: Likewise.
12631 * dynobj.cc: Likewise.
12632 * dynobj.h: Likewise.
12633 * ehframe.cc: Likewise.
12634 * ehframe.h: Likewise.
12635 * errors.cc: Likewise.
12636 * expression.cc: Likewise.
12637 * fileread.cc: Likewise.
12638 * fileread.h: Likewise.
12639 * freebsd.h: Likewise.
12640 * i386.cc: Likewise.
12641 * icf.cc: Likewise.
12642 * incremental.h: Likewise.
12643 * layout.cc: Likewise.
12644 * layout.h: Likewise.
12645 * mapfile.cc: Likewise.
12646 * merge.cc: Likewise.
12647 * merge.h: Likewise.
12648 * object.cc: Likewise.
12649 * object.h: Likewise.
12650 * options.h: Likewise.
12651 * output.cc: Likewise.
12652 * output.h: Likewise.
12653 * parameters.cc: Likewise.
12654 * plugin.cc: Likewise.
12655 * powerpc.cc: Likewise.
12656 * reduced_debug_output.cc: Likewise.
12657 * reduced_debug_output.h: Likewise.
12658 * reloc.cc: Likewise.
12659 * reloc.h: Likewise.
12660 * resolve.cc: Likewise.
12661 * script-sections.cc: Likewise.
12662 * script.cc: Likewise.
12663 * script.h: Likewise.
12664 * sparc.cc: Likewise.
12665 * symtab.cc: Likewise.
12666 * symtab.h: Likewise.
12667 * target-select.cc: Likewise.
12668 * target-select.h: Likewise.
12669 * token.h: Likewise.
12670 * workqueue.cc: Likewise.
12671 * workqueue.h: Likewise.
12672 * x86_64.cc: Likewise.
12673
a0351a69
DK
126742009-12-10 Doug Kwan <dougkwan@google.com>
12675
12676 * arm.cc (attributes.h): New include.
12677 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12678 (Arm_relobj::~Arm_relobj): Delete object pointed by
12679 attributes_section_data_.
12680 (Arm_relobj::attributes_section_data): New method definition.
12681 (Arm_relobj::attributes_section_data_): New data member declaration.
12682 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12683 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12684 attributes_section_data_.
12685 (Arm_dynobj::attributes_section_data): New method definition.
12686 (Arm_dynobj::attributes_section_data_): New data member declaration.
12687 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12688 initialization value of may_use_blx_ to false.
2e702c99 12689 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12690 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12691 object attributes to compute results instead of hard-coding.
12692 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12693 Target_arm::get_secondary_compatible_arch,
12694 Target_arm::set_secondary_compatible_arch
12695 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12696 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12697 New method declarations.
12698 (Target_arm::get_aeabi_object_attribute): New method definition.
12699 (Target_arm::attributes_section_data_): New data member declaration.
12700 (read_arm_attributes_section): New template definition.
12701 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12702 (Arm_dynobj::do_read_symbols): Ditto.
12703 (Target_arm::do_finalize_sections): Merge attributes sections from
12704 input. Check for BLX use after attributes section merging.
12705 Fix __exidx_start and __exidx_end visibility. Create an
12706 .ARM.attributes section if necessary.
12707 (Target_arm::get_secondary_compatible_arch,
12708 Target_arm::set_secondary_compatible_arch,
12709 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12710 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12711 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12712 New method definitions.
12713
b59befec
ILT
127142009-12-09 Ian Lance Taylor <iant@google.com>
12715
12716 * plugin.cc (Plugin::load): Don't cast from void* to a function
12717 pointer.
12718
1276bc89
ILT
127192009-12-09 Ian Lance Taylor <iant@google.com>
12720
12721 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12722 information fields.
12723
2f2de248
L
127242009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12725
12726 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12727 Replace two_file_shared_1.so with two_file_shared_2.so.
12728 * testsuite/Makefile.in: Regenerated.
12729
4f787271
DK
127302009-12-08 Doug Kwan <dougkwan@google.com>
12731
12732 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12733 (HFILES): Add attributes.h and int_encoding.h.
12734 * Makefile.in: Regenerate.
12735 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12736 function definitions to int_encoding.cc
12737 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12738 prototypes to int_encoding.h
12739 * reduced_debug_output.cc (int_encoding.h): New include.
12740 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12741 function definitions to int_encoding.cc
12742 (insert_into_vector, read_from_pointer): Move template definitions to
12743 int_encoding.h
12744 * attributes.cc: New file.
12745 * attributes.h: New file.
12746 * int_encoding.cc: New file.
12747 * int_encoding.h: New file.
12748
20b52f1a
RÁE
127492009-12-07 Rafael Avila de Espindola <espindola@google.com>
12750
12751 PR gold/11055
12752 * incremental-dump.cc (dump_incremental_inputs): New.
12753 (main): Use dump_incremental_inputs.
12754
53d7974c
L
127552009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12756
12757 PR gold/10893
12758 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12759 checking elfcpp::STT_FUNC.
12760 (Target_i386::Relocate::relocate): Likewise.
12761 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12762
12763 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12764 symbols from shared libraries into normal FUNC symbols.
12765
12766 * symtab.h (Symbol): Add is_func and use it.
12767
05a352e6
DK
127682009-12-05 Doug Kwan <dougkwan@google.com>
12769
12770 * arm.cc (Target_arm::arm_info): Initialize new fields
12771 attributes_section and attributes_vendor.
12772 * i386.cc (Target_i386::i386_info): Same.
12773 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12774 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12775 fields attributes_section and attributes_vendor.
53d7974c 12776 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12777 * target.h (Target::attributes_section, Target::attributes_vendor,
12778 Target::is_attributes_section, Target::attribute_arg_type,
12779 Target::attributes_order): New method definitions.
12780 (Target::Target_info::attributes_section,
12781 Target::Target_info::attributes_vendor): New fields.
12782 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12783 virtual method definitions.
12784 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12785 attributes_section and attributes_vendor.
12786 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12787
f4e5969c
DK
127882009-12-05 Doug Kwan <dougkwan@google.com>
12789
12790 * arm.cc: Update comments about interworking and stub generation.
12791 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12792 considered as non-PIC.
12793 (Arm_relocate_functions::base_abs): Fix formatting.
12794 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12795 of function to use GOT entry address instead of offset.
12796 (Target_arm::Scan::global): Issue an error if a symbol would need a
12797 PLT does not get one because it is untyped. Remove code to create
12798 dynamic symbols for relative branches.
12799 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12800 takes unsigned integer instead of boolean.
12801
1abce4a6
L
128022009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12803
12804 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12805 (two_file_test_LDADD): Likewise.
12806 (common_test_1_LDADD): Likewise.
12807 (exception_test_LDADD) Likewise.
12808 (weak_test_LDADD): Likewise.
12809 (many_sections_test_LDADD): Likewise.
12810 (initpri1_LDADD): Likewise.
12811 (script_test_1_LDADD): Likewise.
12812 (script_test_2_LDADD): Likewise.
12813 (justsyms_LDADD): Likewise.
12814 (binary_test_LDADD): Likewise.
12815 (large_LDADD): Likewise.
12816 * testsuite/Makefile.in: Regenerated.
12817
adcf2816 128182009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12819
adcf2816
L
12820 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12821 (Symbol_table::override_with_special): Likewise.
12822 (Symbol_table::add_from_object): Likewise.
12823
28e67f5d
RÁE
128242009-12-04 Rafael Avila de Espindola <espindola@google.com>
12825
12826 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12827 Don't set the data_offset twice.
12828
ae10a101
RÁE
128292009-12-04 Rafael Avila de Espindola <espindola@google.com>
12830
12831 * testsuite/Makefile.in: Regenerate.
12832
f59f41f3
DK
128332009-12-03 Doug Kwan <dougkwan@google.com>
12834
12835 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12836 (Target_arm::do_finalize_sections): Add parameter for symbol table
12837 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12838 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12839 parameter for symbol table pointer.
12840 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12841 an additional parameter for a pointer to symbol table.
12842 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12843 parameter for a symbol table pointer.
12844 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12845 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12846 Ditto.
12847 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12848 parameter for a symbol table pointer.
12849
ca55d848
RÁE
128502009-12-03 Rafael Avila de Espindola <espindola@google.com>
12851
12852 * incremental.cc (Incremental_inputs_header)
12853 (Incremental_inputs_header_write, Incremental_inputs_entry)
12854 (Incremental_inputs_entry_write): Move ...
12855 * incremental.h (Incremental_inputs_header)
12856 (Incremental_inputs_header_write, Incremental_inputs_entry)
12857 (Incremental_inputs_entry_write): here.
12858
3aec4f9c
RÁE
128592009-12-02 Rafael Avila de Espindola <espindola@google.com>
12860
12861 * incremental.cc (make_sized_incremental_binary): Set the target.
12862 Error if it is incompatible.
12863 * output.h (Output_file): Add filename method.
12864
9c0ae74d
RÁE
128652009-12-02 Rafael Avila de Espindola <espindola@google.com>
12866
12867 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12868 from the get_* methods.
12869
a45500ae
RÁE
128702009-12-02 Rafael Avila de Espindola <espindola@google.com>
12871
12872 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12873 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12874 Write 0 for the data_offset of scripts.
12875
325e6408
RÁE
128762009-12-02 Rafael Avila de Espindola <espindola@google.com>
12877
12878 * testsuite/Makefile.am: Add the incremental_test.sh test.
12879 * testsuite/incremental_test.sh: New.
12880 * testsuite/incremental_test_1.c: New.
12881 * testsuite/incremental_test_2.c: New.
12882
954c3e2e
RÁE
128832009-12-01 Rafael Avila de Espindola <espindola@google.com>
12884
703d02da 12885 * incremental-dump.cc (main): Fix typos.
954c3e2e 12886
f8086623
RÁE
128872009-11-27 Rafael Avila de Espindola <espindola@google.com>
12888
12889 PR gold/11025
12890 * incremental-dump.cc (main): Use llu to print 64 bit values.
12891
3b0dd6ac
L
128922009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12893 H.J. Lu <hongjiu.lu@intel.com>
12894
12895 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12896 $(LIBDL).
12897 (incremental_dump_LDADD): Likewise.
12898 * Makefile.in: Regenerated.
12899
a6d1ef57 129002009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12901
a6d1ef57
DK
12902 Revert:
12903
12904 2009-11-25 Doug Kwan <dougkwan@google.com>
12905
12906 * arm.cc (Target_arm::Target_arm): Move method definition
12907 outside of class definition. Add code to handle
12908 --target1-rel, --target1-abs and --target2= options.
12909 (Target_arm::get_reloc_reloc_type): Change method to be
12910 non-static and const.
12911 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12912 New data member declaration.
12913 (Target_arm::Scan::local, Target_arm::Scan::global,
12914 Target_arm::Relocate::relocate,
12915 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12916 Adjust call to Target_arm::get_real_reloc_type.
12917 (Target_arm::get_real_reloc_type): Use command line options
12918 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12919 * options.h (--target1-rel, --target1-abs, --target2): New
12920 ARM-only options.
12921
50aeb7d4
DK
129222009-11-25 Doug Kwan <dougkwan@google.com>
12923
12924 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12925 class definition. Add code to handle --target1-rel, --target1-abs
12926 and --target2= options.
12927 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12928 and const.
12929 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12930 member declaration.
12931 (Target_arm::Scan::local, Target_arm::Scan::global,
12932 Target_arm::Relocate::relocate,
12933 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12934 call to Target_arm::get_real_reloc_type.
12935 (Target_arm::get_real_reloc_type): Use command line options to
12936 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12937 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12938 options.
12939
51938283
DK
129402009-11-25 Doug Kwan <dougkwan@google.com>
12941
12942 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12943 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12944 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12945 formatting.
12946 (Arm_relocate_functions::thm_call): Replace body with a call to
12947 Arm_relocate_functions::thumb_branch_common.
12948 (Arm_relocate_functions::thm_jump24,
12949 Arm_relocate_functions::thm_xpc22): New method definitions.
12950 (Arm_relocate_functions::thumb_branch_common): New method definition.
12951 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12952 operator.
12953 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12954 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12955
e2b8f3c4
RÁE
129562009-11-24 Rafael Avila de Espindola <espindola@google.com>
12957
12958 * Makefile.am: Build incremental-dump
12959 * Makefile.in: Regenerate.
12960 * incremental-dump.cc: New.
12961 * incremental.cc (Incremental_inputs_header_data,
12962 Incremental_inputs_entry_data): Move to incremental.h
12963 * incremental.h: (Incremental_inputs_header_data,
12964 Incremental_inputs_entry_data): Move from incremental.cc
12965
bcba9aec
RÁE
129662009-11-24 Rafael Avila de Espindola <espindola@google.com>
12967
12968 * incremental.cc (Incremental_inputs_header,
12969 Incremental_inputs_header_write, Incremental_inputs_entry,
12970 Incremental_inputs_entry_write): Add a typedef with the data type.
12971
7c3afe08
RÁE
129722009-11-24 Rafael Avila de Espindola <espindola@google.com>
12973
12974 * incremental.cc (Incremental_inputs_header,
12975 Incremental_inputs_header_write, Incremental_inputs_entry,
12976 Incremental_inputs_entry_write): Update comment about which
12977 type has the filed descriptions.
12978
d204b6e9
DK
129792009-11-15 Doug Kwan <dougkwan@google.com>
12980
12981 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12982 (Arm_relocate_functions::arm_branch_common): Change method defintion
12983 in class definition to a method declaration and update list of formal
12984 parameters.
12985 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12986 Arm_relocation_functions::jump24): Adjust call to
12987 Arm_relocate_functions::arm_branch_common. Update list of formal
12988 parameters.
12989 (Arm_relocate_functions::xpc25): New method definition.
12990 (Arm_relocate_functions::arm_branch_common): Move method defintion
12991 out from class definition. Use stubs for mode-switching and extending
12992 branch ranges.
12993 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12994 specially. Change code to enable use of stubs in ARM branches.
12995
43d12afe
DK
129962009-11-10 Doug Kwan <dougkwan@google.com>
12997
12998 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12999 in method declaration.
13000 (Target_arm::relocate_stub): New method declaration.
13001 (Target_arm::default_target): Change to return a pointer instead of
13002 a const reference.
13003 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
13004 Target_arm::default_target.
13005 (Arm_Relobj::do_relocate_sections): Remove options paramater in
13006 method definition.
13007 (Target_arm::relocate_section): Adjust view.
13008 (Target_arm::relocate_stub): New method definition.
13009
ac33a407
DK
130102009-11-10 Doug Kwan <dougkwan@google.com>
13011
13012 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
13013 a format warning.
13014 * incremental.cc (open_incremental_binary): Initialized local
13015 variables to avoid warnings.
13016 * object.cc (make_elf_object): Ditto.
13017 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
13018 a format warning.
e1df38aa 13019
88ee28e9
L
13020009-11-09 H.J. Lu <hongjiu.lu@intel.com>
13021
13022 PR gold/10930
13023 * testsuite/plugin_test.c: Include "config.h".
13024
2daedcd6
DK
130252009-11-09 Doug Kwan <dougkwan@google.com>
13026
13027 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
13028 (arm_symbol_value): Remove.
13029 (Arm_relocate_functions::arm_branch_common,
13030 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
13031 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
13032 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
13033 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
13034 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
13035 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
13036 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
13037 Arm_relocate_functions::thm_mobw_abs_nc,
13038 Arm_relocate_functions::thm_mov_abs,
13039 Arm_relocate_functions::movw_prel_nc,
13040 Arm_relocate_functions::thm_movt_abs,
13041 Arm_relocate_functions::movt_prel,
13042 Arm_relocate_functions::thm_movw_prel_nc,
13043 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
13044 (Target_arm::Relocate::relocate): Only decompose address into two
13045 parts if relocation type uses the thumb-bit and pass the actual
13046 bit instead of a flag indicating that the thumb-bit is used. Adjust
13047 calls to methods in Arm_relocate_functions for this change.
13048
1276bc89 130492009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
13050
13051 PR 10925
13052 * reloc.cc: Instantiate
13053 Sized_relobj::initialize_input_to_output_maps and
13054 Sized_relobj:free_input_to_output_maps.
13055
e53ad1b5
ILT
130562009-11-06 Ian Lance Taylor <iant@google.com>
13057
13058 PR 10876
13059 * defstd.cc (in_segment): Set only_if_ref true for "end".
13060
eb44217c
DK
130612009-11-06 Doug Kwan <dougkwan@google.com>
13062
13063 * arm.cc (class Reloc_stub): Correct a comment.
13064 (Target_arm::Target_arm): Initialize arm_input_section_map_.
13065 (Target_arm::scan_section_for_stubs): New method declaration.
13066 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
13067 Change methods from private to protected.
13068 (Target_arm::do_may_relax): New method definition.
13069 (Target_arm::do_relax, Target_arm::group_sections,
13070 Target_arm::scan_reloc_for_stub,
13071 Target_arm::scan_reloc_section_for_stubs): New method declarations.
13072 (Target_arm::arm_input_section_map_): New data member declaration.
13073 (Target_arm::scan_reloc_for_stub,
13074 Target_arm::scan_reloc_section_for_stubs,
13075 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
13076 Target_arm::do_relax): New method definitions.
13077
5d329b7d
ILT
130782009-11-06 Mikolaj Zalewski <mikolaj@google.com>
13079
13080 * configure.ac: Check for (struct stat)::st_mtim
13081 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13082 * config.in: Regenerate.
13083 * configure: Regenerate.
13084
96a0d71b
ILT
130852009-11-05 Ian Lance Taylor <iant@google.com>
13086
13087 PR 10910
13088 * output.cc (Output_segment::add_output_section): Add missing
13089 return statement.
13090
594c8e5e
ILT
130912009-11-04 Ian Lance Taylor <iant@google.com>
13092
13093 PR 10880
13094 * object.h (class Object): Add is_needed and set_is_needed
13095 methods. Add is_needed_ field. Make bool fields into bitfields.
13096 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13097 defined in a dynamic object and referenced by a regular object,
13098 set is_needed for the dynamic object.
13099 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13100 if the file is marked with as_needed and it is not needed.
13101
22b127cc
ILT
131022009-11-04 Ian Lance Taylor <iant@google.com>
13103
13104 PR 10887
13105 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13106 tags if data is discarded by linker script.
13107 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13108 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13109 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13110 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13111
f5c870d2
ILT
131122009-11-04 Ian Lance Taylor <iant@google.com>
13113
13114 * layout.cc (Layout::get_output_section): Add is_interp and
13115 is_dynamic_linker_section parameters. Change all callers.
13116 (Layout::choose_output_section): Likewise.
13117 (Layout::make_output_section): Likewise.
13118 (Layout::add_output_section_data): Add is_dynamic_linker_section
13119 parameter. Change all callers.
13120 * layout.h (class Layout): Update declarations.
13121 * output.h (class Output_section): Add is_interp, set_is_interp,
13122 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13123 Add is_interp_, is_dynamic_linker_section_ fields. Change
13124 generate_code_fills_at_write_ to a bitfield.
13125 * output.cc (Output_section::Output_sections): Initialize new
13126 fields.
13127 (Output_segment::add_output_section): Add do_sort parameter.
13128 Change all callers.
13129
1ae4d23b
ILT
131302009-11-03 Ian Lance Taylor <iant@google.com>
13131
13132 PR 10860
13133 * options.h (class General_options): Add --warn-common.
13134 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13135 merging two common symbols.
13136 (Symbol_table::should_override): Handle --warn-common when merging
13137 a common symbol with a defined symbol. Use report_resolve_problem
13138 for multiple definitions.
13139 (Symbol_table::report_resolve_problem): New function.
13140 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13141
55da9579
DK
131422009-11-03 Doug Kwan <dougkwan@google.com>
13143
13144 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13145 stub_factory_.
13146 (Target_arm::stub_factory): New method definition.
13147 (Target_arm::new_arm_input_section,
13148 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13149 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 13150 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
13151 New type definitions.
13152 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13153 member declarations.
13154 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13155 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13156 New method definitions.
13157
37a9ac43
ILT
131582009-11-03 Ian Lance Taylor <iant@google.com>
13159
13160 * options.h (class General_options): Add --warn_constructors.
13161
b3d6a3d4
ILT
131622009-11-03 Ian Lance Taylor <iant@google.com>
13163
13164 PR 10893
13165 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13166 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13167
934b01dd
ILT
131682009-11-03 Ian Lance Taylor <iant@google.com>
13169
13170 PR 10895
13171 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13172 --msgid-bugs-address.
13173 (install-pdf): New target.
13174 (install-data_yes): Look up one directory to find mkinstalldirs.
13175
03c1939b
L
131762009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13177
13178 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13179 tree.
13180
ebd95253
DK
131812009-10-30 Doug Kwan <dougkwan@google.com>
13182
13183 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13184
e9bbb538
DK
131852009-10-30 Doug Kwan <dougkwan@google.com>
13186
13187 * arm.cc (Stub_addend_reader): New struct template definition
13188 and partial specializations.
13189 (Stub_addend_reader::operator()): New method definition for a
13190 partially specialized template.
13191
d5b40221
DK
131922009-10-30 Doug Kwan <dougkwan@google.com>
13193
13194 * arm.cc (Arm_relobj::processor_specific_flags): New method
13195 definition.
13196 (Arm_relobj::do_read_symbols): New method declaration.
13197 (Arm_relobj::processor_specific_flags_): New data member declaration.
13198 (Arm_dynobj): New class definition.
13199 (Target_arm::do_finalize_sections): Add input_objects parameter.
13200 (Target_arm::do_adjust_elf_header): New method declaration.
13201 (Target_arm::are_eabi_versions_compatible,
13202 (Target_arm::merge_processor_specific_flags): New method declaration.
13203 (Target_arm::do_make_elf_object): New overloaded method definitions
13204 and declaration.
13205 (Arm_relobj::do_read_symbols): New method definition.
13206 (Arm_dynobj::do_read_symbols): Ditto.
13207 (Target_arm::do_finalize_sections): Add input_objects parameters.
13208 Merge processor-specific flags from all input objects.
13209 (Target_arm::are_eabi_versions_compatible,
13210 Target_arm::merge_processor_specific_flags,
13211 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13212 New method definitions.
13213 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13214 Input_objects pointer type parameter.
13215 * layout.cc (Layout::finalize): Pass input objects to target's.
13216 finalize_sections function.
13217 * output.cc (Output_file_header::do_sized_write): Set ELF file
13218 header's processor-specific flags.
13219 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13220 Input_objects pointer type parameter.
13221 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13222 * target.h (Input_objects): New forward class declaration.
13223 (Target::processor_specific_flags,
13224 Target::are_processor_specific_flags_sect): New method definitions.
13225 (Target::finalize_sections): Add input_objects parameter.
13226 (Target::Target): Initialize processor_specific_flags_ and
13227 are_processor_specific_flags_set_.
13228 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13229 parameter.
13230 (Target::set_processor_specific_flags): New method definition.
13231 (Target::processor_specific_flags_,
13232 Target::are_processor_specific_flags_set_): New data member
13233 declarations.
13234 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13235 Input_objects pointer type parameter.
13236
ebabffbd
DK
132372009-10-30 Doug Kwan <dougkwan@google.com>
13238
13239 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13240
ad0f2072
ILT
132412009-10-28 Ian Lance Taylor <iant@google.com>
13242
13243 * object.h (class Relobj): Drop options parameter from
13244 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13245 do_scan_relocs, do_relocate. Change all callers.
13246 (class Sized_relobj): Drop options parameters from
13247 do_gc_process_relocs, do_scan_relocs, do_relocate,
13248 do_relocate_sections, relocate_sections, emit_relocs_scan,
13249 emit_relocs_scan_reltype. Change all callers.
13250 (struct Relocate_info): Remove options field and all references to
13251 it.
13252 * reloc.h (class Read_relocs): Remove options constructor
13253 parameter and options_ field. Change all callers.
13254 (class Gc_process_relocs, class Scan_relocs): Likewise.
13255 (class Relocate_task): Likewise.
13256 * target-reloc.h (scan_relocs): Remove options parameter. Change
13257 all callers.
13258 (scan_relocatable_relocs): Likewise.
13259 * target.h (class Sized_target): Remove options parameter from
13260 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13261 all callers.
13262 * gc.h (gc_process_relocs): Remove options parameter. Change all
13263 callers.
13264 * arm.cc: Update functions to remove options parameters.
13265 * i386.cc: Likewise.
13266 * powerpc.cc: Likewise.
13267 * sparc.cc: Likewise.
13268 * x86_64.cc: Likewise.
13269 * testsuite/testfile.cc: Likewise.
13270
8ffa3667
DK
132712009-10-28 Doug Kwan <dougkwan@google.com>
13272
13273 * arm.cc (Arm_relobj): New class definition.
e1df38aa 13274 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
13275 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13276 New method definitions.
13277
40f36857
CC
132782009-10-28 Cary Coutant <ccoutant@google.com>
13279
13280 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13281 (Plugin::cleanup_done_): New member.
13282 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13283 (Plugin_manager::cleanup_done_): Remove.
13284 (Plugin_manager::add_input_file): Edit error message.
13285 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13286 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13287
2c849493
ILT
132882009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13289
13290 * fileread.cc: (File_read::View::~View): Use the new
13291 data_ownership_ filed.
13292 (File_read::~File_read): Dispose the new whole_file_view_.
13293 (File_read::open): Mmap the whole file if needed.
13294 (File_read::open): Use whole_file_view_ instead of contents_.
13295 (File_read::find_view): Use whole_file_view_ if applicable.
13296 (File_read::do_read): Use whole_file_view_ instead of contents_.
13297 (File_read::make_view): Use whole_file_view_ instead of contents_,
13298 update File_read::View::View call.
13299 (File_read::find_or_make_view): Update File_read::View::View
13300 call.
13301 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13302 remove contents_
13303 (File_read::View::Data_ownership): New enum.
13304 (File_read::View::View): Replace bool mapped_ with Data_ownership
13305 argument.
13306 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13307 (File_read::View::data_ownership_): New field.
13308 (File_read::contents_): Remove (replaced by whole_file_view_).
13309 (File_read::whole_file_view_): New field.
13310 * options.h (class General_options): Add --keep-files-mapped.
13311
24998053
CC
133122009-10-27 Cary Coutant <ccoutant@google.com>
13313
13314 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13315 * testsuite/Makefile.am (plugin_test_5): New test case.
13316 * testsuite/Makefile.in: Regenerate.
13317
72adc4fa
DK
133182009-10-25 Doug Kwan <dougkwan@google.com>
13319
13320 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13321 from private to protected to allow access by child class.
13322 (Sized_relobj::do_relocate_sections): New method declaration.
13323 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13324 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13325 Sized_relobj::relocate_sections. Instantiate template explicitly
13326 for different target sizes and endianity.
13327
07f508a2
DK
133282009-10-24 Doug Kwan <dougkwan@google.com>
13329
13330 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13331 (Arm_input_section::as_arm_input_section): New method.
13332 (Arm_output_section): New class definition.
13333 (Arm_output_section::create_stub_group,
13334 Arm_output_section::group_sections): New method definitions.
13335
10ad9fe5
DK
133362009-10-22 Doug Kwan <dougkwan@google.com>
13337
13338 * arm.cc (Arm_input_section): New class definition.
13339 (Arm_input_section::init, Arm_input_section:do_write,
13340 Arm_input_section::set_final_data_size,
13341 Arm_input_section::do_reset_address_and_file_offset): New method
13342 definitions.
13343
56ee5e00
DK
133442009-10-21 Doug Kwan <dougkwan@google.com>
13345
13346 * arm.cc (Stub_table, Arm_input_section): New forward class
13347 declarations.
13348 (Stub_table): New class defintion.
13349 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13350 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13351 New method definition.
13352
b569affa
DK
133532009-10-21 Doug Kwan <dougkwan@google.com>
13354
13355 * arm.cc: Update copyright comments.
13356 (Target_arm): New forward class template declaration.
13357 (Arm_address): New type.
13358 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13359 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13360 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13361 constants.
13362 (Insn_template): Same.
13363 (DEF_STUBS): New macro.
13364 (Stub_type): New enum type.
13365 (Stub_template): New class definition.
13366 (Stub): Same.
13367 (Reloc_stub): Same.
13368 (Stub_factory): Same.
13369 (Target_arm::Target_arm): Initialize may_use_blx_ and
13370 should_force_pic_veneer_.
13371 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13372 Target_arm::should_force_pic_veneer,
13373 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13374 Target_arm::using_thumb_only, Target_arm:;default_target): New
13375 method defintions.
13376 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13377 New data member declarations.
13378 (Insn_template::size, Insn_template::alignment): New method defintions.
13379 (Stub_template::Stub_template): New method definition.
13380 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13381 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13382 (Stub_factory::Stub_factory): New method definition.
13383 * gold.h (string_hash): New template.
13384 * output.h (Input_section_specifier::hash_value): Use
13385 gold::string_hash.
13386 (Input_section_specifier::string_hash): Remove.
13387 * stringpool.cc (Stringpool_template::string_hash): Use
13388 gold::string_hash.
13389
6c172549
DK
133902009-10-20 Doug Kwan <dougkwan@google.com>
13391
13392 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13393 symbols of relaxed input sections.
13394 * output.h (Output_section::find_relaxed_input_section): Make
13395 method public.
13396
c5617f2f
DK
133972009-10-16 Doug Kwan <dougkwan@google.com>
13398
13399 * dynobj.cc (Versions::Versions): Initialize version_script_.
13400 Only insert base version symbol definition for a shared object
13401 if version script defines any version versions.
13402 (Versions::define_base_version): New method definition.
13403 (Versions::add_def): Check that base version is not needed.
13404 (Versions::add_need): Define base version lazily.
13405 * dynobj.h (Versions::define_base_version): New method declaration.
13406 (Versions::needs_base_version_): New data member declaration.
13407 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13408 (check_DATA): Add no_version_test.stdout.
13409 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13410 New make rules.
13411 * testsuite/Makefile.in: Regenerate.
13412 * testsuite/no_version_test.c: New file.
13413 * testsuite/no_version_test.sh: Ditto.
13414
3c12dcdb
DK
134152009-10-16 Doug Kwan <dougkwan@google.com>
13416
13417 * expression.cc (class Segment_start_expression): New class definition.
13418 (Segment_start_expression::value): New method definition.
13419 (script_exp_function_segment_start): Return a new
13420 Segment_start_expression.
13421 * gold/script-c.h (script_saw_segment_start_expression): New function
13422 prototype.
13423 * script-sections.cc (Script_sections::Script_sections): Initialize
13424 SAW_SEGMENT_START_EXPRESSION_ to false.
13425 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13426 and -Tbbs options to specify section addresses if given in
13427 command line and no SEGMENT_START expression is seen in a script.
13428 * script-sections.h (Script_sections::saw_segment_start_expression,
13429 Script_sections::set_saw_segment_start_expression): New method
13430 definition.
13431 (Script_sections::saw_segment_start_expression_): New data member
13432 declaration.
13433 * script.cc (script_saw_segment_start_expression): New function.
13434 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13435 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13436 script_test_7.sh and script_test_8.sh.
13437 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13438 script_test_8.stdout.
13439 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13440 (script_test_6, script_test_6.stdout, script_test_7,
13441 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13442 * Makefile.in: Regenerate.
13443 * testsuite/script_test_6.sh: New file.
13444 * testsuite/script_test_6.t: Same.
13445 * testsuite/script_test_7.sh: Same.
13446 * testsuite/script_test_7.t: Same.
13447 * testsuite/script_test_8.sh: Same.
13448
64b1ae37
DK
134492009-10-16 Doug Kwan <dougkwan@google.com>
13450
13451 * output.cc (Output_segment::set_section_list_address): Cast
13452 expressions to unsigned long long type to avoid format warnings.
13453
661be1e2
ILT
134542009-10-15 Ian Lance Taylor <iant@google.com>
13455
12edd763 13456 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13457 dot assignment to script_sections_.
12edd763
ILT
13458 * script-sections.cc (Script_sections::add_dot_assignment):
13459 Initialize if necessary.
13460
68b6574b
ILT
13461 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13462 program headers with no load segment if there is a linker script.
13463
661be1e2
ILT
13464 * layout.cc (Layout::set_segment_offsets): Align the file offset
13465 to the segment aligment for -N or -n with no load segment.
13466 * output.cc (Output_segment::add_output_section): Don't crash if
13467 the first section is a TLS section.
13468 (Output_segment::set_section_list_addresses): Print an error
13469 message if the address moves backward in a linker script.
13470 * script-sections.cc
13471 (Output_section_element_input::set_section_addresses): Don't
13472 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13473 (Orphan_output_section::set_section_addresses): Likewise.
13474
f15f61a7
DK
134752009-10-15 Doug Kwan <dougkwan@google.com>
13476
13477 * layout.cc (Layout::finish_dynamic_section): Generate tags
13478 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13479 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13480 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13481
82bb573a
ILT
134822009-10-14 Ian Lance Taylor <iant@google.com>
13483
13484 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13485 fields.
13486 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13487 data_shdr fields of relinfo.
13488 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13489 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13490 R_386_TLS_LDO_32, adjust based on section flags.
13491 (Target_i386::Relocate::fix_up_ldo): Remove.
13492
374ad285
ILT
134932009-10-13 Ian Lance Taylor <iant@google.com>
13494
13495 Add support for -pie.
13496 * options.h (class General_options): Add -pie and
13497 --pic-executable.
13498 (General_options::output_is_position_independent): Test -pie.
13499 (General_options::output_is_executable): Return true if not shared
13500 and not relocatable.
13501 (General_options::output_is_pie): Remove.
13502 * options.cc (General_options::finalize): Reject incompatible uses
13503 of -pie.
13504 * gold.cc (queue_middle_tasks): A -pie link is not static.
13505 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13506 * symtab.cc (Symbol::final_value_is_known): Return false if
13507 output_is_position_independent.
13508 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13509 output_is_position_independent.
13510 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13511 output_is_position_independent.
13512 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13513 output_is_position_independent.
13514 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13515 two_file_pie_test.
13516 (basic_pie_test.o, basic_pie_test): New targets.
13517 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13518 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13519 (two_file_pie_test): New target.
13520 * testsuite/Makefile.in: Rebuild.
13521 * README: Remove note saying that -pie is not supported.
13522
c6585162
ILT
135232009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13524
13525 * options.h (class General_options): Add -init and -fini.
13526 * layout.cc (Layout::finish_dynamic_section): Emit
13527 given init and fini functions.
13528
032ce4e9
ST
135292009-10-13 Sriraman Tallam <tmsriram@google.com>
13530
13531 * gc.h (gc_process_relocs): Check if icf is enabled using new
13532 function.
13533 * gold.cc (queue_initial_tasks): Likewise.
13534 (queue_middle_tasks): Likewise.
13535 * object.cc (do_layout): Likewise.
13536 * symtab.cc (is_section_folded): Likewise.
13537 * main.cc (main): Likewise.
13538 * reloc.cc (Read_relocs::run): Likewise.
13539 (Sized_relobj::do_scan_relocs): Likewise.
13540 * icf.cc (is_function_ctor_or_dtor): New function.
13541 (Icf::find_identical_sections): Check if function is ctor or dtor when
13542 safe icf is chosen.
13543 * options.h (General_options::icf): Change option to be an enum.
13544 (Icf_status): New enum.
13545 (icf_enabled): New method.
13546 (icf_safe_folding): New method.
13547 (set_icf_status): New method.
13548 (icf_status_): New variable.
13549 * (options.cc) (General_options::finalize): Set icf_status_.
13550 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13551 icf_test and icf_keep_unique_test to use the --icf enum flag.
13552 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13553 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13554
f345227a
ST
135552009-10-12 Sriraman Tallam <tmsriram@google.com>
13556
13557 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13558 includes to gc.h and icf.h.
13559 * arm.cc: Include gc.h.
13560 * gold.cc: Likewise.
13561 * i386.cc: Likewise.
13562 * powerpc.cc: Likewise.
13563 * sparc.cc: Likewise.
13564 * x86_64.cc: Likewise.
13565 * gc.h: Include icf.h.
13566
1c7814ed
ILT
135672009-10-11 Ian Lance Taylor <iant@google.com>
13568
13569 * plugin.cc: Include "gold.h" before other header files.
13570
ae3b5189
CD
135712009-10-10 Chris Demetriou <cgd@google.com>
13572
13573 * options.h (Input_file_argument::Input_file_type): New enum.
13574 (Input_file_argument::is_lib_): Replace with...
13575 (Input_file_argument::type_): New member.
13576 (Input_file_argument::Input_file_argument): Take Input_file_type
13577 'type' rather than boolean 'is_lib' as second argument.
13578 (Input_file_argument::is_lib): Use type_.
13579 (Input_file_argument::is_searched_file): New function.
13580 (Input_file_argument::may_need_search): Handle is_searched_file.
13581 * options.cc (General_options::parse_library): Support -l:filename.
13582 (General_options::parse_just_symbols): Update for Input_file_argument
13583 changes.
13584 (Command_line::process): Likewise.
13585 * archive.cc (Archive::get_file_and_offset): Likewise.
13586 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13587 * script.cc (read_script_file, script_add_file): Likewise.
13588 * fileread.cc (Input_file::Input_file): Likewise.
13589 (Input_file::will_search_for): Handle is_searched_file.
13590 (Input_file::open): Likewise.
13591 * readsyms.cc (Read_symbols::get_name): Likewise.
13592 * testsuite/Makefile.am (searched_file_test): New test.
13593 * testsuite/Makefile.in: Regenerate.
13594 * testsuite/searched_file_test.cc: New file.
13595 * testsuite/searched_file_test_lib.cc: New file.
13596
f3048a1d
ILT
135972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13598 Ian Lance Taylor <iant@google.com>
13599
13600 * descriptor.cc: Include <cstdio> and "binary-io.h".
13601 (Descriptors::open): Open the files in binary mode always.
13602 * script.cc (Lex::get_token): Treat \r as whitespace.
13603
d4780e57
ILT
136042009-10-09 Ian Lance Taylor <iant@google.com>
13605
13606 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13607
d9a893b8
ILT
136082009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13609 Ian Lance Taylor <iant@google.com>
13610
13611 * configure.ac: Check for readv function also.
13612 * fileread.cc (readv): Define if not HAVE_READV.
13613 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13614 does not exist.
13615 * config.in: Regenerate.
13616 * configure: Regenerate.
13617
c0a62865
DK
136182009-10-09 Doug Kwan <dougkwan@google.com>
13619
13620 * layout.cc (Layout::make_output_section): Call target hook to make
13621 ordinary output section.
13622 (Layout::finalize): Adjust parameter list of call the
13623 Target::may_relax().
13624 * layout.h (class Layout::section_list): New method.
13625 * merge.h (Output_merge_base::entsize): Change visibility to public.
13626 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13627 New methods.
13628 (Output_merge_string::do_is_string): New method.
13629 * object.cc (Sized_relobj::do_setup): renamed from
13630 Sized_relobj::set_up.
13631 * object.h (Sized_relobj::adjust_shndx,
13632 Sized_relobj::initializ_input_to_output_maps,
13633 Sized_relobj::free_input_to_output_maps): Change visibilities to
13634 protected.
13635 (Sized_relobj::setup): Virtualize.
13636 (Sized_relobj::do_setup): New method declaration.
13637 (Sized_relobj::invalidate_section_offset,
13638 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13639 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13640 * options.cc (parse_int): New function.
13641 * options.h (parse_int): New declaration.
13642 (DEFINE_int): New macro.
13643 (stub_group_size): New option.
13644 * output.cc (Output_section::Output_section): Initialize memebers
13645 merge_section_map_, merge_section_by_properties_map_,
13646 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13647 (Output_section::add_input_section): Handled deferred code-fill
13648 generation and remove an old comment.
13649 (Output_section::add_relaxed_input_section): New method definition.
13650 (Output_section::add_merge_input_section): Use merge section by
13651 properties map to speed to search. Update merge section maps
13652 as appropriate.
13653 (Output_section::build_relaxation_map): New method definition.
13654 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13655 Same.
13656 (Output_section::relax_input_section): Renamed to
13657 Output_section::convert_input_sections_to_relaxed_sections and change
13658 interface to take a vector of pointers to relaxed sections.
13659 (Output_section::find_merge_section,
13660 Output_section::find_relaxed_input_section): New method definitions.
13661 (Output_section::is_input_address_mapped,
13662 Output_section::output_offset, Output_section::output_address):
13663 Use output section data maps to speed up searching.
13664 (Output_section::find_starting_output_address): Add comments.
13665 (Output_section::do_write,
13666 Output_section::write_to_postprocessing_buffer): Do code-fill
13667 generation as appropriate.
13668 (Output_section::get_input_sections): Invalidate relaxed input section
13669 map.
13670 (Output_section::restore_states): Adjust type of checkpoint .
13671 Invalidate relaxed input section map.
13672 * output.h (Output_merge_base): New class declaration.
13673 (Input_section_specifier): New class defintion.
13674 (class Output_relaxed_input_section) Change base class to
13675 Output_section_data_build.
13676 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13677 base class initializer.
13678 (Output_section::add_relaxed_input_section): New method declaration.
13679 (Output_section::Input_section): Change visibility to protected.
2e702c99 13680 (Output_section::Input_section::relobj,
c0a62865
DK
13681 Output_section::Input_section::shndx): Handle relaxed input sections.
13682 Output_section::input_sections) Change visibility to protected. Also
13683 define overload to return a non-const pointer.
13684 (Output_section::Merge_section_properties): New class defintion.
13685 (Output_section::Merge_section_by_properties_map,
13686 Output_section::Output_section_data_by_input_section_map,
13687 Output_section::Relaxation_map): New types.
13688 (Output_section::relax_input_section): Rename method to
13689 Output_section::convert_input_sections_to_relaxed_sections and change
13690 interface to take a vector of relaxed section pointers.
13691 (Output_section::find_merge_section,
13692 Output_section::find_relaxed_input_section,
13693 Output_section::build_relaxation_map,
13694 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13695 New method declarations.
13696 (Output_section::merge_section_map_
13697 Output_section::merge_section_by_properties_map_,
13698 Output_section::relaxed_input_section_map_,
13699 Output_section::is_relaxed_input_section_map_valid_,
13700 Output_section::generate_code_fills_at_write_): New data members.
13701 * script-sections.cc
13702 (Output_section_element_input::set_section_addresses): Call
13703 current_data_size and addralign methods of relaxed input sections.
13704 (Orphan_output_section::set_section_addresses): Call current_data_size
13705 and addralign methods of relaxed input sections.
13706 * symtab.cc (Symbol_table::compute_final_value): Extract template
13707 from the body of Symbol_table::sized_finalize_symbol.
13708 (Symbol_table::sized_finalized_symbol): Call
13709 Symbol_table::compute_final_value.
13710 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13711 (Symbol_table::compute_final_value): New templated method declaration.
13712 * target.cc (Target::do_make_output_section): New method defintion.
13713 * target.h (Target::make_output_section): New method declaration.
13714 (Target::relax): Add more parameters for input objects, symbol table
13715 and layout. Adjust call to do_relax.
13716 (Target::do_make_output_section): New method declaration.
13717 (Target::do_relax): Add parameters for input objects, symbol table
13718 and layout.
13719
d446d6c4
ILT
137202009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13721
13722 * pread.c: Include stdio.h.
13723
bc06c745
ILT
137242009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13725
13726 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13727 defined.
13728
75aea3d0
ILT
137292009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13730
13731 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13732 Change read_shndx type to unsigned int.
13733 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13734 int.
13735 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13736 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13737 Change read_shndx type to unsigned int.
13738 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13739 int.
13740 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13741 * layout.cc (Layout::create_symtab_sections): Cast the result of
13742 local_symcount * symsize to off_t in the gold_assert.
13743
be8fcb75
ILT
137442009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13745
13746 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13747 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13748 R_ARM_BASE_ABS.
13749 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13750 (Arm_relocate_functions::thm_abs5): New function.
13751 (Arm_relocate_functions::abs12): New function.
13752 (Arm_relocate_functions::abs16): New function.
13753 (Arm_relocate_functions::base_abs): New function.
13754 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13755 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13756 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13757 R_ARM_BASE_ABS.
13758 (Scan::global): Likewise.
13759 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13760 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13761 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13762 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13763 R_ARM_BASE_ABS.
13764
c2a122b6
ILT
137652009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13766
13767 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13768 (Arm_relocate_functions::movt_prel): New function.
13769 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13770 (Arm_relocate_functions::thm_movt_prel): New function.
13771 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13772 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13773 (Scan::global, Relocate::relocate): Likewise.
13774 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13775
c4aa1e2d
ILT
137762009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13777
13778 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13779 Incremental_checker.
13780 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13781 unsigned int.
13782 (class Incremental_inputs_header): New class.
13783 (Incremental_inputs_header_writer): Edit comment.
13784 (Incremental_inputs_entry): New class.
13785 (Incremental_inputs_entry_writer): Edit comment.
13786 (Sized_incremental_binary::do_find_incremental_inputs_section):
13787 Add *strtab_shndx parameter, fill it.
13788 (Sized_incremental_binary::do_check_inputs): New method.
13789 (Incremental_checker::can_incrementally_link_output_file): Use
13790 Sized_incremental_binary::check_inputs.
13791 (Incremental_inputs::report_command_line): Save command line in
13792 command_line_.
13793 * incremental.h:
13794 (Incremental_binary::find_incremental_inputs_section): New
13795 method.
13796 (Incremental_binary::do_find_incremental_inputs_section): Add
13797 strtab_shndx parameter.
13798 (Incremental_binary::do_check_inputs): New pure virtual method.
13799 (Sized_incremental_binary::do_check_inputs): Declare.
13800 (Incremental_checker::Incremental_checker): Add incremental_inputs
13801 parameter, use it to initialize incremental_inputs_.
13802 (Incremental_checker::incremental_inputs_): New field.
13803 (Incremental_checker::command_line): New method.
13804 (Incremental_checker::inputs): New method.
13805 (Incremental_checker::command_line_): New field.
13806
c549a694
ILT
138072009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13808
13809 * incremental.cc: Include <cstdarg> and "target-select.h".
13810 (vexplain_no_incremental): New function.
13811 (explain_no_incremental): New function.
13812 (Incremental_binary::error): New method.
13813 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13814 method.
13815 (make_sized_incremental_binary): New function.
13816 (open_incremental_binary): New function.
13817 (can_incrementally_link_file): Add checks if output is ELF and has
13818 inputs section.
13819 * incremental.h: Include "elfcpp_file.h" and "output.h".
13820 (Incremental_binary): New class.
13821 (Sized_incremental_binary): New class.
13822 (open_incremental_binary): Declare.
13823 * object.cc (is_elf_object): Use
13824 elfcpp::Elf_recognizer::is_elf_file.
13825 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13826 * output.h (Output_file::filesize): New method.
13827
fd3c5f0b
ILT
138282009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13829
13830 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13831 New function.
13832 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13833 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13834 function.
13835 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13836 function.
13837 (Arm_relocate_functions::movw_abs_nc): New function.
13838 (Arm_relocate_functions::movt_abs): New function.
13839 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13840 (Arm_relocate_functions::thm_movt_abs): New function.
13841 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13842 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13843 (Scan::global): Likewise.
13844 (Relocate::relocate): Likewise.
13845 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13846
7f5309a5
ILT
138472009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13848
13849 * arm.cc (Arm_relocate_functions::got_prel) New function.
13850 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13851 (Relocate::relocate): Likewise.
13852 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13853
364c7fa5
ILT
138542009-10-06 Ian Lance Taylor <iant@google.com>
13855
13856 * options.h (class General_options): Define
13857 split_stack_adjust_size parameter.
13858 * object.h (class Object): Add uses_split_stack_ and
13859 has_no_split_stack_ fields. Add uses_split_stack and
13860 has_no_split_stack accessor functions. Declare
13861 handle_split_stack_section.
13862 (class Reloc_symbol_changes): Define.
13863 (class Sized_relobj): Define Function_offsets. Declare
13864 split_stack_adjust, split_stack_adjust_reltype, and
13865 find_functions.
13866 * object.cc (Object::handle_split_stack_section): New function.
13867 (Sized_relobj::do_layout): Call handle_split_stack_section.
13868 * dynobj.cc (Sized_dynobj::do_layout): Call
13869 handle_split_stack_section.
13870 * reloc.cc (Sized_relobj::relocate_sections): Call
13871 split_stack_adjust for executable sections in split_stack
13872 objects. Pass reloc_map to relocate_section.
13873 (Sized_relobj::split_stack_adjust): New function.
13874 (Sized_relobj::split_stack_adjust_reltype): New function.
13875 (Sized_relobj::find_functions): New function.
13876 * target-reloc.h: Include "object.h".
13877 (relocate_section): Add reloc_symbol_changes parameter. Change
13878 all callers.
13879 * target.h (class Target): Add calls_non_split method. Declare
13880 do_calls_non_split virtual method. Declare match_view and
13881 set_view_to_nop.
13882 * target.cc: Include "elfcpp.h".
13883 (Target::do_calls_non_split): New function.
13884 (Target::match_view): New function.
13885 (Target::set_view_to_nop): New function.
13886 * gold.cc (queue_middle_tasks): Give an error if mixing
13887 split-stack and non-split-stack objects with -r.
13888 * i386.cc (Target_i386::relocate_section): Add
13889 reloc_symbol_changes parameter.
13890 (Target_i386::do_calls_non_split): New function.
13891 * x86_64.cc (Target_x86_64::relocate_section): Add
13892 reloc_symbol_changes parameter.
13893 (Target_x86_64::do_calls_non_split): New function.
13894 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13895 parameter.
13896 * powerpc.cc (Target_powerpc::relocate_section): Add
13897 reloc_symbol_changes parameter.
13898 * sparc.cc (Target_sparc::relocate_section): Add
13899 reloc_symbol_changes parameter.
13900 * configure.ac: Call AM_CONDITIONAL for the default target.
13901 * configure: Rebuild.
13902 * testsuite/Makefile.am (TEST_AS): New variable.
13903 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13904 (check_DATA): Add split_i386 and split_x86_64 files.
13905 (SPLIT_DEFSYMS): Define.
13906 (split_i386_[1234n].o): New targets.
13907 (split_i386_[124]): New targets.
13908 (split_i386_[1234r].stdout): New targets.
13909 (split_x86_64_[1234n].o): New targets.
13910 (split_x86_64_[124]): New targets.
13911 (split_x86_64_[1234r].stdout): New targets.
13912 (MOSTLYCLEANFILES): Add new executables.
13913 * testsuite/split_i386.sh: New file.
13914 * testsuite/split_x86_64.sh: New file.
13915 * testsuite/split_i386_1.s: New file.
13916 * testsuite/split_i386_2.s: New file.
13917 * testsuite/split_i386_3.s: New file.
13918 * testsuite/split_i386_4.s: New file.
13919 * testsuite/split_i386_n.s: New file.
13920 * testsuite/split_x86_64_1.s: New file.
13921 * testsuite/split_x86_64_2.s: New file.
13922 * testsuite/split_x86_64_3.s: New file.
13923 * testsuite/split_x86_64_4.s: New file.
13924 * testsuite/split_x86_64_n.s: New file.
13925 * testsuite/testfile.cc (Target_test): Update relocation_section
13926 function.
13927 * testsuite/Makefile.in: Rebuild.
13928
e8a9fcda
ILT
139292009-10-06 Ian Lance Taylor <iant@google.com>
13930
13931 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13932 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13933 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13934 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13935 the address on ldo_addrs_.
13936 (Target_i386::Relocate::fix_up_ldo): New function.
13937
e99daf92
ILT
139382009-10-06 Rafael Espindola <espindola@google.com>
13939
13940 * plugin.cc (add_input_library): New.
13941 (Plugin::load): Add add_input_library to tv.
13942 (Plugin_manager::add_input_file): Add the is_lib argument.
13943 (add_input_file): Update call to Plugin_manager::add_input_file.
13944 (add_input_library): New.
13945 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13946
966d4097
DK
139472009-09-30 Doug Kwan <dougkwan@google.com>
13948
13949 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13950 symbol and call Symbol::may_need_copy_reloc to determine if
13951 a copy reloc is needed.
13952 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13953 nocopyreloc is given in command line.
13954 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13955 given in command line.
13956 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13957 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13958 of the removed Target_i386::may_need_copy_reloc.
13959 * options.h (copyreloc): New option with default value false.
13960 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13961 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13962 instead of the removed Target_powerpc::may_need_copy_reloc.
13963 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13964 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13965 instead of the removed Target_sparc::may_need_copy_reloc.
13966 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13967 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13968 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13969 instead of the removed Target_x86_64::may_need_copy_reloc.
13970
029ba973
ILT
139712009-09-30 Ian Lance Taylor <iant@google.com>
13972
13973 * object.h (class Object): Remove target_ field, and target,
13974 sized_target, and set_target methods.
13975 (Object::sized_target): Remove.
13976 (class Sized_relobj): Update declarations. Remove sized_target.
13977 * object.cc (Sized_relobj::setup): Remove target parameter.
13978 Change all callers.
13979 (Input_objects::add_object): Don't do anything with the target.
13980 (make_elf_sized_object): Add punconfigured parameter. Change all
13981 callers. Set or test parameter target.
13982 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13983 Change all callers.
13984 * parameters.cc (Parameters::set_target): Change parameter type to
13985 be non-const.
13986 (Parameters::default_target): Remove.
13987 (set_parameters_target): Change parameter type to be non-const.
13988 (parameters_force_valid_target): New function.
13989 (parameters_clear_target): New function.
13990 * parameters.h (class Parameters): Update declarations. Remove
13991 default_target method. Add sized_target and clear_target
13992 methods. Change target_ to be non-const.
13993 (set_parameters_target): Update declaration.
13994 (parameters_force_valid_target): Declare.
13995 (parameters_clear_target): Declare.
13996 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13997 as NULL if we aren't searching.
13998 (Add_symbols::run): Don't check for compatible target.
13999 * fileread.cc (Input_file::open_binary): Call
14000 parameters_force_valid_target.
14001 * gold.cc (queue_middle_tasks): Likewise.
14002 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
14003 set_target on object.
14004 * dynobj.h (class Sized_dynobj): Update declarations.
14005 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
14006 make_elf_object returns NULL.
14007 (Archive::include_member): Don't check whether object target is
14008 compatible.
14009 * output.cc (Output_section::add_input_section): Get target from
14010 parameters.
14011 (Output_section::relax_input_section): Likewise.
14012 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
14013 parameters.
14014 (Sized_relobj::do_scan_relocs): Likewise.
14015 (Sized_relobj::relocate_sections): Likewise.
14016 * resolve.cc (Symbol_table::resolve): Likewise.
14017 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
14018 parameter. Change all callers.
14019 (Symbol_table::add_from_object): Get target from parameters.
14020 (Symbol_table::add_from_relobj): Don't check object target.
14021 (Symbol_table::add_from_dynobj): Likewise.
14022 (Symbol_table::define_special_symbol): Get target from
14023 parameters.
14024 * symtab.h (class Symbol_table): Update declaration.
14025 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
14026 parameter. Change all callers. Clear parameter target.
14027 (Binary_test): Test target here.
14028 * testsuite/object_unittest.cc (gold_testsuite): Remove
14029 target_test_pointer parameter. Change all callers.
14030 (Object_test): Test target here.
14031
a6a22b83
ILT
140322009-09-26 Ian Lance Taylor <iant@google.com>
14033
14034 * testsuite/initpri1.c: Don't try to use constructor priorities if
14035 compiling with gcc before 4.3.
14036
6a8f49fe
ILT
140372009-09-22 Mikolaj Zalewski <mikolajz@google.com>
14038
14039 * testsuite/retain_symbols_file_test.sh (check_present): Change
14040 output file name to retain_symbols_file_test.stdout.
14041 (check_absent): Likewise.
14042
8c604651
CS
140432009-09-18 Craig Silverstein <csilvers@google.com>
14044
14045 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
14046 * options.cc: Include <cerrno> and <fstream>.
14047 (General_options::finalize): Parse -retain-symbols-file tag.
14048 * options.h: New flag.
14049 (General_options): New method should_retain_symbol, new
14050 variable symbols_to_retain.
14051 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
14052 should_retain_symbol map.
14053 * testsuite/Makefile.am (retain_symbols_file_test): New test.
14054 * testsuite/Makefile.in: Regenerate.
14055 * testsuite/retain_symbols_file_test.sh: New file.
14056
ca58b19f
NC
140572009-09-18 Nick Clifton <nickc@redhat.com>
14058
14059 * po/es.po: Updated Spanish translation.
14060
20e6d0d6
DK
140612009-09-17 Doug Kwan <dougkwan@google.com>
14062
14063 * debug.h (DEBUG_RELAXATION): New constant.
14064 (DEBUG_ALL): Add DEBUG_RELAXATION.
14065 (debug_string_to_enum): Add relaxation debug option.
14066 * layout.cc
14067 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
14068 Layout::Relaxation_debug_check::read_sections,
14069 Layout::Relaxation_debug_check::read_sections): New method definitions.
14070 (Layout::Layout): Initialize data members
14071 record_output_section_data_from_scrips_,
14072 script_output_section_data_list_ and relaxation_debug_check_.
14073 (Layout::save_segments, Layout::restore_segments,
14074 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14075 Layout::relaxation_loop_body): New method definitions.
14076 (Layout::finalize): Support relaxation. Move section layout code to
14077 Layout::relaxation_loop_body.
14078 (Layout::set_asection_address_from_script): Move code for orphan
14079 section placement out.
14080 (Layout::place_orphan_sections_in_script): New method definition.
14081 * layout.h (Output_segment_headers, Output_file_header):
14082 New forward class declarations.
14083 (Layout::~Layout): Define.
14084 (Layout::new_output_section_data_from_script): New method definition.
14085 (Layout::place_orphan_sections_in_script): New method declaration.
14086 (Layout::Segment_states): New type declaration.
14087 (Layout::save_segments, Layout::restore_segments,
14088 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14089 Layout::relaxation_loop_body): New method declarations.
14090 (Layout::Output_section_data_list): New type declaration.
14091 (Layout::Relaxation_debug_check): New class definition.
14092 (Layout::record_output_section_data_from_script_,
14093 Layout::script_output_section_data_list_, Layout::segment_states_,
14094 Layout::relaxation_debug_check_): New data members.
14095 * output.cc: (Output_section_headers::do_size): New method definition.
14096 (Output_section_headers::Output_section_headers): Move size
14097 computation to Output_section_headers::do_size.
14098 (Output_segment_headers::do_size): New method definition.
e1df38aa 14099 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
14100 Output_file_header::do_size and call it.
14101 (Output_file_header::do_size): New method definition.
14102 (Output_data_group::Output_data_group): Adjust call to
14103 Output_section_data.
14104 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14105 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 14106 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
14107 RELAXED_INPUT_SECTION_CODE.
14108 (Output_section::Output_section): Initialize data member checkpoint_.
14109 (Output_section::~Output_section): Delete checkpoint object pointed
14110 by checkpoint_.
14111 (Output_section::add_input_section): Always add an Input_section if
14112 relaxing.
14113 (Output_section::add_merge_input_section): Add assert.
14114 (Output_section::relax_input_section): New method definition.
14115 (Output_section::set_final_data_size): Set load address to zero for
14116 an unallocated section.
14117 (Output_section::do_address_and_file_offset_have_reset_values):
14118 New method definition.
14119 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14120 Handle relaxed input section.
14121 (Output_section::sort_attached_input_sections): Checkpoint input
14122 section list lazily.
14123 (Output_section::get_input_sections): Change type of input_sections to
14124 list of Simple_input_section pointers. Checkpoint input section list
14125 lazily. Also handle relaxed input sections.
14126 (Output_section::add_input_section_for_script): Take a reference to
14127 a Simple_input_section object instead of Relobj pointer and section
14128 index as parameter. Handle relaxed input sections.
14129 (Output_section::save_states, Output_section::restore_states): New
14130 method definitions.
14131 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14132 (Output_data::is_data_size_fixed): New method definition.
14133 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14134 if it is fixed.
14135 (Output_data::address_and_file_offset_have_reset_values): New method
14136 definition.
14137 (Output_data::do_address_and_file_offset_have_reset_values): New method
14138 definition.
14139 (Output_data::set_data_size): Check that data size is not fixed.
14140 (Output_data::fix_data_size): New method definition.
14141 (Output_data::is_data_size_fixed_): New data member.
14142 (Output_section_headers::set_final_data_size): New method definition.
14143 (Output_section_headers::do_size): New method declaration.
14144 (Output_segment_headers::set_final_data_size): New method definition.
14145 (Output_segment_headers::do_size): New method declaration.
14146 (Output_file_header::set_final_data_size)::New method definition.
14147 (Output_file_header::do_size)::New method declaration.
14148 (Output_section_data::Output_section_data): Add new parameter
14149 is_data_size_fixed and use it to fix data size.
14150 (Output_data_const::Output_data_const): Adjust call to base class
14151 constructor and fix data size.
14152 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14153 base class constructor and fix data size.
14154 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14155 base class constructor and fix data size.
14156 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14157 class constructor and fix data size.
14158 (Output_data_group::set_final_data_size): New method definition.
14159 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14160 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14161 class constructor and fix data size.
14162 (Output_relaxed_input_section): New class definition.
14163 (Output_section::Simple_input_section): New class definition.
14164 (Output_section::get_input_sections): Adjust parameter list.
14165 (Output_section::add_input_section_for_script): Same.
14166 (Output_section::save_states, Output_section::restore_states,
14167 Output_section::do_address_and_file_offset_have_reset_values,
14168 (Output_section::Input_section::Input_section): Handle
14169 RELAXED_INPUT_SECTION_CODE. Add new overload for
14170 Output_relaxed_input_section.
14171 (Output_section::Input_section::is_input_section,
14172 Output_section::Input_section::set_output_section): Handle relaxed
14173 input section.
14174 (Output_section::Input_section::is_relaxed_input_section,
14175 Output_section::Input_section::output_section_data,
14176 Output_section::Input_section::relaxed_input_section): New method
14177 definitions.
14178 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14179 value.
14180 (Output_section::Input_section::u1_): Update comments.
14181 (Output_section::Input_section::u2_): Add new union member poris.
14182 (Output_section::Checkpoint_output_section): New classs definition.
14183 (Output_section::relax_input_section): New method declaration.
14184 (Output_section::checkpoint_): New data member.
14185 (Output_segment): Update comments.
14186 (Output_segment::Output_segment): Un-privatize copy constructor.
14187 (Output_segment::operator=): Un-privatize.
14188 * script-sections.cc (Output_section_element::Input_section_list):
14189 Change element type to Output_section::Simple_input_section.
14190 (Output_section_element_dot_assignment::set_section_addresses):
14191 Register output section data for relaxation clean up.
14192 (Output_data_exression::Output_data_expression): Adjust call to base
14193 constructor to fix data size.
14194 (Output_section_element_data::set_section_addresses): Register
14195 Output_data_expression object for relaxation clean up.
14196 (struct Input_section_info): Replace Relobj pointer and section index
14197 pair with Output_section::Simple_input_section and Convert struct to a
14198 class.
14199 (Input_section_sorter::operator()): Adjust access to
e1df38aa 14200 Input_section_info data member to use accessors.
20e6d0d6
DK
14201 (Output_section_element_input::set_section_addresses): Use layout
14202 parameter. Adjust code to use Output_section::Simple_input_section
14203 and Input_secction_info classes. Register filler for relaxation
14204 clean up.
14205 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14206 and section index pair with Output_section::Simple_input_section
14207 class. Adjust code accordingly.
14208 (Phdrs_element::release_segment): New method definition.
14209 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14210 segment list.
14211 (Script_sections::release_segments): New method definition.
14212 * gold/script-sections.h (Script_sections::release_segments): New
14213 method declaration.
14214 * gold/target.h (Target::may_relax, Target::relax,
14215 Target::do_may_relax, Target::do_relax): New method definitions.
14216
5e445df6
ILT
142172009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14218
14219 * arm.cc (has_signed_unsigned_overflow): New function.
14220 (Arm_relocate_functions::abs8): New function.
14221 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14222 (Target_arm::Scan::global): Likewise.
14223 (Target_arm::relocate::relocate): Likewise.
14224 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14225 Likewise.
14226
8c604651 142272009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
14228
14229 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14230 * testsuite/Makefile.in: Regenerate.
14231
1e9cc1c2
NC
142322009-09-11 Nick Clifton <nickc@redhat.com>
14233
14234 * po/gold.pot: Updated by the Translation project.
14235
6a89f575
CC
142362009-09-08 Cary Coutant <ccoutant@google.com>
14237
14238 * output.cc (Output_file::open): Add execute permission to empty file.
14239 * testsuite/Makefile.am (permission_test): New test.
14240 * testsuite/Makefile.in: Regenerate.
14241
fdcac5af
ILT
142422009-09-02 Ian Lance Taylor <iant@google.com>
14243
14244 * output.cc (Output_file::resize): Call map_no_anonymous rather
14245 than map.
14246
44453f85
ILT
142472009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14248
14249 * gold.cc: Include "incremental.h".
14250 (queue_initial_tasks): Call Incremental_checker methods.
14251 * incremental.cc: Include "output.h".
14252 (Incremental_checker::can_incrementally_link_output_file): New
14253 method.
14254 * incremental.h (Incremental_checker): New class.
14255
14256 * output.cc (Output_file::open_for_modification): New method.
14257 (Output_file::map_anonymous): Changed return type to bool. Record
14258 map in base_ field.
14259 (Output_file::map_no_anonymous): New method, broken out of map.
14260 (Output_file::map): Use map_no_anonymous and map_anonymous.
14261 * output.h (class Output_file): Update declarations.
14262
293c1386
CC
142632009-08-24 Cary Coutant <ccoutant@google.com>
14264
14265 * options.h (Command_line::Pre_options): New class.
14266 (Command_line::pre_options): New member.
14267 * options.cc (gold::options::ready_to_register): New variable.
14268 (One_option::register_option): Do nothing if not registering options.
14269 Assert if same short option registered twice.
14270 (General_options::General_options): Turn off option registration when
14271 done constructing.
14272 (Command_line::Pre_options::Pre_options): New constructor.
14273
f773f3d2
CC
142742009-08-24 Cary Coutant <ccoutant@google.com>
14275
06a73cfe
CC
14276 * options.h (General_options::no_keep_memory): Remove incorrect
14277 short option.
f773f3d2 14278
a15af8e2
RW
142792009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14280
14281 * Makefile.am (am__skiplex, am__skipyacc): New.
14282 * Makefile.in: Regenerate.
14283
c462b41b
RW
142842009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14285
14ec8efd
RW
14286 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14287 (INCLUDES): ... this.
14288 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14289 (AM_CPPFLAGS): Renamed from ...
14290 (INCLUDE): ... this.
14291 * Makefile.in, testsuite/Makefile.in: Regenerate.
14292
81ecdfbb
RW
14293 * Makefile.in: Regenerate.
14294 * aclocal.m4: Likewise.
14295 * config.in: Likewise.
14296 * configure: Likewise.
14297 * testsuite/Makefile.in: Likewise.
14298
c462b41b
RW
14299 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14300 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14301 * Makefile.in: Regenerate.
14302 * testsuite/Makefile.in: Regenerate.
14303
2da73f13
CC
143042009-08-19 Cary Coutant <ccoutant@google.com>
14305
14306 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14307 symbols in shared libraries overridden by hidden or internal symbols
14308 in the main program.
14309
2db70501
CD
143102009-08-19 Chris Demetriou <cgd@google.com>
14311
14312 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14313 checking source file names in error messages.
14314
f733487b
DK
143152009-08-18 Doug Kwan <dougkwan@google.com>
14316
14317 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14318 an elcpp::Ehdr as parameter. Adjust call to set_target.
14319 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14320 an elfcpp::Ehdr as parameter.
14321 * object.cc (Object::set_target): Remove the version that looks up
14322 a target and sets it.
14323 (Sized_relobj::setup): Take a Target object instead of
14324 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14325 (make_elf_sized_object): Find target and ask target to
14326 make an ELF object.
14327 * object.h: (Object::set_target): Remove the version that looks up
14328 a target and sets it.
14329 (Sized_relobj::setup): Take a Target object instead of
14330 an elfcpp:Ehdr as parameter.
14331 * target.cc: Include dynobj.h.
14332 (Target::do_make_elf_object_implementation): New.
2e702c99 14333 (Target::do_make_elf_object): New.
f733487b
DK
14334 * target.h (Target::make_elf_object): New template declaration.
14335 (Target::do_make_elf_object): New method declarations.
14336 (Target::do_make_elf_object_implementation): New template declaration.
14337
cc70f101
ILT
143382009-08-14 Ian Lance Taylor <iant@google.com>
14339
14340 * gold.h (FUNCTION_NAME): Define.
14341 (gold_unreachable): Use FUNCTION_NAME.
14342
ef5e0cb1
ST
143432009-08-12 Sriraman Tallam <tmsriram@google.com>
14344
14345 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14346 symbol in the --keep-unique list is not found.
14347
48c187ce
ST
143482009-08-12 Sriraman Tallam <tmsriram@google.com>
14349
14350 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14351 been maked as --keep-unique.
14352 (Icf::unfold_section): New function.
14353 * icf.h (Icf::unfold_section): New function.
14354 * options.h (General_options::keep_unique): New option.
14355 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14356 * testsuite/Makefile.in: Regenerate.
14357 * testsuite/icf_keep_unique_test.sh: New file.
14358 * testsuite/icf_keep_unique_test.cc: New file.
14359
645afe0c
CC
143602009-08-12 Cary Coutant <ccoutant@google.com>
14361
14362 PR 10471
14363 * resolve.cc (Symbol_table::resolve): Check for references from
14364 dynamic objects to hidden and internal symbols.
14365 * testsuite/Makefile.am (hidden_test.sh): New test.
14366 * testsuite/Makefile.in: Regenerate.
14367 * testsuite/hidden_test.sh: New script.
14368 * testsuite/hidden_test_1.c: New test source.
14369 * testsuite/hidden_test_main.c: New test source.
14370
11af873f
DK
143712009-08-11 Doug Kwan <dougkwan@google.com>
14372
14373 * arm.cc: Update comments.
14374 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14375 segment to locate the .ARM.exidx section if present.
14376
b9f7d72d
DK
143772009-08-09 Doug Kwan <dougkwan@google.com>
14378
14379 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14380 patch.
14381
ddd3c53c
ST
143822009-08-07 Sriraman Tallam <tmsriram@google.com>
14383 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14384 compiler warnings.
14385
27721062
ST
143862009-08-06 Sriraman Tallam <tmsriram@google.com>
14387
14388 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14389 valid tls_segment only for non-debug-section relocations.
14390 * testsuite/Makefile.am: Add gc_tls_test.
14391 * testsuite/Makefile.in: Regenerate.
14392 * testsuite/gc_tls_test.cc: New file.
14393 * testsuite/gc_tls_test.sh: New file.
14394
ef15dade 143952009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14396
ef15dade
ST
14397 * icf.cc: New file.
14398 * icf.h: New file.
14399 * Makefile.am (CCFILES): Add icf.cc.
14400 (HFILES): Add icf.h
14401 * Makefile.in: Regenerate.
14402 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14403 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14404 section, symbol and addend information for the relocs.
14405 * gold.cc (queue_middle_tasks): Call identical code folding.
14406 * gold.h: Add defines for multimap.
14407 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14408 to the call of finalize_local_symbols.
14409 * main.cc (main): Create object of class Icf.
14410 * object.cc (Sized_relobj::do_layout): Allow this function to be
14411 called twice during icf.
14412 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14413 to sections marked as identical by icf.
14414 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14415 when available.
14416 (Sized_relobj::do_section_entsize): New function.
14417 * object.h (Object::section_entsize): New function.
14418 (Object::do_section_entsize): New pure virtual function.
14419 (Relobj::finalize_local_symbols): Add new parameter.
14420 (Relobj::do_section_entsize): New function.
14421 * options.h (General_options::icf): New option.
14422 (General_options::icf_iterations): New option.
14423 (General_options::print_icf_sections): New option.
14424 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14425 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14426 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14427 icf.
14428 * symtab.cc (Symbol_table::is_section_folded): New function.
14429 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14430 to sections marked as identical by icf.
14431 * symtab.h (Symbol_table::set_icf): New function.
14432 (Symbol_table::icf): New function.
14433 (Symbol_table::is_section_folded): New function.
14434 (Symbol_table::icf_): New data member.
14435 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14436 * testsuite/Makefile.am: Add commands to build icf_test.
14437 * testsuite/Makefile.in: Regenerate.
14438 * testsuite/icf_test.sh: New file.
14439 * testsuite/icf_test.cc: New file.
14440
c3b65ac4
CD
144412009-07-24 Chris Demetriou <cgd@google.com>
14442
14443 * layout.cc (is_compressible_debug_section): Fix incorrect
14444 comment about compressed section names.
14445
1caf2c51
ILT
144462009-07-20 Ian Lance Taylor <ian@airs.com>
14447
14448 PR 10419
14449 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14450
1ef4d87f
ILT
144512009-07-16 Ian Lance Taylor <iant@google.com>
14452
14453 PR 10400
14454 * layout.h: #include <map>.
14455 (class Kept_section): Change from struct to class. Add accessors
14456 and setters. Add section size to Comdat_group mapping. Change
14457 Comdat_group to std::map. Add is_comdat_ field. Add
14458 linkonce_size field in union.
14459 (class Layout): Update declaration of find_or_add_kept_section.
14460 Don't declare find_kept_object.
14461 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14462 parameter. Add object, shndx, is_comdat, and is_group_name
14463 parameters. Change all callers. Adjust for new Kept_section.
14464 (Layout::find_kept_object): Remove.
14465 * object.cc (Sized_relobj::include_section_group): Update use of
14466 Kept_section. Rename secnum to shndx. Only record
14467 Kept_comdat_section if sections are the same size.
14468 (Sized_relobj::include_linkonce_section): Update use of
14469 Kept_section. Only record Kept_comdat_section if sections are the
14470 same size. Set size of linkonce section.
14471 (Sized_relobj::map_to_kept_section): Update call to
14472 get_kept_comdat_section.
14473 * object.h (class Sized_relobj): Rename fields in
14474 Kept_comdat_section to drop trailing underscores; change object
14475 field to Relobj*. Change Kept_comdat_section_table to store
14476 struct rather than pointer.
14477 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14478 Add kept_object and kept_shndx parameters. Change all callers.
14479 (Sized_relobj::get_kept_comdat_section): Change return type to
14480 bool. Add kept_object and kept_shndx parameters. Change all
14481 callers.
14482 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14483 Layout::find_or_add_kept_section.
14484
37c3b7b0
ILT
144852009-07-09 Ian Lance Taylor <iant@google.com>
14486
14487 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14488 Reserve space in the hash table.
14489
98fa85cb
ILT
144902009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14491
14492 * fileread.cc (File_read::get_mtime): New method.
14493 * fileread.h (Timespec): New structure.
14494 (File_read::get_mtime): New method.
14495 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14496 Renamed from timestamp_nsec.
14497 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14498 Elf_Xword.
e1df38aa 14499 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14500 timestamp_nsec.
e1df38aa 14501 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14502 (Incremental_inputs::report_obejct): Save mtime; style fix.
14503 (Incremental_inputs::report_script): Save mtime; style fix.
14504 (Incremental_inputs::finalize_inputs): Style fix.
14505 (Incremental_inputs::finalize): Style fix.
14506 (Incremental_inputs::create_input_section_data): Store inputs
14507 mtime.
14508 * incremental.h (Incremental_inputs::report_script): Add mtime
14509 argument.
14510 (Incremental_inputs::Input_info::Input_info): Intialize only one
14511 union member.
14512 (Incremental_inputs::Input_info::archive): Move to nameless
14513 union.
14514 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14515 (Incremental_inputs::Input_info::script): Move to nameless union.
14516 (Incremental_inputs::mtime): New field.
14517 * script.cc (read_input_script): Pass file mtime to
14518 Incremental_input.
14519 * script.h (Script_info::inputs): Style fix.
14520
c9d70757
ILT
145212009-07-01 Ian Lance Taylor <ian@airs.com>
14522
14523 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14524 instead of 32.
14525
9c547ec3
ILT
145262009-06-24 Ian Lance Taylor <iant@google.com>
14527
14528 PR 10156
14529 * layout.cc (Layout::choose_output_section): If we find an
14530 existing section, update the flags.
14531 (Layout::create_notes): New function, broken out of
14532 Layout::finalize.
14533 (Layout::finalize): Don't create note sections.
14534 (Layout::create_note): Don't crash if linker script discards
14535 section.
14536 (Layout::create_gold_note): Likewise.
14537 (Layout::create_build_id): Likewise. Don't set
14538 after_input_sections on the section.
14539 (Layout::create_executable_stack_info): Remove target parameter.
14540 Change caller.
14541 * layout.h (class Layout): Declare create_notes. Update
14542 declaration of create_executable_stack_info.
14543 * gold.cc (queue_middle_tasks): Call create_notes.
14544 * output.cc (Output_section::update_flags_for_input_section): Move
14545 here from output.h. If SHF_ALLOC flag is newly set, mark address
14546 invalid.
14547 * output.h (Output_data::mark_address_invalid): New function.
14548 (class Output_section): Only declare, not define,
14549 update_flags_for_input_section. Remove set_flags.
14550
55458500
ILT
145512009-06-24 Ian Lance Taylor <iant@google.com>
14552
14553 * script-sections.cc (Output_section_definition::
14554 set_section_addresses): Rename shadowing local load_address to
14555 laddr.
14556
1307d6cd
ILT
145572009-06-24 Ian Lance Taylor <iant@google.com>
14558
14559 PR 10244
14560 * reloc.cc (relocate_sections): Skip empty relocation sections.
14561
ec3f783e
ILT
145622009-06-23 Ian Lance Taylor <iant@google.com>
14563
14564 PR 10156
14565 * layout.cc (Layout::create_note): Use choose_output_section
14566 rather than make_output_section.
14567
459c9f1c
ILT
145682009-06-23 Ian Lance Taylor <iant@google.com>
14569
14570 PR 10237
14571 * options.cc (General_options::parse_V): Set printed_version_.
14572 (General_options::General_options): Initialize printed_version_.
14573 * options.h (class General_options): Add printed_version_ field.
14574 * gold.cc (queue_initial_tasks): If there are no input files,
14575 don't give a fatal error if we printed the version information.
14576 (queue_middle_tasks): If using -r with a shared object, give a
14577 fatal error rather than an ordinary error.
14578
1518dc8f
ILT
145792009-06-23 Ian Lance Taylor <iant@google.com>
14580
14581 PR 10219
14582 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14583 (Layout::make_output_section): Set have_stabstr_section_ if we see
14584 a .stab*str section.
14585 (Layout::finalize): Call link_stabs_sections.
14586 (Layout::link_stabs_sections): New file.
14587 * layout.h (class Layout): Add have_stabstr_section_ field.
14588 Declare link_stabs_sections.
14589
3d857b98
DK
145902009-06-23 Doug Kwan <dougkwan@google.com>
14591
14592 * Makefile.am (libgold_a_LIBADD): New.
14593 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14594 * Makefile.in: Regenerate.
3d857b98
DK
14595 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14596 * configure: Regenerate.
14597 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14598 * fileread.cc: Include sys/state.h
14599 * gold.h: Declare memmem and strndup if found missing.
14600 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14601
0639a6f6
ILT
146022009-06-23 Ian Lance Taylor <iant@google.com>
14603
14604 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14605 * configure: Rebuild.
14606
8d63875c
ILT
146072009-06-23 Ian Lance Taylor <iant@google.com>
14608
14609 PR 10147
14610 * object.cc (Object::section_contents): Don't try to get a view if
14611 the section has length zero.
14612 (Object::handle_gnu_warning_section): If the section is empty, use
14613 the name of the section as the warning.
14614
f7c8a183
ILT
146152009-06-23 Ian Lance Taylor <iant@google.com>
14616
14617 PR 10133
14618 * stringpool.h (class Stringpool_template): Add optimize_ field.
14619 (Stringpool_template::set_optimize): New function.
14620 * stringpool.cc (Stringpool_template::Stringpool_template):
14621 Initialize optimize_ field.
14622 (Stringpool_template::set_string_offsets): Test local optimize
14623 fild rather than parameter.
14624 * layout.cc (Layout::Layout): Call set_optimize on the section
14625 name stringpool.
14626
e6a307ba
ILT
146272009-06-22 Ian Lance Taylor <iant@google.com>
14628
14629 PR 10030
14630 * yyscript.y: Parse TARGET.
14631 * script.cc (script_set_target): New function.
14632 * script-c.h (script_set_target): Declare.
14633 * options.cc (General_options::string_to_object_format): Rename
14634 from string_to_object_format in anonymous namespace. Change
14635 callers.
14636 * options.h (class General_options): Declare
14637 string_to_object_format.
14638
3ee173de
ILT
146392009-06-22 Ian Lance Taylor <iant@google.com>
14640
14641 * script-sections.cc (Script_sections::create_segments): Don't put
14642 program headers in a PT_LOAD segment if -n or -N.
14643
146442009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14645
14646 PR 10141
14647 * options.h (class General_options): Add -z lazy and -z now. Sort
14648 -z options into alphabetical order.
14649 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14650
cd6739a1 146512009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14652
14653 * layout.cc (Layout::make_output_section): Call
14654 Target::new_output_section.
14655 (Layout::attach_allocated_section_to_segment): Put large section
14656 sections in a separate load segment with the large segment flag
14657 set.
14658 (Layout::segment_precedes): Sort large data segments after other
14659 load segments.
14660 (align_file_offset): New static function.
14661 (Layout::set_segment_offsets): Use align_file_offset.
14662 * output.h (class Output_section): Add is_small_section_ and
14663 is_large_section_ fields.
14664 (Output_section::is_small_section): New function.
14665 (Output_section::set_is_small_section): New function.
14666 (Output_section::is_large_section): New function.
14667 (Output_section::set_is_large_section): New function.
14668 (Output_section::is_large_data_section): New function.
14669 (class Output_segment): Add is_large_data_segment_ field.
14670 (Output_segment::is_large_data_segment): New function.
14671 (Output_segment::set_is_large_data_segment): New function.
14672 * output.cc (Output_section::Output_section): Initialize new
14673 fields.
14674 (Output_segment::Output_segment): Likewise.
14675 (Output_segment::add_output_section): Add assertion that large
14676 data sections always go in large data segments. Force small data
14677 sections to the end of the list of data sections. Force small BSS
14678 sections to the start of the list of BSS sections. For large BSS
14679 sections to the end of the list of BSS sections.
14680 * symtab.h (class Symbol): Declare is_common_shndx.
14681 (Symbol::is_defined): Check Symbol::is_common_shndx.
14682 (Symbol::is_common): Likewise.
14683 (class Symbol_table): Define enum Commons_section_type. Update
14684 declarations. Add small_commons_ and large_commons_ fields.
14685 * symtab.cc (Symbol::is_common_shndx): New function.
14686 (Symbol_table::Symbol_table): Initialize new fields.
14687 (Symbol_table::add_from_object): Put small and large common
14688 symbols in the right list.
14689 (Symbol_table::sized_finalized_symbol): Check
14690 Symbol::is_common_shndx.
14691 (Symbol_table::sized_write_globals): Likewise.
14692 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14693 common symbol lists. Don't call do_allocate_commons_list if the
14694 list is empty.
14695 (Symbol_table::do_allocate_commons_list): Remove is_tls
14696 parameter. Add comons_section_type parameter. Change all
14697 callers. Handle small and large common symbols.
14698 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14699 Symbol::is_common_shndx.
14700 * resolve.cc (symbol_to_bits): Likewise.
14701 * target.h (Target::small_common_shndx): New function.
14702 (Target::small_common_section_flags): New function.
14703 (Target::large_common_shndx): New function.
14704 (Target::large_common_section_flags): New function.
14705 (Target::new_output_section): New function.
14706 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14707 small_common_section_flags, and large_common_section_flags
14708 fields.
14709 (Target::do_new_output_section): New virtual function.
14710 * arm.cc (Target_arm::arm_info): Initialize new fields.
14711 * i386.cc (Target_i386::i386_info): Likewise.
14712 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14713 Likewise.
14714 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14715 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14716 (Target_x86_64::do_new_output_section): New function.
14717 * configure.ac: Define conditional MCMODEL_MEDIUM.
14718 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14719 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14720 (large_LDFLAGS): Define.
14721 * testsuite/large.c: New file.
14722 * testsuite/testfile.cc (Target_test::test_target_info):
14723 Initialize new fields.
14724 * configure, testsuite/Makefile.in: Rebuild.
14725
bb04269c
DK
147262009-06-05 Doug Kwan <dougkwan@google.com>
14727
14728 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14729 * Makefile.in: Regenerate.
bb04269c
DK
14730 * i386.cc (class Target_i386): Define new virtual method to
14731 override do_is_local_label_name in parent.
14732 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14733 local symbols if --discard-locals or -X is given.
14734 * options.h (class General_options): Declare new options
14735 '--discard-locals' and '-X' for discarding locals.
14736 * target.h (class Target): Define new methods is_local_label_name.
14737 Declare new virtual method do_is_local_label_name.
14738 * target.cc: New file.
14739 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14740 (check_SCRIPTS): Add discard_locals_test.sh.
14741 (check_DATA): Add discard_local_tests.syms.
14742 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14743 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14744 * testsuite/Makefile.in: Regenerate.
14745 * testsuite/discard_locals_test.c: New file.
14746 * testsuite/discard_locals_test.sh: Same.
14747
805bb01c
DK
147482009-06-05 Doug Kwan <dougkwan@google.com>
14749
14750 * object.cc (Sized_relobj::Sized_relobj): Initialize
14751 discarded_eh_frame_shndx_ to -1U.
14752 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14753 section.
14754 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14755 a discarded .eh_frame section.
14756 (Sized_relobj::do_finalize_local_symbols): Ditto.
14757 * object.h (class Sized_relobj): Declare new member
14758 discarded_eh_frame_shndx_.
14759 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14760 (local_labels_test.o, local_labels_test): New rules.
14761 * testsuite/Makefile.in: Regenerate.
14762
1dcd334d
DK
147632009-06-04 Doug Kwan <dougkwan@google.com>
14764
14765 * layout.cc (Layout::section_name_mapping): Add mapping for
14766 special ARM sections.
14767
96d49306
DK
147682009-06-03 Doug Kwan <dougkwan@google.com>
14769
14770 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14771 (utils::has_overflow): Same.
14772
dff16297
ILT
147732009-06-03 Ian Lance Taylor <iant@google.com>
14774
14775 * layout.cc (Layout::section_name_mapping): New array, replacing
14776 Layout::linkonce_mapping.
14777 (Layout::section_name_mapping_count): New variable, replacing
14778 Layout::linkonce_mapping_count.
14779 (Layout::linkonce_output_name): Remove.
14780 (Layout::output_section_name): Rewrite.
14781 * layout.h (class Layout): Rename Linkonce_mapping to
14782 Section_name_mapping, linkonce_mapping to section_name_mapping,
14783 linkonce_mapping_count to section_name_mapping_count. Don't
14784 declare linkonce_output_name.
14785
c121c671
DK
147862009-06-03 Doug Kwan <dougkwan@google.com>
14787
14788 * gold/arm.cc (namespace utils): New.
14789 (Target_arm::reloc_is_non_pic): Define new method.
14790 (class Arm_relocate_functions): New.
14791 (Target_arm::Relocate::relocate): Handle relocation types used by
14792 Android.
14793
07800fab
ILT
147942009-06-03 Ian Lance Taylor <iant@google.com>
14795
14796 * arm.cc (Target_arm::scan::global): Use || instead of |.
14797
c121c671
DK
147982009-06-02 Doug Kwan <dougkwan@google.com>
14799
14800 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14801 issued_non_pic_error_.
14802 (class Target_arm::Scan): Declare new method check_non_pic.
14803 Define new method symbol_needs_plt_entry.
14804 Declare new data member issued_non_pic_error_.
14805 (class Target_arm::Relocate): Declare new method
14806 should_apply_static_reloc.
14807 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14808 (Target_arm::Scan::check_non_pic): Define new method.
14809 (Target_arm::Scan::local): Handle a small subset of reloc types used
14810 by Android.
14811 (Target_arm::Scan::local): Same.
14812 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14813
b19b0c6d
ILT
148142009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14815
14816 * incremental.cc (Incremental_inputs::report_command_line): Filter
14817 out --incremental-* options.
14818
94cdfcff
DK
148192009-05-29 Doug Kwan <dougkwan@google.com>
14820
14821 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14822 template class.
14823 (class Target_arm): Update comment.
14824 (Target_arm::Target_arm): Initialize new data members GOT_,
14825 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14826 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14827 and Target_arm::rel_dyn_section.
14828 Declare new_enum Target_arm::Got_type.
14829 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14830 and DYNBSS_.
14831 Update commments for member do_dynsym_value.
14832 (Target_arm::got_size, Target_arm::plt_section,
14833 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14834 new methods inside class defintion.
14835 (Target_arm::got_section): Define new method.
14836 (Target_arm::rel_dyn_section): Same.
14837 (Output_data_plt_arm): New template class.
14838 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14839 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14840 (Output_data_plt_arm::add_entry): Same.
14841 (Output_data_plt_arm::first_plt_entry): Define new
14842 static data member for PLT instruction template.
14843 (Output_data_plt_arm::plt_entry): Same.
14844 (Output_data_plt_arm::do_write): Define new method.
14845 (Target_arm::make_plt_entry): Same.
14846 (Target_arm::do_finalize_sections): Same.
14847 (Target_arm::do_dynsym_value): Same.
14848
4a657b0d
DK
148492009-05-28 Doug Kwan <dougkwan@google.com>
14850
14851 * Makefile.am (TARGETSOURCES): Add arm.cc.
14852 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14853 * Makefile.in: Regenerate.
14854 * arm.cc: New file.
14855 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14856
e7ae8c36
DK
148572009-05-26 Doug Kwan <dougkwan@google.com>
14858
14859 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14860 (General_options::check_excluded_libs): Strip off directories in
14861 archive name before matching like GNU ld does.
14862 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14863 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14864 (exclude_libs_test_LDFLAGS): Add linker option
14865 -Wl,--exclude-libs,libexclude_libs_test_3
14866 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14867 an explicit archive without using -l.
14868 (alt/libexclude_libs_test_3.a): New make rule.
14869 * testsuite/Makefile.in: Regenerate.
14870 * testsuite/exclude_libs_test.c : Declare lib3_default().
14871 (main): Call it.
14872 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14873 * exclude_libs_test_3.c: New file.
14874
f12e7348
NC
148752009-05-26 Nick Clifton <nickc@redhat.com>
14876
14877 * po/id.po: New Indonesian translation.
14878 * po/gold.pot: Updated template file.
14879
4daadc0d
ST
148802009-05-22 Sriraman Tallam <tmsriram@google.com>
14881
e1df38aa 14882 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14883 gc_comdat_test files. Add -Wl,--gc-sections to build
14884 gc_comdat_test.
14885 * testsuite/Makefile.in: Regenerate.
14886 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14887
531813ad
ST
148882009-05-21 Sriraman Tallam <tmsriram@google.com>
14889
14890 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14891 kept comdat section was garbage collected.
14892 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14893 * testsuite/Makefile.in: Regenerate.
14894 * testsuite/gc_comdat_test.sh: New file.
14895 * testsuite/gc_comdat_test_1.cc: New file.
14896 * testsuite/gc_comdat_test_2.cc: New file.
14897
65514900
CC
148982009-05-19 Doug Kwan <dougkwan@google.com>
14899
14900 * archive.cc (Archive::Archive): Move constructor from archive.h
14901 to here. Initialize no_export_.
14902 (Archive::get_elf_object_for_member): Set no_export flag of object.
14903 * archive.h (Archive::Archive): Move constructor body to
14904 archive.cc.
14905 (Archive::no_export): New method.
14906 (Archive::no_export_): New field.
14907 * object.h (Object::Object): Initialize no_export_ to false.
14908 (Object::no_export, Object::set_no_export): New methods.
14909 (Object::no_export_): New field.
14910 * options.cc (General_options::parse_exclude_libs): New method.
14911 (General_options::check_excluded_libs) Same.
14912 * options.h (exclude_libs): New option.
14913 (General_options::check_excluded_libs): New method declaration.
14914 (General_options::excluded_libs_): New field.
14915 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14916 default or protected visibility if an object has no-export flag set.
14917 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14918 (check_SCRIPTS): Add exclude_libs_test.sh.
14919 (check_DATA): Add exclude_libs_test.syms.
14920 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14921 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14922 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14923 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14924 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14925 libexclude_libs_test_2.a): New rules.
14926 * testsuite/Makefile.in: Regenerate.
14927 * testsuite/exclude_libs_test.c: New file.
14928 * testsuite/exclude_libs_test.sh: Ditto.
14929 * testsuite/exclude_libs_test_1.c: Ditto.
14930 * testsuite/exclude_libs_test_2.c: Ditto.
14931
1b77ea50
ILT
149322009-05-15 Ian Lance Taylor <iant@google.com>
14933
14934 * configure.ac: Check for declarations for cases where libiberty.h
14935 checks HAVE_DECL_xxx.
14936 * configure, config.in: Rebuild.
14937
072fe7ce
ILT
149382009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14939
14940 * gold.h (Incremental_argument_list): Remove (invalid) forward
14941 declaration.
14942 * incremental.cc (Incremental_inputs::report_achive): New method.
14943 (Incremental_inputs::report_object): New method.
14944 (Incremental_inputs::report_script): New method.
14945 (Incremental_inputs::finalize_inputs): New method.
14946 (Incremental_inputs::finalize): Call finalize_inputs().
14947 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14948 Create inputs entries.
14949 * incremental.h (Incremental_input_type): New enum.
14950 (Incremental_inputs::Incremental_input): Initialize new fields.
14951 (Incremental_inputs::report_inputs): New method.
14952 (Incremental_inputs::report_achive): New method.
14953 (Incremental_inputs::report_object): New method.
14954 (Incremental_inputs::report_script): New method.
14955 (Incremental_inputs::finalize_inputs): New method.
14956 (Incremental_inputs::Input_info): New struct.
14957 (Incremental_inputs::Input_info_map): New typedef.
14958 (Incremental_inputs::lock_): New field.
14959 (Incremental_inputs::Inputs_): New field.
14960 (Incremental_inputs::Inputs_map): New field.
14961 * main.cc (main): Call Incremental_input::report_inputs.
14962 * options.h (Input_argument_list): Typedef moved from
14963 Input_arguments.
14964 (Input_file_group::Files): Remove, use ::Input_argument_list.
14965 (Input_file_group::Input_argument_list): Remove, use
14966 ::Input_argument_list.
14967 * plugin.cc (Plugin_manager::add_input_file): Add error in
14968 incremental build.
14969 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14970 functions.
14971 * script.cc (read_input_script): Call
14972 Incremental_input::report_script.
14973 * script.h (Script_info): New class.
14974
b0481b0b
ILT
149752009-04-27 Ian Lance Taylor <iant@google.com>
14976
14977 * x86_64.cc (do_adjust_output_section): Set entsize to
14978 plt_entry_size.
14979
b22a5a41 149802009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14981
14982 * output.cc (Output_file::close): After short writes, continue
14983 writing from the correct offset in the buffer being written.
14984
40fde488
CD
149852009-04-23 Chris Demetriou <cgd@google.com>
14986
14987 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14988 * configure: Regenerate.
14989 * config.in: Regenerate.
14990 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14991 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14992
3ce2c28e
ILT
149932009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14994
14995 * incremental.cc (Incremental_inputs_header_data): Renamed from
14996 Incremental_input_header_data.
14997 (Incremental_inputs_header_data::data_size): New field.
14998 (Incremental_inputs_header_data::put_input_file_count): Renamed
14999 from input_file_count.
15000 (Incremental_inputs_header_data::put_command_line_offset): Renamed
15001 from command_line_offset.
15002 (Incremental_inputs_header_data::put_reserved): Renamed from
15003 put_reserved.
15004 (Incremental_inputs_entry_data): Renamed from
15005 Incremental_input_entry_data.
15006 (Incremental_inputs_entry_data::data_size): New field.
15007 (Incremental_inputs::report_command_line): New method.
15008 (Incremental_inputs::finalize): New method.
15009 (Incremental_inputs::create_incremental_inputs_data): New method.
15010 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
15011 * incremental.h: New file.
15012 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 15013 (Layout::finalize): Create incremental inputs section in
3ce2c28e 15014 incremental builds.
703d02da 15015 (Layout::create_incremental_info_sections): New method.
3ce2c28e 15016 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
15017 (Layout::create_incremental_info_sections): New method.
15018 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
15019 * main.cc (main): Notify Incremental_input of the command line.
15020
e55bde5e
ILT
150212009-04-01 Ian Lance Taylor <iant@google.com>
15022 Mikolaj Zalewski <mikolajz@google.com>
15023
15024 * gold.h (reserve_unordered_map): Define, three versions, one for
15025 each version of Unordered_map.
15026 * layout.cc (Layout::Layout): Remove options parameter. Add
15027 number_of_input_files parameter. Don't initialize options_.
15028 Initialize number_of_input_files_ and resized_signatures_. Move
15029 sections_are_attached_.
15030 (Layout::layout_group): Reserve space for group_signatures_.
15031 (Layout::find_or_add_kept_section): Change name parameter to be a
15032 reference. Resize signatures_ map when it gets large enough.
15033 (Layout::layout_eh_frame): Use parameters->options() instead of
15034 this->options_.
15035 (Layout::make_output_section): Likewise.
15036 (Layout::attach_allocated_section_to_segment): Likewise.
15037 (Layout::finalize, Layout::create_executable_stack): Likewise.
15038 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
15039 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
15040 * layout.h (class Layout): Update declarations. Remove options_
15041 field. Add number_of_input_files_ and resized_signatures_
15042 fields. Move sections_are_attached_ field.
15043 * main.cc (main): Pass number of input files to Layout
15044 constructor. Don't pass options.
15045
154b857c
ILT
150462009-03-30 Ian Lance Taylor <iant@google.com>
15047
15048 * ffsll.c (ffsll): Correct implementation.
15049
2f35ab9b
ILT
150502009-03-27 Ian Lance Taylor <iant@google.com>
15051
fd03461a
ILT
15052 * ffsll.c: New file.
15053 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
15054 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
15055 * ftruncate.c (ftruncate): Declare before definition.
15056 * mremap.c (mremap): Likewise.
15057 * pread.c (pread): Likewise.
15058 * configure, Makefile.in, config.in: Rebuild.
15059
2f35ab9b
ILT
15060 * mremap.c: New file.
15061 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
15062 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
15063 (mremap): Declare if HAVE_MREMAP is not defined.
15064 * configure, Makefile.in, config.in: Rebuild.
15065
33aea2fd
CC
150662009-03-27 Cary Coutant <ccoutant@google.com>
15067
15068 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
15069 position independent.
15070 * sparc.cc (Target_sparc::check_non_pic): Likewise.
15071 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
15072
6d479619
CC
150732009-03-24 Cary Coutant <ccoutant@google.com>
15074
15075 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
15076 an executable.
15077 (needs_dynamic_reloc): Likewise.
15078
afc06bb8
ILT
150792009-03-24 Ian Lance Taylor <iant@google.com>
15080
15081 * yyscript.y (file_cmd): Recognize EXTERN.
15082 (extern_name_list, extern_name_list_body): New nonterminals.
15083 * script.cc (script_add_extern): Define.
15084 * script-c.h (script_add_extern): Declare.
15085
f6060a4d
ILT
150862009-03-24 Rafael Avila de Espindola <espindola@google.com>
15087
15088 * object.cc (is_elf_object): Define.
15089 * object.h (is_elf_object): Declare.
15090 * archive.cc (Archive::get_elf_object_for_member): Call
15091 is_elf_object.
33aea2fd 15092 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 15093
26736d8e
ILT
150942009-03-24 Elliott Hughes <enh@google.com>
15095
15096 * output.cc (Output_file::map_anonymous): Define.
15097 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15098 try an anonymous one. Report the size if the mmap fails.
15099 * output.h (class Output_file): Declare map_anonymous.
15100
22fd9730
ILT
151012009-03-24 Ian Lance Taylor <iant@google.com>
15102
15103 * target-select.cc (instantiate_target): Don't acquire the lock if
15104 the instantiated_target_ field has already been set.
15105
cb010894
ILT
151062009-03-23 Ian Lance Taylor <iant@google.com>
15107
7f055c20
ILT
15108 * gold-threads.h (class Initialize_lock): Define.
15109 * gold-threads.cc (class Initialize_lock_once): Define.
15110 (initialize_lock_control): New static variable.
15111 (initialize_lock_pointer): New static variable.
15112 (initialize_lock_once): New static function.
15113 (Initialize_lock::Initialize_lock): Define.
15114 (Initialize_lock::initialize): Define.
15115 * target-select.h: Include "gold-threads.h".
15116 (class Target_selector): Add lock_ and initialize_lock_ fields.
15117 Don't define instantiate_target, just declare it.
15118 * target-select.cc (Target_selector::Target_selector): Initialize
15119 new fields.
15120 (Target_selector::instantiate_target): Define.
15121 * descriptors.h: Include "gold-threads.h".
15122 (class Descriptors): Add initialize_lock_ field.
15123 * descriptors.cc (Descriptors::Descriptors): Initialize new
15124 field.
15125 (Descriptors::open): Use initialize_lock_ field
15126 * errors.h (class Errors): Add initialize_lock_ field.
15127 * errors.cc (Errors::Errors): Initialize new field.
15128 (Errors::initialize_lock): Use initialize_lock_ field.
15129 * powerpc.cc (class Target_selector_powerpc): Remove
15130 instantiated_target_ field. In do_recognize call
15131 instantiate_target rather than do_instantiate_target. In
15132 do_instantiate_target just allocate a new target.
15133 * sparc.cc (class Target_selector_sparc): Likewise.
15134
36959681
ILT
15135 * freebsd.h: New file.
15136 * i386.cc: Include "freebsd.h".
15137 (Target_i386): Derive from Target_freebsd rather than
15138 Sized_target.
15139 (Target_selector_i386): Derive from Target_selector_freebsd rather
15140 than Target_selector.
15141 * x86_64.cc: Include "freebsd.h".
15142 (Target_x86_64): Derive from Target_freebsd rather than
15143 Sized_target.
15144 (Target_selector_x86_64): Derive from Target_selector_freebsd
15145 rather than Target_selector.
15146 * target.h (class Target): Add adjust_elf_header and
15147 do_adjust_elf_header.
15148 * output.cc (Output_file_header:: do_sized_write): Call target
15149 adjust_elf_header routine.
15150 * configure.tgt: Set targ_osabi.
15151 * configure.ac: Define GOLD_DEFAULT_OSABI.
15152 * parameters.cc (Parameters::default_target): Pass
15153 GOLD_DEFAULT_OSABI to select_target.
15154 * target-select.h (class Target_selector): Make instantiate_target
15155 protected rather than private.
15156 * Makefile.am (HFILES): Add freebsd.h.
15157 * configure, Makefile.in, config.in: Rebuild.
15158
cb010894
ILT
15159 * merge.cc (do_add_input_section): Correct pend value. Change
15160 message about last entry not being null terminated from error to
15161 warning.
15162
0e879927
ILT
151632009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15164
15165 * incremental.cc: New file.
15166 * Makefile.am (CCFILES): Add incremental.cc.
15167 * Makefile.in: Rebuild.
15168
41105937
PP
151692009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15170
15171 * layout.cc (Layout::output_section_name): Preserve names
15172 of '.note.' sections.
e1df38aa 15173
60439920
ILT
151742009-03-19 Ian Lance Taylor <iant@google.com>
15175
15176 * descriptors.cc (Descriptors::open): Check that the options are
15177 valid before using them.
15178
0d371ad3
ILT
151792009-03-18 Ian Lance Taylor <iant@google.com>
15180
15181 * script-sections.h: Include <list>.
15182 (class Script_sections): Change Sections_elements from std::vector
15183 to std::list. Typedef public Elements_iterator. Add
15184 orphan_section_placement_, data_segment_align_start_, and
15185 saw_data_segment_align_ fields. Remove data_segment_align_index_
15186 field.
15187 * script-sections.cc (class Orphan_section_placement): New class.
15188 (class Sections_element): Add virtual functions is_relro and
15189 orphan_section_init. Remove virtual function place_orphan_here.
15190 (class Output_section_definition): Add is_relro and
15191 orphan_section_init. Remove place_orphan_here.
15192 (class Orphan_output_section): Likewise.
15193 (Script_sections::Script_sections): Update for field changes.
15194 (Script_sections::data_segment_align): Set saw_data_segment_align_
15195 and data_segment_align_start_, not data_segment_align_index.
15196 (Script_sections::data_segment_relro_end): Check
15197 saw_data_segment_align_. Use data_segment_align_start_ rather
15198 than data_segment_align_index_.
15199 (Script_sections::place_orphan): Rewrite to use
15200 Orphan_section_placement.
15201
9201d894
ILT
152022009-03-17 Ian Lance Taylor <iant@google.com>
15203
9c5b8369
ILT
15204 * archive.cc (Archive::add_symbols): Check for a version attached
15205 to the symbol name in the archive map.
15206 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15207 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15208 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15209 (ver_test_11.a): New target.
15210 * testsuite/Makefile.in: Rebuild.
15211
9201d894
ILT
15212 * configure.ac: Check for chsize and posix_fallocate. Replace
15213 ftruncate.
15214 * ftruncate.c: New file, from gnulib.
15215 * output.cc (posix_fallocate): Define dummy version if not
15216 HAVE_POSIX_FALLOCATE.
15217 (Output_file::map): Call posix_fallocate rather than lseek and
15218 write.
15219 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15220 * configure, Makefile.in, config.in: Rebuild.
15221
ef4ab7a8 152222009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 15223
ef4ab7a8
PP
15224 * layout.h (Layout::create_note): Add section_name parameter.
15225 * layout.cc (Layout::create_note): Likewise.
15226 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 15227
8c500701
ILT
152282009-03-17 Ian Lance Taylor <iant@google.com>
15229
e85b18e1
ILT
15230 * descriptors.cc: Include "options.h".
15231 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15232 (Descriptors::open): Always use O_CLOEXEC when opening a new
15233 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15234 then set FD_CLOEXEC.
15235
9efe6174
ILT
15236 * sparc.cc (class Target_sparc): Add has_got_section.
15237 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15238 make sure we have a GOT section.
15239
15240 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15241 (Target_sparc::Scan::local): Likewise.
15242 (Target_sparc::Scan::global): Likewise.
15243 (Target_sparc::Relocate::relocate): Likewise.
15244 (Target_sparc::Relocate::relocate_tls): Likewise.
15245
8c500701
ILT
15246 * symtab.cc (Symbol_table::define_default_version): New function,
15247 broken out of add_from_object.
15248 (Symbol_table::add_from_object): Call define_default_version.
15249 (Symbol_table::define_special_symbol): Add resolve_oldsym
15250 parameter. Change all callers. If the version for a symbol comes
15251 from a version script, resolve it with the symbol with the same
15252 name with no version. Also add the symbol without a version if
15253 appropriate.
15254 (do_define_in_output_data): If resolving with oldsym, don't delete
15255 sym.
15256 (do_define_in_output_segment): Likewise.
15257 (do_define_as_constant): Likewise.
15258 * symtab.h (class Symbol_table): Update declarations.
15259
f1ed28fb
ILT
152602009-03-13 Ian Lance Taylor <iant@google.com>
15261
15f8229b
ILT
15262 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15263 (Read_symbols::requeue): New function.
15264 (Read_symbols::do_read_symbols): If make_elf_object fails because
15265 the target type is not configured, and the file was searched for,
15266 issue a warning and retry with the next directory.
15267 (Add_symbols::run): If the file has an incompatible format, and
15268 it was searched for, requeue the Read_symbols task. On error,
15269 release the object.
15270 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15271 dirindex parameter to constructor. Change all callers. Declare
15272 incompatible_warning and requeue.
15273 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15274 input_argument_ and input_group_ fields. Add them to
15275 constructor. Change all callers.
15276 (class Read_script): Add dirindex_ field. Add it to constructor.
15277 Change all callers.
15278 * archive.cc (Archive::setup): Remove input_objects parameter.
15279 Change all callers.
15280 (Archive::get_file_and_offset): Likewise.
15281 (Archive::read_all_symbols): Likewise.
15282 (Archive::read_symbols): Likewise.
15283 (Archive::get_elf_object_for_member): Remove input_objects
15284 parameter. Add punconfigured parameter. Change all callers.
15285 (Archive::add_symbols): Change return type to bool. Check return
15286 value of include_member.
15287 (Archive::include_all_members): Likewise.
15288 (Archive::include_member): Change return type to bool. Return
15289 false if first included object has incompatible target. Set
15290 included_member_ field.
15291 (Add_archive_symbols::run): If add_symbols returns false, requeue
15292 Read_symbols task.
15293 * archive.h (class Archive): Add included_member_ field.
15294 Initialize it in constructor. Add input_file and searched_for
15295 methods. Update declarations.
15296 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15297 input_argument_ fields. Add them to constructor. Change all
15298 callers.
15299 * script.cc: Include "target-select.h".
15300 (class Parser_closure): Add skip_on_incompatible_target_ and
15301 found_incompatible_target_ fields. Add
15302 skip_on_incompatible_target parameter to constructor. Change all
15303 callers. Add methods skip_on_incompatible_target,
15304 clear_skip_on_incompatible_target, found_incompatible_target, and
15305 set_found_incompatible_target.
15306 (read_input_script): Add dirindex parameter. Change all callers.
15307 If parser finds an incompatible target, requeue Read_symbols
15308 task.
15309 (script_set_symbol): Clear skip_on_incompatible_target in
15310 closure.
15311 (script_add_assertion, script_parse_option): Likewise.
15312 (script_start_sections, script_add_phdr): Likewise.
15313 (script_check_output_format): New function.
15314 * script.h (read_input_script): Update declaration.
15315 * script-c.h (script_check_output_format): Declare.
15316 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15317 (ignore_cmd): Remove OUTPUT_FORMAT.
15318 * fileread.cc (Input_file::Input_file): Add explicit this.
15319 (Input_file::will_search_for): New function.
15320 (Input_file::open): Add pindex parameter. Change all callers.
15321 * fileread.h (class Input_file): Add input_file_argument method.
15322 Declare will_search_for. Update declarations.
15323 * object.cc (make_elf_object): Add punconfigured parameter.
15324 Change all callers.
15325 * object.h (class Object): Make input_file public. Add
15326 searched_for method.
15327 (make_elf_object): Update declaration.
15328 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15329 restart search.
15330 * dirsearch.h (class Dirsearch): Update declaration.
15331 * options.h (class General_options): Add --warn-search-mismatch.
15332 * parameters.cc (Parameters::is_compatible_target): New function.
15333 * parameters.h (class Parameters): Declare is_compatible_target.
15334 * workqueue.cc (Workqueue::add_blocker): New function.
15335 * workqueue.h (class Workqueue): Declare add_blocker.
15336
f1ed28fb
ILT
15337 * fileread.cc (Input_file::open): Remove options parameter.
15338 Change all callers.
15339 (Input_file::open_binary): Likewise.
15340 * script.cc (read_input_script): Likewise.
15341 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15342 options parameter from constructor. Change all callers.
15343 (class Read_script): Likewise.
15344 * fileread.h (class Input_file): Update declarations.
15345 * script.h (read_input_script): Update declaration.
15346
34dd024a
NC
153472009-03-10 Nick Clifton <nickc@redhat.com>
15348
15349 * po/es.po: New Spanish translation.
15350
6d71b17c
CC
153512009-03-06 Cary Coutant <ccoutant@google.com>
15352
15353 * options.cc (parse_short_option): Keep dash_z from registering itself.
15354
031cdbed
ILT
153552009-03-03 Ian Lance Taylor <iant@google.com>
15356
15357 PR 9918
15358 * target-reloc.h (relocate_section): Pass output_section to
15359 relocate.
15360 * i386.cc (Target_i386::should_apply_static_reloc): Add
15361 output_section parameter. Change all callers.
15362 (Target_i386::Relocate::relocate): Add output_section parameter.
15363 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15364 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15365 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15366 * testsuite/two_file_shared.sh: New script.
15367 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15368 (check_DATA): Add two_file_shared.dbg.
15369 (two_file_shared.dbg): New target.
15370 * testsuite/Makefile.in: Rebuild.
15371
15d5fa16
ILT
153722009-03-01 Ian Lance Taylor <iant@google.com>
15373
15374 * configure.ac: Check for byteswap.h.
15375 * configure: Rebuild.
15376 * config.in: Rebuild.
15377
8a4c0b0d
ILT
153782009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15379
15380 * layout.cc (Layout::find_or_add_kept_section): New function.
15381 (Layout::add_comdat): Removed.
15382 * layout.h (struct Kept_section): Move out of class Layout.
15383 Remove trailing underscores from field names. Add group_sections
15384 field. Rename group_ field to is_group. Change all uses.
15385 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15386 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15387 comdat_groups_ field.
15388 (Sized_relobj::include_section_group): Use
15389 find_or_add_kept_section and Kept_section::group_sections.
15390 (Sized_relobj::include_linkonce_section): Likewise.
15391 * object.cc (class Sized_relobj): Don't define Comdat_group or
15392 Comdat_group_table. Remove find_comdat_group and
15393 add_comdat_group. Remove comdat_groups_ field.
15394 * plugin.cc (include_comdat_group): Use
15395 Layout::find_or_add_kept_section.
15396
b4ecf66b
ILT
153972009-02-28 Ian Lance Taylor <iant@google.com>
15398
14359ca0
ILT
15399 * README: --gc-sections and map files are now supported. Document
15400 some build requirements.
15401
b4ecf66b
ILT
15402 PR 6992
15403 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15404 relocatable link set the value of the section symbol to zero.
15405 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15406 relocatable link don't include the section address in the local
15407 symbol value.
15408
0602e05a
ILT
154092009-02-27 Ian Lance Taylor <iant@google.com>
15410
fd9d194f
ILT
15411 PR 6811
15412 * options.h (class Search_directory): Add is_system_directory.
15413 (class General_options): Declare is_in_system_directory.
15414 * options.cc (get_relative_sysroot): Make static.
15415 (get_default_sysroot): Make static.
15416 (General_optoins::is_in_system_directory): New function.
15417 * fileread.cc (Input_file::is_in_system_directory): New function.
15418 * fileread.h (class Input_file): Declare is_in_system_directory.
15419 * object.h (class Object): Add is_in_system_directory.
15420 (class Input_objects): Remove system_library_directory_ field.
15421 * object.cc (Input_objects::add_object): Don't set
15422 system_library_directory_.
15423 (input_objects::found_in_system_library_directory): Remove.
15424 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15425 parameter. Change all callers.
15426 (Symbol_table::sized_write_globals): Likewise.
15427 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15428 Call Object::is_in_system_directory.
15429 * symtab.h (class Symbol_table): Update declarations.
15430
61edd21f
ILT
15431 PR 5990
15432 * descriptors.h (Open_descriptor): Add is_on_stack field.
15433 * descriptors.cc (Descriptors::open): If the descriptor is on the
15434 top of the stack, remove it. Initialize is_on_stack field.
15435 (Descriptors::release): Only add pod to stack if it is not on the
15436 stack already.
15437 (Descriptors::close_some_descriptor): Clear stack_next and
15438 is_on_stack fields.
15439
e29e076a
ILT
15440 PR 7091
15441 * output.cc (Output_section::find_starting_output_address): Rename
15442 from starting_output_address; add PADDR parameter; change return
15443 type.
15444 * output.h (class Output_section): Declare
15445 find_starting_output_address instead of starting_output_address.
15446 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15447 section symbol for which we can't find a merge section.
15448
0602e05a
ILT
15449 PR 9836
15450 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15451 hidden or internal, force the symbol to be local.
15452 * resolve.cc (Symbol::override_visibility): Define.
15453 (Symbol::override_base): Use override_visibility.
15454 (Symbol_table::resolve): Likewise.
15455 (Symbol::override_base_with_special): Likewise.
15456 (Symbol_table::override_with_special): If the visibility is hidden
15457 or internal, force the symbol to be local.
15458 * symtab.h (class Symbol): Add set_visibility and
15459 override_visibility.
15460 * testsuite/ver_test_1.sh: New file.
15461 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15462 (check_DATA): Add ver_test_1.syms.
15463 (ver_test_1.syms): New target.
15464 * testsuite/Makefile.in: Rebuild.
15465
401a9a73
CC
154662009-02-25 Cary Coutant <ccoutant@google.com>
15467
15468 * layout.cc (Layout::choose_output_section): Don't rename sections
15469 when using a linker script that has a SECTIONS clause.
15470 * Makefile.in: Regenerate.
15471
15472 * testsuite/Makefile.am (script_test_5.sh): New test case.
15473 * testsuite/Makefile.in: Regenerate.
15474 * testsuite/script_test_5.cc: New file.
15475 * testsuite/script_test_5.sh: New file.
15476 * testsuite/script_test_5.t: New file.
15477
f488e4b0
CC
154782009-02-13 Rafael Avila de Espindola <espindola@google.com>
15479
15480 * archive.cc (Archive::include_member): Update calls to add_symbols.
15481 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15482 the Layout argument.
15483 * dynobj.h (do_add_symbols): Add the Layout argument.
15484 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15485 Layout argument.
15486 * object.h (Object::add_symbols): Add the Layout argument.
15487 (Object::do_add_symbols): Add the Layout argument.
15488 (Sized_relobj::do_add_symbols): Add the Layout argument.
15489 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15490 Unify the two versions.
15491 (Add_plugin_symbols): Remove.
15492 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15493 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15494 (Add_plugin_symbols): Remove.
15495 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15496 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15497 (Add_symbols::run): Make it work with Pulginobj.
15498
89dd1680
ILT
154992009-02-06 Ian Lance Taylor <iant@google.com>
15500
15501 * object.cc (Sized_relobj::do_layout): Make info message start
15502 with lower case letter.
15503
266d0a74
ILT
155042009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15505
602b464e
ILT
15506 * binary.cc: Fix file comment.
15507
266d0a74
ILT
15508 * options.h (enum Incremental_disposition): Define.
15509 (class General_options): Add new options: --incremental,
15510 --incremental_changed, --incremental_unchanged,
15511 --incremental_unknown. Add incremental_disposition_ and
15512 implicit_incremental_ fields.
15513 (General_options::incremental_disposition): New function.
15514 (class Position_dependent_options): Add incremental_disposition
15515 option.
15516 (Position_dependent_options::copy_from_options): Set incremental
15517 dispositions.
15518 * options.cc (General_options::parse_incremental_changed): New
15519 function.
2e702c99
RM
15520 (General_options::parse_incremental_unchanged): New function.
15521 (General_options::parse_incremental_unknown): New function.
15522 (General_options::General_options): Initialize new fields
266d0a74 15523 incremental_disposition_ and implicit_incremental_.
2e702c99 15524 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15525 without --incremental.
15526
f073bbf7
CD
155272009-02-06 Chris Demetriou <cgd@google.com>
15528
15529 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15530 pointer and to report location as the file name associated with
15531 the symbol.
15532 (gold_undefined_symbol_at_location): New function to replace the
15533 old gold_undefined_symbol functionality.
15534 * target-reloc.h (relocate_section): Update to use
15535 gold_undefined_symbol_at_location.
15536 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15537 Call gold_undefined_symbol function rather than gold_error.
15538 * errors.h (Errors::undefined_symbol): Take location as a
15539 string, rather than calculating it from a relocation.
15540 * errors.cc (Errors::fatal): Print "fatal error:" before the
15541 formatted message.
15542 (Errors::error, Errors::error_at_location): Print "error: "
15543 before the formatted message.
15544 (Errors::undefined_symbol): Take location as a string, rather
15545 than calculating it from a relocation.
15546 (gold_undefined_symbol_at_location): New function akin to
15547 old gold_undefined_symbol, calculates location from relocation.
15548 (gold_undefined_symbol): Change to take only a Symbol pointer
15549 and to report location as the file name associated with the symbol.
15550 * testsuite/debug_msg.sh: Update for changed error messages.
15551 * testsuite/undef_symbol.sh: Likewise.
15552
8e94a90c
ILT
155532009-02-04 Duncan Sands <baldrick@free.fr>
15554
15555 PR 9812
15556 * reduced_debug_output.h
15557 (Output_reduced_debug_abbrev_section::failed): Use format for
15558 gold_warning.
15559 (Output_reduced_debug_info_section::faild): Likewise.
15560
88a0e15b
ILT
155612009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15562
15563 * script.cc (Lazy_demangler): New class.
2e702c99 15564 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15565 symbol only once.
15566
5efc7cd2
CC
155672009-01-29 Cary Coutant <ccoutant@google.com>
15568
15569 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15570 to __tls_get_addr.
15571 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15572
e0ebcf42
ILT
155732009-01-28 Ian Lance Taylor <iant@google.com>
15574
5efc7cd2 15575 * version.cc (version_string): Bump to 1.9.
75fe7426 15576
e0ebcf42
ILT
15577 * gold.h: Include <cstring> and <stdint.h>.
15578 * version.cc: Include <cstdio>.
15579 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15580 warning.
15581 * reduced_debug_output.cc (insert_into_vector): Rename from
15582 Insert_into_vector; change all callers. Use Swap_unaligned to
15583 avoid aliasing issue; remove union since it is unnecessary.
15584
8e2813be 155852009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15586
15587 * Makefile.am (CCFILES): Add gc.cc.
15588 (HFILES): Add gc.h.
15589 * Makefile.in: Regenerate.
15590 * gold.cc (Gc_runner): New class.
15591 (queue_initial_tasks): Call garbage collection related tasks
15592 when corresponding options are invoked.
15593 (queue_middle_gc_tasks): New function.
15594 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15595 processed early before laying out sections during garbage collection.
15596 * gold.h (queue_middle_gc_tasks): New function.
15597 (is_prefix_of): Move from "layout.cc".
15598 * i386.cc (Target_i386::gc_process_relocs): New function.
15599 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15600 * main.cc (main): Create object of class "Garbage_collection".
15601 * object.cc (Relobj::copy_symbols_data): New function.
15602 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15603 (Sized_relobj::do_layout): Allow this function to be called twice
15604 during garbage collection and defer layout of section during the
6d03d481
ST
15605 first call.
15606 * object.h (Relobj::get_symbols_data): New function.
15607 (Relobj::is_section_name_included): New function.
15608 (Relobj::copy_symbols_data): New function.
15609 (Relobj::set_symbols_data): New function.
15610 (Relobj::get_relocs_data): New function.
15611 (Relobj::set_relocs_data): New function.
15612 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15613 (Relobj::gc_process_relocs): New function.
15614 (Relobj::do_gc_process_relocs): New pure virtual function.
15615 (Relobj::sd_): New data member.
15616 (Sized_relobj::is_output_section_offset_invalid): New function.
15617 (Sized_relobj::do_gc_process_relocs): New function.
15618 * options.h (General_options::gc_sections): Modify to not be a no-op.
15619 (General_options::print_gc_sections): New option.
15620 * plugin.cc (Plugin_finish::run): Remove function call to
15621 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15622 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15623 * reloc.cc (Read_relocs::run): Add task to process relocs and
15624 determine unreferenced sections when doing garbage collection.
15625 (Gc_process_relocs): New class.
15626 (Sized_relobj::do_gc_process_relocs): New function.
15627 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15628 sections that are garbage collected.
15629 * reloc.h (Gc_process_relocs): New class.
15630 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15631 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15632 symbols whose corresponding sections are garbage collected.
15633 (Symbol_table::Symbol_table): Add new parameter for the garbage
15634 collection object.
15635 (Symbol_table::gc_mark_undef_symbols): New function.
15636 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15637 (Symbol_table::gc_mark_dyn_syms): New function.
15638 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15639 as garbage.
15640 (Symbol_table::add_from_object): Likewise.
15641 (Symbol_table::add_from_relobj): When building shared objects, do not
15642 treat externally visible symbols as garbage.
15643 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15644 table information for static and relocatable links.
15645 * symtab.h (Symbol_table::set_gc): New function.
15646 (Symbol_table::gc): New function.
15647 (Symbol_table::gc_mark_undef_symbols): New function.
15648 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15649 (Symbol_table::gc_mark_dyn_syms): New function.
15650 (Symbol_table::gc_): New data member.
e1df38aa 15651 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15652 function.
15653 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15654 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15655
3b293544
CF
156562009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15657
15658 * options.h (General_options::gc_sections): Define as a no-op for now.
15659 (General_options::no_keep_memory): Ditto.
15660 (General_options::Bshareable): Define.
15661 * options.cc (General_options::finalize): Honor -Bshareable.
15662
83d22aa8
AS
156632009-01-20 Andreas Schwab <schwab@suse.de>
15664
15665 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15666 read the value in the contents, since we don't use it. Use the
15667 template endianness when writing.
15668 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15669
cd536b21
AS
156702009-01-19 Andreas Schwab <schwab@suse.de>
15671
15672 * configure.tgt (powerpc64-*): Fix targ_obj.
15673
99e9a495
ILT
156742009-01-15 Ian Lance Taylor <iant@google.com>
15675
15676 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15677 local symbols when stripping all symbols.
15678
bbbfea06
CC
156792009-01-14 Cary Coutant <ccoutant@google.com>
15680
99e9a495 15681 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15682
0f7c0701
CC
156832009-01-14 Cary Coutant <ccoutant@google.com>
15684
15685 * archive.cc (Archive::get_elf_object_for_member): Remove call
15686 to File_read::claim_for_plugin.
15687 * descriptors.cc (Descriptors::open): Remove reference to
15688 is_claimed.
15689 (Descriptors::claim_for_plugin): Remove.
15690 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15691 (Descriptors::is_claimed): Remove.
15692 (claim_descriptor_for_plugin): Remove.
15693 * fileread.cc (File_read::claim_for_plugin): Remove.
15694 * fileread.h (File_read::claim_for_plugin): Remove.
15695 (File_read::descriptor): Reopen descriptor if necessary.
15696 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15697 (Plugin_manager::all_symbols_read): Add task parameter. Change
15698 all callers.
15699 (Plugin_manager::get_input_file): New function.
15700 (Plugin_manager::release_input_file): New function.
15701 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15702 corresponding data member.
15703 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15704 and pass to base constructor. Change all callers.
15705 (get_input_file, release_input_file): New functions.
15706 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15707 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15708 (Plugin_manager::all_symbols_read): Add task parameter.
15709 (Plugin_manager::get_input_file): New function.
15710 (Plugin_manager::release_input_file): New function.
15711 (Plugin_manager::task_): New data member.
15712 (Pluginobj::Pluginobj): Add filesize parameter.
15713 (Pluginobj::filename): New function.
15714 (Pluginobj::descriptor): New function.
15715 (Pluginobj::filesize): New function.
15716 (Pluginobj::filesize_): New data member.
15717 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15718 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15719 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15720
15721 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15722 with archive libraries.
15723 * testsuite/Makefile.in: Regenerate.
15724 * testsuite/plugin_test.c (struct sym_info): New type.
15725 (get_input_file, release_input_file): New static variables.
15726 (onload): Capture new transfer vector entries.
15727 (claim_file_hook): Stop reading at end of file according to filesize.
15728 Factor out parsing of readelf output into separate function.
15729 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15730 APIs and get the source file name from the symbol table. Convert
15731 source file name to corresponding object file name. Print info
15732 message when adding new input files.
15733 (parse_readelf_line): New function.
15734 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15735 * testsuite/plugin_test_2.sh: Likewise.
15736 * testsuite/plugin_test_3.sh: Likewise.
15737 * testsuite/plugin_test_4.sh: New test case.
15738
62a6d109
ILT
157392009-01-07 Ian Lance Taylor <iant@google.com>
15740
15741 * version.cc (version_string): Bump to 1.8.
15742
483620e8
CC
157432008-12-23 Cary Coutant <ccoutant@google.com>
15744
15745 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15746 * plugin.cc (Plugin_manager::finish): Rename as
15747 layout_deferred_objects. Move cleanup to separate function.
15748 (Plugin_manager::cleanup): New function.
15749 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15750 separately.
15751 * plugin.h (Plugin_manager::finish): Rename as
15752 layout_deferred_objects.
15753 (Plugin_manager::cleanup): New function.
15754 (Plugin_manager::cleanup_done): New field.
15755
d66a9eb3
CC
157562008-12-23 Cary Coutant <ccoutant@google.com>
15757
15758 * plugin.cc (is_visible_from_outside): New function.
15759 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15760 so we don't return "IR only" status for exported symbols or -r links.
15761
15762 * testsuite/Makefile.am (plugin_test_3): New test case.
15763 * testsuite/Makefile.in: Regenerate.
15764 * testsuite/plugin_test_3.sh: New file.
15765
5995b570
CC
157662008-12-22 Cary Coutant <ccoutant@google.com>
15767
15768 * object.cc (Sized_relobj::layout_section): New function.
15769 (Sized_relobj::do_layout): Defer layout of input sections until after
15770 plugin has provided replacement files.
15771 (Sized_relobj::do_layout_deferred_sections): New function.
15772 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15773 (Relobj::layout_deferred_sections): New function.
15774 (Relobj::do_layout_deferred_sections): New function.
15775 (Sized_relobj::do_layout_deferred_sections): New function.
15776 (Sized_relobj::layout_section): New function.
15777 (Sized_relobj::Deferred_layout): New structure.
15778 (Sized_relobj::deferred_layout_): New field.
15779 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15780 Change all callers. Layout deferred sections.
15781 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15782 references.
15783 (Plugin_hook::run): Move code from do_plugin_hook inline.
15784 (Plugin_hook::do_plugin_hook): Remove.
15785 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15786 (Plugin_manager::finish): Renamed, was cleanup.
15787 (Plugin_manager::should_defer_layout): New function.
15788 (Plugin_manager::add_deferred_layout_object): New function.
15789 (Plugin_manager::Deferred_layout_list): New type.
15790 (Plugin_manager::deferred_layout_objects_): New field.
15791 (Plugin_hook::do_plugin_hook): Remove.
15792
ee769c88
ILT
157932008-12-17 Ian Lance Taylor <iant@google.com>
15794
15795 * options.h (class General_options): Add --no case for
15796 --export-dynamic.
15797
abc8dcba
CC
157982008-12-16 Cary Coutant <ccoutant@google.com>
15799
15800 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15801 vector.
15802 (Plugin_manager::claim_file): Create plugin object even if
15803 plugin did not call the add_symbols callback.
15804 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15805 asking for more symbols than were added.
15806 * testsuite/Makefile.am (plugin_test_1): Add test case with
15807 no global symbols.
15808 (empty.syms): New target.
15809 * testsuite/Makefile.in: Regenerate.
15810 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15811 message. Don't call add_symbols if no globals.
15812 (all_symbols_read_hook): Don't provide replacement for empty
15813 claimed file.
15814
b0074644
ILT
158152008-12-12 Ian Lance Taylor <iant@google.com>
15816
68943102
ILT
15817 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15818 r_type == 0 for a local symbol with r_sym == 0.
15819 (scan_relocatable_relocs): Pass r_sym to
15820 local_non_section_strategy.
15821 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15822 r_sym parameter.
15823
b0074644
ILT
15824 * configure.ac: Update test for TLS descriptors: they are
15825 supported as of glibc 2.9.
15826 * configure: Rebuild.
15827
c2508178
ILT
158282008-12-11 Ian Lance Taylor <iant@google.com>
15829
15830 PR 7091
15831 * target-reloc.h (Default_scan_relocatable_relocs): For each
15832 function, map r_type == 0 to RELOC_DISCARD.
15833
2756a258
CC
158342008-12-10 Cary Coutant <ccoutant@google.com>
15835
15836 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15837 object to override a kept COMDAT group from a plugin object.
15838
bb6f53d3
ILT
158392008-12-09 Ian Lance Taylor <iant@google.com>
15840
fbc558e1
ILT
15841 PR 7088
15842 * yyscript.y (file_cmd): Handle INPUT.
15843
bb6f53d3
ILT
15844 * testsuite/initpri1.c: Change all declarations to be full
15845 prototypes by adding void, to avoid compiler warnings.
15846
4674ecfc
CC
158472008-12-05 Rafael Avila de Espindola <espindola@google.com>
15848
15849 * options.cc (General_options::parse_plugin_opt): New.
15850 (General_options::add_plugin): The argument now is just the filename.
15851 (General_options::add_plugin_option): New.
15852 * options.h (plugin_opt): New.
15853 (add_plugin): Change argument name.
15854 (add_plugin_option): New.
15855 * plugin.cc (Plugin::load): Don't parse the plugin option.
15856 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15857 (Plugin::add_option): New.
15858 (Plugin::args_): Change type.
15859 (Plugin::filename_): New.
15860 (Plugin_manager::add_plugin_option): New.
15861 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15862 * testsuite/Makefile.in: Regenerate.
15863
fd06b4aa
CC
158642008-12-05 Cary Coutant <ccoutant@google.com>
15865
15866 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15867 Handle --strip-lto-sections option.
15868 * options.h (strip_lto_sections): New option.
15869
6c52134c
CC
158702008-12-01 Cary Coutant <ccoutant@google.com>
15871
15872 * plugin.cc (ld_plugin_message): Change format parameter to const.
15873 Fix mismatch between new[] and delete.
15874
a45248e0
CC
158752008-11-14 Cary Coutant <ccoutant@google.com>
15876
15877 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15878 instead of -1U.
15879
c82fbeee
CS
158802008-11-05 Craig Silverstein <csilvers@google.com>
15881
15882 * options.cc (General_options::parse_dynamic_list): New function.
15883 * options.h (General_options): New flags dynamic_list,
15884 dynamic_list_data, dynamic_list_cpp_new, and
15885 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15886 (General_options::in_dynamic_list): New function.
15887 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15888 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15889 (Lex::can_continue_name): Likewise.
15890 (yylex): Likewise.
15891 (read_script_file): New parameter script_options.
15892 (read_dynamic_list): New function.
15893 (Script_options::define_dynamic_list): New function.
15894 (dynamic_list_keyword_parsecodes): New variable.
15895 (dynamic_list_keywords): New variable.
15896 * script.h (Script_options::define_dynamic_list): New function
15897 prototype.
15898 (read_dynamic_list): New function prototype.
15899 * symtab.cc (strprefix): New macro.
15900 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15901 dynamic_list_data, dynamic_list_cpp_new, and
15902 dynamic_list_cpp_typeinfo.
15903 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15904 (dynamic_list_expr): New rule.
15905 (dynamic_list_nodes): Likewise.
15906 (dynamic_list_node): Likewise.
15907 * testsuite/Makefile.am (dynamic_list): New test.
15908 * testsuite/Makefile.in: Regenerated.
15909 * testsuite/dynamic_list.t: New file.
15910 * testsuite/dynamic_list.sh: New file.
15911
e0bb29a5
CS
159122008-11-05 Craig Silverstein <csilvers@google.com>
15913
15914 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15915 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15916 (t11_last): Likewise.
15917 * testsuite/ver_test_6.c (main): Likewise.
15918
4e1e25e0
CC
159192008-10-07 Cary Coutant <ccoutant@google.com>
15920
15921 * options.c (General_options::finalize): Add check for -static and
15922 -shared.
15923 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15924 is not empty.
15925
92f03fcb
CC
159262008-10-02 Cary Coutant <ccoutant@google.com>
15927
15928 * plugin.cc (make_sized_plugin_object): Fix conditional
15929 compilation to work when not all targets are enabled.
15930
fbd8a257
CC
159312008-09-29 Cary Coutant <ccoutant@google.com>
15932
15933 * archive.cc (Archive::get_file_and_offset): Use filename instead
15934 of name to get library path.
15935 (Archive::include_member): Unlock external member of a thin archive.
15936
15937 * testsuite/Makefile.am (TEST_AR): New variable.
15938 (thin_archive_test_1): New test.
15939 (thin_archive_test_2): New test.
81636b3f
CC
15940 * testsuite/Makefile.in: Regenerate.
15941 * testsuite/thin_archive_main.cc: New file.
15942 * testsuite/thin_archive_test_1.cc: New file.
15943 * testsuite/thin_archive_test_2.cc: New file.
15944 * testsuite/thin_archive_test_3.cc: New file.
15945 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15946
eff45813
CC
159472008-09-29 Cary Coutant <ccoutant@google.com>
15948
15949 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15950 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15951 instead of -1U.
15952 (Sized_relobj::do_finalize_local_symbols): Likewise.
15953 (Sized_relobj::map_to_kept_section): Likewise.
15954 * object.h (Sized_relobj::invalid_address): New constant.
15955 (Sized_relobj::do_output_section_offset): Check for invalid_address
15956 and return -1ULL.
15957 * output.cc (Output_reloc::local_section_offset): Use constant
15958 invalid_address instead of -1U.
15959 (Output_reloc::get_address): Likewise.
15960 (Output_section::output_address): Change -1U to -1ULL.
15961 * output.h (Output_reloc::invalid_address): New constant.
15962 * reloc.cc (Sized_relobj::write_sections): Use constant
15963 invalid_address instead of -1U.
15964 (Sized_relobj::relocate_sections): Likewise.
15965 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15966 values for merge sections.
15967 * target-reloc.h (relocate_for_relocatable): Use constant
15968 invalid_address instead of -1U.
15969
89fc3421
CC
159702008-09-19 Cary Coutant <ccoutant@google.com>
15971
15972 Add plugin functionality for link-time optimization (LTO).
15973 * configure.ac (plugins): Add --enable-plugins option.
15974 * configure: Regenerate.
15975 * config.in: Regenerate.
15976 * Makefile.am (LIBDL): New variable.
15977 (CCFILES): Add plugin.cc.
15978 (HFILES): Add plugin.h.
15979 (ldadd_var): Add LIBDL.
15980 * Makefile.in: Regenerate.
15981
15982 * archive.cc: Include "plugin.h".
15983 (Archive::setup): Don't preread archive symbols when using a plugin.
15984 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15985 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15986 files.
15987 (Archive::include_member): Add symbols from plugin objects.
15988 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15989 * descriptors.cc (Descriptors::open): Check for file descriptors
15990 abandoned by plugins.
15991 (Descriptors::claim_for_plugin): New function.
15992 * descriptors.h (Descriptors::claim_for_plugin): New function.
15993 (Open_descriptor::is_claimed): New field.
15994 (claim_descriptor_for_plugin): New function.
15995 * fileread.cc (File_read::claim_for_plugin): New function.
15996 * fileread.h (File_read::claim_for_plugin): New function.
15997 (File_read::descriptor): New function.
15998 * gold.cc: Include "plugin.h".
15999 (queue_initial_tasks): Add task to call plugin hooks for generating
16000 new object files.
16001 * main.cc: Include "plugin.h".
16002 (main): Load plugin libraries.
16003 * object.h (Pluginobj): Declare.
16004 (Object::pluginobj): New function.
16005 (Object::do_pluginobj): New function.
16006 (Object::set_target): New function.
16007 * options.cc: Include "plugin.h".
16008 (General_options::parse_plugin): New function.
16009 (General_options::General_options): Initialize plugins_ field.
16010 (General_options::add_plugin): New function.
16011 * options.h (Plugin_manager): Declare.
16012 (General_options): Add --plugin option.
16013 (General_options::has_plugins): New function.
16014 (General_options::plugins): New function.
16015 (General_options::add_plugin): New function.
16016 (General_options::plugins_): New field.
16017 * plugin.cc: New file.
16018 * plugin.h: New file.
16019 * readsyms.cc: Include "plugin.h".
16020 (Read_symbols::do_read_symbols): Check for archive before checking
16021 for ELF file. Call plugin hooks to claim files.
16022 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
16023 from a real object file; force override when processing replacement
16024 files.
16025 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
16026 (Symbol::init_base_object): Likewise.
16027 (Symbol::init_base_output_data): Likewise.
16028 (Symbol::init_base_output_segment): Likewise.
16029 (Symbol::init_base_constant): Likewise.
16030 (Symbol::init_base_undefined): Likewise.
16031 (Symbol::output_section): Assert that object is not a plugin.
16032 (Symbol_table::add_from_pluginobj): New function.
16033 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
16034 undefined.
16035 (Symbol_table::sized_write_globals): Likewise.
16036 (Symbol_table::add_from_pluginobj): Instantiate template.
16037 * symtab.h (Sized_pluginobj): Declare.
16038 (Symbol::in_real_elf): New function.
16039 (Symbol::set_in_real_elf): New function.
16040 (Symbol::in_real_elf_): New field.
16041 (Symbol_table::add_from_pluginobj): New function.
16042
16043 * testsuite/Makefile.am (AM_CFLAGS): New variable.
16044 (LIBDL): New variable.
16045 (LDADD): Add LIBDL.
16046 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
16047 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
16048 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
16049 (MOSTLYCLEANFILES): Likewise.
16050 * testsuite/Makefile.in: Regenerate.
16051 * testsuite/plugin_test.c: New file.
16052 * testsuite/plugin_test_1.sh: New file.
16053 * testsuite/plugin_test_2.sh: New file.
16054
de31bda5
ILT
160552008-09-16 Ian Lance Taylor <iant@google.com>
16056
9c2d0ef9
ILT
16057 * target-reloc.h (relocate_section): Check whether a symbol is
16058 defined by the ABI before reporting an undefined symbol error.
16059 * target.h (Target::is_defined_by_abi): Make parameter const.
16060 (Target::do_is_defined_by_abi): Likewise.
16061 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
16062 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
16063 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
16064 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
16065 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
16066 * testsuite/Makefile.in: Rebuild.
16067
de31bda5
ILT
16068 * fileread.cc (make_view): Add casts to avoid warning.
16069
9fa33bee
AO
160702008-09-16 Alexandre Oliva <aoliva@redhat.com>
16071
16072 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
16073 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16074
183fd0e3
AO
160752008-09-16 Alexandre Oliva <aoliva@redhat.com>
16076
16077 * options.h (General_options::output_is_executable): New.
16078 (General_options::output_is_pie): New.
16079 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16080 for shared libraries.
16081 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16082
7be8330a
CD
160832008-09-11 Chris Demetriou <cgd@google.com>
16084
16085 * options.h (origin): New -z option.
16086 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16087 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16088 in DT_FLAGS_1.
16089
a9caad02
CC
160902008-09-05 Cary Coutant <ccoutant@google.com>
16091
16092 * fileread.cc (File_read::make_view): Add check for attempt to map
16093 beyond end of file.
16094
ae6dce4d
CC
160952008-09-05 Cary Coutant <ccoutant@google.com>
16096
16097 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16098 explicit instantiations.
16099
d7ab2a47
KVH
161002008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16101
16102 PR gold/6858
16103 * options.cc (General_options::finalize): Allow undefined symbols
16104 in shlibs if linking -shared.
16105
16106 PR gold/6859
16107 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16108 symbols as not needing a dynsym entry.
16109
1e52a9c1
CS
161102008-08-20 Craig Silverstein <csilvers@google.com>
16111
16112 * fileread.cc (File_read::open): Do not lock the file unless it
16113 was successfully opened.
16114
d85c80a3
CC
161152008-08-14 Cary Coutant <ccoutant@google.com>
16116
16117 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16118 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16119 * testsuite/tls_test.cc (struct int128): 128-bit struct
16120 for testing TLS relocs with non-zero addend.
16121 (v12): New TLS variable.
16122 (t12): New test.
16123 (t_last): Add check for v12.
16124 * testsuite/tls_test.h (t12): New function.
16125 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16126
2d924fd9
ILT
161272008-08-13 Ian Lance Taylor <iant@google.com>
16128
16129 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16130 set tls_segment_ or relro_segment_.
16131 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16132 when appropriate.
16133 * output.h (Output_section::clear_is_relro): New function.
16134 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16135 sections specially even when output_data_ is empty.
16136 (Output_segment::maximum_alignment): When first section is relro,
16137 only force alignment for PT_LOAD segments.
16138 * script.cc (script_data_segment_align): New function.
16139 (script_data_segment_relro_end): New function.
16140 * script-c.h (script_data_segment_align): Declare.
16141 (script_data_segment_relro_end): Declare.
16142 * script-sections.h (class Script_sections): Declare
16143 data_segment_align and data_segment_relro_end. Add fields
16144 segment_align_index_ and saw_relro_end_.
16145 * script-sections.cc (class Sections_element): Add set_is_relro
16146 virtual function. Add new bool* parameter to place_orphan_here.
16147 Add get_output_section virtual function.
16148 (class Output_section_definition): Add set_is_relro. Add new
16149 bool* parameter to place_orphan_here. Add get_output_section.
16150 Add is_relro_ field.
16151 (Output_section_definition::Output_section_definition): Initialize
16152 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16153 and is_relro_ fields.
16154 (Output_section_definition::place_orphan_here): Add is_relro
16155 parameter.
16156 (Output_section_definition::set_section_addresses): Set relro for
16157 output section.
16158 (Output_section_definition::alternate_constraint): Likewise.
16159 (class Orphan_output_section): Add new bool* parameter to
16160 place_orphan_here. Add get_output_section.
16161 (Orphan_output_section::place_orphan_here): Add is_relro
16162 parameter.
16163 (Script_sections::Script_sections): Initialize
16164 data_segment_align_index_ and saw_relro_end_.
16165 (Script_sections::data_segment_align): New function.
16166 (Script_sections::data_segment_relro_end): New function.
16167 (Script_sections::place_orphan): Set or clear is_relro.
16168 (Script_sections::set_section_addresses): Force alignment of first
16169 TLS section.
16170 * yyscript.y (exp): Call script_data_segment_align and
16171 script_data_segment_relro_end.
16172 * testsuite/relro_script_test.t: New file.
16173 * testsuite/relro_test.cc (using_script): Declare.
16174 (t1, t2): Test using_script.
16175 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16176 (relro_script_test_SOURCES): Define.
16177 (relro_script_test_DEPENDENCIES): Define.
16178 (relro_script_test_LDFLAGS): Define.
16179 (relro_script_test_LDADD): Define.
16180 (relro_script_test.so): New target.
16181 * testsuite/Makefile.in: Rebuild.
16182
f827c9a9
CC
161832008-08-06 Cary Coutant <ccoutant@google.com>
16184
16185 * archive.cc (Archive::total_archives, Archive::total_members)
16186 (Archive::total_members_loaded): New variables.
16187 (Archive::setup): Add parameter. Add option to preread
16188 archive symbols.
16189 (Archive::read_armap): Add counter.
16190 (Archive::get_file_and_offset): New function.
16191 (Archive::get_elf_object_for_member): New function.
16192 (Archive::read_all_symbols): New function.
16193 (Archive::read_symbols): New function.
16194 (Archive::add_symbols): Add counters.
16195 (Archive::include_all_members): Use armap to find members if it's
16196 already built.
16197 (Archive::include_member): Skip reading symbols if already read.
16198 Factored code into Archive::get_file_and_offset and
16199 Archive::get_elf_object_for_member. Changed call to
16200 Mapfile::report_include_archive_member.
16201 (Archive::print_stats): New function.
16202 * archive.h: Declare Object and Read_symbols_data classes.
16203 (Archive::Archive): Add initializers for new members.
16204 (Archive::setup): Add parameter.
16205 (Archive::print_stats): New function.
16206 (Archive::total_archives, Archive::total_members)
16207 (Archive::total_members_loaded): New variables.
16208 (Archive::get_file_and_offset): New function.
16209 (Archive::get_elf_object_for_member): New function.
16210 (Archive::read_all_symbols): New function.
16211 (Archive::read_symbols): New function.
16212 (Archive::Archive_member): New class.
16213 (Archive::members_): New member.
16214 (Archive::num_members_): New member.
16215 * main.cc: Include archive.h.
16216 (main): Call Archive::print_stats.
16217 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16218 archive parameter; member_name is now the fully-decorated name.
16219 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16220 * options.h: (General_options): Add --preread-archive-symbols option.
16221 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16222 Archive::setup.
16223
de4c45bd
ILT
162242008-08-04 Ian Lance Taylor <iant@google.com>
16225
16226 * symtab.h (Symbol::use_plt_offset): New function.
16227 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16228 * powerpc.cc (Relocate::relocate): Likewise.
16229 * sparc.cc (Relocate::relocate): Likewise.
16230 * x86_64.cc (Relocate::relocate): Likewise.
16231 * testsuite/weak_plt.sh: New test.
16232 * testsuite/weak_plt_main.cc: New test.
16233 * testsuite/weak_plt_shared.cc: New test.
16234 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16235 (check_PROGRAMS): Add weak_plt.
16236 (check_DATA): Add weak_plt_shared.so.
16237 (weak_plt_main_pic.o, weak_plt): New targets.
16238 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16239 * testsuite/Makefile.in: Rebuild.
16240
16241 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16242 gcctestdir/ld.
16243 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16244 * testsuite/Makefile.in: Rebuild.
16245
323ee3f4
AM
162462008-08-04 Alan Modra <amodra@bigpond.net.au>
16247
16248 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16249 * Makefile.in: Regenerate.
16250 * po/POTFILES.in: Regenerate.
16251
7c07ecec
ILT
162522008-07-29 Ian Lance Taylor <iant@google.com>
16253
16254 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16255 symbols before other symbols.
16256 * testsuite/script_test_2.cc (test_addr): Declare.
16257 (test_addr_alias): Declare.
16258 (main): Check that test_addr and test_addr_alias have the right
cd536b21 16259 values.
7c07ecec
ILT
16260 * testsuite/script_test_2.t: Define test_addr_alias and
16261 test_addr.
16262
5778530e
ILT
162632008-07-24 Ian Lance Taylor <iant@google.com>
16264
2a00e4fb
ILT
16265 PR 5990
16266 * descriptors.cc: New file.
16267 * descriptors.h: New file.
16268 * gold-threads.h (class Hold_optional_lock): New class.
16269 * fileread.cc: Include "descriptors.h".
16270 (File_read::~File_read): Release descriptor rather than closing
16271 it.
16272 (File_read::open) [file]: Call open_descriptor rather than open.
16273 Set is_descriptor_opened_.
16274 (File_read::open) [memory]: Assert that descriptor is not open.
16275 (File_read::reopen_descriptor): New function.
16276 (File_read::release): Release descriptor.
16277 (File_read::do_read): Make non-const. Reopen descriptor.
16278 (File_read::read): Make non-const.
16279 (File_read::make_view): Reopen descriptor.
16280 (File_read::do_readv): Likewise.
16281 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16282 Update declarations.
16283 * layout.cc: Include "descriptors.h".
16284 (Layout::create_build_id): Use open_descriptor rather than open.
16285 * output.cc: Include "descriptors.h".
16286 (Output_file::open): Use open_descriptor rather than open.
16287 * archive.cc (Archive::const_iterator): Change Archive to be
16288 non-const.
16289 (Archive::begin, Archive::end): Make non-const.
16290 (Archive::count_members): Likewise.
16291 * archive.h (class Archive): Update declarations.
16292 * object.h (Object::read): Make non-const.
16293 * Makefile.am (CCFILES): Add descriptors.cc.
16294 (HFILES): Add descriptors.h.
16295 * Makefile.in: Rebuild.
16296
801647d1
ILT
16297 PR 6716
16298 * gold.h: Always include <clocale>. Add Solaris workarounds
16299 following code in binutils/sysdep.h.
16300
5edd166e
ILT
16301 PR 6048
16302 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16303 this->eh_frame_hdr_ is NULL before using it.
16304
c89ad728
ILT
16305 * dynobj.cc (Versions::Versions): Update comment.
16306
aa86f06b
ILT
16307 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16308 the base version name.
16309
5778530e
ILT
16310 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16311 array size plus one.
16312 (Stringpool_template::set_string_offsets): Subtract one from key
16313 before using it as an array index.
16314 (Stringpool_template::get_offset_with_length): Likewise.
16315 (Stringpool_template::write_to_buffer): Likewise.
16316 * stringpool.h (Stringpool_template::get_offset_from_key):
16317 Likewise.
16318
057ead22
ILT
163192008-07-23 Ian Lance Taylor <iant@google.com>
16320
7f649c59
ILT
16321 PR 6658
16322 * object.h (Merged_symbol_value::value): Do our best to handle a
16323 negative addend.
16324
057ead22
ILT
16325 PR 6647
16326 * script.cc (Version_script_info::get_versions): Don't add empty
16327 version tag to return value.
16328 (Version_script_info::get_symbol_version_helper): Change return
16329 type to bool. Add pversion parameter. Change all callers.
16330 (script_register_vers_node): Don't require a non-NULL tag.
16331 * script.h (class Version_script_info): Update declarations.
16332 (Version_script_info::get_symbol_version): Change return type to
16333 bool. Add version parameter. Change all callers.
16334 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16335 handling. Handle an empty version from a version script.
16336 (Symbol_table::define_special_symbol): Likewise.
16337 * testsuite/ver_test_10.script: New file.
16338 * testsuite/ver_test_10.sh: New file.
16339 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16340 (check_DATA): Add ver_test_10.syms.
16341 (ver_test_10.syms, ver_test_10.so): New target.
16342 * testsuite/Makefile.in: Rebuild.
16343
58e54ac2
CD
163442008-07-23 Simon Baldwin <simonb@google.com>
16345
16346 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16347 to zero for undefined symbols from dynamic libraries.
16348
95d14cd3
ILT
163492008-07-23 Ian Lance Taylor <iant@google.com>
16350
16351 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16352 Change all callers.
16353 * symtab.h (class Symbol_table): Update declaration.
16354 * testsuite/ver_test_9.cc: New file.
16355 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16356 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16357 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16358 (ver_test_9.so, ver_test_9.o): New targets.
16359 * testsuite/Makefile.in: Rebuild.
16360
92de84a6
ILT
163612008-07-22 Ian Lance Taylor <iant@google.com>
16362
34810851
ILT
16363 * options.h (class General_options): Define --check-sections.
16364 * layout.cc (Layout::set_segment_offsets): Handle
16365 --check-sections.
16366
af6156ef
ILT
16367 * options.h (class General_options): Define -n/--nmagic and
16368 -N/--omagic.
16369 * options.cc (General_options::finalize): For -n/--nmagic or
16370 -N/--omagic, set -static.
16371 * layout.cc (Layout::attach_allocated_section_to_segment): If
16372 -N/--omagic, don't put read-only and read-write sections in
16373 different segments.
16374 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16375 finding a read-only segment.
16376 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16377 don't set the minimum segment alignment to the common page size,
16378 and don't set the file offset to the address modulo the page size.
16379 * script-sections.cc (Script_sections::create_segments): If
16380 -n/--omagic, don't put read-only and read-write sections in
16381 different segments.
16382
92de84a6
ILT
16383 * cref.cc: New file.
16384 * cref.h: New file.
16385 * options.h (class General_options): Add --print-symbol-counts.
16386 * main.cc (main): Issue defined symbol report if requested.
16387 * archive.cc (Archive::interpret_header): Make into a const member
16388 function.
16389 (Archive::add_symbols): Call Input_objects::archive_start and
16390 archive_stop.
16391 (Archive::const_iterator): Define new class.
16392 (Archive::begin, Archive::end): New functions.
16393 (Archive::include_all_members): Rewrite to use iterator.
16394 (Archive::count_members): New function.
16395 * archive.h (class Archive): Update declarations.
16396 (Archive::filename): New function.
16397 * object.cc: Include "cref.h".
16398 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16399 (Sized_relobj::do_get_global_symbol_counts): New function.
16400 (Input_objects::add_object): Add object to cross-referencer.
16401 (Input_objects::archive_start): New function.
16402 (Input_objects::archive_stop): New function.
16403 (Input_objects::print_symbol_counts): New function.
16404 * object.h: Declare Cref and Archive.
16405 (Object::get_global_symbol_counts): New function.
16406 (Object::do_get_global_symbol_counts): New pure virtual function.
16407 (class Sized_relobj): Add defined_count_ field. Update
16408 declarations.
16409 (class Input_objects): Add cref_ field. Update constructor.
16410 Update declarations.
16411 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16412 defined_count_.
16413 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16414 symbol counts.
16415 (Sized_dynobj::do_get_global_symbol_counts): New function.
16416 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16417 defined_count_. Update declarations. Define Symbols typedef.
16418 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16419 parameter. Change all callers.
16420 (Symbol_table::add_from_dynobj): Add sympointers and defined
16421 parameters. Change all callers.
16422 * symtab.h (class Symbol_table): Update declarations.
16423 * Makefile.am (CCFILES): Add cref.cc.
16424 (HFILES): Add cref.h.
16425 * Makefile.in: Rebuild.
16426
3f7c5e1d
CD
164272008-07-22 Simon Baldwin <simonb@google.com>
16428
16429 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16430 to zero when writing undefined symbols.
16431
e0b64032
ILT
164322008-07-22 Ian Lance Taylor <iant@google.com>
16433
16434 * output.cc (Output_section::add_input_section): Don't try to
16435 merge empty merge sections.
16436
096b02cf
CS
164372008-07-21 Craig Silverstein <csilvers@google.com>
16438
16439 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16440 Include symbol version in error message.
cd536b21 16441
1d1f116d
CD
164422008-07-20 Chris Demetriou <cgd@google.com>
16443
cd536b21 16444 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16445 (RANDOM_SEED_CFLAGS): New substituted variable.
16446 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16447 * configure: Rebuild.
16448 * Makefile.in: Likewise.
16449 * testsuite/Makefile.in: Likewise.
16450
a18f591e
ILT
164512008-07-18 Ian Lance Taylor <iant@google.com>
16452
16453 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16454 where we see NAME/NULL and NAME/VERSION as separate symbols.
16455 * testsuite/ver_test_main.cc (main): Call t4.
16456 (t4, t4_2a): Define.
16457 * testsuite/ver_test_2.cc (t4_2): Define.
16458 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16459 * testsuite/ver_test_4.cc (t4_2a): Define.
16460 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16461 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16462
c6e3f6ed
ILT
164632008-07-17 Ian Lance Taylor <iant@google.com>
16464
16465 * dynobj.cc (Versions::add_def): If we give an error about a
16466 missing version, go ahead and create the version anyhow.
16467
ef9beddf
ILT
164682008-07-10 Ian Lance Taylor <iant@google.com>
16469
16470 Handle output sections with more than 0x7fffffff bytes.
16471 * object.h (class Relobj): Change map_to_output_ to
16472 output_sections_, and just keep a section pointer. Change all
16473 uses. Move comdat group support to Sized_relobj.
16474 (Relobj::is_section_specially_mapped): Remove.
16475 (Relobj::output_section): Remove poff parameter. Change all
16476 callers.
16477 (Relobj::output_section_offset): New function.
16478 (Relobj::set_section_offset): Rewrite.
16479 (Relobj::map_to_output): Remove.
16480 (Relobj::output_sections): New function.
16481 (Relobj::do_output_section_offset): New pure virtual function.
16482 (Relobj::do_set_section_offset): Likewise.
16483 (class Sized_relobj): Add section_offsets_ field. Add comdat
16484 group support from Relobj. Update declarations.
16485 (Sized_relobj::get_output_section_offset): New function.
16486 (Sized_relobj::do_output_section_offset): New function.
16487 (Sized_relobj::do_set_section_offset): New function.
16488 * object.cc (Relobj::output_section_address): Remove.
16489 (Sized_relobj::Sized_relobj): Initialize new fields.
16490 (Sized_relobj::include_section_group): Cast find_kept_object to
16491 Sized_relobj.
16492 (Sized_relobj::include_linkonce_section): Likewise.
16493 (Sized_relobj::do_layout): Use separate arrays for output section
16494 and output offset.
16495 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16496 output_sections.
16497 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16498 output_sections and section_offsets.
16499 (Sized_relobj::write_local_symbols): Likewise.
16500 (map_to_kept_section): Compute output address directly.
16501 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16502 output_sections and section_offsets.
16503 (Sized_relobj::write_sections): Likewise.
16504 (Sized_relobj::relocate_sections): Likewise.
16505 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16506 * output.h (class Output_reloc): Update declarations. Change
16507 u2_.relobj to Sized_relobj*.
16508 (class Output_data_reloc): Change add functions to use
16509 Sized_relobj*.
16510 * output.cc (Output_reloc::Output_reloc): Change relobj to
16511 Sized_relobj*.
16512 (Output_reloc::local_section_offset): Change return type to
16513 Elf_Addr. Use get_output_section_offset.
16514 (Output_reloc::get_address): Likewise.
16515 (Output_section::is_input_address_mapped): Don't call
16516 is_section_specially_mapped.
16517 (Output_section::output_offset): Likewise.
16518 (Output_section::output_address): Likewise.
16519 (Output_section::starting_output_address): Likewise.
16520 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16521 parameter to Sized_relobj*.
16522 (Copy_relocs::need_copy_reloc): Likewise.
16523 (Copy_relocs::save): Likewise.
16524 * copy-relocs.h (class Copy_relocs): Update declarations.
16525 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16526 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16527 * target-reloc.h (relocate_for_relocatable): Change
16528 offset_in_output_section type to Elf_Addr. Change code that uses
16529 it as well.
16530 * layout.cc (Layout::layout): Always set *off.
16531 * mapfile.cc (Mapfile::print_input_section): Use
16532 output_section_offset.
16533 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16534 Sized_relobj*.
16535 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16536 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16537 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16538
5cb66f97
ILT
165392008-07-03 Ian Lance Taylor <iant@google.com>
16540
16541 * layout.cc (Layout::include_section): Do not discard unrecognized
16542 SHT_STRTAB sections.
16543
afe47622
CS
165442008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16545
16546 * script.cc (Lex::can_continue_name): Make '?' allowable in
16547 version-script names.
16548 * testsuite/version_script.map: Change glob pattern to use '?'
16549
5adf9721
ILT
165502008-06-30 Manish Singh <yosh@gimp.org>
16551
16552 PR 6585
16553 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16554 Correct typo.
16555
e6fde208
ILT
165562008-06-30 Ian Lance Taylor <iant@google.com>
16557
16558 PR 6660
16559 PR 6682
16560 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16561 versions]: Don't try to read the value in the contents, since we
16562 don't use it. Use the template endianness when writing.
16563
3f2e6a2d
CC
165642008-06-25 Cary Coutant <ccoutant@google.com>
16565
16566 * fileread.cc (File_read::make_view): Assert on zero-length view.
16567 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16568 symbol table when there are no symbols to read.
16569
c43d3a48
CS
165702008-06-23 Craig Silverstein <csilvers@google.com>
16571
16572 * version.cc (version_string): Bump to 1.7
16573
5f494ea0
CS
165742008-06-18 Craig Silverstein <csilvers@google.com>
16575
16576 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16577 constant 0xFFFF to type Valtype.
16578 (Powerpc_relocate_functions::rel16_ha): Likewise.
16579
c42e122e
ILT
165802008-06-17 Ian Lance Taylor <iant@google.com>
16581
f34787f8
ILT
16582 * output.h (Output_section::Input_section): Initialize p2align_ to
16583 zero for Output_section_data constructors.
16584 (Output_section::Input_section::addralign): If not an input
16585 section, return the alignment of the Output_section_data.
16586 * testsuite/copy_test.cc: New file.
16587 * testsuite/copy_test_1.cc: New file.
16588 * testsuite/copy_test_2.cc: New file.
16589 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16590 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16591 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16592 (copy_test_1_pic.o, copy_test_1.so): New targets.
16593 (copy_test_2_pic.o, copy_test_2.so): New targets.
16594 * testsuite/Makefile.in: Rebuild.
16595
c42e122e
ILT
16596 * script-sections.cc (Script_sections::place_orphan): Initialize
16597 local variable exact.
16598
ce3ac18a
DE
165992008-06-13 David Edelsohn <edelsohn@gnu.org>
16600
16601 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16602
42cacb20
DE
166032008-06-12 David Edelsohn <edelsohn@gnu.org>
16604 David S. Miller <davem@davemloft.net>
16605
16606 * powerpc.cc: New file.
16607 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16608 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16609 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16610 * Makefile.in: Rebuild.
16611
7b308235
ILT
166122008-06-09 Ian Lance Taylor <iant@google.com>
16613
16614 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16615 <exception>.
16616 (throwing, orig_terminate): New static variables.
16617 (terminate_handler): New static function.
16618 (t2): Set terminate handler.
16619
f0b886e3
ILT
166202008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16621
16622 PR 6584
cd536b21 16623 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16624 alignment.
16625
3e90f135
CC
166262008-05-30 Cary Coutant <ccoutant@google.com>
16627
16628 * archive.cc (Archive::include_all_members) Correct to step
16629 over symbol table and extended name table in thin archives.
16630
e09ad04a
ILT
166312008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16632
16633 PR 6407
16634 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16635 calculation.
16636
62b01cb5
ILT
166372008-05-28 Caleb Howe <cshowe@google.com>
16638
16639 * reduced_debug_output.cc: New file.
16640 * reduced_debug_output.h: New file.
92de84a6 16641 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16642 * options.cc (General_options::finalize): Add strip_debug_non_line
16643 to the strip heirarchy.
16644 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16645 fields.
16646 * layout.cc: Include "reduced_debug_output.h".
16647 (Layout::Layout): Initialize new fields.
16648 (line_only_debug_sections): New static array.
16649 (is_lines_only_debug_sections): New static inline function.
16650 (Layout::include_section): Handle --strip-debug-non-line.
16651 (Layout::make_output_section): If --strip-debug-non-line, build
16652 new output sections for .debug_abbrev and .debug_info.
16653 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16654 gold. Warn about possible overflow.
16655 (read_signed_LEB_128): Likewise.
16656 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16657 (read_signed_LEB_128): Declare.
16658 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16659 (HFILES): Add reduced_debug_output.h.
16660 * Makefile.in: Rebuild.
16661
7d9e3d98
ILT
166622008-05-21 Ian Lance Taylor <iant@google.com>
16663
16664 * mapfile.cc: New file.
16665 * mapfile.h: New file.
16666 * options.h (class General_options): Add -M/--print-map and -Map.
16667 * options.cc (General_options::finalize): Make -M equivalent to
16668 -Map -.
16669 * main.cc: Include <cstdio> and "mapfile.h".
16670 (main): Open mapfile if requested.
16671 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16672 constructor. Change caller.
16673 (queue_initial_tasks): Add mapfile parameter. Change caller.
16674 (queue_middle_tasks): Likewise.
16675 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16676 declarations.
16677 * archive.cc: Include "mapfile.h".
16678 (Archive::add_symbols): Add mapfile parameter. Change all
16679 callers. Pass mapfile, symbol, and reason to include_member.
16680 (Archive::include_all_members): Add mapfile parameter. Change all
16681 callers.
16682 (Archive::include_member): Add mapfile, sym, and why parameters.
16683 Change all callers. Report inclusion to map file.
16684 * archive.h: Include "fileread.h".
16685 (class Archive): Update declarations.
16686 (Archive::file): New const method.
16687 (class Add_archive_symbols): Add mapfile_ field. Update
16688 constructor. Change all callers.
16689 * readsyms.h (class Read_symbols): Likewise.
16690 (class Finish_group): Likewise.
16691 (class Read_script): Likewise.
16692 * common.cc: Include "mapfile.h".
16693 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16694 all callers.
16695 (Symbol_table::do_allocate_commons): Likewise.
16696 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16697 symbol allocation to mapfile.
16698 * common.h (class Allocate_commons_task): Add mapfile_ field.
16699 Update constructor. Change all callers.
16700 * symtab.h (class Symbol_table): Update declarations.
16701 * layout.cc: Include "mapfile.h".
16702 (Layout_task_runner::run): Print information to mapfile.
16703 (Layout::create_gold_note): Change Output_data_fixed_space to
16704 Output_data_zero_fill.
16705 (Layout::create_build_id): Likewise.
16706 (Layout::print_to_mapfile): New function.
16707 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16708 constructor. Change caller.
16709 (class Layout): Declare print_to_mapfile.
16710 * output.cc (Output_section::Input_section::print_to_mapfile): New
16711 function.
16712 (Output_section::add_input_section): If producing a map, always
16713 add to input_sections_ list.
16714 (Output_section::do_print_to_mapfile): New function.
16715 (Output_segment::print_sections_to_mapfile): New function.
16716 (Output_segment::print_section_list_to_mapfile): New function.
16717 * output.h: Include "mapfile.h".
16718 (Output_data::print_to_mapfile): New function.
16719 (Output_data::do_print_to_mapfile): New virtual function.
16720 (Output_segment_headers::do_print_to_mapfile): New function.
16721 (Output_file_header::do_print_to_mapfile): New function.
16722 (Output_data_const::do_print_to_mapfile): New function.
16723 (class Output_data_const_buffer): Add map_name_ field. Update
16724 constructor. Change all callers. Add do_print_to_mapfile
16725 function.
16726 (class Output_data_fixed_space): Likewise.
16727 (class Output_data_space): Likewise.
16728 (class Output_data_zero_fill): New class.
16729 (Output_data_strtab::do_print_to_mapfile): New function.
16730 (Output_data_reloc_base::do_print_to_mapfile): New function.
16731 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16732 (Output_data_group::do_print_to_mapfile): New function.
16733 (Output_data_got::do_print_to_mapfile): New function.
16734 (Output_data_dynamic::do_print_to_mapfile): New function.
16735 (Output_symtab_xindex::do_print_to_mapfile): New function.
16736 (class Output_section): Declare do_print_to_mapflie. Declare
16737 print_to_mapfile in Input_section.
16738 (class Output_segment): Declare new functions.
16739 * object.h (Sized_relobj::symbol_count): New function.
16740 * script-sections.cc
16741 (Output_section_element_dot_assignment::set_section_addresses):
16742 Change Output_data_fixed_space to Output_data_zero_fill.
16743 (Output_data_expression::do_print_to_mapfile): New function.
16744 * script.cc (read_input_script): Add mapfile parameter. Change
16745 all callers.
16746 * script.h (read_input_script): Update declaration.
16747 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16748 (Eh_frame::do_print_to_mapfile): New function.
16749 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16750 (Output_merge_string::do_print_to_mapfile): New function.
16751 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16752 function.
16753 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16754 function.
16755 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16756 function.
16757 * Makefile.am (CCFILES): Add mapfile.cc.
16758 (HFILES): Add mapfile.h.
16759 * Makefile.in: Rebuild.
16760
9f1d377b
ILT
167612008-05-19 Ian Lance Taylor <iant@google.com>
16762
16763 * options.h (class General_options): Add -z relro.
16764 * layout.cc (Layout::Layout): Initialize relro_segment_.
16765 (Layout::add_output_section_data): Return the output section.
16766 (Layout::make_output_section): Rcognize relro sections and mark
16767 them appropriately.
16768 (Layout::attach_allocated_section_to_segment): Put relro sections
16769 in a PT_GNU_RELRO segment.
16770 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16771 section as relro.
16772 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16773 PT_TLS segments.
16774 (Layout::linkonce_mapping): Map d.rel.ro.local to
16775 .data.rel.ro.local.
16776 (Layout::output_section_name): Us .data.rel.ro.local for any
16777 section which begins with that.
16778 * layout.h (class Layout): Update add_output_section_data
16779 declaration. Add relro_segment_ field.
16780 * output.cc (Output_section::Output_section): Initialize is_relro_
16781 and is_relro_local_ fields.
16782 (Output_segment::add_output_section): Group relro sections.
16783 (Output_segment::is_first_section_relro): New function.
16784 (Output_segment::maximum_alignment): If there is a relro section,
16785 align the segment to the common page size.
16786 (Output_segment::set_section_addresses): Track whether we are
16787 looking at relro sections. If the last section is a relro
16788 section, align to the common page size.
16789 (Output_segment::set_section_list_addresses): Add in_relro
16790 parameter. Change all callers. Align to the page size when
16791 moving from relro to non-relro section.
16792 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16793 segment.
16794 * output.h (class Output_section): Add is_relro_ and
16795 is_relro_local_ fields.
16796 (Output_section::is_relro): New function.
16797 (Output_section::set_is_relro): New function.
16798 (Output_section::is_relro_local): New function.
16799 (Output_section::set_is_relro_local): New function.
16800 (class Output_segment): Update declarations.
16801 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16802 * sparc.cc (Target_sparc::got_section): Likewise.
16803 * x86_64.cc (Target_x86_64::got_section): Likewise.
16804 * testsuite/relro_test_main.cc: New file.
16805 * testsuite/relro_test.cc: New file.
16806 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16807 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16808 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16809 (relro_test.so, relro_test_pic.o): New targets.
16810 * testsuite/Makefile.in: Rebuild.
16811
a984ee1d
ILT
168122008-05-16 Ian Lance Taylor <iant@google.com>
16813
01676dcd
ILT
16814 * output.cc (Output_segment::add_output_section): Remove front
16815 parameter.
16816 * output.h (class Output_segment): Remove
16817 add_initial_output_section and overloaded add_output_section.
16818 Update declaration of remaining add_output_section.
16819 * layout.cc (Layout::create_interp): Call add_output_section
16820 rather than add_initial_output_section.
16821 (Layout::finish_dynamic_section): Likewise.
16822
497897f9
ILT
16823 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16824 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16825 know the dynamic type.
16826 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16827 field. Initialize it in constructor.
16828 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16829 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16830 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16831 reloc.
16832
a984ee1d
ILT
16833 * output.cc (Output_reloc::get_address): Change return type to
16834 Elf_Addr.
16835 * output.h (class Output_reloc): Update get_address declaration.
16836 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16837 for section addresses.
16838
55ba0940
ILT
168392008-05-09 Ian Lance Taylor <iant@google.com>
16840
16841 PR 6493
16842 * gold.cc (gold_nomem): Use return value of write.
16843
75517b77
ILT
168442008-05-08 Ian Lance Taylor <iant@google.com>
16845
16846 * symtab.c (Symbol::init_base_output_data): Add version
16847 parameter. Change all callers.
16848 (Symbol::init_base_output_segment): Likewise.
16849 (Symbol::init_base_constant): Likewise.
16850 (Symbol::init_base_undefined): Likewise.
16851 (Sized_symbol::init_output_data): Likewise.
16852 (Sized_symbol::init_output_segment): Likewise.
16853 (Sized_symbol::init_constant): Likewise.
16854 (Sized_symbol::init_undefined): Likewise.
16855 (Symbol_table::do_define_in_output_data): If the new symbol has a
16856 version, mark it as the default.
16857 (Symbol_table::do_define_in_output_segment): Likewise.
16858 (Symbol_table::do_define_as_constant): Likewise.
16859 * symtab.h (class Symbol): Update declarations.
16860 (class Sized_symbol): Likewise.
16861 * resolve.cc (Symbol::override_version): New function.
c42e122e 16862 (Symbol::override_base): Call override_version.
75517b77
ILT
16863 (Symbol::override_base_with_special): Likewise.
16864 * testsuite/ver_script_8.script: New file.
16865 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16866 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16867 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16868 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16869
f1f70eae
ILT
168702008-05-06 Ian Lance Taylor <iant@google.com>
16871
f3e9c5c5
ILT
16872 PR 6049
16873 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16874 functions.
16875 (class General_options): Remove existing --undefined, and add
16876 --no-undefined instead. Add new --undefined as synonym for -u.
16877 * archive.cc (Archive::add_symbols): Check whether symbol was
16878 named with -u.
16879 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16880 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16881 all uses. Add IS_UNDEFINED. Update declarations to split
16882 different versions of init_base. Declare init_base_undefined.
16883 (Symbol::is_defined): Handle IS_UNDEFINED.
16884 (Symbol::is_undefined): Likewise.
16885 (Symbol::is_weak_undefined): Call is_undefined.
16886 (Symbol::is_absolute): Handle IS_CONSTANT.
16887 (class Sized_symbol): Update declarations to split different
16888 versions of init. Declare init_undefined.
16889 (class Symbol_table): Declare new functions.
16890 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16891 Change all callers.
16892 (Symbol::init_base_output_data): Likewise.
16893 (Symbol::init_base_output_segment): Likewise.
16894 (Symbol::init_base_constant): Likewise.
16895 (Symbol::init_base_undefined): New function.
16896 (Sized_symbol::init_object): Rename from init. Change all
16897 callers.
16898 (Sized_symbol::init_output_data): Likewise.
16899 (Sized_symbol::init_output_segment): Likewise.
16900 (Sized_symbol::init_constant): Likewise.
16901 (Sized_symbol::init_undefined): New function.
16902 (Symbol_table::add_undefined_symbols_from_command_line): New
16903 function.
16904 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16905 function.
16906 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16907 (Symbol::output_section): Likewise.
16908 (Symbol::set_output_section): Likewise.
16909 (Symbol_table::sized_finalize_symbol): Likewise.
16910 (Symbol_table::sized_write_globals): Likewise.
16911 * resolve.cc (Symbol_table::should_override): Likewise.
16912 (Symbol::override_base_with_special): Likewise.
16913
8bdcdf2c
ILT
16914 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16915 symbol, change it to have default visibility.
16916 * testsuite/protected_1.cc: New file.
16917 * testsuite/protected_2.cc: New file.
16918 * testsuite/protected_3.cc: New file.
16919 * testsuite/protected_main_1.cc: New file.
16920 * testsuite/protected_main_2.cc: New file.
16921 * testsuite/protected_main_3.cc: New file.
16922 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16923 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16924 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16925 (protected_1.so): New target.
16926 (protected_1_pic.o, protected_2_pic.o): New targets.
16927 (protected_3_pic.o): New target.
16928 (check_PROGRAMS): Add protected_2.
16929 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16930 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16931 * testsuite/Makefile.in: Rebuild.
16932
2b706932
ILT
16933 * options.h (DEFINE_var): Add set_user_set_##varname__.
16934 (DEFINE_bool_alias): New macro.
16935 (class General_options): Define -Bstatic using DEFINE_bool_alias
16936 rather than DEFINE_special. Add --undefined as an alias for -z
16937 defs.
16938 * options.cc (General_options::parse_Bstatic): Remove.
16939
d82a5bcc
ILT
16940 * options.h (class General_options): Add --fatal-warnings.
16941 * main.cc (main): Implement --fatal-warnings.
16942 * errors.h (Errors::warning_count): New function.
16943
f1f70eae
ILT
16944 * options.h (class General_options): Add -Bsymbolic-functions.
16945 * symtab.h (Symbol::is_preemptible): Check for
16946 -Bsymbolic-functions.
16947
8825ac63
ILT
169482008-05-05 Ian Lance Taylor <iant@google.com>
16949
d98bc257
ILT
16950 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16951 as noVARNAME rather than no-VARNAME.
16952 (class General_options): Add option -z combreloc.
16953 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16954 get_address.
16955 (Output_reloc::sort_before) [SHT_REL]: New function.
16956 (Output_reloc::sort_before) [SHT_RELA]: New function.
16957 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16958 Sort_relocs_comparison.
16959 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16960 parameter. Change all callers.
16961 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16962 sort_relocs parameter. Change all callers.
16963 * output.cc (Output_reloc::get_address): New function, broken out
16964 of write_rel.
16965 (Output_reloc::write_rel): Call it.
16966 (Output_reloc::compare): New function.
16967 (Output_data_reloc_base::do_write): Optionally sort relocs.
16968
60b2b4e7
ILT
16969 * configure.ac: If targ_extra_obj is set, link it in.
16970 * configure.tgt: Initialize all variables.
16971 (x86_64*): Set targ_extra_obj and targ_extra_size.
16972 * configure: Rebuild.
16973
8825ac63
ILT
16974 * object.cc (Sized_relobj::include_section_group): Adjust section
16975 indexes read from group data. Build vector to pass to
16976 layout_group.
16977 * layout.cc (Layout::layout_group): Add flags and shndxes
16978 parameters. Remove contents parameter. Change caller. Update
16979 explicit instantiations.
16980 * layout.h (class Layout): Update layout_group declaration.
16981 * output.cc (Output_data_group::Output_data_group): Add flags and
16982 input_shndxes parameters. Remove contents parameter. Change
16983 caller.
16984 (Output_data_group::do_write): Change input_sections_ to
16985 input_shndxes_.
16986 * output.h (class Output_data_group): Update constructor
16987 declaration. Rename input_sections_ to input_shndxes_.
16988 * testsuite/many_sections_test.cc: Add template.
16989
e94cf127
CC
169902008-04-30 Cary Coutant <ccoutant@google.com>
16991
4418b2d5
CC
16992 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16993
e94cf127
CC
16994 * layout.cc (Layout::include_section): Refactored check for debug
16995 info section.
16996 (Layout::add_comdat): Add new parameters. Change type
16997 of signature parameter. Add object and shndx to signatures table.
16998 (Layout::find_kept_object): New function.
16999 * layout.h: Include <cstring>.
17000 (Layout::is_debug_info_section): New function.
17001 (Layout::add_comdat): Add new parameters.
17002 (Layout::find_kept_object): New function.
17003 (Layout::Kept_section): New struct.
17004 (Layout::Signatures): Change type of map range.
17005 * object.cc (Relobj::output_section_address): New function.
17006 (Sized_relobj::include_section_group): Add new parameters. Change
17007 calls to Layout::add_comdat. Change to build table of kept comdat
17008 groups and table mapping discarded sections to kept sections.
17009 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
17010 (Sized_relobj::do_layout): Change calls to include_section_group and
17011 include_linkonce_section.
17012 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
17013 value to zero when section is discarded.
17014 (Sized_relobj::map_to_kept_section): New function.
17015 * object.h (Relobj::output_section_address): New function.
17016 (Relobj::Comdat_group): New type.
17017 (Relobj::find_comdat_group): New function.
17018 (Relobj::Comdat_group_table): New type.
17019 (Relobj::Kept_comdat_section): New type.
17020 (Relobj::Kept_comdat_section_table): New type.
17021 (Relobj::add_comdat_group): New function.
17022 (Relobj::set_kept_comdat_section): New function.
17023 (Relobj::get_kept_comdat_section): New function.
17024 (Relobj::comdat_groups_): New field.
17025 (Relobj::kept_comdat_sections_): New field.
17026 (Symbol_value::input_value): Update comment.
17027 (Sized_relobj::map_to_kept_section) New function.
17028 (Sized_relobj::include_linkonce_section): Add new parameter.
17029 * target-reloc.h (Comdat_behavior): New type.
17030 (get_comdat_behavior): New function.
17031 (relocate_section): Add code to map a discarded section to the
17032 corresponding kept section when applying a relocation.
17033
e4e5049b
CS
170342008-04-30 Craig Silverstein <csilvers@google.com>
17035
17036 * dwarf_reader.cc (next_generation_count): New static var.
17037 (Addr2line_cache_entry): New struct.
17038 (addr2line_cache): New static var.
17039 (Dwarf_line_info::one_addr2line): Added caching.
17040 (Dwarf_line_info::clear_addr2line_cache): New function.
17041 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
17042 cache-size parameter.
17043 (Dwarf_line_info::one_addr2line_cache): New function.
17044 * symtab.cc (Symbol_table::detect_odr_violations): Pass
17045 new cache-size argument to one_addr2line(), and clear cache.
17046
d09e9154
CC
170472008-04-28 Cary Coutant <ccoutant@google.com>
17048
17049 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
17050 R_386_PC8 relocations.
17051
7ef73768
ILT
170522008-04-23 Ian Lance Taylor <iant@google.com>
17053
55438702
ILT
17054 * object.cc (Sized_relobj::include_section_group): Check for
17055 invalid section group.
17056
c165fb93
ILT
17057 * object.cc (make_elf_object): Correct test for 64-bit ELF file
17058 header size.
17059
7ef73768
ILT
17060 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
17061 than read for file header.
17062 * archive.cc (Archive::include_member): Likewise.
17063
6194aaab
L
170642008-04-23 Paolo Bonzini <bonzini@gnu.org>
17065
17066 * aclocal.m4: Regenerate.
17067 * configure: Regenerate.
17068
d491d34e
ILT
170692008-04-19 Ian Lance Taylor <iant@google.com>
17070
5ea2bac6
ILT
17071 * version.cc (version_string): Bump to 1.6.
17072
7bc3e21a
ILT
17073 * testsuite/Makefile.am (many_sections_r_test): New target.
17074 (many_sections_r_test_SOURCES): Remove.
17075 (many_sections_r_test_DEPENDENCIES): Remove.
17076 (many_sections_r_test_LDFLAGS): Remove.
17077 (many_sections_r_test_LDADD): Remove.
17078
7fcd3aa9
ILT
17079 * object.cc (Sized_relobj::do_add_symbols): Always pass
17080 local_symbol_count_ to add_from_relobj.
17081
4c94d6ae
ILT
17082 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17083 every thousand variables.
17084 * testsuite/Makefile.in: Rebuild.
17085
d491d34e
ILT
17086 * object.cc (Xindex::initialize_symtab_xindex): New function.
17087 (Xindex::read_symtab_xindex): New function.
17088 (Xindex::sym_xindex_to_shndx): New function.
17089 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17090 available.
17091 (Sized_relobj::do_initialize_xindex): New function.
17092 (Sized_relobj::do_read_symbols): Adjust section links.
17093 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17094 parameter. Change all callers.
17095 (Sized_relobj::include_section_group): Adjust section links and
17096 symbol section indexes.
17097 (Sized_relobj::do_layout): Adjust section links.
17098 (Sized_relobj::do_count_local_symbols): Adjust section links and
17099 symbol section indexes.
17100 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17101 ordinary and special symbols.
17102 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17103 dynsym_xindex parameters. Change all callers. Adjust section
17104 links. Use SHN_XINDEX when needed.
17105 (Sized_relobj::get_symbol_location_info): Adjust section links.
17106 Don't get fooled by special symbols.
17107 * object.h (class Xindex): Define.
17108 (class Object): Add xindex_ parameter. Declare virtual functoin
17109 do_initialize_xindex.
17110 (Object::adjust_sym_shndx): New function.
17111 (Object::set_xindex): New protected function.
17112 (class Symbol_value): Add is_ordinary_shndx_ field.
17113 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17114 (Symbol_value::value): Assert ordinary section.
17115 (Symbol_value::initialize_input_to_output_map): Likewise.
17116 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17117 Change all callers.
17118 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17119 all callers.
17120 (class Sized_relobj): Update declarations.
17121 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17122 parameter. Change all callers.
17123 (Sized_relobj::adjust_shndx): New function.
17124 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17125 field.
17126 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17127 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17128 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17129 (Sized_dynobj::read_dynsym_section): Adjust section links.
17130 (Sized_dynobj::read_dynamic): Likewise.
17131 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17132 section links.
17133 (Sized_dynobj::do_initialize_xindex): New function.
17134 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17135 do_initialize_xindex.
17136 (Sized_dynobj::adjust_shndx): New function.
17137 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17138 dynsym_xindex_ fields.
17139 (Layout::finalize): Add a call to set_section_indexes before
17140 creating the symtab sections.
17141 (Layout::set_section_indexes): Don't do anything if the section
17142 already has a section index.
17143 (Layout::create_symtab_sections): Add shnum parameter. Change
17144 caller. Create .symtab_shndx section if needed.
17145 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17146 caller.
17147 (Layout::allocated_output_section_count): New function.
17148 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17149 needed.
17150 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17151 fields. Update declarations.
17152 (Layout::symtab_xindex): New function.
17153 (Layout::dynsym_xindex): New function.
17154 (class Write_symbols_task): Add layout_ field.
17155 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17156 Change caller.
17157 * output.cc (Output_section_headers::Output_section_headers): Add
17158 shstrtab_section parameter. Change all callers.
17159 (Output_section_headers::do_sized_write): Store overflow values
17160 for section count and section string table section index in
17161 section header zero.
17162 (Output_file_header::do_sized_write): Check for overflow of
17163 section count and section string table section index.
17164 (Output_symtab_xindex::do_write): New function.
17165 (Output_symtab_xindex::endian_do_write): New function.
17166 * output.h (class Output_section_headers): Add shstrtab_section_.
17167 Update declarations.
17168 (class Output_symtab_xindex): Define.
17169 (Output_section::has_out_shndx): New function.
17170 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17171 field.
17172 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17173 Change all callers.
17174 (Sized_symbol::init): Likewise.
17175 (Symbol::output_section): Check for ordinary symbol.
17176 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17177 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17178 callers.
17179 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17180 Change all callers. Simplify handling of symbols from sections
17181 not included in the link.
17182 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17183 distinction.
17184 (Weak_alias_sorter::operator()): Assert that symbols are
17185 ordinary.
17186 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17187 distinction.
17188 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17189 parameters. Change all callers.
17190 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17191 symbol distinction. Use SHN_XINDEX when needed.
17192 (Symbol_table::write_section_symbol): Add symtab_xindex
17193 parameter. Change all callers.
17194 (Symbol_table::sized_write_section_symbol): Likewise. Use
17195 SHN_XINDEX when needed.
17196 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17197 declarations.
17198 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17199 (Symbol::is_defined): Check is_ordinary.
17200 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17201 (Symbol::is_absolute, Symbol::is_common): Likewise.
17202 (class Sized_symbol): Update declarations.
17203 (class Symbol_table): Update declarations.
17204 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17205 parameters. Change all callers.
17206 (Sized_symbol::override): Likewise.
17207 (Symbol_table::override): Likewise.
17208 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17209 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17210 is_ordinary, and orig_st_shndx parameters. Change all callers.
17211 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17212 to be in an ordinary section.
17213 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17214 object and is_ordinary parameters. Change all callers.
17215 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17216 Change all callers. Don't add undefined or non-ordinary symbols
17217 to reloc_map_.
17218 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17219 Change all callers.
17220 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17221 declarations.
17222 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17223 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17224 (Sized_relobj::relocate_sections): Likewise.
17225 * target-reloc.h (scan_relocs): Adjust section symbol index.
17226 (scan_relocatable_relocs): Likewise.
17227 * i386.cc (Scan::local): Check for ordinary symbols.
17228 * sparc.cc (Scan::local): Likewise.
17229 * x86_64.cc (Scan::local): Likewise.
17230 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17231 to symbol_section_and_value.
17232 * testsuite/many_sections_test.cc: New file.
17233 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17234 (check_PROGRAMS): Add many_sections_test.
17235 (many_sections_test_SOURCES): Define.
17236 (many_sections_test_DEPENDENCIES): Define.
17237 (many_sections_test_LDFLAGS): Define.
17238 (BUILT_SOURCES): Add many_sections_define.h.
17239 (many_sections_define.h): New target.
17240 (BUILT_SOURCES): Add many_sections_check.h.
17241 (many_sections_check.h): New target.
17242 (check_PROGRAMS): Add many_sections_r_test.
17243 (many_sections_r_test_SOURCES): Define.
17244 (many_sections_r_test_DEPENDENCIES): Define.
17245 (many_sections_r_test_LDFLAGS): Define.
17246 (many_sections_r_test_LDADD): Define.
17247 (many_sections_r_test.o): New target.
17248 * testsuite/Makefile.in: Rebuild.
17249
c5818ff1
CC
172502008-04-17 Cary Coutant <ccoutant@google.com>
17251
17252 * errors.cc (Errors::info): New function.
17253 (gold_info): New function.
17254 * errors.h (Errors::info): New function.
17255 * gold.h (gold_info): New function.
17256 * object.cc (Input_objects::add_object): Print trace output.
17257 * options.cc (options::parse_set): New function.
17258 (General_options::parse_wrap): Deleted.
17259 (General_options::General_options): Deleted initializer.
17260 * options.h (options::String_set): New typedef.
17261 (options::parse_set): New function.
17262 (DEFINE_set): New macro.
17263 (General_options::wrap): Changed to use DEFINE_set. Changed
17264 callers of any_wrap_symbols and is_wrap_symbol.
17265 (General_options::trace, General_options::trace_symbol):
17266 New options.
17267 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17268 (General_options::wrap_symbols_): Deleted.
17269 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17270
b5be4a7c
DM
172712008-04-17 David S. Miller <davem@davemloft.net>
17272
17273 * options.cc (General_options::parse_V): New function.
17274 * options.h: Add entries for -V and -Qy.
17275
155a0dd7
ILT
172762008-04-17 Ian Lance Taylor <iant@google.com>
17277
17278 * common.cc (Symbol_table::allocate_commons): Remove options
17279 parameter. Change caller.
17280 (Symbol_table::do_allocate_commons): Remove options parameter.
17281 Change caller. Just call do_allocate_commons_list twice.
17282 (Symbol_table::do_allocate_commons_list): New function, broken out
17283 of do_allocate_commons.
17284 * common.h (class Allocate_commons_task): Remove options_ field.
17285 Update constructor.
17286 * symtab.cc (Symbol_table::Symbol_table): Initialize
17287 tls_commons_.
17288 (Symbol_table::add_from_object): Put TLS common symbols on
17289 tls_commons_ list.
17290 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17291 which are IN_OUTPUT_DATA.
17292 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17293 allocate_commons and do_allocate_commons declarations. Declare
17294 do_allocate_commons_list.
17295 * gold.cc (queue_middle_tasks): Update creation of
17296 Allocate_commons_task to not pass options.
17297 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17298 (TLS_TEST_C_FLAGS): New variable.
17299 (tls_test_c_pic.o): New target.
17300 (tls_test_shared.so): Link in tls_test_c_pic.o.
17301 (tls_test_c_pic_ie.o): New target.
17302 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17303 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17304 (tls_test_c.o): New target.
17305 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17306 (tls_pic_test_LDADD): Likewise.
17307 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17308 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17309 (tls_test_c_gnu2.o): New target.
17310 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17311 tls_test_c_gnu2.o.
17312 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17313 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17314 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17315 * testsuite/tls_test.cc: Include "config.h".
17316 (t_last): Call t11_last.
17317 * testsuite/tls_test.h (t11, t11_last): Declare.
17318 * testsuite/tls_test_c.c: New file.
17319 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17320 * configure.ac: Check for OpenMP support.
17321 * configure, config.in, Makefile.in: Rebuild.
17322 * testsuite/Makefile.in: Rebuild.
17323
edfbb029
CC
173242008-04-16 Cary Coutant <ccoutant@google.com>
17325
17326 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17327 (Target_i386::tls_base_symbol_defined_): New field.
17328 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17329 (Target_i386::Scan::global): Likewise.
17330 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17331 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17332 (Target_x86_64::tls_base_symbol_defined_): New field.
17333 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17334 (Target_x86_64::Scan::global): Likewise.
17335
f3c69fca
CC
173362008-04-16 Cary Coutant <ccoutant@google.com>
17337
17338 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17339 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17340 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17341 building shared libraries.
17342 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17343 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17344 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17345 * testsuite/Makefile.in: Rebuild.
17346 * testsuite/weak_undef.h: New file.
17347 * testsuite/weak_undef_file1.cc: Add extra test cases.
17348 * testsuite/weak_undef_file2.cc: Likewise.
17349 * testsuite/weak_undef_test.cc: Likewise.
17350
7c414435
DM
173512008-04-16 David S. Miller <davem@davemloft.net>
17352
32b769e1
DM
17353 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17354 Add issued_non_pic_error_ field. Declare check_non_pic.
17355 (Target_sparc::Scan::check_non_pic): New function.
17356 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17357 (Target_sparc::Scan::global): Likewise.
17358
11936fb1
DM
17359 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17360 * configure: Rebuild.
17361
7c414435
DM
17362 * options.h (DEFINE_enable): New macro.
17363 (new_dtags): New enable option.
17364 (initfirst, interpose, loadfltr, nodefaultlib,
17365 nodelete, nodlopen, nodump): New -z options.
17366 * layout.cc (Layout:finish_dynamic_section): If new
17367 dtags enabled, emit DT_RUNPATH. Also, emit a
17368 DT_FLAGS_1 containing any specified -z flags.
17369
85c7bf8b
ILT
173702008-04-16 Ian Lance Taylor <iant@google.com>
17371
12c0daef
ILT
17372 * copy-relocs.cc: New file.
17373 * copy-relocs.h: New file.
17374 * reloc.cc: Remove Copy_relocs code.
17375 * reloc.h: Likewise.
17376 * reloc-types.h (struct Reloc_types) [both versions]: Add
17377 get_reloc_addend_noerror.
17378 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17379 variants of add_global which take an addend which must be zero.
17380 * i386.cc: Include "copy-relocs.h".
17381 (class Target_i386): Change type of copy_relocs_ to variable,
17382 update initializer.
17383 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17384 Change all callers.
17385 (Target_i386::do_finalize_sections): Change handling of
17386 copy_relocs_.
17387 * sparc.cc: Include "copy-relocs.h".
17388 (class Target_sparc): Change type of copy_relocs_ to variable,
17389 update initializer.
17390 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17391 Change all callers.
17392 (Target_sparc::do_finalize_sections): Change handling of
17393 copy_relocs_.
17394 * x86_64.cc: Include "copy-relocs.h".
17395 (class Target_x86_64): Change type of copy_relocs_ to variable,
17396 update initializer.
17397 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17398 class. Change all callers.
17399 (Target_x86_64::do_finalize_sections): Change handling of
17400 copy_relocs_.
17401 * Makefile.am (CCFILES): Add copy-relocs.cc.
17402 (HFILES): Add copy-relocs.h.
17403
4f4995b6
ILT
17404 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17405
85c7bf8b
ILT
17406 * testsuite/script_test_4.sh: Permit leading zeroes.
17407
4f2a9edd
ILT
174082008-04-15 Ian Lance Taylor <iant@google.com>
17409
e6188289
ILT
17410 * script-sections.cc (Script_sections::create_segments): Use
17411 header_size_adjustment even when there is enough room for the
17412 headers.
17413 * testsuite/script_test_4.sh: New file.
17414 * testsuite/script_test_4.t: New file.
17415 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17416 (check_DATA): Add script_test_4.stdout.
17417 (MOSTLYCLEANFILES): Likewise.
17418 (script_test_4): New target.
17419 (script_test_4.stdout): New target.
17420 * testsuite/Makefile.in: Rebuild.
17421
4f2a9edd
ILT
17422 * sparc.cc: Add definitions for Output_data_plt_sparc class
17423 constants.
17424
f5314dd5
DM
174252008-04-14 David S. Miller <davem@davemloft.net>
17426
17427 * sparc.cc: New file.
17428 * Makefile.am (TARGETSOURCES): Add sparc.cc
17429 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17430 * configure.tgt: Document targ_extra_size and
17431 targ_extra_big_endian. Add entries for sparc-* and
17432 sparc64-*.
17433 * configure.ac: Handle targ_extra_size and
17434 targ_extra_big_endian.
17435 * Makefile.in: Rebuild.
17436 * configure: Likewise.
17437 * po/POTFILES.in: Likewise.
17438 * po/gold.pot: Likewise.
17439
154e0e9a
ILT
174402008-04-14 Ian Lance Taylor <iant@google.com>
17441
17442 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17443 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17444 in the name/type/flags to section mapping. Don't call
17445 allocate_output_section.
17446 (Layout::choose_output_section): Change parameter from adjust_name
17447 to is_input_section. Don't permit input sections after sections
17448 are attached to segments. Don't call allocate_output_section.
17449 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17450 not write_enable_output_section.
17451 (Layout::make_output_section): Don't push to
17452 unattached_section_list_ nor call attach_to_segment. Call
17453 attach_section_to_segment if sections are attached.
17454 (Layout::attach_sections_to_segments): New function.
17455 (Layout::attach_section_to_segment): New function.
17456 (Layout::attach_allocated_section_to_segment): Rename from
17457 attach_to_segment. Remove flags parameter.
17458 (Layout::allocate_output_section): Remove function.
17459 (Layout::write_enable_output_section): Remove function.
17460 * layout.h (class Layout): Update for above changes. Add new
17461 field sections_are_attached_.
17462 * output.h (Output_section::update_flags_for_input_section): New
17463 function.
17464 * output.cc (Output_section::add_input_section): Call
17465 update_flags_for_input_section.
17466 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17467
009a67a2
CC
174682008-04-11 Cary Coutant <ccoutant@google.com>
17469
17470 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17471 thought unnecessary.
17472 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17473
759b1a24
ILT
174742008-04-11 Ian Lance Taylor <iant@google.com>
17475
17476 * output.h (class Output_section_data): Remove inline definition
17477 of set_addralign.
17478 * output.cc (Output_section_data::set_addralign): New function.
17479
c2b45e22
CC
174802008-04-11 Cary Coutant <ccoutant@google.com>
17481
17482 Add support for TLS descriptors for i386 and x86_64.
17483 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17484 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17485 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17486 GOT_TYPE_TLS_DESC.
17487 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17488 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17489 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17490 relocations.
17491 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17492 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17493 Fix problem with initial-exec relocations.
17494 (Target_i386::Relocate::relocate_tls): Likewise.
17495 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17496 relaxation.
17497 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17498 support for section-plus-offset dynamic table entries.
17499 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17500 (Output_data_dynamic::Dynamic_entry): Add support for
17501 section-plus-offset dynamic table entries.
17502 (Output_data_dynamic::Classification): Likewise.
17503 (Output_data_dynamic::classification_): Renamed offset_.
17504 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17505 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17506 (Target_x86_64::make_plt_section): New function.
17507 (Target_x86_64::reserve_tlsdesc_entries): New function.
17508 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17509 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17510 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17511 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17512 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17513 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17514 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17515 add extra PLT entry for TLS descriptors.
17516 (Output_data_plt_x86_64::got_): New field.
17517 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17518 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17519 fields.
17520 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17521 descriptors.
17522 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17523 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17524 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17525 R_386_TLS_DESC_CALL relocations.
17526 (Target_x86_64::Scan::global): Likewise.
17527 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17528 for TLS descriptors.
17529 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17530 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17531 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17532 GD-to-IE relaxation.
17533 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17534 and TLS_DESCRIPTORS.
17535 * Makefile.in: Rebuild.
17536 * configure: Rebuild.
17537 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17538 (tls_test_shared2.so): New target.
17539 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17540 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17541 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17542 (tls_shared_gd_to_ie_test_LDADD): New variable.
17543 (tls_shared_gnu2_gd_to_ie_test): New target.
17544 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17545 New targets.
17546 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17547 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17548 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17549 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17550 (tls_shared_gnu2_test): New target.
17551 (tls_test_gnu2_shared.so): New target.
17552 (tls_shared_gnu2_test_SOURCES): New variable.
17553 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17554 (tls_shared_gnu2_test_LDFLAGS): New variable.
17555 (tls_shared_gnu2_test_LDADD): New variable.
17556 * testsuite/Makefile.in: Rebuild.
17557 * testsuite/Makefile.
17558
83bfb6b7
ILT
175592008-04-11 Ian Lance Taylor <iant@google.com>
17560
17561 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17562 justsyms.t.
17563 * testsuite/Makefile.in: Rebuild.
17564
17565 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17566 long.
17567 * testsuite/script_test_2.cc (main): Adjust test.
17568
706e1f5e
ILT
175692008-04-11 David S. Miller <davem@davemloft.net>
17570 Ian Lance Taylor <iant@google.com>
17571
17572 * options.h (General_options): Add entries for '-Y' and
17573 '-relax'.
17574 * options.cc (General_options:finalize): If -Y was used, add those
17575 entries to the library path instead of the default "/lib" and
17576 "/usr/lib".
17577
7c98e6bb
DM
175782008-04-11 David S. Miller <davem@davemloft.net>
17579
17580 * testsuite/justsyms.t: Start at 0x100.
17581 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17582 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17583 long.
17584 * testsuite/script_test_2.cc: Adjust string and section length
17585 checks.
7c98e6bb 17586
99a37bfd
ILT
175872008-04-09 Ian Lance Taylor <iant@google.com>
17588
2cefc357
ILT
17589 PR gold/5996
17590 * script-sections.cc (Sections_element::allocate_to_segment): Add
17591 orphan parameter.
17592 (Output_section_definition::allocate_to_segment): Likewise.
17593 (Orphan_output_section::allocate_to_segment): Likewise.
17594 (Script_sections::attach_sections_using_phdrs_clause): Don't
17595 propagate non-PT_LOAD segments to orphan sections.
17596 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17597 readelf rather than objdump.
17598 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17599 .interp section and PT_INTERP segment are the same size.
17600 * testsuite/Makefile.in: Rebuild.
17601
99a37bfd
ILT
17602 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17603 aliases for symbols defined in the same object.
17604 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17605 (weak_alias_test_SOURCES): New variable.
17606 (weak_alias_test_DEPENDENCIES): New variable.
17607 (weak_alias_test_LDFLAGS): New variable.
17608 (weak_alias_test_LDADD): New variable.
17609 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17610 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17611 (weak_alias_test_3.o): New target.
17612 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17613 * testsuite/weak_alias_test_main.cc: New file.
17614 * testsuite/weak_alias_test_1.cc: New file.
17615 * testsuite/weak_alias_test_2.cc: New file.
17616 * testsuite/weak_alias_test_3.cc: New file.
17617
780e49c5
ILT
176182008-04-08 Ian Lance Taylor <iant@google.com>
17619
cdb0b8f5
ILT
17620 * options.h (class General_options): Add --noinhibit-exec option.
17621 * main.cc (main): Check --noinhibit-exec.
17622
0864d551
ILT
17623 * options.h (class General_options): Define --wrap as a special
17624 option. Add wrap_symbols_ field.
17625 (General_options::any_wrap_symbols): New function.
17626 (General_options::is_wrap_symbol): New function.
17627 * options.cc (General_options::parse_wrap): New function.
17628 (General_options::General_options): Initialize wrap_symbols_.
17629 * symtab.cc (Symbol_table::wrap_symbol): New function.
17630 (Symbol_table::add_from_object): Handle --wrap.
17631 * symtab.h (class Symbol_table): Declare wrap_symbol.
17632 * target.h (Target::wrap_char): New function.
17633 (Target::Target_info): Add wrap_char field.
17634 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17635 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17636 * testsuite/testfile.cc (Target_test::test_target_info):
17637 Likewise.
17638
789aa6de
ILT
17639 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17640 there is one.
17641
2c38906f
ILT
17642 * layout.h (class Layout): Add added_eh_frame_data_ field.
17643 * layout.cc (Layout::Layout): Initialize new field.
17644 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17645 output section until we find a section we merged successfully.
17646 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17647 that the size be non-zero.
17648
780e49c5
ILT
17649 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17650 qualifier.
17651
7fcd0256
ILT
176522008-04-08 Craig Silverstein <csilvers@google.com>
17653
17654 * configure.ac: Export new conditional variable HAVE_ZLIB.
17655 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17656 on HAVE_ZLIB.
17657 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17658 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17659
6835af53
ILT
176602008-04-07 Ian Lance Taylor <iant@google.com>
17661
e24f324c
ILT
17662 * version.cc (version_string): Set to "1.5".
17663
a036edd8
ILT
17664 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17665 Add issued_non_pic_error_ field. Declare check_non_pic.
17666 (Target_x86_64::Scan::check_non_pic): New function.
17667 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17668 (Target_x86_64::Scan::global): Likewise.
17669
624f8810
ILT
17670 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17671 addend parameter. Change caller. Handle merge sections.
17672 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17673 Address to Addend. Don't add in the result of
17674 local_section_offset, pass down the addend and use the returned
17675 value.
17676 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17677 Update declarations of local_section_offset and symbol_value.
17678 * testsuite/two_file_test_1.cc (t18): New function.
17679 * testsuite/two_file_test_2.cc (f18): New function.
17680 * testsuite/two_file_test_main.cc (main): Call t18.
17681 * testsuite/two_file_test.h (t18, f18): Declare.
17682
6835af53
ILT
17683 * configure.ac: Don't test for objdump, c++filt, or readelf.
17684 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17685 conditionals.
17686 (TEST_READELF): New variable.
17687 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17688 (check_PROGRAMS): Add two_file_strip_test.
17689 (two_file_strip_test): New target.
17690 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17691 (two_file_same_shared_strip_test_SOURCES): New variable.
17692 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17693 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17694 (two_file_same_shared_strip_test_LDADD): New variable.
17695 (two_file_shared_strip.so): New target.
17696 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17697 (ver_test_5.syms, ver_test_7.syms): Likewise.
17698 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17699 (strip_test_3.stdout): Use TEST_OBJDUMP.
17700 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17701
86925eef
CC
177022008-04-04 Cary Coutant <ccoutant@google.com>
17703
17704 * symtab.h (Symbol::is_weak_undefined): New function.
17705 (Symbol::is_strong_undefined): New function.
17706 (Symbol::is_absolute): New function.
17707 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17708 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17709 absolute symbols.
17710 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17711 (weak_undef_test): New target.
17712 * testsuite/Makefile.in: Rebuild.
17713 * testsuite/weak_undef_file1.cc: New file.
17714 * testsuite/weak_undef_file2.cc: New file.
17715 * testsuite/weak_undef_test.cc: New file.
17716
126f3ece
ILT
177172008-04-03 Craig Silverstein <csilvers@google.com>
17718
17719 * compressed_output.h (class Output_compressed_section): Use
17720 unsigned buffer.
17721 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17722 add zlib header.
17723 (zlib_compressed_suffix): Removed.
17724 (Output_compressed_section::set_final_data_size): Use unsigned
17725 buffers.
17726 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17727 Fix linker invocation.
17728 (flagstest_o_specialfile_and_compress_debug_sections):
17729 Likewise.
17730 * testsuite/Makefile.in: Regenerated.
17731
deae2a14
DM
177322008-04-02 David S. Miller <davem@davemloft.net>
17733
17734 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17735 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17736
70752818
ILT
177372008-04-02 Craig Silverstein <csilvers@google.com>
17738
17739 * TODO: New file.
17740
39d0cb0e
ILT
177412008-04-02 Ian Lance Taylor <iant@google.com>
17742
17743 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17744 parameters. Update for new key type to views_. Change all
17745 callers.
17746 (File_read::read): Adjust for byteshift in returned view.
17747 (File_read::add_view): New function, broken out of
17748 find_and_make_view.
17749 (File_read::make_view): New function, broken out of
17750 find_and_make_view.
17751 (File_read::find_or_make_view): Add offset and aligned
17752 parameters. Rewrite accordingly. Change all callers.
17753 (File_read::get_view): Add offset and aligned parameters. Adjust
17754 for byteshift in return value.
17755 (File_read::get_lasting_view): Likewise.
17756 * fileread.h (class File_read): Update declarations.
17757 (class File_read::View): Add byteshift_ field. Add byteshift to
17758 constructor. Add byteshift method.
17759 * archive.h (Archive::clear_uncached_views): New function.
17760 (Archive::get_view): Add aligned parameter. Change all callers.
17761 * object.h (Object::get_view): Add aligned parameter. Change all
17762 callers.
17763 (Object::get_lasting_view): Likewise.
17764
17765 * fileread.cc (File_read::release): Don't call clear_views if
17766 there are multiple objects.
17767 * fileread.h (File_read::clear_uncached_views): New function.
17768 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17769 on the archive.
17770
a1207466
CC
177712008-03-31 Cary Coutant <ccoutant@google.com>
17772
17773 Add thin archive support.
17774 * archive.cc (Archive::armagt): New const.
17775 (Archive::setup): Remove task parameter and calls to unlock.
17776 (Archive::unlock_nested_archives): New function.
17777 (Archive::read_header): Add nested_off parameter. Change
17778 all callers.
17779 (Archive::interpret_header): Likewise.
17780 (Archive::include_all_members): Change to handle thin
17781 archives.
17782 (Archive::include_member): Likewise.
17783 * archive.h (Archive::Archive): Add new parameters and
17784 initializers.
17785 (Archive::armagt): New const.
17786 (Archive::setup): Remove task parameter.
17787 (Archive::unlock_nested_archives): New function.
17788 (Archive::read_header): Add nested_off parameter.
17789 (Archive::interpret_header): Likewise.
17790 (Archive::Nested_archive_table): New typedef.
17791 (Archive::is_thin_archive_): New field.
17792 (Archive::nested_archives_): New field.
17793 (Archive::options_): New field.
17794 (Archive::dirpath_): New field.
17795 (Archive::task_): New field.
17796 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17797 for thin archives. Pass additional parameters to
17798 Archive::Archive. Unlock the archive file after calling
17799 Archive::setup.
cd536b21 17800
479f6503
ILT
178012008-03-29 Ian Lance Taylor <iant@google.com>
17802
686c8caf
ILT
17803 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17804 version symbol to be local.
17805 * testsuite/ver_test_4.sh: New file.
17806 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17807 (check_DATA): Add ver_test_4.syms.
17808 (ver_test_4.syms): New target.
17809 * testsuite/Makefile.in: Rebuild.
17810
ab794b6b
ILT
17811 * output.cc
17812 (Output_section::Input_section_sort_entry::has_priority): New
17813 function.
17814 (Output_section::Input_section_sort_entry::match_file_name): New
17815 function.
17816 (Output_section::Input_section_sort_entry::match_section_name):
17817 Remove.
17818 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17819 Remove.
17820 (Output_section::Input_section_sort_entry::match_section_file):
17821 Remove.
17822 (Output_section::Input_section_sort_compare::operator()): Rewrite
17823 using new Input_section_sort_entry functions. Sort crtbegin and
17824 crtend first. Sort sections with no priority before sections with
17825 a priority.
17826 * testsuite/initpri1.c (d3): Check j != 4.
17827 (cd5): New constructor/destructor function.
17828 (main): Check j != 2.
17829
479f6503
ILT
17830 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17831 new symbol when resolving, don't call set_is_default.
17832 * testsuite/ver_test_7.cc: New file.
17833 * testsuite/ver_test_7.sh: New file.
17834 * testsuite/Makefile.am (ver_test_7.so): New target.
17835 (ver_test_7.o): New target.
17836 (check_SCRIPTS): Add ver_test_7.sh.
17837 (check_DATA): Add ver_test_7.syms.
17838 (ver_test_7.syms): New target.
17839
2fd32231
ILT
178402008-03-28 Ian Lance Taylor <iant@google.com>
17841
17842 * layout.cc (Layout::layout): If we see an input section with a
17843 name that needs sorting, set the must_sort flag for the output
17844 section.
17845 (Layout::make_output_section): If the name of the output section
17846 indicates that it might require sorting, set the may_sort flag.
17847 * output.h (Output_section::may_sort_attached_input_sections): New
17848 function.
17849 (Output_section::set_may_sort_attached_input_sections): New
17850 function.
17851 (Output_section::must_sort_attached_input_sections): New
17852 function.
17853 (Output_section::set_must_sort_attached_input_sections): New
17854 function.
17855 (class Output_section): Declare Input_section_sort_entry. Define
17856 Input_section_sort_compare. Declare
17857 sort_attached_input_sections. Add new fields:
17858 may_sort_attached_input_sections_,
17859 must_sort_attached_input_sections_,
17860 attached_input_sections_are_sorted_.
17861 * output.cc (Output_section::Output_section): Initialize new
17862 fields.
17863 (Output_section::add_input_section): Add an entry to
17864 input_sections_ if may_sort or must_sort are true.
17865 (Output_section::set_final_data_size): Call
17866 sort_attached_input_sections if necessary.
17867 (Output_section::Input_section_sort_entry): Define new class.
17868 (Output_section::Input_section_sort_compare::operator()): New
17869 function.
17870 (Output_section::sort_attached_input_sections): New function.
17871 * configure.ac: Check whether the compiler supports constructor
17872 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17873 * testsuite/initpri1.c: New file.
17874 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17875 CONSTRUCTOR_PRIORITY.
17876 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17877 (initpri1_LDFLAGS): New variable.
17878 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17879
18e6b24e
ILT
178802008-03-27 Ian Lance Taylor <iant@google.com>
17881
49bdd526
ILT
17882 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17883 * testsuite/common_test_1.c: New file.
17884 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17885 (common_test_1_SOURCES): New variable.
17886 (common_test_1_DEPENDENCIES): New variable.
17887 (common_test_1_LDFLAGS): New variable.
17888
18e6b24e
ILT
17889 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17890 and commons_ correctly when NAME/VERSION does not override
17891 NAME/NULL.
17892 * testsuite/ver_test_6.c: New file.
17893 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17894 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17895 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17896
04bf7072
ILT
178972008-03-26 Ian Lance Taylor <iant@google.com>
17898
5871526f
ILT
17899 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17900 of an undefined symbol from a version script.
17901 * testsuite/Makefile.am (ver_test_5.so): New target.
17902 (ver_test_5.o): New target.
17903 (check_SCRIPTS): Add ver_test_5.sh.
17904 (check_DATA): Add ver_test_5.syms.
17905 (ver_test_5.syms): New target.
17906 * testsuite/ver_test_5.cc: New file.
17907 * testsuite/ver_test_5.script: New file.
17908 * testsuite/ver_test_5.sh: New file.
17909 * Makefile.in, testsuite/Makefile.in: Rebuild.
17910
04bf7072
ILT
17911 PR gold/5986
17912 Fix problems building gold with gcc 4.3.0.
17913 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17914 (gold_error_at_location, gold_warning_at_location): Use it.
17915 * configure.ac: Check whether we can compile and use a template
17916 function with a printf attribute.
17917 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17918 when jumping over bytes.
17919 * object.cc: Instantiate Object::read_section_data.
17920 * debug.h: Include <cstring>
17921 * dwarf_reader.cc: Include <algorithm>
17922 * main.cc: Include <cstring>.
17923 * options.cc: Include <cstring>.
17924 * output.cc: Include <cstring>.
17925 * script.cc: Include <cstring>.
17926 * script.h: Include <string>.
17927 * symtab.cc: Include <cstring> and <algorithm>.
17928 * target-select.cc: Include <cstring>.
17929 * version.cc: Include <string>.
17930 * testsuite/testmain.cc: Include <cstdlib>.
17931 * configure, config.in: Rebuild.
17932
874c5b28
ILT
179332008-03-25 Ian Lance Taylor <iant@google.com>
17934
819d6c3a
ILT
17935 * options.cc: Include "../bfd/bfdver.h".
17936 (options::help): Print bug reporting address.
17937
f4b2c6f5
ILT
17938 * version.cc (print_version): Adjust output for current value of
17939 BFD_VERSION_STRING.
17940
17941 * NEWS: New file.
17942
e96caa79
ILT
17943 * options.cc (options::help): Print list of supported targets.
17944 * target-select.h: Include <vector>.
17945 (class Target_selector): Make machine_, size_, and is_big_endian_
17946 fields const. Add bfd_name_ and instantiated_target_ fields.
17947 (Target_selector::Target_selector): Add bfd_name parameter.
17948 (Target_selector::recognize): Make non-virtual, call
17949 do_recognize.
17950 (Target_selector::recognize_by_name): Make non-virtual, call
17951 do_recognize_by_name.
17952 (Target_selector::supported_names): New function.
17953 (Target_selector::bfd_name): New function.
17954 (Target_selector::do_instantiate_target): New pure virtual
17955 function.
17956 (Target_selector::do_recognize): New virtual function.
17957 (Target_selector::do_recognize_by_name): New virtual function.
17958 (Target_selector::instantiate_target): New private function.
17959 (supported_target_names): Declare.
17960 * target-select.cc (Target_selector::Target_selector): Update for
17961 new parameter and fields.
17962 (select_target_by_name): Check that the name matches before
17963 calling recognize_by_name.
17964 (supported_target_names): New function.
17965 * i386.cc (class Target_selector_i386): Update Target_selector
17966 constructor call. Remove recognize and recognize_by_name. Add
17967 do_instantiate_target.
17968 * x86_64.cc (class Target_selector_x86_64): Likewise.
17969 * testsuite/testfile.cc (class Target_selector_test): Update for
17970 changes to Target_selector.
17971
874c5b28
ILT
17972 * README: Rewrite, with some notes on unsupported features.
17973
0a65a3a7
CC
179742008-03-24 Cary Coutant <ccoutant@google.com>
17975
17976 * i386.cc (Target_i386::Got_type): New enum declaration.
17977 (Target_i386::Scan::local): Updated callers of Output_data_got
17978 member functions.
17979 (Target_i386::Scan::global): Likewise.
17980 (Target_i386::Relocate::relocate): Likewise.
17981 (Target_i386::Relocate::relocate_tls): Likewise.
17982 * object.h (Got_offset_list): New class.
17983 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17984 (Sized_relobj::local_got_offset): Likewise.
17985 (Sized_relobj::set_local_got_offset): Likewise.
17986 (Sized_relobj::local_has_tls_got_offset): Removed.
17987 (Sized_relobj::local_tls_got_offset): Removed.
17988 (Sized_relobj::set_local_tls_got_offset): Removed.
17989 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17990 * output.cc (Output_data_got::add_global): Added got_type parameter.
17991 (Output_data_got::add_global_with_rel): Likewise.
17992 (Output_data_got::add_global_with_rela): Likewise.
17993 (Output_data_got::add_global_pair_with_rel): New function.
17994 (Output_data_got::add_global_pair_with_rela): New function.
17995 (Output_data_got::add_local): Added got_type parameter.
17996 (Output_data_got::add_local_with_rel): Likewise.
17997 (Output_data_got::add_local_with_rela): Likewise.
17998 (Output_data_got::add_local_pair_with_rel): New function.
17999 (Output_data_got::add_local_pair_with_rela): New function.
18000 (Output_data_got::add_global_tls): Removed.
18001 (Output_data_got::add_global_tls_with_rel): Removed.
18002 (Output_data_got::add_global_tls_with_rela): Removed.
18003 (Output_data_got::add_local_tls): Removed.
18004 (Output_data_got::add_local_tls_with_rel): Removed.
18005 (Output_data_got::add_local_tls_with_rela): Removed.
18006 * output.h (Output_data_got::add_global): Added got_type parameter.
18007 (Output_data_got::add_global_with_rel): Likewise.
18008 (Output_data_got::add_global_with_rela): Likewise.
18009 (Output_data_got::add_global_pair_with_rel): New function.
18010 (Output_data_got::add_global_pair_with_rela): New function.
18011 (Output_data_got::add_local): Added got_type parameter.
18012 (Output_data_got::add_local_with_rel): Likewise.
18013 (Output_data_got::add_local_with_rela): Likewise.
18014 (Output_data_got::add_local_pair_with_rel): New function.
18015 (Output_data_got::add_local_pair_with_rela): New function.
18016 (Output_data_got::add_global_tls): Removed.
18017 (Output_data_got::add_global_tls_with_rel): Removed.
18018 (Output_data_got::add_global_tls_with_rela): Removed.
18019 (Output_data_got::add_local_tls): Removed.
18020 (Output_data_got::add_local_tls_with_rel): Removed.
18021 (Output_data_got::add_local_tls_with_rela): Removed.
18022 * resolve.cc (Symbol::override_base_with_special): Removed
18023 reference to has_got_offset_ field.
18024 * symtab.cc (Symbol::init_fields): Replaced initialization
18025 of got_offset_ with got_offsets_. Removed initialization
18026 of has_got_offset_
53fcba31 18027 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
18028 (Symbol::got_offset): Likewise.
18029 (Symbol::set_got_offset): Likewise.
18030 (Symbol::has_tls_got_offset): Removed.
18031 (Symbol::tls_got_offset): Removed.
18032 (Symbol::set_tls_got_offset): Removed.
18033 (Symbol::got_offset_): Removed.
18034 (Symbol::tls_mod_got_offset_): Removed.
18035 (Symbol::tls_pair_got_offset_): Removed.
18036 (Symbol::got_offsets_): New field.
18037 (Symbol::has_got_offset): Removed.
18038 (Symbol::has_tls_mod_got_offset): Removed.
18039 (Symbol::has_tls_pair_got_offset): Removed.
18040 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
18041 (Target_x86_64::Scan::local): Updated callers of Output_data_got
18042 member functions.
18043 (Target_x86_64::Scan::global): Likewise.
18044 (Target_x86_64::Relocate::relocate): Likewise.
18045 (Target_x86_64::Relocate::relocate_tls): Likewise.
18046
bd52eafb
BE
180472008-03-25 Ben Elliston <bje@au.ibm.com>
18048
18049 * yyscript.y: Fix spelling error in comment.
18050
8b105e34
ILT
180512008-03-24 Ian Lance Taylor <iant@google.com>
18052
8ed814a9
ILT
18053 * options.h (class General_options): Define build_id option.
18054 * layout.h (class Layout): Declare write_build_id, create_note,
18055 create_build_id. Add build_id_note_ member.
18056 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
18057 "libiberty.h", "md5.h", "sha1.h".
18058 (Layout::Layout): Initialize eh_frame_data_,
18059 eh_frame_hdr_section_, and build_id_note_.
18060 (Layout::finalize): Call create_build_id.
18061 (Layout::create_note): New function, broken out of
18062 Layout::create_gold_note.
18063 (Layout::create_gold_note): Call create_note.
18064 (Layout::create_build_id): New function.
18065 (Layout::write_build_id): New function.
18066 (Close_task_runner::run): Call write_build_id.
18067
8b105e34
ILT
18068 * x86_64.cc: Correct license to GPLv3.
18069
086a1841
ILT
180702008-03-23 Ian Lance Taylor <iant@google.com>
18071
18072 * options.cc: Include "demangle.h".
18073 (parse_optional_string): New function.
18074 (parse_long_option): Handle takes_optional_argument.
18075 (parse_short_option): Update dash_z initializer. Handle
18076 takes_optional_argument.
18077 (General_options::General_options): Initialize do_demangle_.
18078 (General_options::finalize): Set do_demangle_. Handle demangling
18079 style.
18080 * options.h (parse_optional_string): Declare.
18081 (struct One_option): Add optional_arg field. Update constructor.
18082 Update call constructor calls. Add takes_optional_argument
18083 function.
18084 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18085 (DEFINE_optional_string): Define.
18086 (General_options::demangle): Change from DEFINE_bool to
18087 DEFINE_optional_string.
18088 (General_options::no_demangle): New function.
18089 (General_options::do_demangle): New function.
18090 (General_options::set_do_demangle): New function.
18091 (General_options::execstack_status_): Move definition to end of
18092 class definition.
18093 (General_options::static_): Likewise.
18094 (General_options::do_demangle_): New field.
18095 * object.cc (big_endian>::get_symbol_location_info): Call
18096 Options::do_demangle, not Options::demangle.
18097 * symtab.cc (demangle): Likewise.
18098
cbb93e63
ILT
180992008-03-22 Ian Lance Taylor <iant@google.com>
18100
18101 * gold.h: Include <cstddef> and <sys/types.h>
18102 * options.h: Include <cstring>.
18103
ec531623
ILT
181042008-03-21 Ian Lance Taylor <iant@google.com>
18105
18106 * Added source code to GNU binutils.
752937aa 18107\f
b90efa5b 18108Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
18109
18110Copying and distribution of this file, with or without modification,
18111are permitted in any medium without royalty provided the copyright
18112notice and this notice are preserved.
18113
18114Local Variables:
18115mode: change-log
18116left-margin: 8
18117fill-column: 74
18118version-control: never
18119End:
This page took 1.473536 seconds and 4 git commands to generate.