Add "-z call-nop=PADDING" option to ld
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
0fd15345
L
12015-10-20 H.J. Lu <hongjiu.lu@intel.com>
2
3 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
4 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
5 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
6 x86_64_mov_to_lea1.o.
7 * testsuite/Makefile.in: Regenerated.
8
64571972
L
92015-10-16 H.J. Lu <hongjiu.lu@intel.com>
10
11 PR gold/19119
12 * options.h (General_options): Remove "obsolete" from -m.
13 * parameters.cc (set_parameters_target): Check if input target
14 is compatible with output emulation set by "-m emulation".
15
01f573ad
L
162015-10-13 H.J. Lu <hongjiu.lu@intel.com>
17
18 PR gold/19118
19 * i386.cc (Target_iamcu): New class.
20 (Target_selector_iamcu): Likewise.
21 (Target_iamcu::iamcu_info): New variable.
22 (target_selector_iamcu): Likewise.
23
3b0357da
AS
242015-10-07 Andreas Schwab <schwab@suse.de>
25
26 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
27
9eacb935
CC
282015-10-06 Cary Coutant <ccoutant@gmail.com>
29
30 PR gold/18855
31 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
32 parameter.
33 (Sparc_relocate_functions::gdop_lox10): Likewise.
34 (Target_sparc::Relocate::relocate): Use addend when computing
35 symbol value for R_SPARC_GOTDATA_OP*.
36
3d4fde69
CC
372015-09-07 Cary Coutant <ccoutant@gmail.com>
38
39 PR gold/18930
40 PR gold/18886
41 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
42 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
43
358de988
L
442015-09-02 H.J. Lu <hongjiu.lu@intel.com>
45
46 PR gold/18886
47 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
48 shared libraries into normal FUNC symbols.
49 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
50 symbols aren't from shared libraries.
51
d49044c7
AM
522015-09-02 Alan Modra <amodra@gmail.com>
53
54 PR 18878
55 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
56 (Target_powerpc::Branch_info::make_stub): Determine whether long
57 branch stub is for save/restore function.
58 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
59 (Stub_table): Add need_save_res_.
60 (Stub_table:clear_stubs): Clear need_save_res_.
61 (Stub_table:set_address_and_size): Add save/restore section size.
62 (Stub_table::add_long_branch_entry): Add save_res param. Set
63 need_save_res_, but don't add space for save/restore stubs.
64 (Stub_table::find_long_branch_entry): Return offset to local copy
65 of save/restore func.
66 (Stub_table::do_write): Don't output save/restore stubs. Instead
67 copy the save/restore functions.
68 (Output_data_save_res:contents): New accessor.
69 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
70
7c61d651
CC
712015-08-25 Cary Coutant <ccoutant@gmail.com>
72
73 PR gold/18847
74 * script-sections.cc (Memory_region::set_address): New method.
75 (Script_sections::find_memory_region): Add explicit_only parameter.
76 (Output_section_definition::set_section_addresses): Handle case where
77 script specifies both address and vma region.
78 * script-sections.h (Script_sections::find_memory_region): Add
79 explicit_only parameter.
80
4bfacfd3
CC
812015-08-25 Cary Coutant <ccoutant@gmail.com>
82
83 PR gold/18859
84 * object.cc (Input_objects::add_object): Store objects in a map,
85 indexed by soname; update as-needed flag when necessary.
86 * object.h (Object::clear_as_needed): New method.
87 (Input_objects::so_names_): Change from set to map.
88
1757d35c
CC
892015-08-25 Cary Coutant <ccoutant@gmail.com>
90
91 PR gold/14746
92 * expression.cc (Expression::Expression_eval_info): Add
93 is_valid_pointer field.
94 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
95 Adjust all callers.
96 (Addr_expression::value_from_output_section): Check whether address
97 is valid.
98 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
99 if evaluation failed due to address that is not yet valid.
100 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
101 parameter.
102
3ac0a36c
CC
1032015-08-25 Cary Coutant <ccoutant@gmail.com>
104
105 PR gold/18866
106 PR gold/18703
107 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
108
9215b98b
AM
1092015-08-20 Alan Modra <amodra@gmail.com>
110
111 PR gold/18846
112 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
113 Subtract os->address() from addend.
114 * powerpc.cc (relocate_relocs): Likewise.
115
40fc1451
SD
1162015-08-12 Simon Dardis <simon.dardis@imgtec.com>
117
118 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
119 lazy_stub_normal_1, lazy_stub_normal_1_n64,
120 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
121 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
122 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
123 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
124 of 'addu/daddu'.
125
37a42ee9
L
1262015-07-27 H.J. Lu <hongjiu.lu@intel.com>
127
128 * configure: Regenerated.
129
ab3b14b0
DK
1302015-07-26 Doug Kwan <dougkwan@google.com>
131
132 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
133 disassembler output format.
134
cdb06167
HS
1352015-07-23 Ian Coolidge <icoolidge@google.com>
136 Plumb --pic-veneer option for gold.
137
138 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
139 generation.
140 * options.h (General_options): Add --pic-veneer option.
141
5b2af7dd
L
1422015-07-22 H.J. Lu <hongjiu.lu@intel.com>
143
144 PR gold/18663
145 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
146 script_test_1a.cc script_test_1b.cc.
147 (script_test_11_r.o): Replace script_test_11.o with
148 script_test_11a.o script_test_11b.o.
149 (script_test_11.o): Removed.
150 (script_test_11a.o): New.
151 (script_test_11b.o): Likewise.
152 * testsuite/Makefile.in: Regenerated.
153 * testsuite/script_test_1.h: New file.
154 * testsuite/script_test_1b.cc: Likewise.
155 * testsuite/script_test_11.h: Likewise.
156 * testsuite/script_test_11b.c: Likewise.
157 * testsuite/script_test_1.cc: Renamed to ...
158 * testsuite/script_test_1a.cc: This.
159 Include "script_test_1.h".
160 (main): Call check_int and check_ptr.
161 * testsuite/script_test_11.c: Renamed to ...
162 * testsuite/script_test_11a.c: This.
163 Include "script_test_11.h".
164 (main): Call ptr_equal.
165
cd78ea77
L
1662015-07-22 H.J. Lu <hongjiu.lu@intel.com>
167
168 PR gold/18628
169 * testsuite/ifuncdep2.c (global): Change protected to hidden.
170 * testsuite/ifuncmod1.c (global): Likewise.
171 * testsuite/ifuncmod5.c (global): Likewise.
172
f945ba50
AM
1732015-07-22 Alan Modra <amodra@gmail.com>
174
175 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
176
5417c94d
CC
1772015-07-21 Cary Coutant <ccoutant@gmail.com>
178
179 PR gold/18548
180 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
181 forced local symbol even when oldsym != NULL.
182 (Symbol_table::do_define_in_output_segment): Likewise.
183 (Symbol_table::do_define_as_constant): Likewise.
184
cb5cf5e2
CC
1852015-07-21 Cary Coutant <ccoutant@gmail.com>
186
b8c6c5ef 187 PR gold/18698
cb5cf5e2
CC
188 * archive.cc (Library_base::should_include_member): Don't use entry
189 point for relocatable links, or if target is not yet valid.
190 * parameters.cc (Parameters::entry): Check target_valid().
191
0ef3814f
HS
1922015-07-20 Han Shen <shenhan@google.com>
193
194 Optimize erratum 843419 fix.
195
196 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
197 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
198 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
199 (E843419_stub): New sub-class of Erratum_stub.
200 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
201 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
202 (AArch64_relobj::create_erratum_stub): Add 1 argument.
203 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
204
2bca0377
HS
2052015-07-20 Han Shen <shenhan@google.com>
206
207 Fix arm elf header flags wrt hardfp bit.
208
209 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
210
f54f5e31
L
2112015-07-20 H.J. Lu <hongjiu.lu@intel.com>
212
213 PR gold/18689
214 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
215 from input group section for relocatable link.
216 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
217 (check_DATA): Add pr18689.stdout.
218 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
219 (pr18689.stdout): New rule.
220 (pr18689a.o): Likewise.
221 (pr18689b.o): Likewise.
222 (pr18689.o): Likewise.
223 * testsuite/pr18689.c: New file.
224 * testsuite/pr18689.sh: Likewise.
225 * testsuite/Makefile.in: Regenerated.
226
c20ceeb2
YW
2272015-07-20 Yiran Wang <yiran@google.com>
228 Cary Coutant <ccoutant@gmail.com>
229
230 PR gold/15574
231 * resolve.cc (Symbol_table): Remove warning about references
232 from shared objects to hidden symbols.
233 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
234 * testsuite/Makefile.in: Regenerate.
235 * testsuite/hidden_test.sh: Check dynamic symbol table; update
236 expected error messages.
237
19a7fe52
L
2382015-07-14 H.J. Lu <hongjiu.lu@intel.com>
239
240 * compressed_output.cc (Output_compressed_section::set_final_data_size):
241 Make --compress-debug-sections=zlib the same as
242 --compress-debug-sections=zlib-gabi.
243 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
244 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
245 ".zdebug_".
246 * testsuite/Makefile.in: Regenerated.
247
fb8b9dbc
L
2482015-07-12 H.J. Lu <hongjiu.lu@intel.com>
249
250 PR gold/18322
251 * compressed_output.cc (zlib_compress): Add argument for
252 compression header size. Set header size to compression header
253 size if it isn't 0. Don't write out the zlib header here.
254 (Output_compressed_section::set_final_data_size): Support
255 zlib-gnu and zlib-gabi compressions. Pass compression header
256 size to zlib_compress and write out compression header. Set
257 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
258 clear the SHF_COMPRESSED bit
259 * options.h (compress_debug_sections): Add zlib-gnu and
260 zlib-gabi.
261 * output.h (Output_section::set_flags): New.
262 * testsuite/Makefile.am (check_PROGRAMS): Add
263 flagstest_compress_debug_sections_none,
264 flagstest_compress_debug_sections_gnu and
265 flagstest_compress_debug_sections_gabi.
266 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
267 flagstest_compress_debug_sections.stdout,
268 flagstest_compress_debug_sections.cmp,
269 flagstest_compress_debug_sections.check,
270 flagstest_compress_debug_sections_gnu.stdout,
271 flagstest_compress_debug_sections_gnu.cmp,
272 flagstest_compress_debug_sections_gnu.check,
273 flagstest_compress_debug_sections_gabi.stdout,
274 flagstest_compress_debug_sections_gabi.cmp and
275 flagstest_compress_debug_sections_gabi.check.
276 (flagstest_compress_debug_sections_none): New.
277 (flagstest_compress_debug_sections_none.stdout): Likewise.
278 (flagstest_compress_debug_sections.stdout): Likewise.
279 (flagstest_compress_debug_sections.check): Likewise.
280 (flagstest_compress_debug_sections.cmp): Likewise.
281 (flagstest_compress_debug_sections_gnu): Likewise.
282 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
283 (flagstest_compress_debug_sections_gnu.check): Likewise.
284 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
285 (flagstest_compress_debug_sections_gabi): Likewise.
286 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
287 (flagstest_compress_debug_sections_gnu.check): Likewise.
288 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
289 * testsuite/Makefile.in: Regenerated.
290
48058663
L
2912015-07-12 H.J. Lu <hongjiu.lu@intel.com>
292
293 PR gold/18321
294 * compressed_output.h (decompress_input_section): Add arguments
295 for ELF class, big endian and sh_flags.
296 * compressed_output.cc (decompress_input_section): Likewise.
297 Support the SHF_COMPRESSED section.
298 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
299 functions.
300 * plugin.h (Pluginobj): Likewise.
301 * layout.cc (Layout::get_output_section_flags): Also clear the
302 SHF_COMPRESSED bit.
303 * object.h (Compressed_section_info): Add flag to store sh_flags.
304 (Object): Add pure virtual elfsize and is_big_endian member
305 functions.
306 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
307 prefix here.
308 (build_compressed_section_map): Check SHF_COMPRESSED for
309 uncompressed size. Store sh_flags in Compressed_section_info.
310 Pass size, big_endian and sh_flags to decompress_input_section.
311 Skip the ".debug"/".zdebug" prefix when passing section name to
312 need_decompressed_section.
313 (Sized_relobj_file<size, big_endian>::do_find_special_section):
314 Don't check ".zdebug_*" sections.
315 (Object::decompressed_section_contents): Pass ELF class, big
316 endian and sh_flags to decompress_input_section.
317 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
318 Likewise.
319 * testsuite/Makefile.am (check_DATA): Add
320 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
321 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
322 gdb_index_test_2_gabi.stdout.
323 (debug_msg_cdebug_gabi.o): New.
324 (odr_violation1_cdebug_gabi.o): Likewise.
325 (odr_violation2_cdebug_gabi.o): Likewise.
326 (debug_msg_cdebug_gabi.err): Likewise.
327 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
328 (gdb_index_test_cdebug_gabi.o): Likewise.
329 (gdb_index_test_2_gabi): Likewise.
330 (gdb_index_test_2_gabi.stdout): Likewise.
331 * testsuite/gdb_index_test_2_gabi.sh: New file.
332 * testsuite/Makefile.in: Regenerated.
333
73854cdd
HS
3342015-07-09 Han Shen <shenhan@google.com>
335
336 Use "gold_info" instead of "gold_warning" for erratum fix.
337
338 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
339 'gold_info'.
340 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
341
61163dfa
HS
3422015-07-09 Han Shen <shenhan@google.com>
343
344 Drop missing symbol warning for arm/aarch64.
345
346 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
347 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
348 symbol warning.
349
b91deca9
HS
3502015-07-07 Han Shen <shenhan@google.com>
351
352 Make gold aarch64 accept long form of mapping symbols.
353
354 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
355 of mapping symbols.
356
15162bef
DK
3572015-06-29 Doug Kwan <dougkwan@google.com>
358
359 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
360 at address expected by test.
361 * testsuite/arm_cortex_a8_b.s: Ditto.
362 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
363 * testsuite/arm_cortex_a8_bl.s: Ditto.
364 * testsuite/arm_cortex_a8_blx.s: Ditto.
365 * testsuite/arm_cortex_a8_local.s: Ditto.
366 * testsuite/arm_fix_v4bx.s: Ditto.
367 * testsuite/arm_unaligned_reloc.s: Ditto.
368 * testsuite/thumb_bl_out_of_range.s: Ditto.
369 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
370 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 371
56b06706
HS
3722015-06-29 Han Shen <shenhan@google.com>
373
374 Patch for erratum 843419 internal error.
375
72f4393d
L
376 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
377 (Erratum_stub::update_erratum_insn): New method.
378 (Stub_table::relocate_stubs): Modified to place relocated insn.
379 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 380
2f0c79aa
HS
3812015-06-12 Han Shen <shenhan@google.com>
382
383 Fix erratum 835769.
384
72f4393d
L
385 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
386 defintion outside class definition.
387 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
388 (AArch64_insn_utilities::aarch64_op31): New member.
389 (AArch64_insn_utilities::aarch64_ra): New member.
390 (AArch64_insn_utilities::aarch64_mac): New member.
391 (AArch64_insn_utilities::aarch64_mlxl): New member.
392 (ST_E_835769): New global enum member.
393 (Stub_table::relocate_stubs): Add 835769 handler.
394 (Stub_template_repertoire::Stub_template_repertoire): Install new
395 stub type.
396 (AArch64_relobj::scan_errata): This func is renamed from
397 scan_erratum_843419.
398 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
399 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
400 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
401 (Target_aarch64::scan_erratum_835769_span): New method.
402 (Target_aarch64::create_erratum_stub): New method.
403 (Target_aarch64::is_erratum_835769_sequence): New method.
404 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
405 code into create_erratum_stub.
406 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 407
5d7908e0
CC
4082015-06-11 Cary Coutant <ccoutant@gmail.com>
409
410 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
411 outside class body.
412 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
413
dd68f8fa
CC
4142015-06-11 Cary Coutant <ccoutant@gmail.com>
415
416 PR gold/17731
417 * layout.cc (corresponding_uncompressed_section_name): New function.
418 (Layout::choose_output_section): Call it.
419 * layout.h (corresponding_uncompressed_section_name): New function.
420 * script-sections.cc (Input_section_info::set_section_name): Check
421 for compressed debug section (.zdebug style).
422
a3a0c391
JY
4232015-06-11 Jing Yu <jingyu@google.com>
424
425 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
426 * testsuite/Makefile.in: Regenerate.
427
970cdef2
DI
4282015-06-11 Davide Italiano <dccitaliano@gmail.com>
429
430 * gold.h (is_cident): Correct typo.
431
a48d0c12
HS
4322015-06-10 Han Shen <shenhan@google.com>
433 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
434
435 Now fixing for 843419 is fully functional.
436
437 The first part of the erratum fix CL is here -
438 https://sourceware.org/ml/binutils/2015-04/msg00229.html
439
440 * aarch64.cc(global enum): New constants representing stub types.
441 (Stub_template): New POD struct.
442 (Stub_template_repertoire): New class.
443 (Stub_base): New class.
444 (Erratum_stub): New class.
445 (Reloc_stub): Refactored to be a subclass of Stub_base.
446 (Reloc_stub::Stub_type): Removed.
447 (Reloc_stub::offset): Moved to Stub_base.
448 (Reloc_stub::set_offset): Moved to Stub_base.
449 (Reloc_stub::destination_address): Moved to Stub_base.
450 (Reloc_stub::set_destination_address): Moved to Stub_base.
451 (Reloc_stub::reset_destination_address): Moved to Stub_base.
452 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
453 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
454 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
455 (Reloc_stub::write): Moved to Stub_base.
456 (Reloc_stub::invalid_offset): Moved to Stub_base.
457 (Reloc_stub::invalid_address): Moved to Stub_base.
458 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
459 (Reloc_stub::stub_insns_): Moved to Stub_base.
460 (Reloc_stub::offset_): Moved to Stub_base.
461 (Reloc_stub::destination_address_): Moved to Stub_base.
462 (Stub_table::The_aarch64_relobj): New typedef.
463 (Stub_table::The_erratum_stub): New typedef.
464 (Stub_table::The_erratum_stub_less): New typedef.
465 (Stub_table::The_erratum_stub_set): New typedef.
466 (Stub_table::The_erratum_stub_set_iter): New typedef.
467 (Stub_table::empty): Added emptiness testing for erratum stubs.
468 (Stub_table::add_erratum_stub): New method to add an erratum stub.
469 (Stub_table::find_erratum_stub): New method.
470 (Stub_table::find_erratum_stubs_for_input_section): New method.
471 (Stub_table::erratum_stub_address): New method.
472 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
473 (Stub_table::do_addralign): Modified to handle erratum stubs.
474 (Stub_table::erratum_stubs_): New member.
475 (Stub_table::erratum_stub_size_): New member.
476 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
477 (Stub_table::do_write): Modified to handle erratum stubs.
478 (AArch64_relobj::The_erratum_stub): New typedef.
479 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
480 (AArch64_relobj::fix_errata): New method.
481 (Target_aarch64::The_reloc_stub_type): Removed.
482 (Target_aarch64::The_erratum_stub): New typede.
483 (AArch64_relocate_functions::construct_b): New method.
484
1e1b2efc
NC
4852015-06-08 Nick Clifton <nickc@redhat.com>
486
487 * po/fr.po: New French Translation.
488
b8cf5075
CC
4892015-06-07 Cary Coutant <ccoutant@gmail.com>
490
491 PR gold/18288
492 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
493 callers. Don't use STT_COMMON to check for common symbols.
494 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
495 symbol that's not in a common section.
496 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
497 common symbols.
498
bdd2d2b7
CC
4992015-06-04 Cary Coutant <ccoutant@gmail.com>
500
501 PR gold/18200
502 * Makefile.am (diststuff): Add target.
503 * Makefile.in: Regenerate.
504
cd3c333f
CC
5052015-06-04 Cary Coutant <ccoutant@gmail.com>
506
507 PR gold/17498
508 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
509 temporary locals in merge sections.
510 * options.cc (General_options::parse_discard_all): New method.
511 (General_options::parse_discard_locals): New method.
512 (General_options::parse_discard_none): New method.
513 (General_options::General_options): Initialize discard_locals_.
514 * options.h (--discard-all): Convert to special option.
515 (--discard-locals): Likewise.
516 (--discard-none): New option.
517 (General_options::discard_all): New method.
518 (General_options::discard_locals): New method.
519 (General_options::discard_sec_merge): New method.
520 (General_options::Discard_locals): New enum.
521 (General_options::discard_locals_): New data member.
522
8086551f
CC
5232015-06-03 Cary Coutant <cary@google.com>
524
525 * script-sections.cc (Script_sections::Script_sections): Initialize
526 segments_created_.
527 (Script_sections::create_note_and_tls_segments): Set flag when
528 segments are created.
529 (Script_sections::expected_segment_count): Count PT_INTERP.
530 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
531 segments are created.
532 * script-sections.h (Script_sections::segments_created_): New data
533 member.
534
374082df
CC
5352015-06-03 Cary Coutant <ccoutant@gmail.com>
536
537 PR gold/15370
538 * script-sections.cc
539 (Output_section_element_input::set_section_addresses): When there
540 are several patterns with no sort spec, put all sections in the same
541 bin.
542 * testsuite/Makefile.am (script_test_12): New testcase.
543 (script_test_12i): New testcase.
544 * testsuite/Makefile.in: Regenerate.
545 * testsuite/script_test_12.t: New test linker script.
546 * testsuite/script_test_12i.t: New test linker script.
547 * testsuite/script_test_12a.c: New test source file.
548 * testsuite/script_test_12b.c: New test source file.
549
775ed62e
CC
5502015-06-02 Cary Coutant <ccoutant@gmail.com>
551
552 * nacl.h (Sniff_file): Switch parameters to get_view to get an
553 aligned view.
554
9c7fe3c5
CC
5552015-06-03 Cary Coutant <ccoutant@gmail.com>
556
72f4393d
L
557 PR gold/17819
558 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
559 separate task to schedule the build id computation.
560 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
561 add Output_file and offset.
562 (Hash_task::run): Get and release the input views.
563 (Hash_task::is_runnable): Always return NULL (always runnable).
564 (Layout::queue_build_id_tasks): Remove.
565 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
566 parameters; use them instead of class members.
567 (Build_id_task_runner::run): New function.
568 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
569 to write_build_id.
570 * layout.h (Layout::queue_build_id_tasks): Remove.
571 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
572 parameters.
573 (Layout::array_of_hashes_): Remove.
574 (Layout::size_of_array_of_hashes_): Remove.
575 (Layout::input_view_): Remove.
576 (Build_id_task_runner): New class.
577 (Close_task_runner::Close_task_runner): Add array_of_hashes and
578 size_of_hashes parameters.
579 (Close_task_runner::array_of_hashes_): New data member.
580 (Close_task_runner::size_of_hashes_): New data member.
581 * testsuite/Makefile.am
582 (flagstest_compress_debug_sections_and_build_id_tree): New test.
583 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 584
400f8944
RÁE
5852015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
586
587 * merge.cc (get_input_merge_map): Update for data structure change.
588 (get_or_make_input_merge_map): Update for data structure change.
589 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
590 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
591
bbec1a5d
AM
5922015-05-16 Alan Modra <amodra@gmail.com>
593
594 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
595 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
596 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
597 (lis_0): Rename from lis_0_0.
598
efc6fa12
CC
5992015-04-29 Cary Coutant <cary@google.com>
600 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
601
602 * gc.h (Garbage_collection::is_section_garbage): Change Object*
603 to Relobj*.
604 (Garbage_collection::add_reference): Likewise.
605 (Garbage_collection::gc_process_relocs): Likewise. Don't push
606 object/shndx pair onto *secvec for dynamic objects. Don't follow
607 relocations pointing to dynamic objects for GC.
608 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
609 (Icf::unfold_section): Likewise.
610 (Icf::is_section_folded): Likewise.
611 (Icf::get_folded_section): Likewise.
612 * icf.h: (Icf::get_folded_section): Likewise.
613 (Icf::unfold_section): Likewise.
614 (Icf::is_section_folded): Likewise.
615 (Icf::section_has_function_pointers): Likewise.
616 (Icf::set_section_has_function_pointers): Likewise.
617 * object.h (Section_id): Likewise.
618 (Const_section_id): Likewise.
619 * output.cc (Output_section::update_section_layout): Likewise.
620 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
621 Likewise.
622 * plugin.cc (update_section_order): Likewise.
623 (unique_segment_for_sections): Likewise.
624 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
625 (Target_powerpc::do_gc_add_reference): Likewise.
626 (Target_powerpc::gc_process_relocs): Likewise.
627 (Target_powerpc::do_gc_add_reference): Likewise.
628 * symtab.cc (Symbol_table::is_section_folded): Likewise.
629 (Symbol_table::gc_mark_symbol): Likewise.
630 * symtab.h: (Symbol_table::is_section_folded): Likewise.
631 * target.h: (Sized_target::gc_add_reference): Likewise.
632 (Sized_target::do_gc_add_reference): Likewise.
633
f9d3ecaa
NC
6342015-04-29 Nick Clifton <nickc@redhat.com>
635
636 * po/fi.po: Updated Finnish translation.
637
faa2211d
AM
6382015-04-28 Alan Modra <amodra@gmail.com>
639
640 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
641 than unsigned int for find_global_entry result temp. Compare
642 against invalid_address.
643 (Target_powerpc::do_plt_address_for_global): Likewise.
644 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
645 on plt call stub existence for debug info. Do assert for plt
646 and global entry stub existence if an alloc section.
647
6ec65f28
AM
6482015-04-28 Alan Modra <amodra@gmail.com>
649
650 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
651 on missing global entry stub due to bogus debug info.
652
7a2a1c79
HS
6532015-04-27 Han Shen <shenhan@google.com>
654
655 * options.h (--fix-cortex-a53-843419): Rename option.
656 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
657 option.
658 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
659
cfbf0e3c
RÁE
6602015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
661
662 PR gold/18327
663 * output.cc (Output_section::is_input_address_mapped): Assume a missing
664 entry is mapped.
665 * testsuite/Makefile.am: Add the eh_test test.
666 * testsuite/Makefile.in: Regenerate.
667 * testsuite/eh_test_a.cc: New test.
668 * testsuite/eh_test_b.cc: New test.
669
6ec65f28
AM
6702015-04-23 Sriraman Tallam <tmsriram@google.com>
671
a100d66f
ST
672 * options.h (--weak-unresolved-symbols): New option.
673 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
674 binding to weak with new option.
675 * symtab.h (is_weak_undefined): Check for new option.
676 (is_strong_undefined): Check for new option.
677 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
678 * testsuite/Makefile.in: Regenerate.
679 * testsuite/weak_unresolved_symbols_test.cc: New file.
680
4b889c30
IC
6812015-04-20 Ian Coolidge <icoolidge@google.com>
682
683 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
684 GNU_UNIQUE.
685
4277535c
RÁE
6862015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
687
688 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
689 push_back.
690 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
691 * object.cc (Sized_relobj_file::do_layout): Use push_back.
692 * powerpc.cc (process_gc_mark): Use push_back.
693 (Target_powerpc::do_gc_mark_symbol): Use push_back.
694 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
695
7a2a1c79 6962015-04-16 Han Shen <shenhan@google.com>
5019d64a 697
6ec65f28
AM
698 * aarch64.cc (AArch64_insn_utilities): New utility class.
699 (AArch64_relobj::Mapping_symbol_position): New struct.
700 (AArch64_relobj::Mapping_symbol_info): New typedef.
701 (AArch64_relobj::do_count_local_symbols): New function overriding
702 parent's implementation.
703 (AArch64_relobj::mapping_symbol_info_): New member
704 (AArch64_relobj::scan_erratum_843419): New method.
705 (Target_aarch64::scan_erratum_843419_span): New method.
706 (Target_aarch64::is_erratum_843419_sequence): New method.
707 * options.h (fix_cortex_a53): New option.
5019d64a 708
a6a17750
CC
7092015-04-09 Cary Coutant <ccoutant@google.com>
710
711 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
712 in a PIE link.
713 * testsuite/Makefile.am (tls_pie_test.sh): New test.
714 * testsuite/Makefile.in: Regenerate.
715 * testsuite/tls_pie_test.sh: New.
716
437ddf0c
CC
7172015-04-09 Cary Coutant <ccoutant@google.com>
718
719 * debug.h (DEBUG_LOCATION): New.
720 (DEBUG_ALL): Include DEBUG_LOCATION.
721 (debug_string_to_enum): Add DEBUG_LOCATION.
722 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
723 output to print correct context.
724 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
725 up to 4 more locations at the beginning of the function.
726 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
727 result before sorting list of line numbers.
728 * testsuite/debug_msg.sh: Allow range of line numbers for
729 canonical results on optimized code.
730
24491327
HS
7312015-04-07 HC Yen <hc.yen@mediatek.com>
732
733 Add AArch32 support for gold linker.
734 gold/
735 * arm.cc: Add V8 arch combine table.
736
7fa5525f
RÁE
7372015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
738
739 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
740
5368dcf2
RÁE
7412015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
742
743 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
744 to find by using the return value of insert.
745
9dbb4b02
RÁE
7462015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
747
748 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
749 constructor call.
750
1fa29f10
IT
7512015-04-06 Ilya Tocar <ilya.tocar@intel.com>
752
753 PR gold/17641
754 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
755 (Target_x86_64::Scan::local): Don't create GOT entry, when we
756 can convert mov to lea.
757 (Target_x86_64::Scan::global): Ditto.
758 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
759 %reg to lea foo(%rip), %reg if possible.
760 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
761 * testsuite/x86_64_mov_to_lea1.s: New.
762 * testsuite/x86_64_mov_to_lea2.s: Ditto.
763 * testsuite/x86_64_mov_to_lea3.s: Ditto.
764 * testsuite/x86_64_mov_to_lea4.s: Ditto.
765 * testsuite/x86_64_mov_to_lea.sh: Ditto.
766
39f3de7c
L
7672015-04-02 H.J. Lu <hongjiu.lu@intel.com>
768
769 * configure: Regenerated.
770
c4fc4724
IT
7712015-04-01 Ilya Tocar <ilya.tocar@intel.com>
772
773 PR gold/17640
774 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
775 (Target_i386::Scan::local): Don't create GOT entry, when we
776 can convert GOT to GOTOFF.
777 (Target_i386::Scan::global): Ditto.
778 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
779 lea foo@GOTOFF(%reg), %reg if possible.
780 * testsuite/Makefile.am (i386_mov_to_lea): New test.
781 * testsuite/i386_mov_to_lea1.s: New.
782 * testsuite/i386_mov_to_lea2.s: Ditto.
783 * testsuite/i386_mov_to_lea3.s: Ditto.
784 * testsuite/i386_mov_to_lea4.s: Ditto.
785 * testsuite/i386_mov_to_lea5.s: Ditto.
786 * testsuite/i386_mov_to_lea.sh: Ditto.
787
918357b9
L
7882015-04-01 H.J. Lu <hongjiu.lu@intel.com>
789
790 * Makefile.am (ZLIB): New.
791 (ZLIBINC): Likewise.
792 (AM_CFLAGS): Add $(ZLIBINC).
793 (AM_CXXFLAGS): Likewise.
794 (ldadd_varldadd_var): Add $(ZLIB).
795 (incremental_dump_LDADD): Likewise.
796 (dwp_LDADD): Likewise.
797 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
798 <zlib.h>.
799 (zlib_compress): Don't check HAVE_ZLIB_H.
800 (zlib_decompress): Likewise.
801 * options.h (compress_debug_sections): Likewise.
802 * configure.ac (AM_CONDITIONAL): Removed.
803 * testsuite/Makefile.am (ZLIB): New.
804 (LDADD): Add $(ZLIB).
805 Don't check HAVE_ZLIB.
806 * Makefile.in: Regenerated.
807 * config.in: Likewise.
808 * configure: Likewise.
809 * testsuite/Makefile.in: Likewise.
810
6b0ad2eb
JY
8112015-03-30 Jing Yu <jingyu@google.com>
812
813 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
814 TLSLD_ADD_DTPREL_LO12_NC.
815 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
816 _TLS_MODULE_BASE_ point to the start of tls segment.
817 (Target_aarch64::optimize_tls_reloc): Add cases for
818 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
819 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
820 (Target_aarch64::Scan::local): Likewise.
821 (Target_aarch64::Scan::global): Likewise.
822 (Target_aarch64::Relocate::relocate): Likewise.
823 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
824 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
825 relocations.
826
0916f9e7
RÁE
8272015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
828
829 * merge.cc (Object_merge_map::add_mapping): call
830 Object_merge_map::Input_merge_map::add_mapping.
831 (Object_merge_map::Input_merge_map::add_mapping): New.
832 (Output_merge_data::do_add_input_section): Call
833 get_or_make_input_merge_map before a loop.
834 (Output_merge_string<Char_type>::finalize_merged_data): Call
835 get_or_make_input_merge_map before a loop.
836 * merge.h (Object_merge_map): Make Input_merge_map public.
837 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
838 (Relobj::get_or_create_merge_map): New.
839 * object.h (Relobj::get_or_create_merge_map): New.
840
282c9750
AM
8412015-03-24 Alan Modra <amodra@gmail.com>
842
843 PR 18147
844 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
845 relocation errors for branches to strong undefined symbols.
846
67f95b96
RÁE
8472015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
848
849 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
850 (Object_merge_map::is_merge_section_for): Remove.
851 (Object_merge_map::find_merge_section): New.
852 * merge.h (Object_merge_map::is_merge_section_for): Remove.
853 (Object_merge_map::find_merge_section): New.
854 (Object_merge_map::get_input_merge_map): Add a const version.
855 * object.cc (Relobj::is_merge_section_for): Remove.
856 (Relobj::find_merge_section): New.
857 * object.h (Relobj::is_merge_section_for): Remove.
858 (Relobj::find_merge_section): New.
859 * output.cc
860 (Output_section::Input_section::is_merge_section_for): Remove.
861 (Output_section::add_merge_input_section): Don't call
862 add_merge_input_section.
863 (Output_section::find_merge_section): Return const. Use
864 object->find_merge_section.
865 (Output_section::build_lookup_maps): Don't build a map for
866 merge sections.
867 (Output_section::is_input_address_mapped): Return false if
868 section is not found.
869 (Output_section::find_starting_output_address): Use
870 find_merge_section instead of is_merge_section_for.
871 (Output_section::add_script_input_section): Don't build a map for
872 merge sections.
873 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
874 (Output_section_lookup_maps::find_merge_section): Remove.
875 (Output_section_lookup_maps::add_merge_input_section) Remove.
876 (Output_section::find_merge_section): Return const.
877
152f7024
CC
8782015-03-22 Cary Coutant <cary@google.com>
879
880 PR gold/18106
881 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
882 non-SIB form of lea, with nop after the call.
883
bccffdfd
CC
8842015-03-21 Cary Coutant <cary@google.com>
885
886 PR gold/14217
887 * output.cc (Output_segment::is_first_section_relro): Don't ignore
888 .tdata section.
889 (Output_segment::set_section_addresses): Don't align size of relro
890 segment for .tbss.
891
1c582fe7
CC
8922015-03-21 Cary Coutant <cary@google.com>
893
894 PR gold/18010
895 * stringpool.cc (Stringpool_template): Don't optimize if section
896 alignment is greater than sizeof(char).
897
410da591
CC
8982015-03-21 Cary Coutant <cary@google.com>
899
900 PR gold/18048
901 * script-c.h (script_include_directive): Add first_token parameter.
902 * script.cc (script_include_directive): Add first_token parameter, and
903 pass it to read_script_file.
904 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
905 (PARSING_MEMORY_DEF): New tokens.
906 (top): Add new productions for INCLUDE files.
907 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
908 Pass PARSING_LINKER_SCRIPT to script_include_directive.
909 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
910 (section_cmd): Pass PARSING_SECTION_CMDS.
911 (file_or_sections_cmd): Remove.
912 (memory_def): Pass PARSING_MEMORY_DEF.
913 * testsuite/Makefile.am (memory_test_2): New test.
914 * testsuite/Makefile.in: Regenerate.
915 * testsuite/memory_test_inc.t: New script file.
916 * testsuite/memory_test_inc_1.t.src: New script file.
917 * testsuite/memory_test_inc_2.t.src: New script file.
918 * testsuite/memory_test_inc_3.t.src: New script file.
919
0d5bbdb0
CC
9202015-03-21 Cary Coutant <cary@google.com>
921
922 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
923 (Sized_relobj_dwo::setup): Build compressed section map.
924 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
925 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
926 section map.
927 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
928 compressed_sections_ field.
929 (build_compressed_section_map): Take Object instead of
930 Sized_relobj_file parameter; add decompress_if_needed parameter.
931 (Sized_relobj_file::do_find_special_sections): Store compressed
932 section map in parent Object.
933 (Sized_relobj_file::do_decompressed_section_contents): Move
934 implementation to Object::decompressed_section_contents.
935 (Sized_relobj_file::do_discard_decompressed_sections): Move
936 implementation to Object::discard_decompressed_sections.
937 * object.h (build_compressed_section_map): Declare.
938 (Object::Object): Add compressed_sections_ field.
939 (Object::section_is_compressed): Move implementation here.
940 (Object::decompressed_section_contents): De-virtualize.
941 (Object::discard_decompressed_sections): De-virtualize.
942 (Object::do_section_is_compressed): Delete.
943 (Object::do_decompressed_section_contents): Delete.
944 (Object::set_compressed_sections): New method.
945 (Object::compressed_sections): New method.
946 (Object::compressed_sections_): New data member.
947 (Compressed_section_info, Compressed_section_map): Move to top of file.
948 (Sized_relobj_file::do_section_is_compressed): Delete.
949 (Sized_relobj_file::do_decompressed_section_contents): Delete.
950 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
951 (Sized_relobj_file::compressed_sections_): Move to Object class.
952
bd9e0d46
CC
9532015-03-21 Cary Coutant <ccoutant@google.com>
954
955 PR gold/18152
956 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
957 deferred objects.
958
943c8b43
CC
9592015-03-11 Cary Coutant <ccoutant@google.com>
960
961 * options.cc (General_options::finalize): Don't allow -z relro
962 with incremental linking.
963 * testsuite/Makefile.am (incremental_test): Add -z norelro.
964 (incremental_test_2): Likewise.
965 (incremental_test_3): Likewise.
966 (incremental_test_4): Likewise.
967 (incremental_test_5): Likewise.
968 (incremental_test_6): Likewise.
969 (incremental_copy_test): Likewise.
970 (incremental_common_test_1): Likewise.
971 (incremental_comdat_test_1): Likewise.
972 * testsuite/Makefile.in: Regenerate.
973
e1663197
CC
9742015-03-09 Cary Coutant <ccoutant@google.com>
975
976 PR gold/14675
977 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
978 return enum indicating whether .eh_frame section is empty, optimizable,
979 unrecognized, or an end marker. Adjust explicit instantiations.
980 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
981 (Eh_frame::add_ehframe_input_section): Change return type.
982 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
983 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
984 to the .eh_frame output section until we see the end marker.
985 (Layout::finalize_eh_frame_section): New.
986 * layout.h: (Layout::finalize_eh_frame_section): New.
987
beb8418f
L
9882015-03-05 H.J. Lu <hongjiu.lu@intel.com>
989
990 * output.cc (Relobj::initialize_input_to_output_map<size>):
991 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
992
48c73428
CC
9932015-03-04 Cary Coutant <ccoutant@google.com>
994
995 * parameters.cc (Parameters::set_target_once): Call
996 Target::select_as_default_target just once from here...
997 (set_parameters_target): ...instead of from here.
998
9992015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1000
1001 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1002 Output_section_data instead of a Merge_map.
1003 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1004 (Eh_frame::read_cie): Use add_merge_mapping instead of
1005 Merge_map::add_mapping.
1006 (Eh_frame::read_fde): Ditto.
1007 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1008 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1009 merge_map_->get_output_offset.
1010 (Eh_frame::do_is_merge_section_for): Delete.
1011 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1012 instead of a Merge_map.
1013 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1014 Merge_map.
1015 (Eh_frame::do_is_merge_section_for): Delete.
1016 (Eh_frame::merge_map_): Delete.
1017 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1018 and use a Output_section_data instead of a Merge_map.
1019 (Object_merge_map::add_mapping): Ditto.
1020 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1021 (Object_merge_map::is_merge_section_for): Pass in and use a
1022 Output_section_data instead of a Merge_map.
1023 (Merge_map): Delete.
1024 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1025 of merge_map_.get_output_offset.
1026 (Output_merge_base::do_is_merge_section_for): Delete.
1027 (Output_merge_data::do_add_input_section): Use
1028 object->add_merge_mapping instead of add_mapping.
1029 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1030 * merge.h (Merge_map): Delete forward declaration.
1031 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1032 instead of a Merge_map.
1033 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1034 (Object_merge_map::is_merge_section_for): Pass in and use a
1035 Output_section_data instead of a Merge_map.
1036 (Input_merge_map::Object_merge_map::merge_map): Replace with
1037 output_data.
1038 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1039 Output_section_data instead of a Merge_map.
1040 (Merge_map): Delete.
1041 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1042 (Output_merge_base::do_is_merge_section_for): Delete.
1043 (Output_merge_base::add_mapping): Delete.
1044 (Output_merge_base::merge_map_): Delete.
1045 * object.cc (Relobj::initialize_input_to_output_map): New.
1046 (Relobj::initialize_input_to_output_map): New.
1047 (Relobj::merge_output_offset): New.
1048 (Relobj::is_merge_section_for): New.
1049 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1050 bits.
1051 * object.h (Relobj::merge_map): Delete.
1052 (initialize_input_to_output_map): New.
1053 (set_merge_map): Delete.
1054 (add_merge_mapping): New.
1055 (merge_output_offset): New.
1056 (is_merge_section_for): New.
1057 * output.cc (Output_section::Input_section::is_merge_section_for):
1058 Use object->is_merge_section_for.
1059 * output.h (Output_section_data::is_merge_section_for): Delete.
1060 (Output_section_data::do_is_merge_section_for): Delete.
1061 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1062 Use object->initialize_input_to_output_map.
1063 (Merged_symbol_value<size>::value_from_output_section): Use
1064 object->merge_output_offset.
1065
48c73428 10662015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1067 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1068
1069 * output.cc (Output_section::add_merge_input_section): Do not
1070 attempt to merge sections with an entsize of 0.
1071
48c73428 10722015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1073
1074 * attributes.h (class Output_attributes_section_data ): Add
1075 do_print_to_mapfile function.
1076
ec86f434
AM
10772015-02-24 Alan Modra <amodra@gmail.com>
1078
1079 PR 18010
1080 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1081 complain if value is not a multiple of four.
1082 (Target_powerpc::Relocate::relocate): Correct handling of
1083 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1084
be66981e
L
10852015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1086
1087 * configure.ac (default_size): Set to 32 for x32.
1088 * configure: Regenerated.
1089
e3ee8ed4
AM
10902015-02-18 Alan Modra <amodra@gmail.com>
1091
1092 PR 17954
1093 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1094 visibility.
1095
3a935c6c
RÁE
10962015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1097
1098 * gc.h (Garbage_collection::add_reference): Don't use find.
1099
e0a1e121
RÁE
11002015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1101
1102 * object.cc (write_local_symbols): avoid std::vector copy.
1103
45a4fb1a
RÁE
11042015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1105
1106 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1107
2d9afefe
MW
11082015-02-09 Mark Wielaard <mjw@redhat.com>
1109
1110 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1111 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1112
e9c1bdad
CC
11132015-02-16 Cary Coutant <ccoutant@google.com>
1114
1115 PR gold/13577
1116 PR gold/16992
1117 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1118 DF_SYMBOLIC if --dynamic-list option is used.
1119 * options.cc (General_options::finalize): --dynamic-list is not
1120 mutually exclusive with -Bsymbolic.
1121 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1122 listed in --dynamic-list.
1123 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1124 -Bsymbolic-functions.
1125 * testsuite/Makefile.in: Regenerate.
1126
0ed4b0bf
CC
11272015-02-16 Cary Coutant <ccoutant@google.com>
1128
1129 PR gold/17971
1130 * incremental.cc: Remove redundant include of "output.h".
1131
1a920511
JY
11322015-02-12 Jing Yu <jingyu@google.com>
1133
1134 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1135 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1136 New relocation.
1137 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1138 TLSLE_MOVW_* relocations.
1139 (Target_aarch64::Scan::global): Likewise.
1140 (Target_aarch64::Relocate::relocate): Likewise.
1141 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1142 for new TLSLE_MOVW_* relocations.
1143
07f107f3
WN
11442015-02-11 Will Newton <will.newton@linaro.org>
1145
1146 PR gold/13321
1147 * arm.cc (Target_arm::make_plt_section): Create an ARM
1148 state mapping symbol at the start of the PLT.
1149
e051a5b5
L
11502015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1151
1152 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1153 Replace two_file_shared_2.so with two_file_shared_1.so.
1154 * testsuite/Makefile.in: Regenerated.
1155
dddcc5b9
AM
11562015-02-09 Alan Modra <amodra@gmail.com>
1157
1158 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1159 plugin_test_thin.a and defsym_test.
1160 * testsuite/Makefile.in: Regenerate.
1161
b39b8b9d
RÁE
11622015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1163
1164 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1165 body.
1166
b66d1c52
CC
11672015-02-04 Peter Collingbourne <pcc@google.com>
1168
1169 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1170 forwarding symbols when computing symbol resolution info for plugins.
1171 * plugin.h (Plugin_manager::symtab): New method.
1172 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1173
23081de0
CC
11742015-02-03 Cary Coutant <ccoutant@google.com>
1175 Peter Collingbourne <pcc@google.com>
1176
1177 PR gold/15660
1178 * archive.cc (Thin_archive_object_unlocker): New class.
1179 (Archive::include_member): Unlock external members of thin archives.
1180 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1181 (plugin_test_2): Likewise.
1182 (plugin_test_3): Likewise.
1183 (plugin_test_4): Likewise.
1184 (plugin_test_5): Likewise.
1185 (plugin_test_6): Likewise.
1186 (plugin_test_7): Likewise.
1187 (plugin_test_8): Likewise.
1188 (plugin_test_9): Likewise.
1189 (plugin_test_10): Likewise.
1190 (plugin_test_11): New test case.
1191 * testsuite/Makefile.in: Regenerate.
1192 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1193 file to decide whether to claim file.
1194 (all_symbols_read_hook): Likewise.
1195 * testsuite/plugin_test_1.sh: Adjust expected output.
1196 * testsuite/plugin_test_2.sh: Likewise.
1197 * testsuite/plugin_test_3.sh: Likewise.
1198 * testsuite/plugin_test_6.sh: Likewise.
1199 * testsuite/plugin_test_tls.sh: Likewise.
1200 * testsuite/plugin_test_11.sh: New testcase.
1201
12022015-02-03 Cary Coutant <ccoutant@google.com>
1203
1204 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1205 file descriptors when debugging enabled. Add debug output.
1206 (Descriptors::release): Add debug output.
1207 (Descriptors::close_some_descriptor): Likewise.
1208 (Descriptors::close_all): Likewise.
1209 * fileread.cc (File_read::lock): Likewise.
1210 (File_read::unlock): Likewise.
1211
24dd5808
CC
12122015-02-02 Cary Coutant <ccoutant@google.com>
1213
1214 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1215 executable output file.
1216
fa89cc82
HS
12172015-01-22 Han Shen <shenhan@google.com>
1218
1219 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1220 (Target_arm::do_plt_address_for_global): New method.
1221 (Target_arm::do_plt_address_for_local): New method.
1222 (Target_arm::rel_irelative_section): New method.
1223 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1224 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1225 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1226 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1227 (Target_arm::Scan::check_non_pic): Add ifunc support.
1228 (Target_arm::Scan::local): Add ifunc support.
1229 (Target_arm::Scan::global): Add ifunc support.
1230 (Target_arm::make_plt_section): New method.
1231 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1232 (Target_arm::make_local_ifunc_plt_entry): New method.
1233 (Target_arm::got_irelative_): New member.
1234 (Target_arm::rel_irelative_): New member.
1235 (Target_arm::got_section): Add creation for got_irelative_.
1236 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1237 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1238 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1239 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1240 (Output_data_plt_arm::IRelative_data): New type.
1241 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1242 (Output_data_plt_arm::add_entry): Add more parameters.
1243 (Output_data_plt_arm::add_relocation): New method.
1244 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1245 (Output_data_plt_arm::rel_irelative): New method.
1246 (Output_data_plt_arm::entry_count): Modified.
1247 (Output_data_plt_arm::address_for_global): New method.
1248 (Output_data_plt_arm::address_for_local): New method.
23081de0 1249gold/
fa89cc82
HS
1250 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1251 (Output_data_plt_arm::insert_irelative_data): New method.
1252 (Output_data_plt_arm::irelative_rel_): New member.
1253 (Output_data_plt_arm::got_): New member.
1254 (Output_data_plt_arm::got_irelative_): New member.
1255 (Output_data_plt_arm::irelative_count_): New member.
1256 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1257 (Output_data_plt_arm::irelative_data_vec_): New member.
1258 (Output_data_plt_arm::do_write): Write out irelative entries.
1259 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1260 more parameters to ctor.
1261 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1262 more parameters to ctor.
1263 * output.h (Output_data_reloc::add_local_relative): New method.
1264 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1265
0f81d3f0
AM
12662015-01-29 Alan Modra <amodra@gmail.com>
1267
1268 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1269 and GOT_TLSGD to LE optimization.
1270
65d92137
CC
12712015-01-28 Cary Coutant <ccoutant@google.com>
1272
1273 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1274 for undef TLS symbols.
1275 (Target_x86_64::Relocate::relocate_tls): Likewise.
1276 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1277
5485698a
CC
12782015-01-25 Cary Coutant <ccoutant@google.com>
1279
1280 * output.cc (Output_segment::set_section_addresses): Fix calculation
1281 of size of relro segment.
1282
b01a4b04
AM
12832015-01-22 Alan Modra <amodra@gmail.com>
1284
1285 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1286 condition for need of ifunc plt entry.
1287 (Target_powerpc::Scan::global <got relocs>): Likewise.
1288
3d0064a9
CC
12892015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1290
1291 * mips.cc (reloc_high): Add r_sym.
1292 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1293 reloc_high constructor.
1294 (Mips_relocate_functions::relgot16_local): Likewise.
1295 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1296 r_type to decide whether LO16 matches HI16.
1297 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1298 rello16 and relgot16_local.
1299
a5cd8f05
CC
13002015-01-09 Cary Coutant <ccoutant@google.com>
1301
1302 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1303 unless alignment is larger than page size.
1304
4fc1b9d4
L
13052015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1306 Cary Coutant <ccoutant@google.com>
1307
1308 PR gold/17729
1309 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1310 (DEFAULT_TARGET_X32): Set for x32.
1311 * x86_64.cc (cmp_insn_32): New.
1312 (lea_r10_insn_32): Likewise.
1313 (lea_r11_insn_32): Likewise.
1314 (cmp_insn_64): Likewise.
1315 (lea_r10_insn_64): Likewise.
1316 (lea_r11_insn_64): Likewise.
1317 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1318 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1319 (check_DATA): Add split_x32 files.
1320 (split_x32_[1234n].o): New targets.
1321 (split_x32_[124]): New targets.
1322 (split_x32_[1234r].stdout): New targets.
1323 * testsuite/split_x32.sh: New file.
1324 * testsuite/split_x32_1.s: Likewise.
1325 * testsuite/split_x32_2.s: Likewise.
1326 * testsuite/split_x32_3.s: Likewise.
1327 * testsuite/split_x32_4.s: Likewise.
1328 * testsuite/split_x32_n.s: Likewise.
1329 * configure: Regenerated.
1330 * testsuite/Makefile.in: Likewise.
1331
e749cab8
L
13322015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1333
1334 PR gold/17809
1335 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1336 x32.
1337
af759df0
AM
13382015-01-02 Alan Modra <amodra@gmail.com>
1339
1340 * version.cc (print_version): Just print current year.
1341 * dwp.cc (print_version): Likewise.
1342
b90efa5b
AM
13432015-01-01 Alan Modra <amodra@gmail.com>
1344
1345 Update year range in copyright notice of all files.
1346
f12d1e8a
AM
13472014-12-25 Alan Modra <amodra@gmail.com>
1348
1349 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1350 new enums.
1351 (Target_arm::merge_object_attributes, ): Likewise.
1352
5c294fee
TG
13532014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1354
1355 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1356 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1357 AEABI_VFP_args_vfp to check that.
1358 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1359 value and replace hardcoded values by enum values.
1360
e30880c2
CC
13612014-12-22 Cary Coutant <ccoutant@google.com>
1362
1363 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1364
bd040da1
L
13652014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1366
1367 PR gold/14608
1368 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1369 to "return i * i * 3;".
1370
e02a4046
CC
13712014-12-16 Cary Coutant <ccoutant@google.com>
1372
1373 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1374 (Mapfile::print_output_data): Use current_data_size() to avoid
1375 assert for sections requiring postprocessing; if address is not valid,
1376 print 0.
1377 (Mapfile::print_output_section): Use current_data_size(); print note
1378 that addresses and sizes are before compression.
1379
add6016b
L
13802014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1381
1382 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1383 Cast current_group_size to unsigned long when reporting error.
1384
0bf32ea9
JY
13852014-12-10 Jing Yu <jingyu@google.com>
1386
1387 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1388 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1389 Update error message.
1390 (Target_aarch64::do_relax): Use absolute value of option
1391 stub_group_size. Replace local variable with class member
1392 stub_group_size_.
1393
cbcb23fa
AM
13942014-12-04 Alan Modra <amodra@gmail.com>
1395
1396 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1397 addend of PLTREL24 reloc when not generating a plt stub. Make
1398 max_branch_offset an "Address".
fbad6518 1399 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1400 (Target_powerpc::Relocate::relocate): Likewise.
1401
1611bc4a
AM
14022014-12-04 Alan Modra <amodra@gmail.com>
1403
1404 PR 17670
1405 * symtab.cc (Symbol::set_undefined): Remove assertion.
1406 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1407 on symbols defined in discarded sections, instead return false.
1408 Rearrange params, update all callers.
1409 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1410 branches to syms in discarded sections.
1411 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1412 undefined and flag as discarded.
1413 (Target_powerpc::Relocate::relocate): Localize variable.
1414
4759c34e
L
14152014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1416
1417 PR gold/17675
1418 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1419 * testsuite/Makefile.in: Regenerated.
1420
1f98a074
AM
14212014-12-03 Alan Modra <amodra@gmail.com>
1422
1423 PR 17566
1424 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1425 when adding dynamic relocations against section symbols.
1426
fb257835
DI
14272014-12-01 Dimitry Ivanov <dimitry@google.com>
1428
1429 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1430 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1431 * options.h (General_options): New -z option (global).
1432
d8e60314
CC
14332014-12-01 Cary Coutant <ccoutant@google.com>
1434
1435 PR gold/17578
1436 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1437 is given.
1438 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1439 given but some inputs require executable stack.
1440
982bbd97
CC
14412014-11-26 Cary Coutant <ccoutant@google.com>
1442
1443 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1444 .debug_str_offsets; strip .debug_gnu_pubnames and
1445 .debug_gnu_pubtypes.
1446 (lines_only_debug_sections): Strip all four new sections.
1447
bb779192
HS
14482014-11-26 Jing Yu <jingyu@google.com>
1449
1450 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1451 register to be x0 when to relax TLSDESC_LD64_LO12.
1452
a3e60ddb
AM
14532014-11-26 Alan Modra <amodra@gmail.com>
1454
1455 * powerpc.cc (struct Stub_table_owner): New.
1456 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1457 unsigned int vector. Update all references.
1458 (powerpc_relobj::set_stub_table): Take an unsigned int param
1459 rather than a Stub_table. Update callers.
1460 (Powerpc_relobj::clear_stub_table): New function.
1461 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1462 stub_group_size_ vars.
1463 (Target_powerpc::new_stub_table): Delete.
1464 (max_branch_delta): New function, extracted from..
1465 (Target_powerpc::Relocate::relocate): ..here..
1466 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1467 status on whether stub created successfully.
1468 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1469 default sizing to..
1470 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1471 reduce on relax failure.
1472 (Target_powerpc::group_sections): Add "no_size_errors" param.
1473 Use stub_group_size_. Set up group info in a temp vector,
1474 before building Stub_table vector. Account for input sections
1475 possibly already converted to relaxed sections.
1476 (Stub_table::init): Delete. Merge into..
1477 (Stub_table::Stub_table): ..here.
1478 (Stub_table::can_reach_stub): New function.
1479 (Stub_table::add_plt_call_entry): Add "from" parameter and
1480 return true iff stub could be reached.
1481 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1482 param too.
1483 (Stub_table::clear_stubs): Add "all" param.
1484
a20605cf
AM
14852014-11-26 Alan Modra <amodra@gmail.com>
1486
1487 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1488 (Target_powerpc::group_sections): Use it.
1489
43b64deb
CC
14902014-11-25 Cary Coutant <ccoutant@google.com>
1491
1492 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1493 (Binary_to_elf::write_symbol): Add st_size parameter.
1494 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1495
c924eb67
CC
14962014-11-25 Cary Coutant <ccoutant@google.com>
1497
1498 PR gold/17639
1499 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1500 (Sized_relobj_file::do_layout): Handle deferred sections properly
1501 during GC pass 1. Don't add reloc sections to deferred list twice.
1502 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1503 (Sized_relobj_file::is_deferred_layout_): New data member.
1504
9d585188
L
15052014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1506
1507 PR gold/17619
1508 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1509 Check PC-relative offset overflow in PLT entry.
1510
3ffaac20
AM
15112014-11-21 Alan Modra <amodra@gmail.com>
1512
1513 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1514 for undefined weaks.
1515
0cfb0717
AM
15162014-11-20 Alan Modra <amodra@gmail.com>
1517
1518 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1519 from --stub-group-size parameter divided by 1024.
1520 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1521 template parameter. Update all uses.
1522 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1523 has_stub_value. Set for long branches. Don't report overflow for
1524 branch to undefined weak symbols. Print info message on
1525 overflowing branch to stub.
1526
f9dffbf0
AM
15272014-11-20 Alan Modra <amodra@gmail.com>
1528
1529 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1530
e88ba8d5
L
15312014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1532
1533 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1534 entry for R_X86_64_GOTPLT64.
1535 (Target_x86_64<size>::Relocate::relocate): Update comments for
1536 R_X86_64_GOTPLT64.
1537
d37ffe25
ED
15382014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1539
1540 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1541 * plugin.h: add lock definition
1542
9726c3c1
HS
15432014-10-29 Han Shen <shenhan@google.com>
1544 Jing Yu <jingyu@google.com>
1545
1546 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1547 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1548 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1549 Symbol::TLS_REF.
1550 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1551 method.
1552 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1553 (Target_aarch64::tls_ld_to_le): New method.
1554 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1555 for 64bit targets.
1556 (Output_data_plt_aarch64::irelative_rel_): New data member.
1557 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1558 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1559 (Output_data_plt_aarch64::add_relocation): New method.
1560 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1561 offset. Add got_irelative size to got size.
1562 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1563 type string with the new typename.
1564 (AArch64_relocate_functions::update_adr): Replace parameter x with
1565 immed.
1566 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1567 (AArch64_relocate_functions::reloc_common): New method.
1568 (AArch64_relocate_funcsions::rela_general): Extract common part out
1569 into reloc_common method.
1570 (AArch64_relocate_functions::rela_general): Likewise.
1571 (AArch64_relocate_functions::pcrela_general): Likewise.
1572 (AArch64_relocate_functions::adr): New method.
1573 (AArch64_relocate_functions::adrp): Calculate immed before calling
1574 update_adr.
1575 (AArch64_relocate_functions::adrp): Likewise.
1576 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1577 comparing x to 0. Calculate immed from ~x when x < 0.
1578 (Target_aarch64::optimize_tls_reloc): Add new cases for
1579 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1580 TLSLD_MOVW_DTPREL_G0_NC.
1581 (Target_aarch64::possible_function_pointer_reloc): Implement this
1582 method.
1583 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1584 comment.
1585 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1586 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1587 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1588 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1589 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1590 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1591 (Target_aarch64::make_plt_entry): Call add_entry with two more
1592 parameters.
1593 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1594 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1595 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1596 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1597 (Target_aarch64::Relocate::relocate_tls): Add cases for
1598 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1599 TLSLD_MOVW_DTPREL_G0_NC.
1600 * testsuite/icf_safe_so_test.cc: Correct test comment.
1601 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1602
80272b8c
AM
16032014-10-22 Alan Modra <amodra@gmail.com>
1604
1605 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1606 thread_starter.
1607
998a69f4
AS
16082014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1609
1610 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1611
aed56ec5
CC
16122014-10-17 Cary Coutant <ccoutant@google.com>
1613
1614 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1615 Add "typename" keyword.
1616
bb779192 16172014-10-15 Han Shen <shenhan@google.com>
72f4393d 1618 Jing Yu <jingyu@google.com>
83a01957
HS
1619
1620 Patch for gold aarch64 backend to support relaxation.
1621 * aarch64-reloc.def: Change format.
1622 * aarch64.cc (class Reloc_stub): New class.
1623 (class Stub_table): New class.
1624 (class AArch64_relobj): New class.
1625 (class AArch64_input_section): New class.
1626 (class AArch64_output_section): New class.
1627 (Target_aarch64::new_stub_table): New method.
1628 (Target_aarch64::new_aarch64_input_section): New method.
1629 (Target_aarch64::find_aarch64_input_section): New method.
1630 (Target_aarch64::scan_section_for_stubs): New method.
1631 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1632 (Target_aarch64::relocate_stub): New method.
1633 (Target_aarch64::current_target): New method.
1634 (Target_aarch64::do_make_elf_object): New method.
1635 (Target_aarch64::do_may_relax): New method.
1636 (Target_aarch64::do_relax): New method.
1637 (Target_aarch64::group_sections): New method.
1638 (Target_aarch64::scan_reloc_for_stub): New method.
1639 (Target_aarch64::do_make_output_section): New method.
1640 (Target_aarch64::stub_tables_): New data member.
1641 (Target_aarch64::aarch64_input_section_map_): New data member.
1642 (AArch64_relocate_functions::maybe_apply_stub): New method.
1643
db4c9594
CC
16442014-09-30 Cary Coutant <ccoutant@google.com>
1645
1646 PR gold/17432
1647 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1648
cd6da036
KC
16492014-09-30 Kito Cheng <kito@0xlab.org>
1650
1651 PR gold/13597
1652 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1653 hash table before sysv-style hash table.
1654
5f772412
ST
16552014-09-29 Sriraman Tallam <tmsriram@google.com>
1656
1657 * options.h (--pic-executable): Add negative to alias to -no-pie.
1658
5efeedf6
CC
16592014-09-26 Cary Coutant <ccoutant@google.com>
1660
1661 PR gold/16773
1662 * object.cc (Sized_relobj_file): Compute value of section symbols
1663 for TLS sections the same as TLS symbols.
1664
1707f183
CC
16652014-09-25 Cary Coutant <ccoutant@google.com>
1666
1667 PR gold/17432
1668 * resolve.cc (Symbol_table::resolve): Override common placeholder
1669 symbols, but adjust sizes.
1670 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1671 symbols to common lists.
1672
00cac886
AM
16732014-09-24 Alan Modra <amodra@gmail.com>
1674
1675 * po/POTFILES.in: Regenerate.
1676
635aa30e 16772014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1678 Cary Coutant <ccoutant@google.com>
635aa30e 1679
71b9b91b 1680 PR gold/14860
635aa30e
CC
1681 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1682 on input_sections_blocker.
1683 * layout.cc (Write_sections_task::locks): Unblock
1684 input_sections_blocker_.
1685 * layout.h (Write_sections_task::Write_sections_task): Add
1686 input_sections_blocker.
1687 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1688 to DEPENDENCIES.
1689 * testsuite/Makefile.in: Regenerate.
1690
c0c71592
RÁE
16912014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1692
1693 * testsuite/Makefile.am (plugin_test_10): New test.
1694 * testsuite/Makefile.in: Regenerate
1695 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1696 * testsuite/plugin_test_10.sh: New file.
1697
6168c2a1
RÁE
16982014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1699
1700 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1701 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1702 during the replacement phase.
1703
3a531937
JY
17042014-09-17 Han Shen <shenhan@google.com>
1705 Jing Yu <jingyu@google.com>
1706
1707 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1708 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1709 * aarch64.cc (Target_aarch64): Add data members
1710 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1711 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1712 constructor.
1713 (Target_aarch64::do_reloc_symbol_index): New method.
1714 (Target_aarch64::do_reloc_addend): New method.
1715 (Target_aarch64::add_tlsdesc_info): New method.
1716 (Target_aarch64::do_dynsym_value): New method.
1717 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1718 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1719 (Target_aarch64::make_data_plt): Add new parameters: got,
1720 got_irelative. Pass them to do_make_data_plt.
1721 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1722 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1723 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1724 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1725 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1726 (Target_aarch64::got_tlsdesc_section): New method.
1727 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1728 (Target_aarch64::define_tls_base_symbol): New method.
1729 (Target_aarch64::reserve_tlsdesc_entries): New method.
1730 (Target_aarch64::got_mod_index_entry): New method.
1731 (Target_aarch64::rela_tlsdesc_section): New method.
1732 (Target_aarch64::rela_irelative_section): New method.
1733 (Target_aarch64::Tlsdesc_info): New struct.
1734 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1735 relocations and tlsdesc relocations.
1736 (Target_aarch64::optimize_tls_reloc): Implement method.
1737 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1738 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1739 in constructor.
1740 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1741 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1742 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1743 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1744 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1745 (Output_data_plt_aarch64::rela_irelative): New method.
1746 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1747 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1748 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1749 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1750 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1751 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1752 (Output_data_plt_aarch64_standard): New member variables:
1753 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1754 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1755 New parameter: got, got_irelative.
1756 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1757 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1758 (Output_data_plt_aarch64::do_write): Replace got_address with
1759 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1760 (AArch64_relocate_functions::update_movnz): New method.
1761 (AArch64_relocate_functions): Correct format.
1762 (AArch64_relocate_functions::movnz): New method.
1763 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1764 before the switch. Add new cases to switch.
00cac886 1765 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1766 tlsgd tlsdesc cases.
1767 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1768 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1769 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1770 Call reloc_name_in_error_message to print unsupported reloc.
1771 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1772 make_data_plt.
1773 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1774 relocs. Fill in some more dynamic tags.
1775 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1776 Skip call tls_get_addr when tlsgd is relaxed.
1777 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1778 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1779 tlsdesc->ie relaxation.
1780
62661c93
SS
17812014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1782
1783 * mips.cc (Target_mips_nacl): New class.
1784 (Target_selector_mips_nacl): New class.
1785 (target_selector_mips32): Rename from target_selector_mips32be and use
1786 Target_selector_mips_nacl instead of Target_selector_mips.
1787 (target_selector_mips32el): Rename from target_selector_mips32 and use
1788 Target_selector_mips_nacl instead of Target_selector_mips.
1789 (target_selector_mips64): Rename from target_selector_mips64be and use
1790 Target_selector_mips_nacl instead of Target_selector_mips.
1791 (target_selector_mips64el): Rename from target_selector_mips64 and use
1792 Target_selector_mips_nacl instead of Target_selector_mips.
1793 (Target_mips::mips_info): Add const attribute.
1794
54674d38
CC
17952014-09-02 Cary Coutant <ccoutant@google.com>
1796
1797 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1798 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1799 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1800 (Sized_incr_dynobj::do_section_name): Likewise.
1801 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1802 (Sized_incr_dynobj::do_section_name): Likewise.
1803 * object.h (Object::section_name): Likewise.
1804 (Object::do_section_name): Likewise.
1805 (Sized_relobj_file::do_section_name): Likewise.
1806 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1807 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1808
9860cbcf
CC
18092014-09-02 Cary Coutant <ccoutant@google.com>
1810
1811 PR gold/17005
1812 * ehframe.cc (Fde::write): Add output_offset parameter.
1813 (Cie::write): Likewise.
1814 (Eh_frame::set_final_data_size): Account for offset within output
1815 section.
1816 (Eh_frame::do_sized_write): Likewise.
1817 * ehframe.h (Fde::write): Add output_offset parameter.
1818 (Cie::write): Likewise.
1819 * output.cc (Output_section::Input_section_sort_entry): Remove
1820 section_has_name_; add output_section_name parameter. Use
1821 output section name for non-input sections.
1822 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1823 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1824 (Output_section::Input_section_sort_compare): Remove logic for
1825 sections without names.
1826 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1827 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1828 Likewise.
1829 (Output_section::Input_section_sort_section_name_compare): Likewise.
1830
8e33481e
HS
18312014-08-29 Han Shen <shenhan@google.com>
1832 Jing Yu <jingyu@google.com>
1833
1834 * aarch64-reloc-property.cc
1835 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1836 reference reloc property in the table.
1837 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1838 3 other entries.
1839 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1840 2 new overloaded methods.
1841 (Output_data_got_aarch64::do_write): Add code to write out
1842 static relocs.
1843 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1844 static relocs.
1845 (Output_data_got_aarch64::static_relocs): New vector to
1846 hold static relocs.
1847 (Target_aarch64::TCB_SIZE): New const static memeber.
1848 (Target_aarch64::tcb_size): New method.
1849 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1850 (Target_aarch64::Relocate::relocate_tls): New method.
1851 (Target_aarch64::Scan::local): Add code handling new reloc types.
1852 (Target_aarch64::Scan::global): Add code handling new reloc types.
1853
81233653
ST
18542014-08-13 Sriraman Tallam <tmsriram@google.com>
1855
1856 * options.h (-no-pie): Add option.
1857
9363c7c3
JY
18582014-08-08 Jing Yu <jingyu@google.com>
1859 Han Shen <shenhan@google.com>
1860
1861 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1862 (DEFFILES): add aarch64-reloc.def.
1863 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1864 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1865 * Makefile.in: Regenerate.
1866 * aarch64-reloc-property.cc: New file.
1867 * aarch64-reloc-property.h: New file.
1868 * aarch64-reloc.def: New file.
1869 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1870 with tab to make the format consistent.
1871 (Output_data_got_aarch64::symbol_table_): New method.
1872 (Target_aarch64::do_plt_address_for_global): New method.
1873 (Target_aarch64::do_plt_address_for_local): New method.
1874 (Target_aarch64::do_select_as_default_target): New method.
1875 (Target_aarch64::do_make_data_plt): New method.
1876 (Target_aarch64::make_data_plt): New method.
1877 (Output_data_plt_aarch64::has_irelative_section): New method.
1878 (Output_data_plt_aarch64::address_for_global): New method.
1879 (Output_data_plt_aarch64::address_for_local): New method.
1880 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1881 (Output_data_plt_aarch64::add_entry): Implement contents.
1882 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1883 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1884 the got_pov entry to plt0.
1885 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1886 Implement contents.
1887 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1888 (AArch64_howto): New struct.
1889 (aarch64_howto[]): New static const array.
1890 (AArch64_relocate_functions): New class.
1891 (Target_aarch64::Scan::get_reference_flags): Remove method.
1892 (Target_aarch64::Scan::local): Implement to support a few relocations.
1893 (Target_aarch64::Scan::global): Implement to support a few relocations.
1894 (Target_aarch64::make_plt_section): Implement contents.
1895 (Target_aarch64::make_plt_entry): Implement contents.
1896 (Target_aarch64::do_finalize_sections): Implement contents.
1897 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1898 (Target_aarch64::relocate_section): Implement contents.
1899
ad9fe6c1
AM
19002014-08-06 Alan Modra <amodra@gmail.com>
1901
1902 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1903
7cd4e5b7
AM
19042014-08-06 Alan Modra <amodra@gmail.com>
1905
1906 PR 13227
1907 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1908
5ad9b0a7
ST
19092014-07-21 Sriraman Tallam <tmsriram@google.com>
1910
1911 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1912 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1913
e051745c
CC
19142014-07-08 Cary Coutant <ccoutant@google.com>
1915
1916 * expression.cc (struct Expression::Expression_eval_info): Add
1917 new fields type_pointer, vis_pointer, and nonvis_pointer.
1918 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1919 nonvis_pointer parameters. Adjust all calls.
1920 (Symbol_expression::value): Update type, visibility, and nonvis bits
1921 in caller.
1922 * script.cc (Symbol_assignment::sized_finalize): Update type,
1923 visibility, and remaining st_other bits for new symbol.
1924 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1925 vis_pointer, and nonvis_pointer parameters.
1926 * symtab.h (Symbol::set_type): New method.
1927
1928 * testsuite/Makefile.am (defsym_test): New test.
1929 * testsuite/Makefile.in: Regenerate.
1930 * testsuite/defsym_test.c: New file.
1931 * testsuite/defsym_test.sh: New file.
1932
f35c4853
CC
19332014-07-08 Cary Coutant <ccoutant@google.com>
1934
1935 PR gold/15639
1936 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1937 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1938 (Sized_dynobj::base_read_symbols): ...new method.
1939 * object.h (Sized_relobj_file::base_read_symbols): New method.
1940 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1941 (Sized_relobj_file::base_read_symbols): ...new method.
1942 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1943 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1944 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1945
2900af2d
AM
19462014-07-04 Alan Modra <amodra@gmail.com>
1947
1948 * po/POTFILES.in: Regenerate.
1949
053a4d68
JY
19502014-07-02 Jing Yu <jingyu@google.com>
1951
1952 * aarch64.cc: New file
1953 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1954 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1955 * Makefile.in: Regenerate.
1956 * configure.tgt: Add entries for aarch64*.
1957 * configure.ac: Likewise.
1958 * configure: Likewise.
1959
7b549045
AM
19602014-06-27 Alan Modra <amodra@gmail.com>
1961
1962 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1963
cb818dbf
CC
19642014-06-24 Cary Coutant <ccoutant@google.com>
1965
1966 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1967 sections.
1968 (Dwo_file::sized_read_unit_index): Likewise.
1969
9810d34d
SS
19702014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1971
1972 * mips.cc: New file.
1973 * Makefile.am (TARGETSOURCES): Add mips.cc
1974 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1975 * configure.tgt: Add entries for mips*.
1976 * configure.ac: Likewise.
1977 * Makefile.in: Regenerate.
1978 * configure: Likewise.
1979
9baa787b
CC
19802014-06-09 Cary Coutant <ccoutant@google.com>
1981
1982 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1983 unit_length is within section bounds.
1984
8f89af0a
CC
19852014-06-09 Cary Coutant <ccoutant@google.com>
1986
1987 PR gold/16980
1988 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1989 map.
1990
a47622ac
AM
19912014-06-07 Alan Modra <amodra@gmail.com>
1992
1993 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1994
4320c691
CC
19952014-06-06 Cary Coutant <ccoutant@google.com>
1996
1997 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1998 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1999 (Dwarf_pubnames_table::read_header): Likewise.
2000 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2001 .debug_gnu_pubtypes.
2002
270c9937
JB
20032014-06-05 Joel Brobecker <brobecker@adacore.com>
2004
2005 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2006 * Makefile.in, configure: Regenerate.
2007
397998fc
AM
20082014-06-03 Alan Modra <amodra@gmail.com>
2009
2010 * powerpc.cc (addis_12_2): Define.
2011 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2012
61f5c66f
AM
20132014-06-03 Alan Modra <amodra@gmail.com>
2014
2015 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2016 st_other output.
2017
f6971787
AM
20182014-06-02 Alan Modra <amodra@gmail.com>
2019
2020 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2021 Only ignore relocs on ELFv1.
2022 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2023
f6fb8322
CC
20242014-05-30 Cary Coutant <ccoutant@google.com>
2025
2026 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2027 * testsuite/Makefile.in: Regenerate.
2028 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2029
c23dd342
L
20302014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2031
2032 PR gold/16945
2033 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2034 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2035
5fe7ffdc
AM
20362014-05-15 Alan Modra <amodra@gmail.com>
2037
2038 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2039 Compare FDE contents with DW_CFA_nop rather than 0.
2040
a82bef93
ST
20412014-05-13 Sriraman Tallam <tmsriram@google.com>
2042
2043 * symtab.h (may_need_copy_reloc): Remove check for position independent
2044 code.
2045 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2046 position independence before pc absolute may_need_copy_reloc call.
2047 Add check for executable output befor pc relative may_need_copy_reloc
2048 call.
2049 * i386.cc: Ditto.
2050 * arm.cc: Ditto.
2051 * sparc.cc: Ditto.
2052 * tilegx.cc: Ditto.
2053 * powerpc.cc: Add check for no position independence before
2054 may_need_copy_reloc calls.
2055 * testsuite/pie_copyrelocs_test.cc: New file.
2056 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2057 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2058 * Makefile.in: Regenerate.
a82bef93 2059
53c66605
ML
20602014-05-08 Martin Liška <mliska@suse.cz>
2061
2062 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2063
57b2284c
CC
20642014-05-06 Cary Coutant <ccoutant@google.com>
2065
2066 PR gold/16900
2067 * i386.cc (Output_data_got_plt_i386): New class.
2068 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2069 parameter. Change all callers.
2070 (Output_data_plt_i386::layout_): Remove.
2071 (Output_data_plt_i386::got_plt_): Change type.
2072 (Target_i386::got_plt_): Change type. Change all references.
2073 (Target_i386::got_section): Create instance of new class.
2074 (Output_data_got_plt_i386::do_write): New function.
2075 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2076 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2077 parameter. Change all callers.
2078 (Output_data_plt_x86_64::layout_): Remove.
2079 (Output_data_plt_x86_64::got_plt_): Change type.
2080 (Target_x86_64::got_plt_): Change type. Change all references.
2081 (Target_x86_64::got_section): Create instance of new class.
2082 (Output_data_got_plt_x86_64::do_write): New function.
2083 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2084 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2085 class.
2086
6b97515d 20872014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2088
6b97515d
CC
2089 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2090 if we have pubnames/pubtypes.
2091
d1bddd3c
CC
20922014-05-02 Cary Coutant <ccoutant@google.com>
2093
5fe7ffdc
AM
2094 * defstd.cc (in_segment): Define __ehdr_start here...
2095 * layout.cc (Layout::finalize): ...Instead of here. Set the
2096 output segment when known.
2097 * resolve.cc (Symbol::override_base_with_special): Remember
2098 the original binding.
2099 * symtab.cc (Symbol::set_output_segment): New function.
2100 (Symbol::set_undefined): New function.
2101 * symtab.h (Symbol::is_weak_undefined): Check original undef
2102 binding.
2103 (Symbol::is_strong_undefined): New function.
2104 (Symbol::set_output_segment): New function.
2105 (Symbol::set_undefined): New function.
2106 * target-reloc.h (is_strong_undefined): Remove.
2107 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2108 Check for hidden undefs.
2109 (relocate_section): Call Symbol::is_strong_undefined.
2110
2111 * testsuite/Makefile.am (ehdr_start_test_1)
2112 (ehdr_start_test_2, ehdr_start_test_3)
2113 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2114 * testsuite/Makefile.in: Regenerate.
2115 * testsuite/ehdr_start_def.cc: New source file.
2116 * testsuite/ehdr_start_test.cc: New source file.
2117 * testsuite/ehdr_start_test.t: New linker script.
2118 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2119
7849f6d8
CC
21202014-04-23 Cary Coutant <ccoutant@google.com>
2121
bf2cc635 2122 PR gold/16870
7849f6d8
CC
2123 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2124
99fd8cff
CC
21252014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2126
2127 * layout.cc (Layout::include_section): Allow a target to decide
2128 whether to include a section.
2129 * target.h (Target::should_include_section): New function.
2130 (Target::do_should_include_section): New function.
2131
91f43acd
CC
21322014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2133
2134 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2135 inline into ...
2136 (Copy_relocs::emit): ... here.
2137 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2138 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2139 (Copy_reloc_entry::entries_): Change from private to protected.
2140
c4eb27e1
ST
21412014-04-02 Sriraman Tallam <tmsriram@google.com>
2142
2143 * icf.cc (get_section_contents): Replace copies of reloc
2144 vectors with const references.
2145
ae447ddd
CC
21462014-04-02 Cary Coutant <ccoutant@google.com>
2147
2148 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2149 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2150 * configure: Regenerate.
2151 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2152 -fno-use-linker-plugin.
2153 (LINK1, CXXLINK1): Add it to the link command.
2154 * testsuite/Makefile.in: Regenerate.
2155
fa47fa92
AM
21562014-03-12 Alan Modra <amodra@gmail.com>
2157
2158 * Makefile.in: Regenerate.
2159
9b12c500
CC
21602014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2161
2162 * symtab.h (Symbol::set_nonvis): New function.
2163
beacaa96
CC
21642014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2165
2166 * symtab.cc (Sized_symbol<32>::init_output_data):
2167 Instantiate the template.
2168 (Sized_symbol<64>::init_output_data): Likewise.
2169
800d9823
CC
21702014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2171
2172 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2173 adjust dynamic symbol value.
2174 * target.h (Target::adjust_dyn_symbol): New function.
2175 (Target::do_adjust_dyn_symbol): New function.
2176
918fc1f8 21772014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2178
918fc1f8
CC
2179 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2180 Get the value of DYNAMIC_CUSTOM dynamic entry.
2181 * output.h (Output_data_dynamic::add_custom): New function.
2182 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2183 dynamic entry.
2184 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2185 * target.h (Target::dynamic_tag_custom_value): New function.
2186 (Target::do_dynamic_tag_custom_value): New function.
2187
98ff9231
CC
21882014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2189
2190 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2191 dynsym indexes.
2192 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2193 (Target::do_has_custom_set_dynsym_indexes): New function.
2194 (Target::set_dynsym_indexes): New function.
2195 (Target::do_set_dynsym_indexes): New function.
2196
b80eed39
AM
21972014-03-07 Alan Modra <amodra@gmail.com>
2198
2199 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2200 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2201 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2202 (Powerpc_relocate_functions::has_overflow_bitfield,
2203 overflowed): Use the above.
2204 (Target_powerpc::Relocate::relocate): Correct overflow checking
2205 for a number of relocations. Modify overflow test for 16-bit
2206 fields in instructions to signed/unsigned according to whether
2207 the field takes a signed or unsigned value.
2208
4b95cf5c
AM
22092014-03-05 Alan Modra <amodra@gmail.com>
2210
2211 Update copyright years.
2212
45965137
AM
22132014-03-05 Alan Modra <amodra@gmail.com>
2214
2215 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2216 R_PPC64_ADDR64_LOCAL.
2217 (Target_powerpc::Relocate::relocate): Likewise.
2218
2c80b753
AM
22192014-03-03 Alan Modra <amodra@gmail.com>
2220
2221 * dwp.cc (print_version): Update copyright year to current.
2222
c1c69e83
AM
22232014-02-10 Alan Modra <amodra@gmail.com>
2224
2225 * po/gold.pot: Regenerate.
2226
dd0c4e70
CC
22272014-02-06 Cary Coutant <ccoutant@google.com>
2228
2229 Fix problem where -u is ignored when a weak undef is seen.
2230
2231 * archive.cc (Library_base::should_include_member): Reorder
2232 code to check for -u option if a weak undef has already been seen.
2233 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2234 * testsuite/Makefile.in: Regenerate.
2235 * testsuite/weak_undef_file3.cc: New file.
2236 * testsuite/weak_undef_file4.cc: New file.
2237 * testsuite/weak_undef_test_2.cc: New file.
2238
1a221d3d
CC
22392014-02-05 Cary Coutant <ccoutant@google.com>
2240
2241 Fix issues with gold undefined symbol diagnostics.
2242
2243 PR binutils/15435
2244 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2245 check to here.
2246 * target-reloc.h (is_strong_undefined): New function.
2247 (relocate_section): Move undef vtable symbol check from here.
2248 Check for is_strong_undefined.
2249
e889f0a4 22502014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2251
e889f0a4
CC
2252 Fix problems with the --dynamic-list option.
2253
2254 PR gold/13577
2255 * options.cc (General_options::parse_dynamic_list):
2256 Set have_dynamic_list_.
2257 (General_options::General_options): Initialize have_dynamic_list_.
2258 (General_options::finalize): Turn off -Bsymbolic and
2259 -Bsymbolic-functions if --dynamic-list provided.
2260 * options.h (General_options::have_dynamic_list): New function.
2261 (General_options::have_dynamic_list_): New data member.
2262 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2263 correctly.
5fe7ffdc 2264
e889f0a4
CC
2265 PR gold/16530
2266 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2267 in --dynamic-list, mark it.
5fe7ffdc 2268
e889f0a4
CC
2269 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2270 (dynamic_list_2): New test case.
2271 * testsuite/Makefile.in: Regenerate.
2272 * testsuite/dynamic_list_2.cc: New file.
2273 * testsuite/dynamic_list_2.t: New file.
2274 * testsuite/dynamic_list_lib1.cc: New file.
2275 * testsuite/dynamic_list_lib2.cc: New file.
2276 * testsuite/gc_dynamic_list_test.c: New file.
2277 * testsuite/gc_dynamic_list_test.sh: New file.
2278 * testsuite/gc_dynamic_list_test.t: New file.
2279
ec673e64
CC
22802014-01-28 Cary Coutant <ccoutant@google.com>
2281
2282 Add .gdb_index version 7 support.
2283
2284 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2285 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2286 debug sections.
2287 (Dwarf_ranges_table::read_ranges_table): Likewise.
2288 (Dwarf_pubnames_table::read_section): Check for GNU-style
2289 sections, and for compressed debug sections.
2290 (Dwarf_pubnames_table::read_header): Compute end address of table.
2291 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2292 for end of list by offset, not by offset == 0.
2293 (Dwarf_info_reader::do_read_string_table): Check for compressed
2294 debug sections.
2295 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2296 Initialize new data members.
2297 (Dwarf_pubnames_table::next_name): return flag_byte.
2298 (Dwarf_pubnames_table::end_of_table_): New data member.
2299 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2300 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2301 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2302 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2303 read skeleton type unit DIEs.
2304 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2305 (Gdb_index::do_write): Write flag_byte.
2306 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2307 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2308 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2309 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2310
221fd5d5
L
23112014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2312
2313 * version.cc (print_version): Update copyright year to 2014.
2314
6c09fb0b
ILT
23152013-12-19 Dimitry Andric <dimitry@andric.com>
2316
2317 * stringpool.cc (Stringpool_template::reserve): Add
2318 HAVE_UNORDERED_MAP case.
2319 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2320
8356f2d0
CC
23212013-12-18 Cary Coutant <ccoutant@google.com>
2322
2323 * configure.ac: Check for <unordered_set> and <unordered_map>.
2324 * config.in: Regenerate.
2325 * configure: Regenerate.
2326 * system.h: Use <unordered_set> and <unordered_map> if available.
2327
f2c7d7ee
RM
23282013-12-10 Roland McGrath <mcgrathr@google.com>
2329
2330 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2331 with $(INSTALL_PROGRAM_ENV).
2332 * Makefile.in: Regenerate.
2333
6632e8cc
CC
23342013-11-22 Cary Coutant <ccoutant@google.com>
2335
2336 * configure.ac: Add check for which library is needed for
2337 dlopen.
2338 * configure: Regenerate.
2339
0c075858
CC
23402013-11-22 Cary Coutant <ccoutant@google.com>
2341
2342 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2343 assembler.
2344 * testsuite/Makefile.in: Regenerate.
2345
f49fe902
L
23462013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2347
2348 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2349 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2350 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2351 (Target_x86_64<size>::Scan::local): Likewise.
2352 (Target_x86_64<size>::Scan::global): Likewise.
2353 (Target_x86_64<size>::Relocate::relocate): Likewise.
2354 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2355 Likewise.
2356 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2357 R_X86_64_PC32_BND.
2358
2359 * testsuite/Makefile.am (check_PROGRAMS): Add
2360 exception_x86_64_bnd_test.
2361 (exception_x86_64_bnd_test_SOURCES): New macro.
2362 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2363 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2364 (exception_x86_64_bnd_test_LDADD): Likewise.
2365 (exception_x86_64_bnd_1.o): New rule.
2366 (exception_x86_64_bnd_2.o): Likewise.
2367 * testsuite/Makefile.in: Regenerated.
2368
9055360d
AM
23692013-11-15 Alan Modra <amodra@gmail.com>
2370
2371 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2372 accessor.
2373 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2374 Only call ppc64_local_entry_offset for 64-bit. Restrict
2375 symval_for_branch lookup to ELFv1.
2376 (Stub_table::add_plt_call_entry): Use unsigned int off.
2377 (Output_data_glink::Address, invalid_address): New.
2378 (Output_data_glink::add_eh_frame): Move out of line. Add
2379 support for ELFv2.
2380 (Output_data_glink::add_global_entry, find_global_entry,
2381 global_entry_address): New functions.
2382 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2383 ge_size): New variables.
2384 (Output_data_glink::set_final_data_size): Add global entry
2385 stub sizing.
2386 (Output_data_glink::do_write): Write global entry stubs.
2387 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2388 parameter. Return true for ELFv2. Adjust callers.
2389 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2390 ELFv1. Similarly for ifunc and dynamic relocation processing
2391 specific to ELFv1. Recognize that symbols are defined on
2392 their plt entries for ELFv2.
2393 (Target_powerpc::symval_for_branch): Assert if called for
2394 ELFv2 or ppc32.
2395 (Target_powerpc::Relocate::relocate): Use global entry plt
2396 stub for symbol value if such exists on ELFv2.
2397 (Target_powerpc::Relocate::relocate): Don't call
2398 symval_for_branch when ELFv2. Do adjust for local entry
2399 offset when ELFv2.
2400 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2401 plt stub for ELFv2.
2402 (Target_powerpc::do_plt_address_for_global): Similarly.
2403
cafdd569
CC
24042013-11-14 Cary Coutant <ccoutant@google.com>
2405
2406 Revert patch -- this did not fix the problem, and there is
2407 no race there.
2408
2409 2013-11-14 Cary Coutant <ccoutant@google.com>
2410
2411 PR gold/14860
2412 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2413 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2414 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2415 updating fde_offsets_.
2416 (Eh_frame_hdr::lock_): New data member.
2417
94e49e16
CC
24182013-11-14 Cary Coutant <ccoutant@google.com>
2419
2420 * dwp.cc (Dwo_file_entry): New type.
2421 (File_list): Use Dwo_file_entry.
2422 (Dwo_file::verify): New function.
2423 (Dwo_file::verify_dwo_list): New function.
2424 (Dwo_file::sized_verify_dwo_list): New function.
2425 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2426 list.
2427 (Dwp_options): New enum type.
2428 (dwp_options): Add --verify-only.
2429 (usage): Likewise.
2430 (main): Likewise.
2431 * dwp.h (gold_info): Add declaration.
2432
7cdd7d57
CC
24332013-11-14 Cary Coutant <ccoutant@google.com>
2434
2435 PR gold/14860
2436 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2437 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2438 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2439 updating fde_offsets_.
2440 (Eh_frame_hdr::lock_): New data member.
2441
1d946cb3
CC
24422013-11-06 Cary Coutant <ccoutant@google.com>
2443
2444 PR gold/15758
2445 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2446 before reloc sections.
2447
4f65b40e
AM
24482013-11-04 Alan Modra <amodra@gmail.com>
2449
2450 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2451 (Symbol::needs_dynamic_reloc): Test new flag.
2452 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2453 (Target_powerpc::Scan::get_reference_flags): Add target param.
2454 Return FUNC_DESC_ABI for 64-bit ELFv1.
2455 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2456 call.
2457 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2458 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2459
908794a9
CC
24602013-10-31 Cary Coutant <ccoutant@google.com>
2461
2462 Restore support for dwp v2 DWARF package file format.
2463
2464 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2465 tu_length parameter. Adjust all callers.
2466 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2467 * dwp.cc: Include dwarf.h.
2468 (Section_bounds): New struct type.
2469 (Unit_set): New struct type.
2470 (Dwo_file::Dwo_file): Initialize new data member.
2471 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2472 Combine and rename to...
2473 (Dwo_file::read_unit_index): ...this.
2474 (Dwo_file::sized_read_compunit_index)
2475 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2476 (Dwo_file::sized_read_unit_index): ...this.
2477 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2478 parameters; add section_id parameter.
2479 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2480 (Dwo_file::add_unit_set): ...this.
2481 (Dwo_file::shndx_map_): Remove.
2482 (Dwo_file::sect_offsets_): New data member.
2483 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2484 (Dwp_output_file::add_section): Rename to...
2485 (Dwp_output_file::add_contribution): ...this.
2486 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2487 (Dwp_output_file::add_tu_set): Likewise.
2488 (Dwp_output_file::Contribution): New type.
2489 (Dwp_output_file::Section::contributions): New data member.
2490 (Dwp_output_file::Cu_or_tu_set): Remove.
2491 (Dwp_output_file::Section::Section): New ctor.
2492 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2493 (Dwp_output_file::Dwp_index::Section_table): New type.
2494 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2495 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2496 parameter.
2497 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2498 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2499 (Dwp_output_file::Dwp_index::section_table): New member function.
2500 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2501 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2502 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2503 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2504 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2505 (Dwp_output_file::Dwp_index::section_table_): New data member.
2506 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2507 (Dwp_output_file::add_output_section): New member function.
2508 (Dwp_output_file::write_new_section): New member function.
2509 (Dwp_output_file::write_contributions): New member function.
2510 (Dwp_output_file::section_id_map_): New data member.
2511 (class Dwo_id_info_reader): Remove.
2512 (class Unit_reader): New class.
2513 (get_dwarf_section_name): New function.
2514 (Dwo_file::read_executable): Adjust initializations of class data.
2515 (Dwo_file::read): Add support for v2 package file format.
2516 (Dwo_file::read_unit_index): Likewise.
2517 (Dwo_file::sized_read_unit_index): Likewise.
2518 (Dwo_file::copy_section): Likewise.
2519 (Dwo_file::add_unit_set): Likewise.
2520 (Dwp_output_file::add_output_section): Likewise.
2521 (Dwp_output_file::add_contribution): Likewise.
2522 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2523 for empty slot.
2524 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2525 file format.
2526 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2527 slot.
2528 (Dwp_output_file::initialize): Remove unused function.
2529 (Dwp_output_file::finalize): Add support for v2 package file format.
2530 (Dwp_output_file::write_index): Likewise.
2531 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2532 function prototype.
2533
2500c017
CC
25342013-10-31 Cary Coutant <ccoutant@google.com>
2535
2536 * configure.ac: Fix check for -fmerge-constants.
2537 * configure.ac: Regenerate.
2538
dd0845d7
RM
25392013-10-30 Roland McGrath <mcgrathr@google.com>
2540
2541 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2542 Correct 9-byte nop sequence to match what the assembler generates.
2543
b4f7960d
AM
25442013-10-30 Alan Modra <amodra@gmail.com>
2545
2546 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2547 ppc64_local_entry_offset, ppc64_local_entry_offset,
2548 do_read_symbols): New functions.
2549 (Powerpc_relobj::e_flags_, st_other_): New vars.
2550 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2551 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2552 (Powerpc_relobj::e_flags_): New var.
2553 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2554 and adjust for ELFv2.
2555 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2556 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2557 (Powerpc_dynobj::do_find_special_sections): Likewise.
2558 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2559 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2560 to ELFv2 local entry.
2561 (Target_powerpc::do_relax): No thread safe barriers needed for
2562 ELFv2.
2563 (Output_data_plt_powerpc::initial_plt_entry_size_,
2564 plt_entry_size): Delete. Replace all uses with
2565 first_plt_entry_offset() and plt_entry_size().
2566 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2567 reserved_size parm. Update callers.
2568 (Output_data_plt_powerpc::entry_count): Update.
2569 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2570 and use Target_powerpc::first_plt_entry_offset().
2571 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2572 rename to plt_entry_size.
2573 (Output_data_plt_powerpc::add_ifunc_entry,
2574 add_local_ifunc_entry): Adjust reloc for ELFv2.
2575 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2576 (glink_eh_frame_fde_64v2): New.
2577 (Stub_table::plt_call_size): Support ELFv2 sizing.
2578 (Output_data_glink::add_eh_frame): Use the new FDE.
2579 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2580 (Stub_table::do_write): Write ELFv2 stubs and glink.
2581 (Target_powerpc::Relocate::relocate): Replaces nop after call
2582 with ld 2,24(1) and adjust local offset destination for ELFv2.
2583
f9c6b907
AM
25842013-10-30 Alan Modra <amodra@gmail.com>
2585
2586 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2587 (Target_powerpc::Scan::global, local): Likewise.
2588 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2589 on all ppc64 @h and @ha relocs.
2590
e84fe78f
AM
25912013-10-14 Alan Modra <amodra@gmail.com>
2592
2593 * output.h (Output_data_got::add_constant): Tidy.
2594 (Output_data_got::add_constant_pair): New function.
2595 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2596 methods used so as to first call reserve_ent().
2597
679e4abf
RM
25982013-10-11 Roland McGrath <mcgrathr@google.com>
2599
44dcb735
RM
2600 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2601 add_got_entry and add_got_entry_pair.
2602
13323c49
RM
2603 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2604 (HAVE_PUBNAMES): Likewise.
2605 * configure: Regenerate.
2606
1496b446
RM
2607 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2608 * testsuite/Makefile.in: Regenerate.
2609
cc84c10b
RM
2610 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2611 Remove const from declaration.
2612 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2613 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2614 * output.h (Output_file_header): Remove const from member target_
2615 and corresponding constructor argument.
2616 * output.cc (Output_file_header::Output_file_header): Update prototype.
2617 (Output_file_header::do_sized_write): Use this->target_ in place
2618 of parameters()->target().
2619
52f66a2c
RM
2620 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2621
2b64b551
RM
2622 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2623 * configure: Regenerate.
2624 * Makefile.in: Regenerate.
2625 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2626 * testsuite/merge_string_literals_2.c: Likewise.
2627 * testsuite/Makefile.am
2628 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2629 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2630 literal -fmerge-constants.
2631 * testsuite/Makefile.in: Regenerate.
2632
43819297
RM
2633 * i386.cc (Target_i386): Remove unused member dynbss_.
2634 * arm.cc (Target_arm): Likewise.
2635 * powerpc.cc (Target_powerpc): Likewise.
2636 * sparc.cc (Target_sparc): Likewise.
2637 * tilegx.cc (Target_tilegx): Likewise.
2638 * x86_64.cc (Target_x86_64): Likewise.
2639 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2640 type_signature_, type_offset_.
2641 * plugin.h (Plugin_hook): Remove unused member layout_.
2642 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2643 mapfile_.
2644 (Read_member): Remove unused members input_objects_, symtab_,
2645 mapfile_, layout_.
2646 (Check_library): Remove unused member symtab_.
2647 * archive.h (Lib_group): Remove unused member lib_.
2648 * archive.cc (Lib_group::Lib_group): Update initializer.
2649 * incremental.h (Incremental_binary): Remove unused member target_.
2650 (Incremental_script_entry): Removed unused member script_.
2651 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2652 * icf.h (Icf): Remove unused member num_tracked_relocs.
2653
39d9ead7
RM
2654 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2655 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2656 its only use.
2657 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2658
679e4abf
RM
2659 * archive.h: Use struct rather than class for forward declaration
2660 of Read_symbols_data.
2661
54de2ea6
CC
26622013-10-07 Cary Coutant <ccoutant@google.com>
2663
2664 PR gold/16010
2665 * testsuite/Makefile.am (icf_test): Fix dependencies.
2666 (icf_safe_test): Likewise.
2667 (icf_safe_so_test): Likewise.
2668 (large_symbol_alignment): Add empty _LDADD rule.
2669 * testsuite/Makefile.in: Regenerate.
2670
b14016f0
L
26712013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2672
2673 PR gold/15927
2674 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2675 relocation for R_X86_64_32 on x32.
2676
eb426534
RM
26772013-08-27 Roland McGrath <mcgrathr@google.com>
2678
2679 * output.cc (Output_segment::set_section_addresses): Take new
2680 Target* argument. If target->isolate_execinstr() and the segment
2681 is executable and starts at a target->abi_pagesize() boundary,
2682 pad its end out to a target->abi_pagesize() boundary with code fill.
2683 * output.h (Output_segment::set_section_addresses): Update decl.
2684 * layout.h (Layout::check_output_data_for_reset_values): Take new
2685 argument RELAX_OUTPUTS.
2686 (Layout): New member relax_output_list_.
2687 (Layout::add_relax_output): New method.
2688 * layout.cc (Layout::Layout): Update constructor.
2689 (Layout::reset_relax_output): New method.
2690 (Layout::clean_up_after_relaxation): Call it.
2691 (Layout::prepare_for_relaxation): Update caller.
2692 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2693 Call reset_relax_output before re-processing segments for
2694 isolate_execinstr case.
2695 (Layout::write_data): Handle relax_output_list_.
2696 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2697 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2698
9aff4b7a
NC
26992013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2700
2701 PR binutils/15834
2702 * object.h: Fix typos.
2703
93f8221c
RM
27042013-08-16 Roland McGrath <mcgrathr@google.com>
2705
2706 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2707 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2708
e44c3715
CC
27092013-08-07 Cary Coutant <ccoutant@google.com>
2710
2711 Revert support for v2 DWP files:
2712
2713 2013-03-01 Cary Coutant <ccoutant@google.com>
2714
2715 Add dwp support for v2 DWARF package file format.
2716 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2717 tu_length parameter. Adjust all callers.
2718 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2719 * dwp.cc: Include dwarf.h.
2720 (Section_bounds): New struct type.
2721 (Unit_set): New struct type.
2722 (Dwo_file::Dwo_file): Initialize new data member.
2723 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2724 Combine and rename to...
2725 (Dwo_file::read_unit_index): ...this.
2726 (Dwo_file::sized_read_compunit_index)
2727 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2728 (Dwo_file::sized_read_unit_index): ...this.
2729 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2730 parameters; add section_id parameter.
2731 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2732 (Dwo_file::add_unit_set): ...this.
2733 (Dwo_file::shndx_map_): Remove.
2734 (Dwo_file::sect_offsets_): New data member.
2735 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2736 (Dwp_output_file::add_section): Rename to...
2737 (Dwp_output_file::add_contribution): ...this.
2738 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2739 (Dwp_output_file::add_tu_set): Likewise.
2740 (Dwp_output_file::Contribution): New type.
2741 (Dwp_output_file::Section::contributions): New data member.
2742 (Dwp_output_file::Cu_or_tu_set): Remove.
2743 (Dwp_output_file::Section::Section): New ctor.
2744 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2745 (Dwp_output_file::Dwp_index::Section_table): New type.
2746 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2747 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2748 parameter.
2749 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2750 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2751 (Dwp_output_file::Dwp_index::section_table): New member function.
2752 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2753 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2754 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2755 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2756 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2757 (Dwp_output_file::Dwp_index::section_table_): New data member.
2758 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2759 (Dwp_output_file::add_output_section): New member function.
2760 (Dwp_output_file::write_new_section): New member function.
2761 (Dwp_output_file::write_contributions): New member function.
2762 (Dwp_output_file::section_id_map_): New data member.
2763 (class Dwo_id_info_reader): Remove.
2764 (class Unit_reader): New class.
2765 (get_dwarf_section_name): New function.
2766 (Dwo_file::read_executable): Adjust initializations of class data.
2767 (Dwo_file::read): Add support for v2 package file format.
2768 (Dwo_file::read_unit_index): Likewise.
2769 (Dwo_file::sized_read_unit_index): Likewise.
2770 (Dwo_file::copy_section): Likewise.
2771 (Dwo_file::add_unit_set): Likewise.
2772 (Dwp_output_file::add_output_section): Likewise.
2773 (Dwp_output_file::add_contribution): Likewise.
2774 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2775 for empty slot.
2776 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2777 file format.
2778 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2779 slot.
2780 (Dwp_output_file::initialize): Remove unused function.
2781 (Dwp_output_file::finalize): Add support for v2 package file format.
2782 (Dwp_output_file::write_index): Likewise.
2783 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2784 function prototype.
2785
c6905c28
CC
27862013-07-31 Cary Coutant <ccoutant@google.com>
2787
2788 * object.cc (Sized_relobj::do_output_section_address): New function.
2789 (Sized_relobj): Instantiate explicitly.
2790 * object.h (Object::output_section_address): New function.
2791 (Object::do_output_section_address): New function.
2792 (Sized_relobj::do_output_section_address): New function.
2793 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2794
27952013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2796 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2797
2798 * parameters.cc (Parameters::entry): Return target-specific entry
2799 symbol name.
2800 * target.h (Target::entry_symbol_name): New function.
2801 (Target_info::entry_symbol_name): New data member.
2802
2803 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2804 * i386.cc (Target_i386::i386_info): Likewise.
2805 (Target_i386_nacl::i386_nacl_info): Likewise.
2806 * sparc.cc (Target_sparc::sparc_info): Likewise.
2807 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2808 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2809 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2810 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2811
234d4ab8
SA
28122013-07-22 Sterling Augustine <saugustine@google.com>
2813
2814 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2815 Convert parameter shndx to local variable. Add parameters symtab
2816 and symtab_size. Scan over section names. Find relocation
2817 section corresponding to current section. Create and initialize
2818 reloc_mapper_ and reloc_type_.
2819 (Dwarf_pubnames_table::read_header): Add assertion. Change
2820 unit_length to off_t. Initialize member unit_length_. Fill in field
2821 cu_offset_.
2822 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2823 Initialize new fields unit_length_ and cu_offset_.
2824 (Dwarf_pubnames_table::read_section): Update prototype.
2825 (Dwarf_pubnames_table::cu_offset): New member function.
2826 (Dwarf_pubnames_table::subsection_size): Likewise.
2827 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2828 New fields.
2829 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2830 member functions public.
2831 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2832 Update comment. Rework logic. Move repeated parts to...
2833 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2834 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2835 pubtypes_table_, and stmt_list_offset.
2836 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2837 Gdb_index::find_pubtype_offset,
2838 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2839 (Gdb_index::pubnames_read): Update prototype and rework logic.
2840 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2841 Forward declare.
2842 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2843 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2844 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2845 Gdb_index::map_pubtable_to_dies):
2846 Declare functions.
2847 (Gdb_index::pubnames_read): Update declaration.
2848 (Gdb_index::Pubname_offset_map): New type.
2849 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2850 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2851 Gdb_index::stmt_list_offset): Declare.
2852 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2853 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2854 Gdb_index::pubtypes_offset_): Remove.
2855
a3ed37d8
RM
28562013-07-19 Roland McGrath <mcgrathr@google.com>
2857
2858 * options.h (General_options): Add -Trodata-segment option.
2859 * parameters.cc (Parameters::check_rodata_segment): New function.
2860 (Parameters::set_target_once): Call it.
2861 * parameters.h (Parameters): Declare it (private member function).
2862 * layout.cc (load_seg_unusable_for_headers): New function, broken
2863 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2864 then validate rodata segment rather than text segment.
2865 (relaxation_loop_body): Call that.
2866 (is_text_segment): New function. Don't admit a non-executable
2867 segment if TARGET->isolate_execinstr().
2868 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2869
eb5b4ded
CC
28702013-07-15 Shawn Landden <shawnlandden@gmail.com>
2871
2872 PR gold/15070
2873 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2874 * nacl.h (Sniff_file::View::View): Request aligned view.
2875
4d5effb9
CC
28762013-07-11 Cary Coutant <ccoutant@google.com>
2877
2878 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2879 correct BRLT entry size.
2880
ba8ca3e7
AM
28812013-07-03 Alan Modra <amodra@gmail.com>
2882
2883 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2884 comment.
2885
267257d2
CC
28862013-07-01 Cary Coutant <ccoutant@google.com>
2887
2888 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2889 reloc_type_.
2890 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2891 (Dwarf_ranges_table::lookup_reloc): New function.
2892 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2893 reloc_type_.
2894 (Dwarf_ranges_table::lookup_reloc): New function.
2895 (Dwarf_ranges_table::reloc_type_): New data member.
2896
06f30c9d
CC
28972013-06-27 Jing Yu <jingyu@google.com>
2898
2899 PR gold/15662
2900 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2901 function.
2902 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2903 (Target_powerpc::do_relax): Call the above.
2904
a2d7bf59
AM
29052013-06-27 Cary Coutant <ccoutant@google.com>
2906
2907 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2908 on garbage collected .opd section.
2909
29102013-06-27 Alan Modra <amodra@gmail.com>
2911
2912 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2913 is non-zero.
2914 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2915 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2916
32364e50
CC
29172013-06-14 Cary Coutant <ccoutant@google.com>
2918
2919 * resolve.cc (Symbol::override_base): Don't override st_type
2920 from plugin placeholder symbols.
2921 (Symbol_table::resolve): Likewise.
2922 (Symbol_table::should_override): Don't complain about TLS mismatch
2923 if the TO symbol is a plugin placeholder.
2924 * testsuite/Makefile.am (plugin_test_tls): New test.
2925 * testsuite/Makefile.in: Regenerate.
2926 * testsuite/plugin_test_tls.sh: New test script.
2927 * testsuite/two_file_test_2_tls.cc: New test source.
2928 * testsuite/two_file_test_tls.cc: New test source.
2929
7fb47cc9
CC
29302013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2931
2932 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2933 the maximum segment alignment is larger than the page size.
2934 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2935 correctly aligns the symbols with large alignemnt.
2936 * testsuite/Makefile.in: Regenerate.
2937 * testsuite/large_symbol_alignment.cc: New file.
2938
6934001a
CC
29392013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2940 Sriraman Tallam <tmsriram@google.com>
2941
2942 * options.h (sort_section): New option.
2943 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2944 Rename from Input_section_sort_section_name_special_ordering_compare.
2945 (Input_section_sort_section_name_compare): New struct.
2946 * output.cc (Output_section::Input_section_sort_section_name_compare::
2947 operator()): New function.
2948 (Output_section::sort_attached_input_sections): Use new sort function
2949 for .text if --sort-section=name is specified.
2950 * layout.cc (Layout::make_output_section):
2951 Add sorting by name when --sort-section=name is specified.
2952 * testsuite/Makefile.am (text_section_grouping): Test option
2953 --sort-section=name.
2954 * testsuite/Makefile.in: Regenerate.
2955 * testsuite/section_sorting_name.cc: New file.
2956 * testsuite/section_sorting_name.sh: New file.
2957
93acabad
CC
29582013-05-21 Cary Coutant <ccoutant@google.com>
2959
2960 * symtab.h (Symbol::is_cxx_vtable): New function.
2961 * target-reloc.h (relocate_section): Check for vtable symbol.
2962 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2963 * testsuite/Makefile.in: Regenerate.
2964 * testsuite/missing_key_func.cc: New test source.
2965 * testsuite/missing_key_func.sh: New test script.
2966
60e8b3fc
CC
29672013-05-21 Cary Coutant <ccoutant@google.com>
2968
2b64b551
RM
2969 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2970 type of enclosing symbol.
2971 (Relocate_info::location): Check symbol type when describing symbol.
2972 * object.h (Symbol_location_info): Remove unused line_number;
2973 add enclosing_symbol_type.
2974 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2975
9df9de2c
CC
29762013-05-13 Cary Coutant <ccoutant@google.com>
2977
2b64b551
RM
2978 * configure.ac: Export DEFAULT_TARGET.
2979 * configure: Regenerate.
2980 * Makefile.in: Regenerate.
2981 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2982 * testsuite/Makefile.in: Regenerate.
2983 * testsuite/debug_msg.sh: Delete duplicate tests.
2984 Don't check undef_int error message match for powerpc where the
2985 source file and line number aren't available.
9df9de2c 2986
bbc5ae17
RM
29872013-05-10 Roland McGrath <mcgrathr@google.com>
2988
2989 * options.h (General_options): Add --rosegment-gap option.
2990 * options.cc (finalize): --rosegment-gap implies --rosegment.
2991 * layout.cc (set_segment_offsets): Let user option override
2992 target->rosegment_gap().
2993
0c6e6c39
RM
29942013-05-10 Roland McGrath <mcgrathr@google.com>
2995
2996 * options.h (General_options): Remove leading space from help
2997 messages for -nostdlib and --rosegment.
2998
cde7cb01
MR
29992013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3000
3001 PR ld/15365
3002 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3003
f31ae5b8
AM
30042013-05-03 Alan Modra <amodra@gmail.com>
3005
3006 * merge.cc (Output_merge_string::do_add_input_section): Correct
3007 scan for number of strings. Rename vars to avoid shadowing.
3008 Include missing terminator in input_size_.
3009
d3a7cd45
L
30102013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3011
3012 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3013 Restore empty string handling.
3014
6ad3daba
CC
30152013-05-01 Cary Coutant <ccoutant@google.com>
3016
3017 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3018 uninitialized warning.
3019
e31908b6
CC
30202013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3021
3022 * output.cc (Output_section::add_merge_input_section): Allow
3023 to merge sections if the alignment is more than character size.
3024 * merge.h (Output_merge_string::Output_merge_string): Remove
3025 assert.
3026 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3027 only not-null strings. Check the alignment of strings.
3028 * stringpool.h
3029 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3030 alignment as the argument.
3031 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3032 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3033 Align non-zero length strings according to the addralign_.
3034 (Stringpool_template<Stringpool_char>::set_string_offsets):
3035 Updating offsets according to the given alignment.
3036 * testsuite/Makefile.am (text_section_grouping): Test if string
3037 literals are getting merged.
3038 * testsuite/Makefile.in: Regenerate.
3039 * testsuite/merge_string_literals_1.c: New file.
3040 * testsuite/merge_string_literals_2.c: Ditto.
3041 * testsuite/merge_string_literals.sh: Ditto.
3042
0e804863
ILT
30432013-04-26 Ian Lance Taylor <iant@google.com>
3044
3045 * target-reloc.h (relocate_section): If the reloc offset is out of
3046 range, pass VIEW as NULL to relocate.relocate.
3047 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3048 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3049 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3050 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3051 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3052 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3053
e7c5ea40
CC
30542013-04-26 Geoff Pike <gpike@chromium.org>
3055
3056 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3057 * layout.cc (Hash_task): New class.
3058 (Layout::queue_build_id_tasks): New function.
3059 (Layout::write_build_id): Handle single-thread portion of build ID
3060 computation. (In some cases, all of it is single-threaded.) Replace
3061 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3062 functionality in fewer lines of code.
3063 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3064 * options.h (General_options): make "--build-id" default to tree
3065 rather than sha1. Add two new options related to --build-id=tree:
3066 --build-id-chunk-size-for-treehash and
3067 --build-id-min-file-size-for-treehash.
3068 * Makefile.am: add testing of --build-id=tree and related new options
3069 (these tests will be invoked by "make check").
3070 * Makefile.in: Regenerate.
3071
49926cd0
AM
30722013-04-25 Alan Modra <amodra@gmail.com>
3073
3074 * configure.tgt: Add powerpcle and powerpc64le.
3075
a4034750
AM
30762013-04-22 Alan Modra <amodra@gmail.com>
3077
3078 PR gold/15355
3079 * layout.cc (Layout::segment_precedes): Allow more than one
3080 segment with the same type and flags.
3081
e79c84aa
CC
30822013-04-15 Cary Coutant <ccoutant@google.com>
3083
3084 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3085 allocate space in file for BSS sections.
3086
2199fbe7
CC
30872013-04-15 Cary Coutant <ccoutant@google.com>
3088
3089 * script-sections.cc (Orphan_output_section): Reset address
3090 to zero after each orphaned section for relocatable links.
3091
502e8a84
CC
30922013-04-15 Cary Coutant <ccoutant@google.com>
3093
a4034750
AM
3094 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3095 section starting address for relocatable link.
3096 * testsuite/Makefile.am (script_test_11): New test.
3097 * testsuite/Makefile.in: Regenerate.
3098 * testsuite/script_test_11.c: New source file.
3099 * testsuite/script_test_11.t: New linker script.
502e8a84 3100
0cfdc767
AM
31012013-04-13 Alan Modra <amodra@gmail.com>
3102
3103 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3104 owner when sections are not adjacent and exceed group size.
3105 (Target_powerpc::group_sections): Handle corner case.
3106 (Target_powerpc::Branch_info::make_stub): Handle case where
3107 stub table doesn't exist due to branches in non-exec sections.
3108 (Target_powerpc::Relocate::relocate): Likewise.
3109
6830ee24
AM
31102013-04-11 Alan Modra <amodra@gmail.com>
3111
3112 PR gold/15354
3113 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3114 .branch_lt to match bfd ld. Adjust comments throughout file.
3115
54a3d865
ILT
31162013-04-04 Ian Lance Taylor <iant@google.com>
3117
3118 GCC PR c++/56840
3119 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3120 sections before checking whether they are included in the link.
3121
9993ba11
ST
31222013-03-29 Sriraman Tallam <tmsriram@google.com>
3123
3124 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3125 object before calling the plugin claim_file handler. Pass the elf
3126 object of the archive to the plugin. Delete the elf object if the
3127 plugin claims the file.
3128
ebacd51e
AM
31292013-03-21 Alan Modra <amodra@gmail.com>
3130
3131 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3132 segment when omagic.
3133
117be58f
AM
31342013-03-21 Alan Modra <amodra@gmail.com>
3135
3136 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3137 comparison warning.
3138 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3139 uninitialized" warning.
3140
32e2b61d
AM
31412013-03-20 Alan Modra <amodra@gmail.com>
3142
3143 * symtab.h (Symbol::clear_version): New function.
3144 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3145 is_needed by weak references. Clear version for symbols defined
3146 in as-needed objects that are not needed.
3147
b3ccdeb5
AM
31482013-03-15 Alan Modra <amodra@gmail.com>
3149
3150 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3151 static and public. Add report_err param. Return false for data refs.
3152 (Target_powerpc::rela_dyn_section): New overloaded function.
3153 (Target_powerpc::plt_, iplt_): Elucidate.
3154 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3155 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3156 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3157 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3158 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3159 push_branch and make_plt_entry for ifunc syms when
3160 reloc_needs_plt_for_ifunc.
3161 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3162 for ifunc unless reloc_needs_plt_for_ifunc.
3163
ad3d8a2f
AM
31642013-03-15 Alan Modra <amodra@gmail.com>
3165
3166 * gc.h (gc_process_relocs): Don't look through function descriptors.
3167 * icf.cc (get_section_contents): Do so here instead.
3168
4d9aa155
AM
31692013-03-13 Alan Modra <amodra@gmail.com>
3170
3171 * powerpc.cc (is_branch_reloc): Forward declare.
3172 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3173 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3174 false for 64-bit, true for 32-bit non-branch relocs.
3175 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3176 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3177 nm output.
3178 (icf_safe_test): Generate linker map file as well as nm output.
3179 (icf_safe_so_test): Likewise.
3180 * testsuite/Makefile.in: Regenerate.
3181 * testsuite/icf_test.sh: Parse linker map file to determine
3182 section folding.
3183 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3184 * testsuite/icf_safe_so_test.sh: Likewise.
3185 (X86_32_or_ARM_specific_safe_fold): Merge into..
3186 (arch_specific_safe_fold): ..this.
3187 (X86_64_specific_safe_fold): Delete unused function.
3188
57420c20
AM
31892013-03-12 Alan Modra <amodra@gmail.com>
3190
3191 * gc.h (gc_process_relocs): Look through function descriptors
3192 to determine shndx, symvalue and addend used by ICF. Tidy
3193 variable duplication.
3194
dc3714f3
AM
31952013-03-11 Alan Modra <amodra@gmail.com>
3196
3197 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3198 * layout.cc (Layout_task_runner::run): ..to here.
3199 * symtab.h (struct Symbol_location): Extract from..
3200 (class Symbol_table): ..here.
3201 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3202 * target.h (class Target): Add function_location and
3203 do_function_location functions.
3204 (class Sized_target): Add do_function_location.
3205 * object.h (class Sized_relobj_file): Move find_shdr..
3206 (class Object): ..to here.
3207 * object.cc: Likewise. Update to suit. Instantiate.
3208 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3209 * powerpc.cc (class Powerpc_dynobj): New.
3210 (Target_powerpc::do_function_location): New function.
3211 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3212 (Powerpc_dynobj::do_read_symbols): New function.
3213 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3214
956b03bb
ILT
32152013-03-08 Ian Lance Taylor <iant@google.com>
3216
3217 * options.cc (General_options::string_to_object_format): Accept
3218 "default".
3219
4bead2d5
AM
32202013-03-08 Alan Modra <amodra@gmail.com>
3221
3222 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3223 pointer to Post_fde.
3224 (struct Post_fde): Move definition to here..
3225 * ehframe.cc (struct Post_fde): ..from here.
3226 (Cie::write): Don't alloc Post_fde.
3227 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3228
02e60bf7
AM
32292013-03-07 Alan Modra <amodra@gmail.com>
3230
3231 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3232 relocation referencing .LC0.
3233 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3234
8343f03a
AM
32352013-03-07 Alan Modra <amodra@gmail.com>
3236
3237 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3238 always_inline. Add assembly for powerpc to avoid GOT.
3239
3366d57c
AM
32402013-03-07 Alan Modra <amodra@gmail.com>
3241
3242 * testsuite/script_test_10.sh: Don't test .bss section
3243 header number.
3244
6c77229c
AM
32452013-03-06 Alan Modra <amodra@gmail.com>
3246
3247 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3248 (Target_powerpc::symval_for_branch): Add symtab param. Update
3249 all callers. Handle folded sections.
3250 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3251 to Powerpc_relobj.
3252 (Global_symbol_visitor_opd::operator()): Likewise.
3253
a39e4af6
AM
32542013-03-04 Alan Modra <amodra@gmail.com>
3255
3256 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3257 * testsuite/Makefile.in: Regenerate.
3258
d5834edb
CC
32592013-03-01 Cary Coutant <ccoutant@google.com>
3260
3261 Add dwp support for v2 DWARF package file format.
3262 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3263 tu_length parameter. Adjust all callers.
3264 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3265 * dwp.cc: Include dwarf.h.
3266 (Section_bounds): New struct type.
3267 (Unit_set): New struct type.
3268 (Dwo_file::Dwo_file): Initialize new data member.
3269 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3270 Combine and rename to...
3271 (Dwo_file::read_unit_index): ...this.
3272 (Dwo_file::sized_read_compunit_index)
3273 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3274 (Dwo_file::sized_read_unit_index): ...this.
3275 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3276 parameters; add section_id parameter.
3277 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3278 (Dwo_file::add_unit_set): ...this.
3279 (Dwo_file::shndx_map_): Remove.
3280 (Dwo_file::sect_offsets_): New data member.
3281 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3282 (Dwp_output_file::add_section): Rename to...
3283 (Dwp_output_file::add_contribution): ...this.
3284 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3285 (Dwp_output_file::add_tu_set): Likewise.
3286 (Dwp_output_file::Contribution): New type.
3287 (Dwp_output_file::Section::contributions): New data member.
3288 (Dwp_output_file::Cu_or_tu_set): Remove.
3289 (Dwp_output_file::Section::Section): New ctor.
3290 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3291 (Dwp_output_file::Dwp_index::Section_table): New type.
3292 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3293 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3294 parameter.
3295 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3296 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3297 (Dwp_output_file::Dwp_index::section_table): New member function.
3298 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3299 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3300 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3301 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3302 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3303 (Dwp_output_file::Dwp_index::section_table_): New data member.
3304 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3305 (Dwp_output_file::add_output_section): New member function.
3306 (Dwp_output_file::write_new_section): New member function.
3307 (Dwp_output_file::write_contributions): New member function.
3308 (Dwp_output_file::section_id_map_): New data member.
3309 (class Dwo_id_info_reader): Remove.
3310 (class Unit_reader): New class.
3311 (get_dwarf_section_name): New function.
3312 (Dwo_file::read_executable): Adjust initializations of class data.
3313 (Dwo_file::read): Add support for v2 package file format.
3314 (Dwo_file::read_unit_index): Likewise.
3315 (Dwo_file::sized_read_unit_index): Likewise.
3316 (Dwo_file::copy_section): Likewise.
3317 (Dwo_file::add_unit_set): Likewise.
3318 (Dwp_output_file::add_output_section): Likewise.
3319 (Dwp_output_file::add_contribution): Likewise.
3320 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3321 for empty slot.
3322 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3323 file format.
3324 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3325 slot.
3326 (Dwp_output_file::initialize): Remove unused function.
3327 (Dwp_output_file::finalize): Add support for v2 package file format.
3328 (Dwp_output_file::write_index): Likewise.
3329 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3330 function prototype.
3331
a68a081d
CC
33322013-03-01 Cary Coutant <ccoutant@google.com>
3333
3334 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3335 function into class definition in header file.
3336 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3337 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3338 New function.
3339 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3340
9d5781f8
AM
33412013-02-28 Alan Modra <amodra@gmail.com>
3342
3343 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3344 * target.cc (Target::do_plt_fde_location): New function.
3345 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3346 accessor function, and constructor param.
3347 (struct Post_fde, Post_fdes): Declare.
3348 (Cie::write): Add post_fdes param.
3349 * ehframe.cc (Fde::write): Use plt_fde_location.
3350 (struct Post_fde): Define.
3351 (Cie::write): Stash FDEs added post merge mapping.
3352 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3353 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3354 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3355 other FDEs.
3356 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3357 (Target_powerpc::has_glink): New function.
3358 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3359 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3360 glink_eh_frame_fde_32, default_fde): New data.
3361 (Stub_table::eh_frame_added_): New var.
3362 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3363 Make const.
3364 (Stub_table::add_eh_frame): New function.
3365 (Output_data_glink::add_eh_frame): New function.
3366 (Target_powerpc::make_glink_section): Call add_eh_frame.
3367
214383dd
ILT
33682013-02-15 Ian Lance Taylor <iant@google.com>
3369
3370 * options.h (DEFINE_uint64_alias): Define.
3371 (class General_options): Add -Ttext-segment as an alias for
3372 -Ttext.
3373
91c2b899
AM
33742013-02-15 Alan Modra <amodra@gmail.com>
3375
3376 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3377 (Stub_table::do_write): ..here, two places.
3378 (Stub_table::plt_call_size): Use it here too.
3379
20e2a8aa
ILT
33802013-02-11 Ian Lance Taylor <iant@google.com>
3381
3382 * descriptors.cc (Descriptors::close_all): New function.
3383 * descriptors.h (class Descriptors): Declare close_all.
3384 (close_all_descriptors): New inline function.
3385 * plugin.cc: Include "descriptors.h".
3386 (Plugin_manager::cleanup): Call close_all_descriptors.
3387
8952bc69
AM
33882013-02-06 Alan Modra <amodra@gmail.com>
3389
3390 * README: Update coding style link.
3391
29bd8b6b
CC
33922013-01-28 Cary Coutant <ccoutant@google.com>
3393
a4034750
AM
3394 * dwp.cc (File_list): New typedef.
3395 (Dwo_name_info_reader): New class.
3396 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3397 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3398 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3399 (Dwo_file::read_executable): New function.
3400 (Dwo_file::read): Move common setup code to ...
3401 (Dwo_file::make_object): ... here.
3402 (dwp_options): Add --exec/-e.
3403 (usage): Likewise.
3404 (main): Likewise.
29bd8b6b 3405
c6ac678d
ST
34062013-01-24 Sriraman Tallam <tmsriram@google.com>
3407
3408 * layout.cc (Layout::layout): Check for option text_reorder.
3409 (Layout::make_output_section): Ditto.
3410 * options.h (text_reorder): New option.
3411 * output.cc (Input_section_sort_compare): Remove special ordering
3412 of section names.
3413 (Output_section::
3414 Input_section_sort_section_name_special_ordering_compare::
3415 operator()): New function.
3416 (Output_section::sort_attached_input_sections): Use new sort function
3417 for .text.
3418 * output.h (Input_section_sort_section_name_special_ordering_compare):
3419 New struct.
3420 * testsuite/Makefile.am (text_section_grouping): Test option
3421 --no-text-reorder
3422 * testsuite/Makefile.in: Regenerate.
3423 * testsuite/text_section_grouping.sh: Check order of functions without
3424 default text reordering.
3425
50701cc1
MF
34262013-01-18 Mike Frysinger <vapier@gentoo.org>
3427
3428 * options.h (General_options): Change default to true for new_dtags.
3429
b1b00fcc
MF
34302013-01-18 Mike Frysinger <vapier@gentoo.org>
3431
3432 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3433 when enable_new_dtags is false. Only add DT_RUNPATH when
3434 enable_new_dtags is true.
3435
ec5b8187
AM
34362013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3437
3438 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3439 used in declaration and definition consistent.
3440 (Target_powerpc::symval_for_branch): Ditto.
3441
a880d4c4
ST
34422013-01-16 Sriraman Tallam <tmsriram@google.com>
3443
3444 * testsuite/plugin_final_layout.cc: Fix comment.
3445
7c381248
ST
34462013-01-16 Sriraman Tallam <tmsriram@google.com>
3447
3448 * layout.cc (Layout::layout): Do not do default sorting for
3449 text sections when section ordering is specified.
3450 (make_output_section): Ditto.
3451 * testsuite/plugin_final_layout.cc: Name the function sections
3452 to catch reordering issues.
3453
e2458743
AM
34542013-01-15 Alan Modra <amodra@gmail.com>
3455
3456 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3457 plt-thread-safe.
3458
431ed302
AM
34592013-01-15 Alan Modra <amodra@gmail.com>
3460
3461 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3462 * testsuite/Makefile.in: Regenerate.
3463
0ec6429b
AM
34642013-01-14 Alan Modra <amodra@gmail.com>
3465
3466 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3467 * testsuite/Makefile.in: Regenerate.
3468
0bf402d5
ILT
34692013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3470
36af3926 3471 PR bfd/14430
0bf402d5
ILT
3472 Fix mingw gold build with plugins enabled
3473 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3474 * configure.ac: Export DLOPEN_LIBS and add headers check.
3475 * plugin.cc: Handle non-dlfcn case.
3476 * Makefile.in: Regenerate.
3477 * config.in: Regenerate.
3478 * configure: Regenerate.
3479 * testsuite/Makefile.in: Regenerate.
3480
9e9143bc
ST
34812013-01-09 Sriraman Tallam <tmsriram@google.com>
3482
3483 * output.h (sort_attached_input_sections): Change to be public.
3484 * script-sections.cc
3485 (Output_section_definition::set_section_addresses): Sort
3486 attached input sections according to section order before linker
3487 script assigns section addresses.
3488 (Orphan_output_section::set_section_addresses): Sort
3489 attached input sections according to section order before linker
3490 script assigns section addresses.
3491 * Makefile.am (final_layout.sh): Use a simple linker script to
3492 check if section ordering still works.
3493 * Makefile.in: Regenerate.
3494
679af368
ILT
34952013-01-09 Ben Cheng <bccheng@google.com>
3496
3497 * arm.cc (Target_arm::attributes_accept_div): New function.
3498 (Target_arm::attributes_forbid_div): New function.
3499 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3500 attribute using the same new functions as what bfd/elf32_arm.c
3501 does.
3502
3136a00e
CC
35032013-01-07 Cary Coutant <ccoutant@google.com>
3504
3505 PR gold/14993
3506 * output.cc (Output_section::add_input_section): For incremental
3507 updates, don't track input sections that are allocated from patch
3508 space.
3509
f2a6224b
L
35102013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3511 Ian Lance Taylor <iant@google.com>
3512
3513 PR gold/14897
3514 * configure.ac (--enable-ld): Removed.
3515 (install_as_default): Set to yes only for --enable-gold=default
3516 or --disable-ld.
3517 * configure: Regenerated.
3518
4f46f626
L
35192013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3520
3521 * options.h (General_options): Add -fuse-ld= for GCC linker
3522 option compatibility.
3523
26e4ef59
CC
35242013-01-04 Cary Coutant <ccoutant@google.com>
3525
3526 * configure.ac: Fix typo restoring CXXFLAGS.
3527 * configure: Regenerate.
3528
3d587466
CC
35292013-01-04 Cary Coutant <ccoutant@google.com>
3530
4f46f626
L
3531 * testsuite/Makefile.am (CXXLINK_S): New macro.
3532 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3533 * testsuite/Makefile.in: Regenerate.
3d587466 3534
44db6695
L
35352013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3536
3537 * version.cc (print_version): Update copyright year to 2013.
3538
edcac0c1
ILT
35392012-12-20 Ian Lance Taylor <iant@google.com>
3540
3541 * layout.cc (Layout::special_ordering_of_input_section): New
3542 function.
3543 (Layout::layout): If input section requires special ordering, must
3544 sort input sections.
3545 (Layout::make_output_section): May sort .text input sections.
3546 (Layout::is_section_name_prefix_grouped): Remove.
3547 * layout.h (class Layout): Declare
3548 special_ordering_of_input_section. Don't declare
3549 is_section_name_prefix_grouped.
3550 * output.cc (Output_section::add_input_section): Revert last
3551 change.
3552 (Output_section::Input_section_sort::match_file_name): Don't crash
3553 if called on output section data.
3554 (Output_section::Input_section_sort_compare): Sort based on
3555 special ordering.
3556 (Output_section::Input_section_sort_section_order_index_compare):
3557 Revert last patch.
3558 (Output_section::sort_attached_input_sections): Likewise.
3559
28f2a4ac
ST
35602012-12-18 Sriraman Tallam <tmsriram@google.com>
3561
edcac0c1 3562 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3563 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3564 * output.cc (Output_section::add_input_section): Check if section
3565 name contains special prefix. Keep input sections to sort such
3566 sections.
3567 (Output_section::Input_section_sort_section_order_index_compare
3568 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3569 (Output_section::sort_attached_input_sections): Add condition to
3570 Input_section_entry constructor call.
28f2a4ac
ST
3571 * testsuite/Makefile.am (text_section_grouping): New test.
3572 * testsuite/Makefile.in: Regenerate.
3573 * testsuite/text_section_grouping.cc: New file.
3574 * testsuite/text_section_grouping.sh: New file.
3575
5bf135a7
NC
35762012-12-17 Nick Clifton <nickc@redhat.com>
3577
3578 * Makefile.am: Add copyright notice.
3579 * NEWS: Likewise.
3580 * README: Likewise.
3581 * configure.ac: Likewise.
3582 * ftruncate.c: Likewise.
3583 * Makefile.in: Regenerate.
3584
59965708
CC
35852012-12-14 Cary Coutant <ccoutant@google.com>
3586
a4034750
AM
3587 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3588 --no-as-needed flag.
3589 (exception_separate_shared_12_test): Likewise.
3590 (incremental_copy_test): Likewise.
3591 * testsuite/Makefile.in: Regenerate.
59965708 3592
2a77e2ab
CC
35932012-12-14 Cary Coutant <ccoutant@google.com>
3594
3595 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3596 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3597
e3deeb9c
AM
35982012-12-12 Alan Modra <amodra@gmail.com>
3599
3600 * powerpc.cc (class Track_tls): New.
3601 (class Relocate, class Scan): Inherit Track_tls.
3602 (Target_powerpc::Scan::local, global): Track tls optimization
3603 and avoid creating plt entry for __tls_get_addr if all uses
3604 are optimized away.
3605 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3606
d8f5a274
AM
36072012-12-12 Alan Modra <amodra@gmail.com>
3608
3609 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3610 Replace no_toc_optimize with toc_optimize.
3611 * output.h (Output_section::input_sections): Provide non-const variant.
3612 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3613 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3614 accessors.
3615 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3616 (class Sort_toc_sections): New.
3617 (Target_powerpc::do_finalize_sections): Sort toc sections.
3618 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3619
4c8a1de1
RM
36202012-12-10 Roland McGrath <mcgrathr@google.com>
3621
3622 * testsuite/binary_unittest.cc (read_all): New function.
3623 (Sized_binary_test): Use it instead of ::read.
3624 * fileread.cc (do_read): Don't assume pread always reads the whole
3625 amount in a single call.
3626
edc27beb
AM
36272012-12-10 Alan Modra <amodra@gmail.com>
3628
3629 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3630 Set EM_PPC64 or EM_PPC here.
3631 (Target_selector_powerpc::do_recognize): Delete.
3632
906b9150
AM
36332012-12-10 Alan Modra <amodra@gmail.com>
3634
3635 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3636 stub_table_.
3637 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3638
418c15ae
RM
36392012-12-07 Roland McGrath <mcgrathr@google.com>
3640
3641 * testsuite/binary_unittest.cc (Sized_binary_test):
3642 Use open_descriptor rather than ::open.
3643
decdd3bc
AM
36442012-12-07 Alan Modra <amodra@gmail.com>
3645
3646 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3647 typedef and invalid_address constant.
3648 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3649 instantiate constants.
3650
db399005
ILT
36512012-12-06 Roland McGrath <mcgrathr@google.com>
3652
3653 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3654 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3655 * aclocal.m4: Regenerate.
3656 * configure: Regenerate.
3657 * Makefile.in: Regenerate.
3658 * testsuite/Makefile.in: Regenerate.
3659
aba6bc71
AM
36602012-12-07 Alan Modra <amodra@gmail.com>
3661
3662 * options.h (General_options): Add no_toc_optimize.
3663 * powerpc.cc (ok_lo_toc_insn): New function.
3664 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3665
9e69ed50
AM
36662012-12-06 Alan Modra <amodra@gmail.com>
3667
3668 * options.h (General_options): Add plt_align, plt_static_chain,
3669 plt_thread_safe. Update stub_group_size help text.
3670 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3671 for new plt_thread_safe_ var.
3672 (use_plt_offset): Correct comments.
3673 (Target_powerpc::do_relax): Look for thread creation symbols to
3674 determine default plt_thread_safe value. Clear plt call stubs
3675 as well as branch stubs each iteration.
3676 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3677 insn constants.
3678 (l, hi, ha, write_insn): Move earlier.
3679 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3680 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3681 plt stubs too.
3682 (Stub_table::update_size): Adjust.
3683 (Stub_table::prev_size, set_prev_size): Delete.
3684 (Stub_table::stub_align): Let --plt-align affect result.
3685 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3686 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3687 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3688 (Stub_table::do_write): Support more stub variants.
3689
f43ba157
AM
36902012-12-04 Alan Modra <amodra@gmail.com>
3691
3692 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3693 (Target_powerpc::do_define_standard_symbols): New function.
3694
34171bc5
AM
36952012-12-03 Alan Modra <amodra@gmail.com>
3696
3697 * output.h: Formatting, whitespace.
3698
dc9589e9 36992012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3700
3701 * layout.h (Layout::get_executable_sections): Declare.
3702 * layout.cc (Layout::get_executable_sections): New function.
3703 * arm.cc (Target_arm::group_sections): Use it.
3704 (Arm_output_section::group_sections): Delete now redundant test.
3705 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3706 param to handle relative relocs.
3707 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3708 (Output_data_reloc::add_absolute): Adjust.
3709 (Output_data_reloc::add_relative): New function.
3710 (Output_data::reset_data_size): New function.
3711 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3712 (Output_section::set_addralign): New function.
3713 (Output_section::checkpoint_set_addralign): New function.
3714 (Output_section::clear_section_offsets_need_adjustment): New function.
3715 (Output_section::input_sections): Make public.
3716 * powerpc.cc (class Output_data_brlt_powerpc): New.
3717 (class Stub_table, class Stub_control): New.
3718 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3719 stub_table_, set_stub_table, stub_table): New vectors and accessor
3720 functions.
3721 (Target_powerpc::do_may_relax, do_relax, push_branch,
3722 new_stub_table, stub_tables, brlt_section, group_sections,
3723 add_branch_lookup_table, find_branch_lookup_table,
3724 write_branch_lookup_table, make_brlt_section): New functions.
3725 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3726 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3727 branch_info_): New vars.
3728 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3729 make call stubs here.
3730 (Output_data_glink): Remove all call stub handling from this class.
3731 (Target_powerpc::Scan::local, global): Save interesting branch
3732 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3733 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3734 functions on final link.
3735 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3736 Handle long branch destinations too.
3737 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3738 do_plt_address_for_local): Adjust lookup of plt call stubs.
3739
627b30b7
AM
37402012-11-30 Alan Modra <amodra@gmail.com>
3741
3742 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3743 relocs against protected symbols when building 32-bit shared libs.
3744
40b469d7
AM
37452012-11-30 Alan Modra <amodra@gmail.com>
3746
3747 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3748 param. Call got_section() to make .got. Update all callers
3749 and their callers and so on.
3750
bb66a627
AM
37512012-11-30 Alan Modra <amodra@gmail.com>
3752
3753 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3754 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3755 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3756 value if it already exists.
3757
d2cf1c6c
L
37582012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3759
3760 PR gold/14858
3761 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3762
edccdf7c
RM
37632012-11-14 Roland McGrath <mcgrathr@google.com>
3764
3765 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3766 than bfc instruction for data sandboxing.
3767
6febeb74
AM
37682012-11-08 Alan Modra <amodra@gmail.com>
3769
3770 * po/POTFILES.in: Regenerate.
3771
0a6f1bf2
AM
37722012-11-05 Alan Modra <amodra@gmail.com>
3773
3774 * configure.ac: Apply 2012-09-10 change to config.in here.
3775 * configure: Regenerate.
3776
26a4e9cb
AM
37772012-11-05 Alan Modra <amodra@gmail.com>
3778
3779 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3780 (struct Opd_ent): Use "Address" rather than "Offset".
3781 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3782 (Target_powerpc::got_section): Make public.
3783 (Target_powerpc::scan_relocs): Move code setting symbols..
3784 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3785 Create _SDA_BASE_ only when referenced.
3786
cc928013
RM
37872012-11-02 Roland McGrath <mcgrathr@google.com>
3788
3789 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3790 from last change.
3791
50ed5eb1
RM
37922012-11-01 Roland McGrath <mcgrathr@google.com>
3793
62fe925a
RM
3794 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3795 for offset_in_output_section parameter.
3796 (Sized_target::relocate_special_relocatable): Likewise.
3797 * arm.cc (Target_arm::relocate_relocs): Likewise.
3798 (Target_arm::relocate_special_relocatable): Likewise.
3799 * i386.cc (Target_i386::relocate_relocs): Likewise.
3800 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3801 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3802 * target-reloc.h (relocate_relocs): Likewise.
3803 * testsuite/testfile.cc (Target_test): Likewise.
3804 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3805 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3806
3807 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3808 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3809
3810 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3811 parameter, which is unused in the [!F_SETFD] case.
3812
50ed5eb1
RM
3813 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3814 SYMNDX to off_t before comparing it to this->data_size().
3815 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3816 * incremental.cc (Output_section_incremental_inputs::do_write):
3817 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3818
2cadc0bf
RM
3819 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3820
3bfcb652
NC
38212012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3822
3823 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3824 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3825 in EABI_VER5.
3826
c1a8d56e
CC
38272012-10-29 Cary Coutant <ccoutant@google.com>
3828
3829 * dwp.cc (usage): Add file and exit status parameters;
3830 add --help and --version options.
3831 (print_version): New function.
3832 (main): Add --help and --version options.
3833
b2490a7b
L
38342012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3835
3836 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3837 final_layout_sequence.txt.
3838 * testsuite/Makefile.in: Regenerated.
3839
aa543512
L
38402012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3841
3842 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3843 COMPILE generated by automake.
3844 (LINK1): Likewise.
3845 (CXXCOMPILE1): Likewise.
3846 (CXXLINK1): Likewise.
3847 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3848 (LINK): Likewise.
3849 (CXXCOMPILE): Likewise.
3850 (CXXLINK): Likewise.
3851 * testsuite/Makefile.in: Regenerated.
3852
d361fafb
L
38532012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3854
3855 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3856 on bad fwrite return.
3857
598c7410
L
38582012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3859
3860 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3861 on val.
3862
35c813e2
CC
38632012-10-23 Cary Coutant <ccoutant@google.com>
3864
3865 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3866 * testsuite/Makefile.in: Regenerate.
3867 * testsuite/dwp_test.h: New source file.
3868 * testsuite/dwp_test_1.cc: New source file.
3869 * testsuite/dwp_test_1.s: New source file.
3870 * testsuite/dwp_test_1.sh: New source file.
3871 * testsuite/dwp_test_1b.cc: New source file.
3872 * testsuite/dwp_test_1b.s: New source file.
3873 * testsuite/dwp_test_2.cc: New source file.
3874 * testsuite/dwp_test_2.s: New source file.
3875 * testsuite/dwp_test_2.sh: New source file.
3876 * testsuite/dwp_test_main.cc: New source file.
3877 * testsuite/dwp_test_main.s: New source file.
3878
77429909
CC
38792012-10-23 Cary Coutant <ccoutant@google.com>
3880
3881 * dwp.h: New header file.
3882 * dwp.cc: New source file.
3883 * gold.h: Move shared declarations to system.h.
3884 * system.h: New header file.
3885 * Makefile.am: Add dwp.
3886 * Makefile.in: Regenerate.
3887
ed5d6712
CC
38882012-10-23 Cary Coutant <ccoutant@google.com>
3889
3890 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3891 Dwarf_info_reader::read_from_pointer.
3892 (Dwarf_pubnames_table::read_header): Likewise.
3893 (Dwarf_pubnames_table::next_name): Likewise.
3894 (Dwarf_die::read_attributes): Likewise.
3895 (Dwarf_die::skip_attributes): Likewise.
3896 (Dwarf_info_reader::read_from_pointer): New function template.
3897 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3898 (Dwarf_pubnames_table): Likewise.
3899 (Dwarf_info_reader::read_from_pointer): New function template.
3900 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3901 Dwarf_pubnames_table ctor.
3902
8787852d
CC
39032012-10-23 Cary Coutant <ccoutant@google.com>
3904
3905 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3906 abbrev_shndx.
3907 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3908 abbrev_shndx_.
3909 (Dwarf_info_reader::set_abbrev_shndx): New method.
3910 (Dwarf_info_reader::abbrev_shndx_): New data member.
3911
9fc236f3
CC
39122012-10-23 Cary Coutant <ccoutant@google.com>
3913
3914 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3915 from object, not parameters.
3916 (Dwarf_info_reader::parse): Likewise.
3917 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3918 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3919 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3920 methods.
3921
effe8365
CC
39222012-10-23 Cary Coutant <ccoutant@google.com>
3923
3924 * fileread.cc (Input_file::Input_file): New constructor.
3925 * fileread.h (class Input_file): Add new constructor.
3926
1698990d
AM
39272012-10-18 Alan Modra <amodra@gmail.com>
3928
3929 PR gold/14727
3930 * object.cc (Relobj::is_section_name_included): Also match
3931 .sdata personality section.
3932
168a4726
AM
39332012-10-18 Alan Modra <amodra@gmail.com>
3934
3935 * target-reloc.h (class Default_comdat_behavior): New, package up..
3936 (get_comdat_behaviour): ..this.
3937 (relocate_section): Add Relocate_comdat_behavior template arg,
3938 adjust code to suit.
3939 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3940 (Target_arm::scan_reloc_section): Likewise.
3941 * i386.cc (Target_i386::relocate_section): Likewise.
3942 * sparc.cc (Target_sparc::relocate_section): Likewise.
3943 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3944 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3945 * powerpc.cc (class Relocate_comdat_behavior): New.
3946 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3947 gold::relocate_section with new template arg.
3948
acc276d8
AM
39492012-10-18 Alan Modra <amodra@gmail.com>
3950
3951 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3952 dynamic relocs for GOT_TPREL got entries, without symbol if
3953 resolving locally.
3954 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3955 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3956 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3957
e10f9870
AM
39582012-10-17 Alan Modra <amodra@gmail.com>
3959
3960 PR gold/14726
3961 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3962
ae034989
ST
39632012-10-16 Sriraman Tallam <tmsriram@google.com>
3964
3965 * layout.cc (Layout::include_section): Keep sections marked
3966 SHF_EXCLUDE when doing relocatable links.
3967
f3a0ed29
AM
39682012-10-16 Alan Modra <amodra@gmail.com>
3969
3970 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3971 (Target_powerpc::do_finalize_sections): Call it.
3972 (Output_data_save_res): New class and supporting functions.
3973 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3974 normal symbols defined in object files.
3975
c6de8ed4
AM
39762012-10-12 Alan Modra <amodra@gmail.com>
3977
3978 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3979 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3980 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3981 section if scan_opd_relocs not yet called.
3982 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3983
03e25981
AM
39842012-10-12 Alan Modra <amodra@gmail.com>
3985
3986 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3987 add_local_ifunc_entry): Revert last change.
3988 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3989
c9824451
AM
39902012-10-05 Alan Modra <amodra@gmail.com>
3991
3992 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3993 do_plt_address_for_global): New functions.
3994 (Output_data_got_powerpc::do_write): Don't segfault when linking
3995 statically.
3996 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3997 add_local_ifunc_entry): Return true on adding entry..
3998 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3999 glink->add_entry call. Remove unused symtab param. Adjust calls.
4000 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4001 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4002 set up symbols here.
4003 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4004 syms here. Do so even when no .iplt. Don't segfault when linking
4005 statically.
4006 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4007 new variants without reloc param.
4008 (Glink_sym_ent::Glink_sym_ent): Likewise.
4009 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4010 reloc when refs will resolve to plt call stub.
4011 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4012 R_PPC_PLTREL24 to resolve locally.
4013 (Target_powerpc::Scan::global): Correct ifunc handling.
4014 (Target_powerpc::Relocate::relocate): Correct local sym glink
4015 lookup. Don't destroy "value" when we have a plt call stub,
4016 and when checking plt call validity.
4017 (Target_powerpc::do_dynsym_value): Simplify.
4018
19fec8c1
AM
40192012-10-05 Alan Modra <amodra@gmail.com>
4020
4021 * i386.cc (Output_data_plt_i386::address_for_global,
4022 address_for_local): Add plt offset to returned value. Adjust uses.
4023 * sparc.cc (Output_data_plt_sparc::address_for_global,
4024 address_for_local): Likewise.
4025 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4026 address_for_local): Likewise.
4027 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4028 address_for_local): Likewise.
4029 * target.h (Target::plt_address_for_global, plt_address_for_local):
4030 Update comment.
4031 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4032 (Output_data_got::Got_entry::write): Nor here.
4033 * output.h: Comment fix.
4034
e867b647
WL
40352012-10-02 Jiong Wang <jiwang@tilera.com>
4036
4037 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4038 global_offset_table_ value for larget got.
4039 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4040
e5d5f5ed
AM
40412012-09-29 Alan Modra <amodra@gmail.com>
4042
4043 * powerpc.cc (Target_powerpc::iplt_): New output section.
4044 (Target_powerpc::iplt_section, make_iplt_section,
4045 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4046 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4047 Target_powerpc::plt_entry_count): Count iplt entries too.
4048 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4049 reloc section in constructor. New params.
4050 (Target_powerpc::make_plt_section): Create reloc section here instead.
4051 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4052 functions.
4053 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4054 (Output_data_glink::add_entry, find_entry): New functions to
4055 deal with local syms.
4056 (Glink_sym_ent): Add support for local syms.
4057 (Output_data_glink::do_write): Handle ifunc plt entries.
4058 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4059 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4060 (Target_powerpc::Relocate::relocate): Likewise.
4061 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4062
ec4dbad3
AM
40632012-09-25 Alan Modra <amodra@gmail.com>
4064
4065 * object.h (Sized_relobj_file::adjust_local_symbol,
4066 do_adjust_local_symbol): New functions.
4067 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4068 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4069 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4070 and irregular opd entry spacing.
4071 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4072 (Global_symbol_visitor_opd): New functor.
4073 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4074 on deleted opd entries.
4075
5c0b3823
WL
40762012-09-15 Jiong Wang <jiwang@tilera.com>
4077
4078 * tilegx.cc: New file.
4079 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4080 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4081 * configure.tgt: Add entries for tilegx*.
4082 * configure.ac: Likewise.
4083 * Makefile.in: Rebuild.
4084 * configure: Likewise.
4085 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4086 tilegx.
4087
bfdfa4cd
AM
40882012-09-13 Alan Modra <amodra@gmail.com>
4089
4090 * target-reloc.h (scan_relocs): Call scan.local for relocs
4091 against symbols in discarded sections. Pass is_discarded
4092 param.
4093 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4094 Add is_discarded param.
4095 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4096 is_discarded to flag opd entry as discarded. Don't emit dyn
4097 relocs on such entries.
4098 (Target_powerpc::Scan::global): Similarly detect and handle
4099 such opd entries.
4100 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4101 opd_ent_. Update all uses.
4102 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4103 (Target_powerpc::relocate_section): Zero out discarded opd
4104 entry relocs.
4105
d77a0555
ILT
41062012-09-12 Ian Lance Taylor <iant@google.com>
4107
4108 PR gold/14570
4109 * output.cc: Rename Output_data_got template parameter from size
4110 to got_size for all functions. Compile all variants of
4111 Output_data_got.
4112 (Output_data_got::Got_entry::write): Correct use of size for
4113 symbol value. Use local_is_tls rather than casting to
4114 Sized_relobj_file.
4115 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4116 (class Sized_relobj_file): Add do_local_is_tls.
4117 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4118
815a1205
AM
41192012-09-11 Alan Modra <amodra@gmail.com>
4120
4121 PR gold/14566
4122 * layout.cc (Layout::set_segment_offsets): When using
4123 common-page-size alignment, ensure we are on a new max-page-size
4124 page.
4125 * output.cc (Output_segment::set_section_addresses): Use
4126 abi_pagesize, not common_pagesize for relro boundary.
4127 (Output_segment::set_offset): Likewise.
4128
bd73a62d
AM
41292012-09-11 Alan Modra <amodra@gmail.com>
4130
4131 * output.h (Output_data_got::add_global_tls, add_local_tls,
4132 add_local_tls_pair): New functions.
4133 (Output_data_got::add_local_pair_with_rel): Remove second
4134 reloc param. Expand comment.
4135 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4136 use_plt_or_tls_offset_, similarly for constructor param.
4137 (Output_data_got::Got_entry::write): Add got_index param.
4138 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4139 add_local_tls_pair): New functions.
4140 (Output_data_got::Got_entry::write): Handle tls symbols
4141 with use_plt_or_tls_offset_ set specially.
4142 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4143 (Output_data_got::do_write): Replace iterator with index, pass
4144 index to entry write function.
4145 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4146 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4147 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4148 call.
4149 * i386.cc (Target_i386::Scan::local): Likewise.
4150 * sparc.cc (Target_sparc::Scan::local): Likewise.
4151 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4152 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4153 do_tls_offset_for_global): New functions.
4154 (Target_powerpc::Scan::local): Correct TLS relocations and got
4155 entry values.
4156 (Target_powerpc::Scan::global): Don't emit unnecessary
4157 dynamic relocations on TLS GOT entries.
4158
00716ab1
AM
41592012-09-10 Matthias Klose <doko@ubuntu.com>
4160
4161 * config.in: Disable sanity check for kfreebsd.
4162
c891b3f9
SA
41632012-09-10 Sterling Augustine <saugustine@google.com>
4164
4165 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4166 (Gdb_index::pubtypes_read): New parameter.
4167 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4168 to calls.
4169 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4170 pubtypes_object_.
4171
e81fea4d
AM
41722012-09-09 Alan Modra <amodra@gmail.com>
4173
4174 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4175 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4176 * gc.h (gc_process_relocs): Call target gc_add_reference.
4177 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4178 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4179 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4180 unnecessary cast.
4181 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4182 to cater for when we don't need code offset. Update use.
4183 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4184 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4185 set_opd_valid): New functions.
4186 (Target_powerpc::do_gc_add_reference): New function.
4187 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4188 stashed refs.
4189 (Target_powerpc::do_gc_mark_symbol): New function.
4190
d2d60eef
CC
41912012-09-06 Cary Coutant <ccoutant@google.com>
4192
4193 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4194 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4195 (Dwarf_die::skip_attributes): Likewise.
4196 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4197 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4198 (main): Call it.
4199 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4200
32ed4573
L
42012012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4202
4203 * testsuite/script_test_3.t: Add .got.plt output section
4204 statement.
4205 * testsuite/script_test_4.t: Likewise.
4206
f4baf0d4
AM
42072012-09-05 Alan Modra <amodra@gmail.com>
4208
4209 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4210 update all uses and lose "enum" when using type.
4211
864a1b56
AM
42122012-09-05 Alan Modra <amodra@gmail.com>
4213
4214 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4215 * configure: Regenerate.
4216 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4217 (plugin_final_layout.stdout): Likewise.
4218 (memory_test): Set page sizes to 0x1000.
4219 * testsuite/Makefile.in: Regenerate.
4220 * testsuite/discard_locals_test.sh: Add FIXME comment.
4221 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4222 * testsuite/pr14265.t: Add .got output section statement.
4223 * testsuite/script_test_2.t: Likewise.
4224 * testsuite/script_test_3.t: Likewise.
4225 * testsuite/script_test_4.t: Likewise.
4226 * testsuite/script_test_5.t: Likewise.
4227 * testsuite/script_test_6.t: Likewise.
4228 * testsuite/script_test_7.t: Likewise.
4229 * testsuite/script_test_9.t: Likewise.
4230
3ea0a085
AM
42312012-09-05 Alan Modra <amodra@gmail.com>
4232
4233 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4234 (Powerpc_relocate_functions::Status): New typedef.
4235 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4236 (Target_powerpc::Scan::local): Handle REL64.
4237 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4238 for REL32 and REL64.
4239 (Target_powerpc::symval_for_branch): New function, extracted from..
4240 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4241 checks. Report overflow errors.
4242
7404fe1b
AM
42432012-09-05 Alan Modra <amodra@gmail.com>
4244
4245 * object.h (Sized_relobj_file::emit_relocs): Delete.
4246 (Sized_relobj_file::emit_relocs_reltype): Delete.
4247 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4248 relocate_relocs for --emit-relocs.
4249 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4250 * output.h: Update comment.
4251 (Output_segment::first_section): New function.
4252 (Output_segment::first_section_load_address): Use first_section.
4253 * output.cc (Output_segment::first_section): New function extracted..
4254 (Output_segment::first_section_load_address): ..from here. Delete.
4255 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4256 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4257 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4258 adjust call to target.h function.
4259 * i386.cc (Target_i386): Likewise.
4260 * sparc.cc (Target_sparc): Likewise.
4261 * x86_64.cc (Target_x86_64): Likewise.
4262 * powerpc.cc (Target_powerpc): Likewise.
4263 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4264 first tls section has section symbol for optimised local dynamic
4265 output relocs.
4266 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4267 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4268 optimised tls code.
4269 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4270 Rename to relocate_relocs. Update error message.
4271
957564c9
AS
42722012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4273
4274 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4275 --just-symbols.
4276
dd93cd0a
AM
42772012-08-31 Alan Modra <amodra@gmail.com>
4278
4279 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4280 (Powerpc_relobj::toc_base_offset): New stub function.
4281 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4282 got_mod_index_offset to tlsld_got_offset. Update all refs.
4283 (Target_powerpc::Relocate::enum skip_tls): New.
4284 (Target_powerpc::call_tls_get_addr_): New var.
4285 (Target_powerpc::is_branch_reloc): Move to file scope.
4286 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4287 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4288 New functions.
4289 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4290 (powerpc_info): Correct common_pagesize for ppc64.
4291 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4292 (Powerpc_relocate_functions): Add overflow check enums and functions.
4293 Add non-shift version of rela, rela_ua. Delete all rel public
4294 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4295 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4296 addr16_ha3, addr14 functions.
4297 (Output_data_got_powerpc::add_constant_pair): New function.
4298 (Output_data_got_powerpc::got_base_offset): Likewise.
4299 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4300 (instruction constants): Sort, add some more.
4301 (Output_data_glink::do_write): Add and use Address typedef. Use
4302 object->toc_base_offset() stub for 64-bit.
4303 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4304 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4305 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4306 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4307 Always treat .opd relocs as against locally defined symbol.
4308 Correct condition for RELATIVE relocs.
4309 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4310 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4311 for 32-bit syms with a plt entry. Correct ppc64 toc base
4312 calculations. Handle TLS relocs, and more. Add overflow
4313 checking and adjust for Powerpc_relocate_functions changes.
4314 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4315 Reinstate --emit-relocs code with FIXME.
4316
a1373b60
AM
43172012-08-30 Alan Modra <amodra@gmail.com>
4318
4319 * layout.cc (Layout::set_segment_offsets): Set p_align to
4320 abi_pagesize, not common_pagesize.
4321 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4322 to determine whether file header can go in segment.
4323
703d02da
AM
43242012-08-30 Alan Modra <amodra@gmail.com>
4325
4326 * output.h (Output_reloc::Output_reloc <output section>): Add
4327 is_relative param. Adjust calls.
4328 (Output_reloc::add_output_section_relative): New functions.
4329 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4330 is_relative.
4331 (Output_reloc::symbol_value): Handle SECTION_CODE.
4332
16164a6b
ST
43332012-08-24 Sriraman Tallam <tmsriram@google.com>
4334
4335 * gold.cc (queue_middle_tasks): Call layout again when unique
4336 segments for sections is desired.
4337 * layout.cc (Layout::Layout): Initialize new members.
4338 (Layout::get_output_section_flags): New function.
4339 (Layout::choose_output_section): Call get_output_section_flags.
4340 (Layout::layout): Make output section for mapping to a unique segment.
4341 (Layout::insert_section_segment_map): New function.
4342 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4343 output sections marked so.
16164a6b
ST
4344 (Layout::segment_precedes): Check for unique segments when sorting.
4345 * layout.h (Layout::Unique_segment_info): New struct.
4346 (Layout::Section_segment_map): New typedef.
4347 (Layout::insert_section_segment_map): New function.
4348 (Layout::get_output_section_flags): New function.
4349 (Layout::is_unique_segment_for_sections_specified): New function.
4350 (Layout::set_unique_segment_for_sections_specified): New function.
4351 (Layout::unique_segment_for_sections_specified_): New member.
4352 (Layout::section_segment_map_): New member.
4353 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4354 Rename is_gc_pass_one to is_pass_one.
4355 Rename is_gc_pass_two to is_pass_two.
4356 Rename is_gc_or_icf to is_two_pass.
4357 Check for which pass based on whether symbols data is present.
4358 Make it two pass when unique segments for sections is desired.
4359 * output.cc (Output_section::Output_section): Initialize new
4360 members.
4361 * output.h (Output_section::is_unique_segment): New function.
4362 (Output_section::set_is_unique_segment): New function.
4363 (Output_section::is_unique_segment_): New member.
4364 (Output_section::extra_segment_flags): New function.
4365 (Output_section::set_extra_segment_flags): New function.
4366 (Output_section::extra_segment_flags_): New member.
4367 (Output_section::segment_alignment): New function.
4368 (Output_section::set_segment_alignment): New function.
4369 (Output_section::segment_alignment_): New member.
4370 (Output_segment::Output_segment): Initialize is_unique_segment_.
4371 (Output_segment::is_unique_segment): New function.
4372 (Output_segment::set_is_unique_segment): New function.
4373 (Output_segment::is_unique_segment_): New member.
4374 * plugin.cc (allow_unique_segment_for_sections): New function.
4375 (unique_segment_for_sections): New function.
4376 (Plugin::load): Add new functions to transfer vector.
4377 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4378 * Makefile.in: Regenerate.
4379 * testsuite/plugin_final_layout.sh: Check if unique segment
4380 functionality works.
4381 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4382 are available.
4383 (allow_unique_segment_for_sections): New global.
4384 (unique_segment_for_sections): New global.
4385 (claim_file_hook): Call allow_unique_segment_for_sections.
4386 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4387
1e2bee4f
CC
43882012-08-22 Cary Coutant <ccoutant@google.com>
4389
4390 * layout.cc (Layout::include_section): Don't assert on GROUP
4391 sections with --emit-relocs.
4392
1d5dfe78
CC
43932012-08-21 Cary Coutant <ccoutant@google.com>
4394
4395 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4396 if --export-dynamic-symbol names an undef symbol.
4397
c9269dff
AM
43982012-08-18 Alan Modra <amodra@gmail.com>
4399
4400 * powerpc.cc: Formatting and white space.
4401 (Powerpc_relobj): Rename got2_section_ to special_.
4402 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4403 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4404 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4405 (Target_powerpc): Add Address typedef and invalid_address. Use
4406 throughout.
4407 (Target_powerpc::is_branch_reloc): New function.
4408 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4409 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4410 for dst_mask, value and addend.
4411 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4412 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4413 (Output_data_glink::do_write): Correct toc base. Don't try to use
4414 uint16_t for 24-bit offset. Use get_output_section_offset and
4415 check return.
4416 (Target_powerpc::Scan::local): Handle more relocs.
4417 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4418 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4419 Plug in toc restoring insn after plt calls. Translate branches
4420 to function descriptor symbols to corresponding entry point.
4421 (Target_powerpc::relocate_for_relocatable): Check return from
4422 get_output_section_offset.
4423 * symtab.h: Comment typo.
4424
b1759dce
ILT
44252012-08-14 Ian Lance Taylor <iant@google.com>
4426
4427 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4428 unsupported_relocal_local to call unsupported_reloc_global.
4429
b9b2ae8b
NC
44302012-08-14 Nick Clifton <nickc@redhat.com>
4431
4432 PR ld/14265
4433 * script-sections.cc (Sections_element::output_section_name): Add
4434 keep return parameter.
4435 (Output_section_element::match_name): Add keep return parameter.
4436 Return the value of the keep_ member.
4437 * script-sections.h (class Output_section): Update
4438 output_section_name prototype.
4439 * layout.cc (Layout::keep_input_section): New public member
4440 function.
4441 (Layout::choose_output_section): Pass keep parameter to
4442 output_section_name.
4443 * layout.h (class Layout): Add keep_input_section.
4444 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4445 sections.
4446 * testsuite/Makefile.am: Add a test.
4447 * testsuite/Makefile.in: Regenerate.
4448 * testsuite/pr14265.c: Source file for the test.
4449 * testsuite/pr14265.t: Linker script for the test.
4450 * testsuite/pr14265.sh: Shell script for the test.
4451
921b5322
AM
44522012-08-14 Alan Modra <amodra@gmail.com>
4453
4454 * target.h (Target::output_section_name): New function.
4455 (Target::do_output_section_name): New function.
4456 * layout.cc (Layout::choose_output_section): Call the above.
4457 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4458
6ce78956
AM
44592012-08-14 Alan Modra <amodra@gmail.com>
4460
4461 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4462 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4463 for replace_constant call.
4464 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4465 (Output_data_glink::do_print_to_mapfile): New function.
4466 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4467 (Target_powerpc::Relocate::relocate): Likewise.
4468
d1a8cabd
AM
44692012-08-14 Alan Modra <amodra@gmail.com>
4470
4471 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4472 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4473 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4474 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4475 all references to shndx_. Handle special case for R_PPC_PLTREL24
4476 here.
4477 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4478 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4479 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4480 here.
4481 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4482 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4483
d83ce4e3
AM
44842012-08-12 Alan Modra <amodra@gmail.com>
4485
4486 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4487 (glink insn constants): Use uint32_t.
4488 (Output_data_glink::add_entry): Use insert, not [] operator.
4489
cf43a2fe
AM
44902012-08-11 Alan Modra <amodra@gmail.com>
4491
4492 * object.h (Sized_relobj_file::find_shdr): New function.
4493 (Sized_relobj_file::find_special_sections): New function.
4494 * object.cc (Sized_relobj_file::find_shdr): New function.
4495 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4496 (Sized_relobj_file::find_special_sections): New function, split out..
4497 (Sized_relobj_file::do_read_symbols): ..from here.
4498 * output.h (Output_data_got::replace_constant): New function.
4499 (Output_data_got::num_entries): New function.
4500 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4501 (Output_data_got::got_offset): Protected rather than private.
4502 (Output_data_got::replace_got_entry): New function.
4503 * output.cc (Output_data_got::replace_got_entry): New function.
4504 * powerpc.cc (class Powerpc_relobj): New.
4505 (class Powerpc_relocate_functions): Delete all psymval variants or
4506 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4507 Implement _ha functions using corresponding _hi function.
4508 (Powerpc_relobj::find_special_sections): New function.
4509 (Target_powerpc::do_make_elf_object): New function.
4510 (class Output_data_got_powerpc): New.
4511 (class Output_data_glink): New.
4512 (class Powerpc_scan_relocatable_reloc): New.
4513 Many more changes througout file.
4514
3c892704
NC
45152012-08-09 Nick Clifton <nickc@redhat.com>
4516
4517 * po/vi.po: Updated Vietnamese translation.
4518
82435b3b
ILT
45192012-08-07 Ian Lance Taylor <iant@google.com>
4520
4521 * layout.cc (Layout::add_target_dynamic_tags): If
4522 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4523 plt_rel.
4524
a6dc81d2
NC
45252012-07-30 Nick Clifton <nickc@redhat.com>
4526
4527 * po/gold.pot: Updated template.
4528 * po/es.po: Updated Spanish translation.
4529
f1415016
CC
45302012-07-18 Cary Coutant <ccoutant@google.com>
4531
4532 PR gold/14344
4533 * configure.ac: Add check for -gpubnames support.
4534 * configure: Regenerate.
4535 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4536 support; force -gno-pubnames.
4537 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4538 support.
4539 (gdb_index_test_4): New test.
4540 * testsuite/Makefile.in: Regenerate.
4541 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4542 * testsuite/gdb_index_test_2.sh: Likewise.
4543 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4544 * testsuite/gdb_index_test_4.sh: New script.
4545 * testsuite/gdb_index_test_comm.sh: New script with common code;
4546 don't look for space after colon.
4547
b7fd7c37
ST
45482012-07-16 Sriraman Tallam <tmsriram@google.com>
4549
4550 * gold.cc (queue_middle_tasks): Update function order only after
4551 deferred objects due to plugins are processed.
4552
1f3212db
ILT
45532012-07-11 Ian Lance Taylor <iant@google.com>
4554
4555 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4556 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4557 (Target_arm::scan_reloc_for_stub): Likewise.
4558 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4559 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4560 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4561 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4562 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4563
81c82a68
ILT
45642012-07-10 Dodji Seketeli <dodji@redhat.com>
4565 Ian Lance Taylor <iant@google.com>
4566
4567 PR gold/14309
4568 * configure.ac: Test whether std::tr1::hash<off_t> works.
4569 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4570 needed.
4571 * output.h (class Output_fill): Add virtual destructor.
4572 * configure, config.in: Rebuild.
4573
eabc84f4
RM
45742012-06-22 Roland McGrath <mcgrathr@google.com>
4575
4576 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4577
370e30b6
RÁE
45782012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4579
4580 * plugin.cc (Plugin::load): Handle position independent executables.
4581
fb1b895d
CC
45822012-06-06 Cary Coutant <ccoutant@google.com>
4583
4584 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4585 add .debug_macro.
4586 (lines_only_debug_sections): Likewise.
4587 (gdb_fast_lookup_sections): New static array.
4588 (is_gdb_debug_section): Rename formal parameter.
4589 (is_lines_only_debug_section): Likewise.
4590 (is_gdb_fast_lookup_section): New function.
4591 (Layout::include_section): Check for ".zdebug_" prefix; pass
4592 section name suffix to is_gdb_debug_section, et al.; check for
4593 fast-lookup sections when building .gdb_index.
4594 * options.h (--strip-debug-gdb): Update GDB version number.
4595
7c0640fa
CC
45962012-06-06 Cary Coutant <ccoutant@google.com>
4597
4598 * configure.ac: Add check for fallocate.
4599 * configure: Regenerate.
4600 * config.in: Regenerate.
4601
4602 * options.h (class General_options): Add --mmap-output-file and
4603 --posix-fallocate options.
4604 * output.cc: (posix_fallocate): Remove; replace with...
4605 (gold_fallocate): New function.
4606 (Output_file::map_no_anonymous): Call gold_fallocate.
4607 (Output_file::map): Check --mmap-output-file option.
4608
2a49eb69
DK
46092012-06-05 Jing Yu <jingyu@google.com>
4610
4611 * gold.h (textdomain): Add do {} to empty while(0).
4612 (bindtextdomain): Likewise.
4613
fad072ac
CC
46142012-06-04 Cary Coutant <ccoutant@google.com>
4615
4616 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4617 has_dynsym_index.
4618
8cc69fb6
ST
46192012-05-25 Sriraman Tallam <tmsriram@google.com>
4620
4621 * symtab.cc (Symbol_table::define_special_symbol):
4622 Initialize *poldsym to prevent uninitialized variable errors.
4623
1be75daa
CC
46242012-05-23 Cary Coutant <ccoutant@google.com>
4625
4626 * layout.cc (Layout::section_name_mapping): Add rules to handle
4627 exact match on .data.rel.ro.local or .data.rel.ro.
4628 (Layout::output_section_name): Check for exact matches.
4629
9b689de0
CC
46302012-05-23 Cary Coutant <ccoutant@google.com>
4631
4632 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4633 more carefully.
4634
b24fdbf5
CC
46352012-05-22 Cary Coutant <ccoutant@google.com>
4636
4637 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4638 object before exporting symbol.
4639
e550e1a2
L
46402012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4641
4642 * testsuite/tls_test.cc: Include "config.h" first.
4643 * testsuite/tls_test_c.c: Likewise.
4644
df7b86aa
NC
46452012-05-17 Daniel Richard G. <skunk@iskunk.org>
4646 Nick Clifton <nickc@redhat.com>
4647
4648 PR 14072
4649 * configure.in: Add check that sysdep.h has been included before
4650 any system header files.
4651 * configure: Regenerate.
4652 * config.in: Regenerate.
4653
1007b503
CC
46542012-05-14 Cary Coutant <ccoutant@google.com>
4655
4656 * layout.cc (Layout::make_output_section): Mark .tdata section
4657 as RELRO.
4658 * testsuite/relro_test.cc: Add a TLS variable.
4659
fd885f3a
L
46602012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4661
4662 PR gold/14091
4663 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4664 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4665 R_X86_64_64.
4666
80f5885c
CC
46672012-05-08 Cary Coutant <ccoutant@google.com>
4668
4669 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4670 (lines_only_debug_sections): Likewise.
4671
2e702c99
RM
46722012-05-02 Roland McGrath <mcgrathr@google.com>
4673
4674 * nacl.cc: New file.
4675 * nacl.h: New file.
4676 * Makefile.am (CCFILES, HFILES): Add them.
4677 * Makefile.in: Regenerate.
4678 * i386.cc (Output_data_plt_i386_nacl): New class.
4679 (Output_data_plt_i386_nacl_exec): New class.
4680 (Output_data_plt_i386_nacl_dyn): New class.
4681 (Target_i386_nacl): New class.
4682 (Target_selector_i386_nacl): New class.
4683 (target_selector_i386): Use it instead of Target_selector_i386.
4684 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4685 (Target_x86_64_nacl): New class.
4686 (Target_selector_x86_64_nacl): New class.
4687 (target_selector_x86_64, target_selector_x32): Use it instead of
4688 Target_selector_x86_64.
4689 * arm.cc (Output_data_plt_arm_nacl): New class.
4690 (Target_arm_nacl): New class.
4691 (Target_selector_arm_nacl): New class.
4692 (target_selector_arm, target_selector_armbe): Use it instead of
4693 Target_selector_arm.
4694
4695 * target-select.cc (select_target): Take new Input_file* and off_t
4696 arguments, pass them on to recognize method of selector.
4697 * object.cc (make_elf_sized_object): Update caller.
4698 * parameters.cc (parameters_force_valid_target): Likewise.
4699 * incremental.cc (make_sized_incremental_binary): Likewise.
4700 * target-select.h: Update decl.
4701 (Target_selector::recognize): Take new Input_file* argument,
4702 pass it on to do_recognize.
4703 (Target_selector::do_recognize): Take new Input_file* argument.
4704 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4705 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4706 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4707 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4708
4709 * target.h (Target::Target_info): New members isolate_execinstr
4710 and rosegment_gap.
4711 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4712 * arm.cc (Target_arm::arm_info): Update initializer.
4713 * i386.cc (Target_i386::i386_info): Likewise.
4714 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4715 * sparc.cc (Target_sparc::sparc_info): Likewise.
4716 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4717 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4718 * layout.cc (Layout::attach_allocated_section_to_segment):
4719 Take new const Target* argument. If target->isolate_execinstr(), act
4720 like --rosegment.
4721 (Layout::find_first_load_seg): Take new const Target* argument;
4722 if target->isolate_execinstr(), reject PF_X segments.
4723 (Layout::relaxation_loop_body): Update caller.
4724 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4725 reset file offset to zero when we hit LOAD_SEG, and then do a second
4726 loop over the segments before LOAD_SEG to reassign offsets after
4727 addresses have been determined. Handle target->rosegment_gap().
4728 (Layout::attach_section_to_segment): Take new const Target* argument;
4729 pass it to attach_allocated_section_to_segment.
4730 (Layout::make_output_section): Update caller.
4731 (Layout::attach_sections_to_segments): Take new const Target* argument;
4732 pass it to attach_section_to_segment.
4733 * gold.cc (queue_middle_tasks): Update caller.
4734 * layout.h (Layout): Update method decls with new arguments.
4735
4736 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4737 Target_info pointer to use.
4738 (Target_arm::do_make_data_plt): New virtual method.
4739 (Target_arm::make_data_plt): New method that calls it.
4740 (Target_arm::make_plt_entry): Use it.
4741 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4742 for the section alignment.
4743 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4744 method.
4745 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4746 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4747 method.
4748 (Output_data_plt_arm::get_plt_entry_size): Call it.
4749 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4750 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4751 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4752 method.
4753 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4754 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4755 method instead of sizeof(plt_entry).
4756 (Output_data_plt_arm::add_entry): Likewise.
4757 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4758 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4759 than static method.
4760 (Target_arm::plt_entry_size): Likewise.
4761 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4762 Move to ...
4763 (Output_data_plt_arm_standard): ... here, new class.
4764 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4765 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4766 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4767
4768 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4769 Take additional argument for the PLT entry size.
4770 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4771 Use get_plt_entry_size method rather than plt_entry_size variable.
4772 (Output_data_plt_x86_64::reserve_slot): Likewise.
4773 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4774 (Output_data_plt_x86_64::add_entry): Likewise.
4775 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4776 (Output_data_plt_x86_64::address_for_global): Likewise.
4777 (Output_data_plt_x86_64::address_for_local): Likewise.
4778 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4779 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4780 Make method non-static.
4781 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4782 method.
4783 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4784 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4785 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4786 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4787 virtual method.
4788 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4789 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4790 virtual method.
4791 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4792 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4793 virtual method.
4794 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4795 (Output_data_plt_x86_64::plt_entry_size)
4796 (Output_data_plt_x86_64::first_plt_entry)
4797 (Output_data_plt_x86_64::plt_entry)
4798 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4799 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4800 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4801 (Output_data_plt_x86_64_standard): ... here, new class.
4802 (Target_x86_64::Target_x86_64): Take optional argument for the
4803 Target_info pointer to use.
4804 (Target_x86_64::do_make_data_plt): New virtual method.
4805 (Target_x86_64::make_data_plt): New method to call it.
4806 (Target_x86_64::init_got_plt_for_update): Use that.
4807 Call this->plt_->add_eh_frame method here.
4808 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4809 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4810 rather than static method.
4811 (Target_x86_64::plt_entry_size): Likewise.
4812 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4813 rather than plt_entry_size variable. Move guts of PLT filling to...
4814 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4815 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4816 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4817
4818 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4819 additional argument for the section alignment.
4820 Don't do add_eh_frame_for_plt here.
4821 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4822 non-static. Use get_plt_entry_size method rather than plt_entry_size
4823 variable.
4824 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4825 method.
4826 (Output_data_plt_i386::get_plt_entry_size): Call it.
4827 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4828 (Output_data_plt_i386::add_eh_frame): New method to call it.
4829 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4830 method.
4831 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4832 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4833 method.
4834 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4835 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4836 method instead of plt_entry_size.
4837 (Output_data_plt_i386::plt_entry_size)
4838 (Output_data_plt_i386::plt_eh_frame_fde_size)
4839 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4840 (Output_data_plt_i386_standard): ... here, new class.
4841 (Output_data_plt_i386_exec): New class.
4842 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4843 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4844 (Output_data_plt_i386::exec_plt_entry): Move to ...
4845 (Output_data_plt_i386_exec::plt_entry): ... here.
4846 (Output_data_plt_i386_dyn): New class.
4847 (Output_data_plt_i386::first_plt_entry): Move to ...
4848 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4849 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4850 (Output_data_plt_i386_dyn::plt_entry): ... here.
4851 (Target_i386::Target_i386): Take optional argument for the Target_info
4852 pointer to use.
4853 (Target_i386::do_make_data_plt): New virtual method.
4854 (Target_i386::make_data_plt): New method to call it.
4855 (Target_i386::make_plt_section): Use that.
4856 Call this->plt_->add_eh_frame method here.
4857 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4858 rather than plt_entry_size variable.
4859 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4860 (Output_data_plt_i386::address_for_local): Likewise.
4861 (Output_data_plt_i386::do_write): Likewise.
4862 Move guts of PLT filling to...
4863 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4864 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4865 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4866 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4867
b9b9f2ee
CC
48682012-05-01 Cary Coutant <ccoutant@google.com>
4869
4870 * dwarf_reader.cc (Dwarf_die::read_attributes)
4871 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4872 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4873 * reduced_debug_output.cc
4874 (Output_reduced_debug_info_section::get_die_end): Remove
4875 DW_FORM_GNU_ref_index. Add default case.
4876
57923f48
MW
48772012-04-26 Mark Wielaard <mjw@redhat.com>
4878
4879 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4880 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4881 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4882 DW_AT_high_pc as offset from DW_AT_low_pc.
4883
4884 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4885 * testsuite/Makefile.in: Regenerate.
4886 * testsuite/gdb_index_test_3.c: New test source file.
4887 * testsuite/gdb_index_test_3.sh: New test source file.
4888
2c54b4f4
ILT
48892012-04-25 Ian Lance Taylor <iant@google.com>
4890
4891 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4892 pointer.
4893 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4894 as a class, not a struct.
4895 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4896 (Target_arm::apply_cortex_a8_workaround): Likewise.
4897 * gc.h: Declare Reloc_types as a struct, not a class.
4898 * object.h: Declare Symbols_data as a struct.
4899 * reloc.h: Declare Read_relocs_data as a struct.
4900 * target.h: Declare Relocate_info as a struct.
4901
a5a5f7a3
DM
49022012-04-24 David S. Miller <davem@davemloft.net>
4903
4904 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4905 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4906 and R_SPARC_WPLT30.
4907
f038d496
CC
49082012-04-24 Cary Coutant <ccoutant@google.com>
4909
4910 * incremental-dump.cc (find_input_containing_global): Replace
4911 magic number with symbolic constant.
4912 (dump_incremental_inputs): Update version number.
4913 * incremental.cc (Output_section_incremental_inputs): Update version
4914 number; import symbolic constants from Incremental_inputs_reader.
4915 (Incremental_inputs::create_data_sections): Align relocations
4916 section correctly for 64-bit targets.
4917 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4918 constants; add padding.
4919 (Output_section_incremental_inputs::write_header): Add assert for
4920 header_size.
4921 (Output_section_incremental_inputs::write_input_files): Add assert
4922 for input_entry_size.
4923 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4924 add assert for object_info_size, input_section_entry_size,
4925 global_sym_entry_size.
4926 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4927 for data structure sizes; use them.
4928 (Incremental_input_entry_reader): Import symbolic constants from
4929 Incremental_inputs_reader; use them.
4930
a4d85145
DM
49312012-04-23 David S. Miller <davem@davemloft.net>
4932
4933 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4934 and elf_flags_set_.
4935 (Target_sparc::Target_sparc): Initialize new fields.
4936 (Target_sparc::do_make_elf_object): New function.
4937 (Target_sparc::do_adjust_elf_header): New function.
4938
1d509098
CC
49392012-04-23 Cary Coutant <ccoutant@google.com>
4940
4941 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4942 CU range table of gdb index.
4943
7ebeff7f
DM
49442012-04-20 David S. Miller <davem@davemloft.net>
4945
4946 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4947 instead of false.
4948
13cf9988
DM
49492012-04-16 David S. Miller <davem@davemloft.net>
4950
2a1079e8
DM
4951 * sparc.cc (Target_sparc::got_address): New function.
4952 (Sparc_relocate_functions::gdop_hix22): New function.
4953 (Sparc_relocate_functions::gdop_lox10): New function.
4954 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4955 relocs.
4956 (Target_sparc::Scan::local): Likewise if the global symbol is not
4957 preemptible and is not IFUNC.
4958 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4959 transformations for local and non-preemptible non-IFUNC global
4960 symbols.
4961
0bc964fc
DM
4962 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4963 writing out 64-bit part of ranges.
4964
661d7a80
DM
4965 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4966 -fpic and -fpie respectively.
4967 * Makefile.in: Regenerate.
4968
8c2bf391
DM
4969 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4970 (Target_sparc::Target_sparc): Initialize new field.
4971 (Target_sparc::do_plt_section_for_global): New function.
4972 (Target_sparc::do_plt_section_for_local): New function.
4973 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4974 (Target_sparc::make_plt_section): New function, broken out of
4975 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4976 (Target_sparc::make_plt_entry): Call make_plt_section.
4977 (Target_sparc::make_local_ifunc_plt_entry): New function.
4978 (Target_sparc::rela_ifunc_section): New function.
4979 (Target_sparc::plt_section): Remove const.
4980 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4981 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4982 and ifunc_count_ fields.
4983 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4984 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4985 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4986 (Output_data_plt_sparc::rela_ifunc): New function.
4987 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4988 (Output_data_plt_sparc::has_ifunc_section): New function.
4989 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4990 (Output_data_plt_sparc::address_for_global): New function.
4991 (Output_data_plt_sparc::address_for_local): New function.
4992 (Output_data_plt_sparc::plt_index_to_offset): New function.
4993 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4994 and entry_count.
4995 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4996 entry_count.
4997 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4998 R_SPARC_JMP_IREL to switch.
4999 (Target_sparc::Scan::check_non_pic): Likewise.
5000 (Target_sparc::Scan::local): Handle IFUNC symbols.
5001 (Target_sparc::Scan::local): Likewise.
5002 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5003 and plt_address_for_local.
5004 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5005 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5006
13cf9988
DM
5007 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5008 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5009 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5010 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5011 global relocs too.
5012 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5013 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5014 calls.
5015 * sparc.cc (Target_sparc::Scan::global): Likewise.
5016 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5017
31821be0
CC
50182012-04-16 Cary Coutant <ccoutant@google.com>
5019
5020 * archive.cc (Library_base::should_include_member): Check for
5021 --export-dynamic-symbol.
5022 * options.h (class General_options): Add --export-dynamic-symbol.
5023 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5024 --export-dynamic-symbol.
5025 (Symbol_table::gc_mark_undef_symbols): Likewise.
5026 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5027
2615994e
DM
50282012-04-12 David S. Miller <davem@davemloft.net>
5029
5030 * sparc.cc (Reloc::wdisp10): New relocation method.
5031 (Reloc::h34): Likewise.
5032 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5033 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5034 R_SPARC_WDISP10.
5035 (Target_sparc::Scan::local): Likewise.
5036 (Target_sparc::Scan::global): Likewise.
5037 (Target_sparc::Relocate::relocate): Likewise.
5038
6782735d
CC
50392012-04-09 Cary Coutant <ccoutant@google.com>
5040
5041 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5042 low_pc == 0.
5043
8c7a0b00
ILT
50442012-04-06 Ian Lance Taylor <iant@google.com>
5045
5046 * timer.cc: #include <unistd.h>.
5047
58797674
RM
50482012-04-06 Roland McGrath <mcgrathr@google.com>
5049
5050 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5051 * config.in: Regenerate.
5052 * configure: Regenerate.
5053
44350750
NC
50542012-04-05 Nick Clifton <nickc@redhat.com>
5055
5056 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5057 (AM_LC_MESSAGES): Add.
5058 * aclocal.m4: Regenerate.
5059 * config.in: Regenerate.
5060 * configure: Regenerate.
5061
c1027032
CC
50622012-03-21 Cary Coutant <ccoutant@google.com>
5063
5064 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5065 * Makefile.in: Regenerate.
5066 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5067 (Sized_elf_reloc_mapper::symbol_section): New function.
5068 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5069 (make_elf_reloc_mapper): New function.
5070 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5071 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5072 (Dwarf_abbrev_table::do_get_abbrev): New function.
5073 (Dwarf_ranges_table::read_ranges_table): New function.
5074 (Dwarf_ranges_table::read_range_list): New function.
5075 (Dwarf_pubnames_table::read_section): New function.
5076 (Dwarf_pubnames_table::read_header): New function.
5077 (Dwarf_pubnames_table::next_name): New function.
5078 (Dwarf_die::Dwarf_die): New function.
5079 (Dwarf_die::read_attributes): New function.
5080 (Dwarf_die::skip_attributes): New function.
5081 (Dwarf_die::set_name): New function.
5082 (Dwarf_die::set_linkage_name): New function.
5083 (Dwarf_die::attribute): New function.
5084 (Dwarf_die::string_attribute): New function.
5085 (Dwarf_die::int_attribute): New function.
5086 (Dwarf_die::uint_attribute): New function.
5087 (Dwarf_die::ref_attribute): New function.
5088 (Dwarf_die::child_offset): New function.
5089 (Dwarf_die::sibling_offset): New function.
5090 (Dwarf_info_reader::check_buffer): New function.
5091 (Dwarf_info_reader::parse): New function.
5092 (Dwarf_info_reader::do_parse): New function.
5093 (Dwarf_info_reader::do_read_string_table): New function.
5094 (Dwarf_info_reader::lookup_reloc): New function.
5095 (Dwarf_info_reader::get_string): New function.
5096 (Dwarf_info_reader::visit_compilation_unit): New function.
5097 (Dwarf_info_reader::visit_type_unit): New function.
5098 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5099 Sized_elf_reloc_mapper.
5100 (Sized_dwarf_line_info::symbol_section): Remove function.
5101 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5102 (Sized_dwarf_line_info::read_line_mappings): Remove object
5103 parameter, adjust callers.
5104 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5105 * dwarf_reader.h: Include <sys/types.h>.
5106 (class Track_relocs): Remove forward declaration.
5107 (class Elf_reloc_mapper): New class.
5108 (class Sized_elf_reloc_mapper): New class.
5109 (class Dwarf_abbrev_table): New class.
5110 (class Dwarf_range_list): New class.
5111 (class Dwarf_ranges_table): New class.
5112 (class Dwarf_pubnames_table): New class.
5113 (class Dwarf_die): New class.
5114 (class Dwarf_info_reader): New class.
5115 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5116 (Sized_dwarf_line_info::symbol_section): Remove member function.
5117 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5118 base class.
5119 * gdb-index.cc: New source file.
5120 * gdb-index.h: New source file.
5121 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5122 and .debug_types sections, call Layout::add_to_gdb_index.
5123 (Sized_relobj_incr::do_section_name): Implement.
5124 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5125 return type; Implement.
5126 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5127 return type.
5128 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5129 parameter list and return type.
5130 (Sized_incr_dynobj::do_section_contents): Likewise.
5131 * layout.cc: Include gdb-index.h.
5132 (Layout::Layout): Initialize gdb_index_data_.
5133 (Layout::init_fixed_output_section): Check for .gdb_index section.
5134 (Layout::add_to_gdb_index): New function. Instantiate.
5135 * layout.h: Add forward declaration for class Gdb_index.
5136 (Layout::add_to_gdb_index): New member function.
5137 (Layout::gdb_index_data_): New data member.
5138 * main.cc: Include gdb-index.h.
5139 (main): Print statistics for gdb index.
5140 * object.cc (Object::section_contents): Move code into
5141 do_section_contents.
5142 (need_decompressed_section): Check for sections needed when building
5143 gdb index.
5144 (build_compressed_section_map): Likewise.
5145 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5146 gdb index.
5147 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5148 sections; call Layout::add_to_gdb_index.
5149 (Sized_relobj_file::do_decompressed_section_contents): Call
5150 do_section_contents directly.
5151 * object.h (Object::do_section_contents): Adjust parameter list and
5152 return type.
5153 (Object::do_decompressed_section_contents): Call do_section_contents
5154 directly.
5155 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5156 return type.
5157 * options.h (class General_options): Add --gdb-index option.
5158 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5159 list and return type.
5160 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5161 * reloc.h (Track_relocs::checkpoint): New function.
5162 (Track_relocs::reset): New function.
5163
5164 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5165 New test cases.
5166 * testsuite/Makefile.in: Regenerate.
5167 * testsuite/gdb_index_test.cc: New test source file.
5168 * testsuite/gdb_index_test_1.sh: New test source file.
5169 * testsuite/gdb_index_test_2.sh: New test source file.
5170
647f1574
DK
51712012-03-19 Doug Kwan <dougkwan@google.com>
5172
5173 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5174 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5175 __exidx_start and __exidx_end. Make symbol table parameter
5176 anonymous as it is not used.
5177 * gold.cc (queue_middle_tasks): Call target hook to define any
5178 target-specific symbols.
5179 * target.h (Target::define_standard_symbols): New method.
5180 (Target::do_define_standard_symbols): Same.
5181 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5182 * testsuite/Makefile.in: Regenerate.
5183 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5184 and __exidx_end.
5185 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5186 relocations are generated for __exidx_start and __exidx_end.
5187
7c6109da
DK
51882012-03-16 Doug Kwan <dougkwan@google.com>
5189
5190 * testsuite/Makefile.am: Disable test initpri3b.
5191 * testsuite/Makefile.in: Regenerate.
5192
7b8957f8
DK
51932012-03-15 Doug Kwan <dougkwan@google.com>
5194
5195 * arm.cc (Target_arm::got_section): Make .got section read-only
5196 if -z now is given.
5197
14dc9ef7
ILT
51982012-03-15 Ian Lance Taylor <iant@google.com>
5199
5200 PR gold/13850
5201 * layout.cc (Layout::make_output_section): Correctly mark
5202 SHT_INIT_ARRAY, et. al., as relro.
5203
fa40b62a
DK
52042012-03-14 Doug Kwan <dougkwan@google.com>
5205
5206 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5207 dynamic relocations for protected symbols in shared objects.
5208
fd325007
ILT
52092012-03-13 Ian Lance Taylor <iant@google.com>
5210
5211 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5212 keep the larger alignment.
5213
e8dd54e1
CC
52142012-03-12 Cary Coutant <ccoutant@google.com>
5215
5216 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5217 handling of DW_LNE_define_file.
5218
feb5f3b0
CC
52192012-03-12 Cary Coutant <ccoutant@google.com>
5220
5221 * reduced_debug_output.cc
5222 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5223 codes to switch.
5224
a1fb4256
CC
52252012-02-29 Cary Coutant <ccoutant@google.com>
5226
5227 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5228
5dd8762a
CC
52292012-02-29 Cary Coutant <ccoutant@google.com>
5230
5231 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5232 Call Object::decompressed_section_contents.
5233 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5234 New dtor.
5235 (Sized_dwarf_line_info::buffer_start_): New data member.
5236 * merge.cc (Output_merge_data::do_add_input_section): Call
5237 Object::decompressed_section_contents.
5238 (Output_merge_string::do_add_input_section): Likewise.
5239 * object.cc (need_decompressed_section): New function.
5240 (build_compressed_section_map): Decompress sections needed later.
5241 (Sized_relobj_file::do_decompressed_section_contents): New function.
5242 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5243 * object.h (Object::decompressed_section_contents): New function.
5244 (Object::discard_decompressed_sections): New function.
5245 (Object::do_decompressed_section_contents): New function.
5246 (Object::do_discard_decompressed_sections): New function.
5247 (Compressed_section_info): New type.
5248 (Compressed_section_map): Include decompressed section contents.
5249 (Sized_relobj_file::do_decompressed_section_contents): New function.
5250 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5251
7b5de7ee
CC
52522012-02-16 Cary Coutant <ccoutant@google.com>
5253
5254 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5255 * testsuite/Makefile.in: Regenerate.
5256
f9fa4a63
CC
52572012-02-14 Cary Coutant <ccoutant@google.com>
5258
5259 * options.cc (General_options::finalize): Disallow -pie and -static.
5260
2c175ebc
DK
52612012-02-03 Doug Kwan <dougkwan@google.com>
5262
5263 * arm.cc (Arm_relocate_functions::abs8,
5264 Arm_relocate_functions::abs16): Use
5265 Bits::has_signed_unsigned_overflow32.
5266 (Arm_relocate_functions::thm_abs8): Correct range of
5267 overflow check.
5268 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5269 in assertions.
5270
90cff06f
DK
52712012-02-02 Doug Kwan <dougkwan@google.com>
5272
5273 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5274 position independent outputs, not just shared objects.
5275
63887f3d
L
52762012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5277
5278 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5279 * configure: Regenerated.
5280
bef2b434
ILT
52812012-01-27 Ian Lance Taylor <iant@google.com>
5282
5283 * reloc.h (Bits): New class with static functions, copied from
5284 namespace utils in arm.cc.
5285 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5286 instead.
5287
c335b55d
L
52882012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5289
5290 * incremental.cc (write_info_blocks): Correct relocation offset.
5291
41194d9f
L
52922012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5293
5294 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5295 (Relocate::tls_gd_to_le): Likewise.
5296
1bae613c
L
52972012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5298
5299 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5300
24482ca0
L
53012012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5302
5303 * configure.ac: Check if -mcmodel=medium works.
5304 * configure: Regenerated.
5305
c2c7840a
CC
53062012-01-24 Cary Coutant <ccoutant@google.com>
5307
5308 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5309 definition and ...
5310 (read_unsigned_LEB_128_x): ... this new function.
5311 (read_signed_LEB_128): Replaced with inline definition and ...
5312 (read_signed_LEB_128_x): ... this new function.
5313 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5314 (read_unsigned_LEB_128): Add inline definition.
5315 (read_signed_LEB_128_x): New function.
5316 (read_signed_LEB_128): Add inline definition.
5317 * testsuite/Makefile.am (leb128_unittest): New unit test.
5318 * testsuite/Makefile.in: Regenerate.
5319 * testsuite/leb128_unittest.cc: New unit test.
5320
833de760 53212012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5322
5323 PR gold/13617
5324 * i386.cc (Target_i386::do_code_fill): When using a jmp
5325 instruction, pad with nop instructions.
5326 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5327
618d6666
L
53282012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5329
5330 * x86_64.cc (gc_process_relocs): Add typename on types used in
5331 template.
5332 (scan_relocs): Likewise.
5333 (relocate_section): Likewise.
5334 (apply_relocation): Likewise.
5335
3660ff06
L
53362012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5337
5338 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5339 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5340 under x32.
5341
fc51264f
L
53422012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5343
5344 * x86_64.cc: Initial support for x32.
5345
dd74ae06
CC
53462012-01-03 Cary Coutant <ccoutant@google.com>
5347
5348 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5349 Use abstract base class for GOT.
5350 * gold/output.h (class Output_data_got_base): New abstract base class.
5351 (class Output_data_got): Derive from new base class, adjust ctors.
5352 (Output_data_got::reserve_slot): Make virtual; rename to
5353 do_reserve_slot; Adjust callers.
5354 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5355 pointer to abstract base class.
5356 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5357
83896202
ILT
53582011-12-18 Ian Lance Taylor <iant@google.com>
5359
5360 * object.h (Relobj::local_symbol_value): New function.
5361 (Relobj::local_plt_offset): New function.
5362 (Relobj::local_has_got_offset): New function.
5363 (Relobj::local_got_offset): New function.
5364 (Relobj::set_local_got_offset): New function.
5365 (Relobj::do_local_symbol_value): New pure virtual function.
5366 (Relobj::do_local_plt_offset): Likewise.
5367 (Relobj::do_local_has_got_offset): Likewise.
5368 (Relobj::do_local_got_offset): Likewise.
5369 (Relobj::do_set_local_got_offset): Likewise.
5370 (Sized_relobj::do_local_has_got_offset): Rename from
5371 local_has_got_offset.
5372 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5373 (Sized_relobj::do_set_local_got_offset): Rename from
5374 set_local_got_offset.
5375 (Sized_relobj_file::do_local_plt_offset): Rename from
5376 local_plt_offset.
5377 (Sized_relobj_file::do_local_symbol_value): New function.
5378 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5379 local_plt_offset.
5380 * output.cc (Output_data_got::Got_entry::write): Change object to
5381 Relobj. Use local_symbol_value.
5382 (Output_data_got::add_global_with_rel): Change rel_dyn to
5383 Output_data_reloc_generic*. Use add_global_generic.
5384 (Output_data_got::add_global_with_rela): Remove. Change all
5385 callers to use add_global_with_rel.
5386 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5387 Output_data_reloc_generic*. Use add_global_generic.
5388 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5389 callers to use add_global_pair_with_rel.
5390 (Output_data_got::add_local): Change object to Relobj*.
5391 (Output_data_got::add_local_plt): Likewise.
5392 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5393 change rel_dyn to Output_data_reloc_generic*. Use
5394 add_local_generic.
5395 (Output_data_got::add_local_with_rela): Remove. Change all
5396 callers to use all_local_with_rel.
5397 (Output_data_got::add_local_pair_with_rel): Change object to
5398 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5399 add_output_section_generic.
5400 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5401 callers to use add_local_pair_with_rel.
5402 (Output_data_got::reserve_local): Change object to Relobj*.
5403 * output.h: (class Output_data_reloc_generic): Add pure virtual
5404 declarations for add_global_generic, add_local_generic,
5405 add_output_section_generic.
5406 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5407 functions for Output_data_reloc_generic. Update declarations for
5408 changes listed in output.cc.
5409 (class Output_data_got): Change template parameter to got_size.
5410 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5411 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5412 function.
5413 (Sized_relobj_incr::do_local_plt_offset): New function.
5414 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5415 add_global_generic.
5416
76677ad0
CC
54172011-12-17 Cary Coutant <ccoutant@google.com>
5418
5419 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5420 * resolve.cc (Symbol_table::resolve): Likewise.
5421 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5422 arrays.
5423 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5424
8b8dd8d5
ILT
54252011-12-16 Ian Lance Taylor <iant@google.com>
5426
5427 * output.h (Output_data_reloc_generic::add): Only call
5428 add_dynamic_reloc if this is a dynamic reloc section.
5429
d55525b9
L
54302011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5431
5432 PR gold/13505
5433 * target-reloc.h (apply_relocation): Replace <64, false> with
5434 <size, big_endian>.
5435
ff81c7c1
NC
54362011-11-25 Nick Clifton <nickc@redhat.com>
5437
5438 * po/it.po: New Italian translation.
5439
628f39be
SA
54402011-11-17 Sterling Augustine <saugustine@google.com>
5441
5442 * script.cc (script_include_directive): Implement.
5443 (read_script_file): New local variables name and search_path. Update
5444 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5445 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5446 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5447
98ef3ea4
SA
54482011-11-11 Sterling Augustine <saugustine@google.com>
5449
5450 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5451 (file_or_sections_cmd): Likewise.
5452
f4a8b6d7
DK
54532011-11-11 Doug Kwan <dougkwan@google.com>
5454
5455 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5456 if --just-symbols is given.
5457
29ab395d
DK
54582011-11-10 Doug Kwan <dougkwan@google.com>
5459
5460 PR gold/13362
5461 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5462 when processing data relocs.
5463 * reloc.h (Relocate_functions::rel_unaligned): New method.
5464 (Relocate_functions::pcrel_unaligned): Ditto.
5465 (Relocate_functions::rel32_unaligned): Ditto.
5466 (Relocate_functions::pcrel32_unaligned): Ditto.
5467
2c339f71
DK
54682011-11-09 Doug Kwan <dougkwan@google.com>
5469
5470 PR gold/13362
5471 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5472 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5473 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5474 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5475 (Relocate_functions::rel_unaligned): New.
5476 (Relocate_functions::rel32_unaligned): New.
5477 * target-reloc.h (relocate_for_relocatable): Add code to handle
5478 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5479 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5480 arm_unaligned_reloc_r): New targets.
5481 * testsuite/Makefile.in: Regenerate.
5482 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5483 linking.
5484
3f3cddf1
ILT
54852011-11-02 Ian Lance Taylor <iant@google.com>
5486
5487 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5488 NATIVE_LINKER.
5489 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5490 * options.cc (General_options::finalize): Use library search path
5491 from configure script if specified. If not native and no sysroot,
5492 only search TOOLLIBDIR.
5493 * options.h (Search_directory::Search_directory): Change name to
5494 const std::string&.
5495 (General_options::add_to_library_path_with_sysroot): Change arg to
5496 const std::string&.
5497 * configure, Makefile.in, config.in: Rebuild.
5498
a8e2273b
ILT
54992011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5500
5501 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5502 we are working around the ARM1176 Erratum.
5503 * options.h (General_options::fix_arm1176): Add option.
5504 * testsuite/Makefile.am: Add testcases, and keep current ones
5505 working.
5506 * testsuite/Makefile.in: Regenerate.
5507 * testsuite/arm_fix_1176.s: New file.
5508 * testsuite/arm_fix_1176.sh: Likewise.
5509
cd6eab1c
ILT
55102011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5511
5512 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5513 may_use_blx_.
5514 (Target_arm::may_use_blx): Remove method.
5515 (Target_arm::set_may_use_blx): Likewise.
5516 (Target_arm::may_use_v4t_interworking): New method.
5517 (Target_arm::may_use_v5t_interworking): Likewise.
5518 (Target_arm::may_use_blx_): Remove member variable.
5519 (Arm_relocate_functions::arm_branch_common): Check for v5T
5520 interworking.
5521 (Arm_relocate_functions::thumb_branch_common): Likewise.
5522 (Reloc_stub::stub_type_for_reloc): Likewise.
5523 (Target_arm::do_finalize_sections): Correct interworking checks.
5524 * testsuite/Makefile.am: Add new tests.
5525 * testsuite/Makefile.in: Regenerate.
5526 * testsuite/arm_farcall_arm_arm.s: New test.
5527 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5528 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5529 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5530 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5531 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5532 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5533 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5534
286adcf4
CC
55352011-10-31 Cary Coutant <ccoutant@google.com>
5536
5537 PR gold/13023
5538 * expression.cc (Expression::eval_with_dot): Add
5539 is_section_dot_assignment parameter.
5540 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5541 absolute and assigning to dot within a section.
5542 * script-sections.cc
5543 (Output_section_element_assignment::set_section_addresses): Pass
5544 dot_section to set_if_absolute.
5545 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5546 as is_section_dot_assignment flag to eval_with_dot.
5547 (Output_section_element_dot_assignment::set_section_addresses):
5548 Likewise.
5549 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5550 parameter. Also set value if relative to dot_section; set the
5551 symbol's output_section.
5552 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5553 parameter. Adjust all callers.
5554 (Expression::eval_maybe_dot): Likewise.
5555 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5556 Adjust all callers.
5557 * testsuite/script_test_2.t: Test assignment of an absolute value
5558 to dot within an output section element.
5559
9634ed06
CC
55602011-10-31 Cary Coutant <ccoutant@google.com>
5561
5562 * options.h (class General_options): Add --[no-]gnu-unique options.
5563 * symtab.cc (Symbol_table::sized_write_globals): Convert
5564 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5565
de4101c7
CC
55662011-10-31 Cary Coutant <ccoutant@google.com>
5567
5568 PR gold/13359
5569 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5570 unnecessary assertion.
5571 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5572
7257cc92
ST
55732011-10-31 Sriraman Tallam <tmsriram@google.com>
5574
5575 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5576 gc_mark_symbol.
5577 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5578 gc_mark_symbol.
5579 Change to just keep the section associated with symbol.
5580 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5581 they are externally visible and --export-dynamic is turned on.
5582 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5583
bfc34b3f
ILT
55842011-10-19 Ian Lance Taylor <iant@google.com>
5585
5586 PR gold/13163
5587 * script-sections.cc
5588 (Output_section_element_dot_assignment::needs_output_section): New
5589 function.
5590
ea0d8c47
ILT
55912011-10-19 Ian Lance Taylor <iant@google.com>
5592
5593 PR gold/13204
5594 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5595 --section-start option was seen.
5596 * options.h (General_options::any_section_start): New function.
5597
abd242a9
DM
55982011-10-18 David S. Miller <davem@davemloft.net>
5599
5600 PR binutils/13301
5601 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5602 member to track relocation locations that have moved during TLS
5603 reloc optimizations.
5604 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5605 (Target_sparc::Relocate::relocate): Adjust view down by 4
5606 bytes if it matches reloc_adjust_addr_.
5607 (Target_sparc::Relocate::relocate_tls): Always move the
5608 __tls_get_addr call delay slot instruction forward 4 bytes when
5609 performing relaxation.
5610
bab9090f
CC
56112011-10-18 Cary Coutant <ccoutant@google.com>
5612
5613 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5614 (Output_file::map_no_anonymous): Check for non-zero
5615 return code from posix_fallocate.
5616
f7c5b166
CC
56172011-10-17 Cary Coutant <ccoutant@google.com>
5618
5619 PR gold/13245
5620 * plugin.cc (is_visible_from_outside): Check for symbols
5621 referenced from dynamic objects.
5622 * resolve.cc (Symbol_table::resolve): Don't count references
5623 from dynamic objects as references from real ELF files.
5624 * testsuite/plugin_test_2.sh: Adjust expected result.
5625
b490c0bb
CC
56262011-10-17 Cary Coutant <ccoutant@google.com>
5627
5628 * gold.cc: Include timer.h.
5629 (queue_middle_tasks): Stamp time.
5630 (queue_final_tasks): Likewise.
5631 * main.cc (main): Store timer in parameters. Print timers
5632 for each pass.
5633 * parameters.cc (Parameters::Parameters): Initialize timer_.
5634 (Parameters::set_timer): New function.
5635 (set_parameters_timer): New function.
5636 * parameters.h (Parameters::set_timer): New function.
5637 (Parameters::timer): New function.
5638 (Parameters::timer_): New data member.
5639 (set_parameters_timer): New function.
5640 * timer.cc (Timer::stamp): New function.
5641 (Timer::get_pass_time): New function.
5642 * timer.h (Timer::stamp): New function.
5643 (Timer::get_pass_time): New function.
5644 (Timer::pass_times_): New data member.
5645
f475cf7b
CC
56462011-10-17 Cary Coutant <ccoutant@google.com>
5647
5648 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5649 task for members of lib groups.
5650
cdd7e244
CC
56512011-10-17 Cary Coutant <ccoutant@google.com>
5652
5653 PR gold/13288
4f95c8b4 5654 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5655 (File_read::make_view): Move bounds check (replace with assert)...
5656 (File_read::find_or_make_view): ... to here.
5657
dfb45471
CC
56582011-10-12 Cary Coutant <ccoutant@google.com>
5659
4f95c8b4 5660 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5661 ::read returns less than requested size.
5662
53bbcc1b
CC
56632011-10-10 Cary Coutant <ccoutant@google.com>
5664
4f95c8b4 5665 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5666 Initialize defined_count_.
5667 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5668 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5669 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5670 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5671 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5672 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5673 member.
5674 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5675 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5676 Return zeroes instead of internal error.
5677
397b129b
CC
56782011-10-10 Cary Coutant <ccoutant@google.com>
5679
5680 PR gold/13249
4f95c8b4 5681 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5682 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5683 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5684 (Output_reloc::type_): Adjust size of bit field.
5685 (Output_reloc::use_plt_offset_): New bit field.
5686 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5687 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5688 flag. Adjust all callers.
4f95c8b4 5689 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5690 creating RELATIVE relocations.
5691
d5698657
NC
56922011-10-10 Nick Clifton <nickc@redhat.com>
5693
5694 * po/es.po: Updated Spanish translation.
5695 * po/fi.po: Updated Finnish translation.
5696
6a59a5c2
DN
56972011-10-03 Diego Novillo <dnovillo@google.com>
5698
5699 * options.cc (parse_uint): Fix dereference of RETVAL.
5700
f0558624
ST
57012011-09-29 Sriraman Tallam <tmsriram@google.com>
5702
5703 * layout.h (section_order_map_): New member.
5704 (get_section_order_map): New member function.
5705 * output.cc (Output_section::add_input_section): Check for patterns
5706 only when --section-ordering-file is specified.
5707 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5708 output_sections have been formed.
5709 * layout.cc (Layout_Layout): Initialize section_order_map_.
5710 * plugin.cc (update_section_order): Store order in order_map. Do not
5711 update the order.
5712 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5713 * testsuite/Makefile.in: Regenerate.
5714 * testsuite/plugin_section_order.c: New file.
5715 * testsuite/plugin_final_layout.cc: New file.
5716 * testsuite/plugin_final_layout.sh: New file.
5717
a7dac153
CC
57182011-09-29 Cary Coutant <ccoutant@google.com>
5719
4f95c8b4 5720 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5721 Check for NULL.
4f95c8b4 5722 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5723 symbols during incremental update.
5724 (Symbol_table::add_from_dynobj): Likewise.
5725
eebd87a5
ILT
57262011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5727 Ian Lance Taylor <iant@google.com>
5728
5729 * symtab.cc (Symbol_table::define_special_symbol): Always
5730 canonicalize version string.
5731
403a3331
CC
57322011-09-26 Cary Coutant <ccoutant@google.com>
5733
4f95c8b4
CC
5734 * gold.cc (queue_initial_tasks): Move option checks ...
5735 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5736 some options; make others fatal.
5737
235061c2
CC
57382011-09-26 Cary Coutant <ccoutant@google.com>
5739
5740 gcc PR lto/47247
5741 * plugin.cc (get_symbols_v2): New function.
5742 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5743 (is_referenced_from_outside): New function.
5744 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5745 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5746 (get_symbols): Pass version parameter.
5747 (get_symbols_v2): New function.
5748 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5749 parameter.
5750 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5751 (onload): Add LDPT_GET_SYMBOLS_V2.
5752 (all_symbols_read_hook): Use get_symbols_v2; check for
5753 LDPR_PREVAILING_DEF_IRONLY_EXP.
5754 * testsuite/plugin_test_3.sh: Update expected results.
5755
dc87f620
ILT
57562011-09-23 Simon Baldwin <simonb@google.com>
5757
5758 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5759 configuration options.
5760 * configure: Regenerate.
5761 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5762 * Makefile.in: Regenerate.
5763 * testsuite/Makefile.in: Regenerate.
5764
a8279f82
ST
57652011-09-19 Sriraman Tallam <tmsriram@google.com>
5766
5767 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5768
0c9350c8
CC
57692011-09-19 Cary Coutant <ccoutant@google.com>
5770
5771 * incremental.cc (can_incremental_update): Fix typo in comment.
5772 * incremental.h (can_incremental_update): Likewise.
5773
aa06ae28
CC
57742011-09-18 Cary Coutant <ccoutant@google.com>
5775
5776 * incremental.cc (can_incremental_update): New function.
5777 * incremental.h (can_incremental_update): New function.
5778 * layout.cc (Layout::init_fixed_output_section): Call it.
5779 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5780 * object.cc (Sized_relobj_file::do_layout): Call
5781 can_incremental_update.
5782
ebb300b2
CC
57832011-09-13 Cary Coutant <ccoutant@google.com>
5784
5785 * configure.ac: Check for glibc support for gnu_indirect_function
5786 support with static linking, setting automake conditional
5787 IFUNC_STATIC.
5788 * Makefile.in: Regenerate.
5789 * configure: Regenerate.
5790
5791 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5792 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5793 for IFUNC_STATIC.
5794 * testsuite/Makefile.in: Regenerate.
5795
1206d0d5
CC
57962011-09-13 Cary Coutant <ccoutant@google.com>
5797
5798 * incremental.cc (Sized_relobj_incr::do_layout): Call
5799 report_comdat_group for kept comdat sections.
5800 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5801 * testsuite/Makefile.in: Regenerate.
5802 * testsuite/incr_comdat_test_1.cc: New source file.
5803 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5804 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5805 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5806
40b29874
ILT
58072011-09-13 Ian Lance Taylor <iant@google.com>
5808
5809 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5810 variable external_symbols_offset.
5811
1b045aac
ILT
58122011-09-12 Ian Lance Taylor <iant@google.com>
5813
5814 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5815 triggered if object has no symbols.
5816
24c6c55a
DM
58172011-09-09 David S. Miller <davem@davemloft.net>
5818
5819 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5820 (Output_fill_debug_line::do_write): Likewise.
5821
66570254
CC
58222011-08-29 Cary Coutant <ccoutant@google.com>
5823
5824 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5825 casts to match formatting specs.
5826 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5827
8ea8cd50
CC
58282011-08-26 Cary Coutant <ccoutant@google.com>
5829
5830 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5831 remaining hole size when allocating.
5832 (Layout::make_output_section): Set fill methods for debug sections.
5833 * layout.h (Free_list::Free_list_node): Move from private to
5834 public.
5835 (Free_list::set_min_hole_size): New function.
5836 (Free_list::begin, Free_list::end): New functions.
5837 (Free_list::min_hole_): New data member.
5838 * output.cc: Include dwarf.h.
5839 (Output_fill_debug_info::do_minimum_hole_size): New function.
5840 (Output_fill_debug_info::do_write): New function.
5841 (Output_fill_debug_line::do_minimum_hole_size): New function.
5842 (Output_fill_debug_line::do_write): New function.
5843 (Output_section::Output_section): Initialize new data member.
5844 (Output_section::set_final_data_size): Ensure patch space is larger
5845 than minimum hole size.
5846 (Output_section::do_write): Fill holes in debug sections.
5847 * output.h (Output_fill): New class.
5848 (Output_fill_debug_info): New class.
5849 (Output_fill_debug_line): New class.
5850 (Output_section::set_free_space_fill): New function.
5851 (Output_section::free_space_fill_): New data member.
5852 * testsuite/Makefile.am (incremental_test_3): Add
5853 --incremental-patch option.
5854 (incremental_test_4): Likewise.
5855 (incremental_test_5): Likewise.
5856 (incremental_test_6): Likewise.
5857 (incremental_copy_test): Likewise.
5858 (incremental_common_test_1): Likewise.
5859 * testsuite/Makefile.in: Regenerate.
5860
7cf80422
NC
58612011-08-26 Nick Clifton <nickc@redhat.com>
5862
5863 * po/es.po: Updated Spanish translation.
5864
c3f7b0e5
CC
58652011-08-01 Cary Coutant <ccoutant@google.com>
5866
5867 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5868 * gold/testsuite/Makefile.in: Regenerate.
5869 * gold/testsuite/justsyms_exec.c: New source file.
5870 * gold/testsuite/justsyms_lib.c: New source file.
5871
9590bf25
CC
58722011-08-01 Cary Coutant <ccoutant@google.com>
5873
5874 * layout.cc (Layout::set_segment_offsets): Don't realign text
5875 segment if -Ttext was specified.
5876 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5877 file type.
5878 * object.h (Sized_relobj_file::e_type): New function.
5879 (Sized_relobj_file::e_type_): New data member.
5880 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5881 base address for ET_EXEC files.
5882 * target.cc (Target::do_make_elf_object_implementation): Allow
5883 ET_EXEC files with --just-symbols option.
5884
dcd8d12e
CC
58852011-07-28 Cary Coutant <ccoutant@google.com>
5886
5887 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5888 Add thread_number parameter.
5889 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5890 * workqueue-threads.cc
5891 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5892 current thread if its thread number is greater than desired thread
5893 count.
5894 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5895 Add thread_number parameter.
5896 (Workqueue::should_cancel_thread): Likewise.
5897 (Workqueue::find_runnable_or_wait): Pass thread_number to
5898 should_cancel_thread.
5899 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5900 parameter.
5901
804eb480
ST
59022011-07-22 Sriraman Tallam <tmsriram@google.com>
5903
5904 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5905 only after checking if it cannot be forced local.
5906 * symtab.h (is_externally_visible): Check if the symbol is not forced
5907 local.
5908
f1ddb600
ILT
59092011-07-15 Ian Lance Taylor <iant@google.com>
5910
5911 * options.h (class General_options): Add --print-output-format.
5912 Move -EL next to -EB, for better --help output.
5913 * target-select.cc: Include <cstdio>, "options.h", and
5914 "parameters.h".
5915 (Target_selector::do_target_bfd_name): New function.
5916 (print_output_format): New function.
5917 * target-select.h (class Target_selector): Update declarations.
5918 (Target_selector::target_bfd_name): New function.
5919 (print_output_format): Declare.
5920 * main.cc: Include "target-select.h".
5921 (main): Handle --print-output-format.
5922 * gold.cc: Include "target-select.h".
5923 (queue_initial_tasks): Handle --print-output-format when there are
5924 no input files.
5925 * parameters.cc (parameters_force_valid_target): Give a better
5926 error message if -EB/-EL does not match target.
5927 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5928 function.
5929
7d172687
ILT
59302011-07-15 Ian Lance Taylor <iant@google.com>
5931
5932 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5933 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5934 (Output_data_plt_i386::do_write): Write address of .dynamic
5935 section to first entry in .got.plt section.
5936 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5937 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5938 Initialize layout_.
5939 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5940 section to first entry in .got.plt section.
5941 * layout.h (Layout::dynamic_section): New function.
5942
e9552f7e
ST
59432011-07-13 Sriraman Tallam <tmsriram@google.com>
5944
5945 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5946 to claim_file call.
5947 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5948 input_section_position_, and input_section_glob_.
5949 (read_layout_from_file): Call function section_ordering_specified.
5950 * layout.h (is_section_ordering_specified): New function.
5951 (section_ordering_specified): New function.
5952 (section_ordering_specified_): New boolean member.
5953 * main.cc(main): Call load_plugins after layout object is defined.
5954 * output.cc (Output_section::add_input_section): Use
5955 function section_ordering_specified to check if section ordering is
5956 needed.
5957 * output.cc (Output_section::add_relaxed_input_section): Use
5958 function section_ordering_specified to check if section ordering is
5959 needed.
5960 (Output_section::update_section_layout): New function.
5961 (Output_section::sort_attached_input_sections): Check if input section
5962 must be reordered.
5963 * output.h (Output_section::update_section_layout): New function.
5964 * plugin.cc (get_section_count): New function.
5965 (get_section_type): New function.
5966 (get_section_name): New function.
5967 (get_section_contents): New function.
5968 (update_section_order): New function.
58797674 5969 (allow_section_ordering): New function.
e9552f7e
ST
5970 (Plugin::load): Add the new interfaces to the transfer vector.
5971 (Plugin_manager::load_plugins): New parameter.
5972 (Plugin_manager::all_symbols_read): New parameter.
5973 (Plugin_manager::claim_file): New parameter. Save the elf object for
5974 unclaimed objects.
5975 (Plugin_manager::get_elf_object): New function.
5976 (Plugin_manager::get_view): Change to directly use the bool to check
5977 if get_view is called from claim_file_hook.
5978 * plugin.h (input_objects): New function
5979 (Plugin__manager::load_plugins): New parameter.
5980 (Plugin_manager::claim_file): New parameter.
5981 (Plugin_manager::get_elf_object): New function.
5982 (Plugin_manager::in_claim_file_handler): New function.
5983 (Plugin_manager::in_claim_file_handler_): New member.
5984 (layout): New function.
5985 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5986 handler with an extra parameter. Make the elf object before calling
5987 claim_file handler.
5988 * testsuite/plugin_test.c (get_section_count): New function pointer.
5989 (get_section_type): New function pointer.
5990 (get_section_name): New function pointer.
5991 (get_section_contents): New function pointer.
5992 (update_section_order): New function pointer.
5993 (allow_section_ordering): New function pointer.
5994 (onload): Check if the new interfaces exist.
5995
9446efde
ILT
59962011-07-13 Ian Lance Taylor <iant@google.com>
5997
5998 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5999 relro section.
6000 * x86_64.cc (Target_x86_64::got_section): Likewise.
6001 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6002 (relro_now_test_SOURCES): New variable.
6003 (relro_now_test_DEPENDENCIES): New variable.
6004 (relro_now_test_LDFLAGS): New variable.
6005 (relro_now_test_LDADD): New variable.
6006 (relro_now_test.so): New target.
6007 * testsuite/Makefile.in: Rebuild.
6008
07aa62f2
ILT
60092011-07-12 Ian Lance Taylor <iant@google.com>
6010
6011 PR gold/12980
6012 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6013 GLOB_DAT relocation rather than a RELATIVE relocation for a
6014 protected symbol when creating a shared library.
6015 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6016 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6017 * testsuite/protected_main_1.cc (main): Test that protected
6018 function has same address.
6019
e2153196
ILT
60202011-07-11 Ian Lance Taylor <iant@google.com>
6021
6022 PR gold/12979
6023 * options.h (class General_options): Add -Bgroup.
6024 * options.cc (General_options::finalize): If -Bgroup is set,
6025 default to --unresolved-symbols=report-all.
6026 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6027 * target-reloc.h (issue_undefined_symbol_error): Handle
6028 --unresolved-symbols=report-all.
6029
6daf5215
ILT
60302011-07-08 Ian Lance Taylor <iant@google.com>
6031
6032 PR gold/11985
6033 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6034 if linker script discards key sections.
6035 (Layout::create_dynamic_symtab): Likewise.
6036 (Layout::assign_local_dynsym_offsets): Likewise.
6037 (Layout::sized_create_version_sections): Likewise.
6038 (Layout::create_interp): Likewise.
6039 (Layout::finish_dynamic_section): Likewise.
6040 (Layout::set_dynamic_symbol_size): Likewise.
6041
beabb2c6
ILT
60422011-07-08 Ian Lance Taylor <iant@google.com>
6043
6044 PR gold/12386
6045 * options.h (class General_options): Add --unresolved-symbols.
6046 * target-reloc.h (issue_undefined_symbol_error): Check
6047 --unresolved-symbols. Add comments.
6048
9c16daf1
ILT
60492011-07-08 Ian Lance Taylor <iant@google.com>
6050
6051 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6052 expression more complex.
6053
191f1a2d
ILT
60542011-07-08 Ian Lance Taylor <iant@google.com>
6055
6056 PR gold/11317
6057 * target-reloc.h (issue_undefined_symbol_error): New inline
6058 function, broken out of relocate_section.
6059 (relocate_section): Call issue_undefined_symbol_error.
6060 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6061 there is no TLS segment if we are about to issue an undefined
6062 symbol error.
6063 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6064
62855347
ILT
60652011-07-08 Ian Lance Taylor <iant@google.com>
6066
6067 PR gold/12279
6068 * resolve.cc (Symbol_table::should_override): Add fromtype
6069 parameter. Change all callers. Give error when linking together
6070 TLS and non-TLS symbol.
6071 (Symbol_table::should_override_with_special): Add fromtype
6072 parameter. Change all callers.
6073 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6074 there is no TLS segment if we have reported some errors.
6075 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6076
67181c72
ILT
60772011-07-08 Ian Lance Taylor <iant@google.com>
6078
6079 PR gold/12372
6080 * target.h (Target::plt_address_for_global): New function.
6081 (Target::plt_address_for_local): New function.
6082 (Target::plt_section_for_global): Remove.
6083 (Target::plt_section_for_local): Remove.
6084 (Target::do_plt_address_for_global): New virtual function.
6085 (Target::do_plt_address_for_local): New virtual function.
6086 (Target::do_plt_section_for_global): Remove.
6087 (Target::do_plt_section_for_local): Remove.
6088 (Target::register_global_plt_entry): Add Symbol_table and Layout
6089 parameters.
6090 * output.cc (Output_data_got::Got_entry::write): Use
6091 plt_address_for_global and plt_address_for_local.
6092 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6093 address of output section.
6094 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6095 got_irelative_, and irelative_count_ fields. Update
6096 declarations.
6097 (Output_data_plt_i386::has_irelative_section): New function.
6098 (Output_data_plt_i386::entry_count): Add irelative_count_.
6099 (Output_data_plt_i386::set_final_data_size): Likewise.
6100 (class Target_i386): Add got_irelative_ and rel_irelative_
6101 fields. Update declarations.
6102 (Target_i386::Target_i386): Initialize new fields.
6103 (Target_i386::do_plt_address_for_global): New function replacing
6104 do_plt_section_for_global.
6105 (Target_i386::do_plt_address_for_local): New function replacing
6106 do_plt_section_for_local.
6107 (Target_i386::got_section): Create got_irelative_.
6108 (Target_i386::rel_irelative_section): New function.
6109 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6110 fields. Don't define __rel_iplt_{start,end}.
6111 (Output_data_plt_i386::add_entry): Add symtab and layout
6112 parameters. Change all callers. Use different PLT and GOT for
6113 IFUNC symbols.
6114 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6115 layout parameters. Change all callers. Use different PLT and
6116 GOT.
6117 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6118 (Output_data_plt_i386::rel_irelative): New function.
6119 (Output_data_plt_i386::address_for_global): New function.
6120 (Output_data_plt_i386::address_for_local): New function.
6121 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6122 IRELATIVE GOT when changing IFUNC GOT entries.
6123 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6124 reloc.
6125 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6126 if we didn't create an IRELATIVE GOT.
6127 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6128 plt_address_for_local.
6129 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6130 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6131 got_irelative_, and irelative_count_ fields. Update
6132 declarations.
6133 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6134 Initialize new fields. Remove symtab parameter. Change all
6135 callers.
6136 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6137 irelative_count_.
6138 (Output_data_plt_x86_64::has_irelative_section): New function.
6139 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6140 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6141 fields. Update declarations.
6142 (Target_x86_64::Target_x86_64): Initialize new fields.
6143 (Target_x86_64::do_plt_address_for_global): New function replacing
6144 do_plt_section_for_global.
6145 (Target_x86_64::do_plt_address_for_local): New function replacing
6146 do_plt_section_for_local.
6147 (Target_x86_64::got_section): Create got_irelative_.
6148 (Target_x86_64::rela_irelative_section): New function.
6149 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6150 all callers. Don't create __rel_iplt_{start,end}.
6151 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6152 parameters. Change all callers. Use different PLT and GOT for
6153 IFUNC symbols.
6154 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6155 layout parameters. Change all callers. Use different PLT and
6156 GOT.
6157 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6158 parameters. Change all callers. Use different PLT and GOT for
6159 IFUNC symbols.
6160 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6161 (Output_data_plt_x86_64::rela_irelative): New function.
6162 (Output_data_plt_x86_64::address_for_global): New function.
6163 (Output_data_plt_x86_64::address_for_local): New function.
6164 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6165 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6166 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6167 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6168 parameters.
6169 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6170 reloc.
6171 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6172 symbols if we didn't create an IRELATIVE GOT.
6173 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6174 plt_address_for_local.
6175 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6176 * testsuite/ifuncvar1.c: New test file.
6177 * testsuite/ifuncvar2.c: New test file.
6178 * testsuite/ifuncvar3.c: New test file.
6179 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6180 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6181 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6182 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6183 * testsuite/Makefile.in: Rebuild.
6184
33c15b45
CC
61852011-07-07 Cary Coutant <ccoutant@google.com>
6186
6187 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6188 (two_file_test_1_ndebug.o): Likewise.
6189 (two_file_test_1b_ndebug.o): Likewise.
6190 (two_file_test_2_ndebug.o): Likewise.
6191 (two_file_test_main_ndebug.o): Likewise.
6192 (incremental_test_2): Link with no-debug versions.
6193
f48b5fb7
CC
61942011-07-06 Cary Coutant <ccoutant@google.com>
6195
6196 * gold/incremental.cc
6197 (Output_section_incremental_inputs::write_info_blocks): Check for
6198 hidden and internal symbols.
6199
221597a5
CC
62002011-07-06 Cary Coutant <ccoutant@google.com>
6201
6202 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6203 Check disposition for startup file.
6204 (Incremental_inputs::report_command_line): Ignore
6205 --incremental-startup-unchanged option.
6206 * options.cc (General_options::parse_incremental_startup_unchanged):
6207 New function.
6208 (General_options::General_options): Initialize new data member.
6209 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6210 (General_options): Add --incremental-startup-unchanged option.
6211 (General_options::incremental_startup_disposition): New function.
6212 (General_options::incremental_startup_disposition_): New data member.
6213
e24719f6
CC
62142011-07-06 Cary Coutant <ccoutant@google.com>
6215
6216 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6217 input file index to Script_info ctor.
6218 (Sized_incremental_binary::do_file_has_changed): Find the
6219 command-line argument for files named in scripts.
6220 * incremental.h (Script_info::Script_info): New ctor
6221 with input file index.
6222 (Script_info::input_file_index): New function.
6223 (Script_info::input_file_index_): New data member.
6224 (Incremental_binary::get_library): Add const.
6225 (Incremental_binary::get_script_info): Add const.
6226 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6227 * testsuite/Makefile.am (incremental_test_5): New test case.
6228 (incremental_test_6): New test case.
6229 * testsuite/Makefile.in: Regenerate.
6230
8f7c81e8
CC
62312011-07-06 Cary Coutant <ccoutant@google.com>
6232
6233 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6234 debug output when command lines differ.
6235
9fbd3822
CC
62362011-07-06 Cary Coutant <ccoutant@google.com>
6237
6238 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6239 --incremental-patch option.
6240 * layout.cc (Free_list::allocate): Extend allocation beyond original
6241 end if enabled.
6242 (Layout::make_output_section): Mark sections that should get
6243 patch space.
6244 * options.cc (parse_percent): New function.
6245 * options.h (parse_percent): New function.
6246 (DEFINE_percent): New macro.
6247 (General_options): Add --incremental-patch option.
6248 * output.cc (Output_section::Output_section): Initialize new data
6249 members.
6250 (Output_section::add_input_section): Print section name when out
6251 of patch space.
6252 (Output_section::add_output_section_data): Likewise.
6253 (Output_section::set_final_data_size): Add patch space when
6254 doing --incremental-full.
6255 (Output_section::do_reset_address_and_file_offset): Remove patch
6256 space.
6257 (Output_segment::set_section_list_addresses): Print debug output
6258 only if --incremental-update.
6259 * output.h (Output_section::set_is_patch_space_allowed): New function.
6260 (Output_section::is_patch_space_allowed_): New data member.
6261 (Output_section::patch_space_): New data member.
6262 * parameters.cc (Parameters::incremental_full): New function.
6263 * parameters.h (Parameters::incremental_full): New function
6264 * testsuite/Makefile.am (incremental_test_2): Add test for
6265 --incremental-patch option.
6266 * testsuite/Makefile.in: Regenerate.
6267 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6268 (t18): Remove function body.
6269
f6cccc2c
DK
62702011-07-05 Doug Kwan <dougkwan@google.com>
6271
6272 PR gold/12771
6273 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6274 Arm_Address type for relocation result.
6275 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6276 overflow check.
6277 (Arm_relocate_functions::abs32): Use unaligned access.
6278 (Arm_relocate_functions::rel32): Ditto.
6279 (Arm_relocate_functions::prel31): Ditto.
6280 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6281 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6282 static data relocations.
6283 * testsuite/Makefile.in: Regnerate.
6284 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6285
28a13fec
ILT
62862011-07-05 Ian Lance Taylor <iant@google.com>
6287
6288 PR gold/12392
6289 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6290 symbols if necessary.
6291 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6292
24d47b34
ILT
62932011-07-05 Ian Lance Taylor <iant@google.com>
6294
6295 PR gold/12952
6296 * resolve.cc (Symbol::override_base_with_special): Simply override
6297 version with special symbol version, ignoring previous version.
6298
41f9cbbe
ILT
62992011-07-05 Ian Lance Taylor <iant@google.com>
6300
6301 * object.cc (Sized_relobj_file::include_section_group): Add
6302 information to comment about signature location.
6303
886288f1
ILT
63042011-07-02 Ian Lance Taylor <iant@google.com>
6305
6306 PR gold/12957
6307 * options.h (class General_options): Add -f and -F.
6308 * options.cc (General_options::finalize): Fatal error if -f/-F
6309 are used without -shared.
6310 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6311
ae3a6d4f
ILT
63122011-07-02 Ian Lance Taylor <iant@google.com>
6313
6314 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6315
21131061
ILT
63162011-07-01 Ian Lance Taylor <iant@google.com>
6317
6318 PR gold/12525
6319 PR gold/12952
6320 * resolve.cc (Symbol::override_base_with_special): Don't override
6321 the version if the overriding symbol has a different name.
6322 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6323 all callers. If we give an error about an undefined version,
6324 define the base version if necessary.
6325 * dynobj.h (class Versions): Update declaration.
6326 * testsuite/weak_alias_test_5.cc: New file.
6327 * testsuite/weak_alias_test.script: New file.
6328 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6329 and versioned_alias have the right value, and call t2.
6330 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6331 weak_alias_test_5.so.
6332 (weak_alias_test_LDADD): Likewise.
6333 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6334 * testsuite/Makefile.in: Rebuild.
6335
611062c0
ILT
63362011-07-01 Ian Lance Taylor <iant@google.com>
6337
6338 PR gold/12525
6339 * options.h (class General_options): Support -z notext.
6340 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6341 -Wl,-z,notext.
6342 (two_file_shared_nonpic.so): Likewise.
6343 (two_file_shared_mixed.so): Likewise.
6344 (two_file_shared_mixed_1.so): Likewise.
6345 (weak_undef_lib_nonpic.so): Likewise.
6346 (alt/weak_undef_lib_nonpic.so): Likewise.
6347 (tls_test_shared_nonpic.so): Likewise.
6348 * testsuite/Makefile.in: Rebuild.
6349
328c7c2f
ILT
63502011-07-01 Ian Lance Taylor <iant@google.com>
6351
6352 PR gold/12525
6353 * configure.ac: Test whether static linking works, setting
6354 the automake conditional HAVE_STATIC.
6355 * testsuite/Makefile.am: Disable tests using -static if
6356 HAVE_STATIC is not true.
6357 * configure, testsuite/Makefile.in: Rebuild.
6358
02d7cd44
ILT
63592011-07-01 Ian Lance Taylor <iant@google.com>
6360
6361 PR gold/12525
6362 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6363 Assert if we see DW_EH_PE_indirect.
6364 * target.h (Target::ehframe_datarel_base): New function.
6365 (Target::do_ehframe_datarel_base): New target function.
6366 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6367 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6368 function.
6369
07a60597
ILT
63702011-07-01 Ian Lance Taylor <iant@google.com>
6371
6372 PR gold/12571
6373 * options.h (class General_options): Add
6374 --ld-generated-unwind-info.
6375 * ehframe.cc (Fde::write): Add address parameter. Change all
6376 callers. If associated with PLT, fill in address and size.
6377 (Cie::set_output_offset): Only add merge mapping if there is an
6378 object.
6379 (Cie::write): Add address parameter. Change all callers.
6380 (Eh_frame::add_ehframe_for_plt): New function.
6381 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6382 input_offset_ fields into union u_, with new plt field.
6383 (Fde::Fde): Adjust for new union field.
6384 (Fde::Fde) [Output_data version]: New constructor.
6385 (Fde::add_mapping): Only add merge mapping if there is an object.
6386 (class Cie): Update declarations.
6387 (class Eh_frame): Declare add_ehframe_for_plt.
6388 * layout.cc (Layout::layout_eh_frame): Break out code into
6389 make_eh_frame_section, and call it.
6390 (Layout::make_eh_frame_section): New function.
6391 (Layout::add_eh_frame_for_plt): New function.
6392 * layout.h (class Layout): Update declarations.
6393 * merge.cc (Merge_map::add_mapping): Add assertion.
6394 * i386.cc: Include "dwarf.h".
6395 (class Output_data_plt_i386): Make first_plt_entry,
6396 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6397 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6398 and plt_eh_frame_fde.
6399 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6400 boundary. Call add_eh_frame_for_plt if appropriate.
6401 * x86_64.cc: Include "dwarf.h".
6402 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6403 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6404 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6405 and plt_eh_frame_fde.
6406 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6407 appropriate.
6408
14788a3f
ILT
64092011-06-29 Ian Lance Taylor <iant@google.com>
6410
6411 PR gold/12629
6412 * object.cc (Sized_relobj_file::layout_section): Change shdr
6413 parameter to be const.
6414 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6415 out of do_layout.
6416 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6417 appropriate. Call layout_eh_frame_section.
6418 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6419 sections.
6420 * object.h (class Sized_relobj_file): Update declarations.
6421
6c21fce1
ILT
64222011-06-29 Ian Lance Taylor <iant@google.com>
6423
37e41b03 6424 PR gold/12652
6c21fce1
ILT
6425 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6426 modifier.
6427 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6428
4d5e4e62
ILT
64292011-06-29 Ian Lance Taylor <iant@google.com>
6430
6431 PR gold/12675
6432 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6433 SHT_X86_64_UNWIND.
6434 * layout.cc (Layout::layout_eh_frame): Likewise.
6435
886f533a
ILT
64362011-06-29 Ian Lance Taylor <iant@google.com>
6437
6438 PR gold/12695
6439 * layout.cc (Layout::symtab_section_shndx): New function.
6440 * layout.h (class Layout): Declare symtab_section_shndx.
6441 * output.cc (Output_section::write_header): Call it.
6442
f3ae1b28
ILT
64432011-06-29 Ian Lance Taylor <iant@google.com>
6444
6445 PR gold/12818
6446 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6447 symbols which are not used in a relocation.
6448
aecf301f
ILT
64492011-06-28 Ian Lance Taylor <iant@google.com>
6450
6451 PR gold/12898
6452 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6453 script create indistinguishable segments.
6454 (Layout::set_segment_offsets): Use stable_sort when sorting
6455 segments. Pass this to Compare_segments constructor.
6456 * layout.h (class Layout): Make segment_precedes non-static.
6457 (class Compare_segments): Change from struct to class. Add
6458 layout_ field. Add constructor.
6459 * script-sections.cc
6460 (Script_sections::attach_sections_using_phdrs_clause): Rename
6461 local orphan to is_orphan. Don't report failure to put empty
6462 section in segment. On attachment failure, report name of
6463 section, and attach to first PT_LOAD segment.
6464
03ef7571
ILT
64652011-06-28 Ian Lance Taylor <iant@google.com>
6466
6467 PR gold/12934
6468 * target-select.cc (Target_selector::Target_selector): Add
6469 emulation parameter. Change all callers.
6470 (select_target_by_bfd_name): Rename from select_target_by_name.
6471 Change all callers.
6472 (select_target_by_emulation): New function.
6473 (supported_emulation_names): New function.
6474 * target-select.h (class Target_selector): Add emulation_ field.
6475 Update declarations.
6476 (Target_selector::recognize_by_bfd_name): Rename from
6477 recognize_by_name. Change all callers.
6478 (Target_selector::supported_bfd_names): Rename from
6479 supported_names. Change all callers.
6480 (Target_selector::recognize_by_emulation): New function.
6481 (Target_selector::supported_emulations): New function.
6482 (Target_selector::emulation): New function.
6483 (Target_selector::do_recognize_by_bfd_name): Rename from
6484 do_recognize_by_name. Change all callers.
6485 (Target_selector::do_supported_bfd_names): Rename from
6486 do_supported_names. Change all callers.
6487 (Target_selector::do_recognize_by_emulation): New function.
6488 (Target_selector::do_supported_emulations): New function.
6489 (select_target_by_bfd_name): Change name in declaration.
6490 (select_target_by_emulation): Declare.
6491 (supported_emulation_names): Declare.
6492 * parameters.cc (parameters_force_valid_target): Try to find
6493 target based on emulation from -m option.
6494 * options.h (class General_options): Change doc string for -m.
6495 * options.cc (help): Print emulations.
6496 (General_options::parse_V): Likewise.
6497 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6498 Add emulation parameter. Change all callers.
6499
200b2bb9
ILT
65002011-06-28 Ian Lance Taylor <iant@google.com>
6501
6502 * target.h (class Target): Add osabi_ field.
6503 (Target::osabi): New function.
6504 (Target::set_osabi): New function.
6505 (Target::Target): Initialize osabi_.
6506 (Target::do_adjust_elf_header): Make pure virtual.
6507 (Sized_target::do_adjust_elf_header): Declare.
6508 * target.cc (Sized_target::do_adjust_elf_header): New function.
6509 (class Sized_target): Instantiate all versions.
6510 * freebsd.h (class Target_freebsd): Remove.
6511 (Target_selector_freebsd::do_recognize): Call set_osabi on
6512 Target.
6513 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6514 (Target_selector_freebsd::set_osabi): Remove.
6515 * i386.cc (class Target_i386): Inherit from Sized_target rather
6516 than Target_freebsd.
6517 * x86_64.cc (class Target_x86_64): Likewise.
6518
b3ce541e
ILT
65192011-06-28 Ian Lance Taylor <iant@google.com>
6520
6521 * target.h (Target::can_check_for_function_pointers): Rewrite.
6522 Make non-virtual.
6523 (Target::can_icf_inline_merge_sections): Likewise.
6524 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6525 (Target::Target_info): Add can_icf_inline_merge_sections field.
6526 (Target::do_can_check_for_function_pointers): New virtual
6527 function.
6528 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6529 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6530 from can_check_for_function_pointers, move in file.
6531 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6532 section_may_have_icf_unsafe_poineters, move in file.
6533 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6534 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6535 Rename from can_check_for_function_pointers, move in file.
6536 (Target_i386::can_icf_inline_merge_sections): Remove.
6537 (Target_i386::i386_info): Initialize
6538 can_icf_inline_merge_sections.
6539 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6540 Initialize can_icf_inline_merge_sections.
6541 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6542 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6543 Rename from can_check_for_function_pointers, move in file.
6544 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6545 (Target_x86_64::x86_64_info): Initialize
6546 can_icf_inline_merge_sections.
6547 * testsuite/testfile.cc (Target_test::test_target_info):
6548 Likewise.
6549 * icf.cc (get_section_contents): Correct formatting.
6550
6d1c4efb
ILT
65512011-06-27 Ian Lance Taylor <iant@google.com>
6552
6553 * symtab.cc (Symbol::versioned_name): New function.
6554 (Symbol_table::add_to_final_symtab): Use versioned_name when
6555 appropriate.
6556 (Symbol_table::sized_write_symbol): Likewise.
6557 * symtab.h (class Symbol): Declare versioned_name.
6558 * stringpool.h (class Stringpool_template): Add variant of add
6559 which takes a std::basic_string.
6560 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6561 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6562 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6563 (ver_test_12.o): New target.
6564 * testsuite/Makefile.in: Rebuild.
6565
57eb9b50
DK
65662011-06-27 Doug Kwan <dougkwan@google.com>
6567
6568 * arm.cc (Arm_relocate_functions::thm_jump8,
6569 Arm_relocate_functions::thm_jump11): Use a wider signed
6570 type to compute offset.
6571 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6572 arm_thm_jump8.
6573 * testsuite/Makefile.in: Regenerate.
6574 * testsuite/arm_branch_in_range.sh: Check test results of
6575 arm_thm_jump11 and arm_thm_jump8.
6576 * testsuite/arm_thm_jump11.s: New test source file.
6577 * testsuite/arm_thm_jump11.t: New linker script.
6578 * testsuite/arm_thm_jump8.s: New test source file.
6579 * testsuite/arm_thm_jump8.t: New linker script.
6580
487b39df
ILT
65812011-06-24 Ian Lance Taylor <iant@google.com>
6582
6583 * layout.cc: Include "object.h".
6584 (ctors_sections_in_init_array): New static variable.
6585 (Layout::is_ctors_in_init_array): New function.
6586 (Layout::layout): Add entry to ctors_sections_in_init_array if
6587 appropriate.
6588 * layout.h (class Layout): Declare is_ctors_in_init_array.
6589 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6590 is_ctors_reverse_view is set.
6591 (Sized_relobj_file::write_sections): Add layout parameter. Change
6592 all callers. Set is_ctors_reverse_view field of View_size.
6593 (Sized_relobj_file::reverse_words): New function.
6594 * object.h (Sized_relobj_file::View_size): Add
6595 is_ctors_reverse_view field.
6596 (class Sized_relobj_file): Update declarations.
6597 * testsuite/initpri3.c: New test.
6598 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6599 initpri3b.
6600 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6601 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6602 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6603 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6604 * testsuite/Makefile.in: Rebuild.
6605
472076e4
CC
66062011-06-24 Cary Coutant <ccoutant@google.com>
6607
6608 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6609 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6610 (debug_msg_cdebug.err): New targets.
6611 * testsuite/Makefile.in: Regenerate.
6612 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6613 Fix checks for link with shared library.
6614
a60af0db
DK
66152011-06-24 Doug Kwan <dougkwan@google.com>
6616
6617 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6618 skip empty text sections.
6619 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6620
5393d741
ILT
66212011-06-22 Ian Lance Taylor <iant@google.com>
6622
6623 PR gold/12910
6624 * options.h (class General_options): Add --ctors-in-init-array.
6625 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6626 friends as SHT_PROGBITS for merging sections.
6627 (Layout::layout): Remove special handling of .init_array and
6628 friends. Don't sort if doing relocatable link. Sort for .ctors
6629 and .dtors if ctors_in_init_array.
6630 (Layout::make_output_section): Force correct section types for
6631 .init_array and friends. Don't sort if doing relocatable link,
6632 Don't sort .ctors and .dtors if ctors_in_init_array.
6633 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6634 (Layout::output_section_name): Add relobj parameter. Change all
6635 callers. Handle .ctors. and .dtors. in code rather than table.
6636 Handle .ctors and .dtors if ctors_in_init_array.
6637 (Layout::match_file_name): New function, moved from output.cc.
6638 * layout.h (class Layout): Update declarations.
6639 * output.cc: Include "layout.h".
6640 (Input_section_sort_entry::get_priority): New function.
6641 (Input_section_sort_entry::match_file_name): Just call
6642 Layout::match_file_name.
6643 (Output_section::Input_section_sort_init_fini_compare::operator()):
6644 Handle .ctors and .dtors. Sort by explicit priority rather than
6645 by name.
6646 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6647 * testsuite/initpri2.c: New test.
6648 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6649 (check_PROGRAMS): Add initpri2.
6650 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6651 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6652 * configure, testsuite/Makefile.in: Rebuild.
6653
e1f74f98
ILT
66542011-06-19 Ian Lance Taylor <iant@google.com>
6655
6656 PR gold/12880
6657 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6658 .interp section to a PT_INTERP segment even if we have seen a
6659 --dynamic-linker option. Don't do it if we have seen a PHDRS
6660 clause in a linker script.
6661 (Layout::finalize): Don't create a .interp section if we've
6662 already create a PT_INTERP segment.
6663 (Layout::create_interp): Always call choose_output_section (revert
6664 patch of 2011-06-17). Don't create PT_INTERP segment.
6665 * script-sections.cc
6666 (Script_sections::create_note_and_tls_segments): Add a .interp
6667 section to a PT_INTERP segment even if we have seen a
6668 --dynamic-linker option.
6669
766f91bb
ILT
66702011-06-18 Ian Lance Taylor <iant@google.com>
6671
6672 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6673 merely because a non-PT_LOAD segment has a dynamic reloc.
6674
0d212c3a
ILT
66752011-06-18 Ian Lance Taylor <iant@google.com>
6676
6677 * layout.cc (Layout::finish_dynamic_section): Don't create
6678 DT_FLAGS entry if not needed.
6679
911a5072
ILT
66802011-06-18 Ian Lance Taylor <iant@google.com>
6681
6682 PR gold/12745
6683 * layout.cc (Layout::layout_eh_frame): Correct handling of
6684 writable .eh_frame section.
6685
534b4e5f
ILT
66862011-06-17 Ian Lance Taylor <iant@google.com>
6687
6688 PR gold/12893
6689 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6690 symbol is redefined with the exact same object and value.
6691
10b4f102
ILT
66922011-06-17 Ian Lance Taylor <iant@google.com>
6693
6694 PR gold/12880
6695 * layout.h (class Layout): Add interp_segment_ field.
6696 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6697 (Layout::attach_allocated_section_to_segment): If making shared
6698 library, put .interp section in PT_INTERP segment.
6699 (Layout::finalize): Also call create_interp if -dynamic-linker
6700 option was used.
6701 (Layout::create_interp): Assert that there is no PT_INTERP
6702 segment. If not using a SECTIONS clause, use make_output_section.
6703 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6704 * script-sections.cc
6705 (Script_sections::create_note_and_tls_segments): If making shared
6706 library, put .interp section in PT_INTERP segment.
6707
a29b0dad
ILT
67082011-06-17 Ian Lance Taylor <iant@google.com>
6709
e588ea8d
ILT
6710 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6711 when making a shared library.
6712
67132011-06-17 Ian Lance Taylor <iant@google.com>
6714
6715 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6716 parameter. Change all callers. Don't issue warning about PC32
6717 against locally defined symbol.
a29b0dad 6718
9d3b0698
ILT
67192011-06-16 Ian Lance Taylor <iant@google.com>
6720
6721 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6722 occurs in same object.
6723
85b0f90c
AM
67242011-06-14 Alan Modra <amodra@gmail.com>
6725
6726 * po/POTFILES.in: Regenerate.
6727
a94907d9
ILT
67282011-06-09 Ian Lance Taylor <iant@google.com>
6729
6730 * script-sections.cc
6731 (Orphan_output_section::set_section_addresses): For a relocatable
6732 link set address to 0.
6733
4fb3a1c3
CC
67342011-06-09 Cary Coutant <ccoutant@google.com>
6735
6736 PR gold/12804
6737 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6738 used with --compress-debug-sections.
6739 * gold/object.cc (Sized_relobj_file::do_layout): Report
6740 uncompressed size of compressed input sections.
6741
61220854
CC
67422011-06-08 Cary Coutant <ccoutant@google.com>
6743
6744 PR gold/12804
6745 * testsuite/two_file_test_2_v1.cc: Change initialization of
6746 v2 to keep it in .data.
6747
e6455dfb
CC
67482011-06-07 Cary Coutant <ccoutant@google.com>
6749
6750 * common.cc (Symbol_table::do_allocate_commons_list): Call
6751 gold_fallback.
6752 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6753 (Errors::fallback): New function.
6754 (gold_fallback): New function.
6755 * errors.h (Errors::fallback): New function.
6756 * gold.cc (gold_exit): Change status parameter to enum; adjust
6757 all callers.
6758 (queue_initial_tasks): Call gold_fallback.
6759 * gold.h: Include cstdlib.
6760 (Exit_status): New enum type.
6761 (gold_exit): Change status parameter to enum.
6762 (gold_fallback): New function.
6763 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6764 (Layout::create_symtab_sections): Likewise.
6765 (Layout::create_shdrs): Likewise.
6766 * main.cc (main): Adjust call to gold_exit.
6767 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6768 (Output_data_got::add_got_entry_pair): Likewise.
6769 (Output_section::add_input_section): Likewise.
6770 (Output_section::add_output_section_data): Likewise.
6771 (Output_segment::set_section_list_addresses): Likewise.
6772 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6773
fb0e076f
CC
67742011-06-07 Cary Coutant <ccoutant@google.com>
6775
6776 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6777 for incremental links.
6778 * output.cc (Output_segment::set_section_list_addresses): Remove
6779 FIXME and test for TLS or BSS.
6780
a5ee4d5d
CC
67812011-06-07 Cary Coutant <ccoutant@google.com>
6782
6783 * testsuite/Makefile.am: Add incremental_copy_test,
6784 incremental_common_test_1.
6785 * testsuite/Makefile.in: Regenerate.
6786 * testsuite/common_test_1_v1.c: New source file.
6787 * testsuite/common_test_1_v2.c: New source file.
6788 * testsuite/copy_test_v1.cc: New source file.
6789
5146f448
CC
67902011-06-07 Cary Coutant <ccoutant@google.com>
6791
6792 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6793 update, allocate common from bss section's free list.
6794 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6795 linker-defined symbols.
6796 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6797 Skip GOT and PLT entries that are no longer referenced.
6798 (Output_section_incremental_inputs::write_info_blocks): Mark
6799 linker-defined symbols.
6800 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6801 * output.cc (Output_section::allocate): New function.
6802 * output.h (Output_section::allocate): New function.
6803 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6804 linker-defined symbols.
6805 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6806 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6807 (Symbol::init_base_output_data): Likewise.
6808 (Symbol::init_base_output_segment): Likewise.
6809 (Symbol::init_base_constant): Likewise.
6810 (Sized_symbol::init_output_data): Likewise.
6811 (Sized_symbol::init_output_segment): Likewise.
6812 (Sized_symbol::init_constant): Likewise.
6813 (Symbol_table::do_define_in_output_data): Likewise.
6814 (Symbol_table::do_define_in_output_segment): Likewise.
6815 (Symbol_table::do_define_as_constant): Likewise.
6816 * symtab.h (Symbol::is_predefined): New function.
6817 (Symbol::init_base_output_data): Add is_predefined parameter.
6818 (Symbol::init_base_output_segment): Likewise.
6819 (Symbol::init_base_constant): Likewise.
6820 (Symbol::is_predefined_): New data member.
6821 (Sized_symbol::init_output_data): Add is_predefined parameter.
6822 (Sized_symbol::init_output_segment): Likewise.
6823 (Sized_symbol::init_constant): Likewise.
6824 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6825
26d3c67d
CC
68262011-06-07 Cary Coutant <ccoutant@google.com>
6827
6828 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6829 instead of emit_copy_reloc.
6830 (Copy_relocs::emit_copy_reloc): Refactor.
6831 (Copy_relocs::make_copy_reloc): New function.
6832 (Copy_relocs::add_copy_reloc): Remove.
6833 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6834 section.
6835 (Copy_relocs::make_copy_reloc): New function.
6836 (Copy_relocs::add_copy_reloc): Remove.
6837 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6838 unchanged input files.
6839 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6840 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6841 Reserve BSS space for COPY relocations.
6842 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6843 (Output_section_incremental_inputs::write_info_blocks): Record
6844 whether a symbol is copied from a shared object.
6845 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6846 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6847 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6848 (Incremental_input_entry_reader::get_output_symbol_index): Add
6849 is_copy parameter.
6850 (Incremental_binary::emit_copy_relocs): New function.
6851 (Incremental_binary::do_emit_copy_relocs): New function.
6852 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6853 new data member.
6854 (Sized_incremental_binary::add_copy_reloc): New function.
6855 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6856 (Sized_incremental_binary::Copy_reloc): New struct.
6857 (Sized_incremental_binary::Copy_relocs): New typedef.
6858 (Sized_incremental_binary::copy_relocs_): New data member.
6859 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6860 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6861 * target.h (Sized_target::emit_copy_reloc): New function.
6862 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6863
7cdb37d9
CC
68642011-06-02 Cary Coutant <ccoutant@google.com>
6865
6866 PR gold/12163
6867 * gold/archive.cc (Archive::Archive): Initialize new data member.
6868 (Archive::include_all_members): Return if archive has already been
6869 included.
6870 * gold/archive.h (Archive::include_all_members_): New data member.
6871
cc643b88
NC
68722011-06-02 Nick Clifton <nickc@redhat.com>
6873
6874 * dynobj.h: Fix spelling mistake in comment.
6875 * output.cc: Likewise.
6876
f62a3ca7 68772011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6878 Asier Llano
f62a3ca7
DK
6879
6880 PR gold/12826
cc643b88 6881 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6882 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6883 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6884 redundant arm_exidx_test.so.
6885 * testsuite/Makefile.in: Regenerate.
6886 (check_SCRIPTS): Add pr12826.sh
6887 (check_DATA): Add pr12826.stdout
6888 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6889 * testsuite/pr12826.sh: New file.
6890 * testsuite/pr12826_1.s: Ditto.
6891 * testsuite/pr12826_1.s: Ditto.
6892
8dbe1edc
ILT
68932011-05-30 Ian Lance Taylor <iant@google.com>
6894
6895 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6896 sections.
6897
c49875be
ILT
68982011-05-29 Ian Lance Taylor <iant@google.com>
6899
6900 PR gold/12804
6901 * testsuite/Makefile.am: Use different file name for two_file_test
6902 temporary file for each incremental test.
6903 * testsuite/Makefile.in: Rebuild.
6904
69d53f7a
ILT
69052011-05-29 Ian Lance Taylor <iant@google.com>
6906
6907 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6908 binary input file is empty.
6909
41d0ab5f
ILT
69102011-05-27 Ian Lance Taylor <iant@google.com>
6911
6912 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6913 (ver_test_9.so): Likewise.
6914 * testsuite/Makefile.in: Rebuild.
6915
89d8a36b
CC
69162011-05-26 Cary Coutant <ccoutant@google.com>
6917
6918 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6919 * incremental.cc (Incremental_inputs::report_input_section): Fix
6920 comment, indentation.
6921 (Incremental_inputs::report_comdat_group): New function.
6922 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6923 of data for incremental input file entry.
6924 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6925 group count, COMDAT group signatures.
6926 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6927 an unchanged input file.
6928 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6929 Initialize new data member.
6930 (Incremental_object_entry::add_comdat_group): New function.
6931 (Incremental_object_entry::get_comdat_group_count): New function.
6932 (Incremental_object_entry::get_comdat_signature_key): New function.
6933 (Incremental_object_entry::groups_): New data member.
6934 (Incremental_inputs::report_comdat_group): New function.
6935 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6936 data for incremental input file entry.
6937 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6938 (Incremental_input_entry_reader::get_input_section): Adjust size of
6939 data for incremental input file entry.
6940 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6941 (Incremental_input_entry_reader::get_comdat_group_signature): New
6942 function.
6943 * object.cc (Sized_relobj::include_section_group): Report kept
6944 COMDAT groups for incremental links.
6945
1706a06f
ILT
69462011-05-24 David Meyer <pdox@google.com>
6947
6948 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6949 with name parameter. Add found_name parameter.
6950 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6951 * dirsearch.h (class Dirsearch): Update declaration.
6952
a10ae760
ILT
69532011-05-24 Ian Lance Taylor <iant@google.com>
6954
6955 * archive.cc (Library_base::should_include_member): Pull in object
6956 from archive if it defines the entry symbol.
6957 * parameters.cc (Parameters::entry): New function.
6958 * parameters.h (class Parameters): Declare entry.
6959 * output.h (class Output_file_header): Remove entry_ field.
6960 * output.cc (Output_file_header::Output_file_header): Remove entry
6961 parameter. Change all callers.
6962 (Output_file_header::entry): Use parameters->entry.
6963 * gold.cc (queue_middle_tasks): Likewise.
6964 * plugin.cc (Plugin_hook::run): Likewise.
6965
aa92d6ed
CC
69662011-05-24 Cary Coutant <ccoutant@google.com>
6967
6968 * gold.cc (queue_initial_tasks): Pass incremental base filename
6969 to Output_file::open_base_file; don't print error message.
6970 * incremental-dump.cc (main): Adjust call to
6971 Output_file::open_for_modification.
6972 * incremental-dump.cc (main): Likewise.
6973 * incremental.cc (Incremental_inputs::report_command_line):
6974 Ignore --incremental-base option when comparing command lines.
6975 Ignore parameter when given as separate argument.
6976 * options.h (class General_options): Add --incremental-base.
6977 * output.cc (Output_file::Output_file):
6978 (Output_file::open_base_file): Add base_name and writable parameters;
6979 read base file into new file; print error message here.
6980 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6981 callers.
6982 * output.h (Output_file::open_for_modification): Rename to...
6983 (Output_file::open_base_file): ...this; add base_name and
6984 writable parameters; adjust all callers.
6985 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6986 callers.
6987 * testsuite/Makefile.am (incremental_test_4): Test
6988 --incremental-base.
6989 * testsuite/Makefile.in: Regenerate.
6990
2eedd706
CC
69912011-05-24 Cary Coutant <ccoutant@google.com>
6992
6993 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6994 incremental_test_4.
6995 * testsuite/Makefile.in: Regenerate.
6996 * testsuite/two_file_test_1_v1.cc: New test source file.
6997 * testsuite/two_file_test_1b_v1.cc: New test source file.
6998 * testsuite/two_file_test_2_v1.cc: New test source file.
6999
0f1c85a6
CC
70002011-05-24 Cary Coutant <ccoutant@google.com>
7001
7002 * dynobj.h (Dynobj::do_dynobj): New function.
7003 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7004 flag and soname for shared objects.
7005 * incremental.cc (Incremental_inputs::report_object): Make
7006 either Incremental_object_entry or Incremental_dynobj_entry; add
7007 soname to string table.
7008 (Incremental_inputs::report_input_section): Add assertion.
7009 (Output_section_incremental_inputs::set_final_data_size): Adjust
7010 type of input file entry for shared libraries; adjust size of
7011 shared library info entry.
7012 (Output_section_incremental_inputs::write_input_files): Write
7013 as_needed flag for shared libraries.
7014 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7015 of input file entry for shared libraries; write soname.
7016 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7017 soname from incremental info.
7018 * incremental.h (enum Incremental_input_flags): Add
7019 INCREMENTAL_INPUT_AS_NEEDED.
7020 (Incremental_input_entry::Incremental_input_entry): Initialize new
7021 data member.
7022 (Incremental_input_entry::set_as_needed): New function.
7023 (Incremental_input_entry::as_needed): New function.
7024 (Incremental_input_entry::do_dynobj_entry): New function.
7025 (Incremental_input_entry::as_needed_): New data member.
7026 (Incremental_object_entry::Incremental_object_entry): Don't check
7027 for shared library.
7028 (Incremental_object_entry::do_type): Likewise.
7029 (class Incremental_dynobj_entry): New class.
7030 (Incremental_input_entry_reader::as_needed): New function.
7031 (Incremental_input_entry_reader::get_soname): New function.
7032 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7033 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7034 size of shared library info entry.
58797674 7035 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7036 incremental link when adding DT_NEEDED entries.
7037 * object.h (Object::Object): Initialize new data member.
7038 (Object::dynobj): New function.
7039 (Object::set_as_needed): New function.
7040 (Object::as_needed): New function.
7041 (Object::do_dynobj): New function.
7042 (Object::as_needed_): New data member.
7043
6fa2a40b
CC
70442011-05-24 Cary Coutant <ccoutant@google.com>
7045
7046 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7047 info; adjust display of GOT entries.
7048 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7049 vector of input objects; remove file_status_.
7050 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7051 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7052 got_plt reader; call target hooks to reserve GOT entries.
7053 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7054 of input file info header and GOT info entry.
7055 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7056 relocation info.
7057 (Got_plt_view_info::got_descriptor): Remove.
7058 (Got_plt_view_info::sym_index): New data member.
7059 (Got_plt_view_info::input_index): New data member.
7060 (Local_got_offset_visitor::visit): Write input file index.
7061 (Global_got_offset_visitor::visit): Write 0 for input file index.
7062 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7063 with sym_index and input_index.
7064 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7065 incremental info GOT entry; replace got_descriptor with input_index.
7066 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7067 map from input file index to object.
7068 (Sized_relobj_incr::do_layout): Replace direct data member reference
7069 with accessor function.
7070 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7071 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7072 Adjust size of input file info header.
7073 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7074 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7075 (Incremental_input_entry_reader::get_input_section): Adjust size of
7076 input file info header.
7077 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7078 of incremental info GOT entry.
7079 (Incremental_got_plt_reader::get_got_desc): Remove.
7080 (Incremental_got_plt_reader::get_got_symndx): New function.
7081 (Incremental_got_plt_reader::get_got_input_index): New function.
7082 (Sized_incremental_binary::Sized_incremental_binary): Remove
7083 file_status_; add input_objects_.
7084 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7085 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7086 (Sized_incremental_binary::file_is_unchanged): Remove.
7087 (Sized_incremental_binary::set_input_object): New function.
7088 (Sized_incremental_binary::input_object): New function.
7089 (Sized_incremental_binary::file_status_): Remove.
7090 (Sized_incremental_binary::input_objects_): New data member.
7091 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7092 references.
7093 (Sized_relobj_incr::invalid_address): Move to base class.
7094 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7095 class.
7096 (Sized_relobj_incr::do_output_section_offset): Likewise.
7097 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7098 (Sized_relobj_incr::section_offsets_): Likewise.
7099 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7100 function.
7101 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7102 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7103 with accessor function.
7104 (Sized_relobj_file::do_layout): Likewise.
7105 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7106 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7107 (Sized_relobj_file::compute_final_local_value): Replace refs to
7108 section_offsets_ with accessor function.
7109 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7110 * object.h (Relobj::Relobj): Initialize new data members.
7111 (Relobj::add_dyn_reloc): New function.
7112 (Relobj::first_dyn_reloc): New function.
7113 (Relobj::dyn_reloc_count): New function.
7114 (Relobj::first_dyn_reloc_): New data member.
7115 (Relobj::dyn_reloc_count_): New data member.
7116 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7117 references.
7118 (Sized_relobj::Address): New typedef.
7119 (Sized_relobj::invalid_address): Move here from child class.
7120 (Sized_relobj::Sized_relobj): Initialize new data members.
7121 (Sized_relobj::sized_relobj): New function.
7122 (Sized_relobj::is_output_section_offset_invalid): Move here from
7123 child class.
7124 (Sized_relobj::get_output_section_offset): Likewise.
7125 (Sized_relobj::local_has_got_offset): Likewise.
7126 (Sized_relobj::local_got_offset): Likewise.
7127 (Sized_relobj::set_local_got_offset): Likewise.
7128 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7129 (Sized_relobj::clear_got_offsets): New function.
7130 (Sized_relobj::section_offsets): Move here from child class.
7131 (Sized_relobj::do_output_section_offset): Likewise.
7132 (Sized_relobj::do_set_section_offset): Likewise.
7133 (Sized_relobj::Local_got_offsets): Likewise.
7134 (Sized_relobj::local_got_offsets_): Likewise.
7135 (Sized_relobj::section_offsets_): Likewise.
7136 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7137 references.
7138 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7139 class.
7140 (Sized_relobj_file::sized_relobj): New function
7141 (Sized_relobj_file::local_has_got_offset): Move to base class.
7142 (Sized_relobj_file::local_got_offset): Likewise.
7143 (Sized_relobj_file::set_local_got_offset): Likewise.
7144 (Sized_relobj_file::get_output_section_offset): Likewise.
7145 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7146 (Sized_relobj_file::do_output_section_offset): Likewise.
7147 (Sized_relobj_file::do_set_section_offset): Likewise.
7148 (Sized_relobj_file::Local_got_offsets): Likewise.
7149 (Sized_relobj_file::local_got_offsets_): Likewise.
7150 (Sized_relobj_file::section_offsets_): Likewise.
7151 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7152 (all constructors).
7153 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7154 (Output_reloc::get_symbol_index): Likewise.
7155 (Output_reloc::local_section_offset): Likewise.
7156 (Output_reloc::get_address): Likewise.
7157 (Output_reloc::symbol_value): Likewise.
7158 (Output_data_got::reserve_slot): Move to class definition.
7159 (Output_data_got::reserve_local): New function.
7160 (Output_data_got::reserve_slot_for_global): Remove.
7161 (Output_data_got::reserve_global): New function.
7162 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7163 (all constructors, two instantiations).
7164 (Output_reloc::get_relobj): New function (two instantiations).
7165 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7166 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7167 (Output_data_reloc::add_global): Adjust type of relobj.
7168 (Output_data_reloc::add_global_relative): Likewise.
7169 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7170 (Output_data_reloc::add_local): Likewise.
7171 (Output_data_reloc::add_local_relative): Likewise.
7172 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7173 (Output_data_reloc::add_local_section): Likewise.
7174 (Output_data_reloc::add_output_section): Likewise.
7175 (Output_data_reloc::add_absolute): Likewise.
7176 (Output_data_reloc::add_target_specific): Likewise.
7177 (Output_data_got::reserve_slot): Move definition here.
7178 (Output_data_got::reserve_local): New function.
7179 (Output_data_got::reserve_global): New function.
7180 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7181 section_offsets_ with accessor function.
7182 (Sized_relobj_file::write_sections): Likewise.
7183 (Sized_relobj_file::do_relocate_sections): Likewise.
7184 * target.h (Sized_target::reserve_local_got_entry): New function.
7185 (Sized_target::reserve_global_got_entry): New function.
7186 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7187 (Target_x86_64::reserve_global_got_entry): New function.
7188 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7189
4829d394
CC
71902011-05-23 Cary Coutant <ccoutant@google.com>
7191
7192 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7193 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7194 bit when checking got_type.
7195 * incremental.cc (Sized_incremental_binary::setup_readers):
7196 Store symbol table and string table locations; initialize bit vector
7197 of file status flags.
7198 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7199 unchanged files.
7200 (Sized_incremental_binary::do_process_got_plt): New function.
7201 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7202 (Output_section_incremental_inputs::set_final_data_size): Record
7203 file index for each input file.
7204 (Output_section_incremental_inputs::write_got_plt): Store file index
7205 instead of input entry offset for each GOT entry.
7206 * incremental.h
7207 (Incremental_input_entry::Incremental_input_entry): Initialize new
7208 data member.
7209 (Incremental_input_entry::set_offset): Store file index.
7210 (Incremental_input_entry::get_file_index): New function.
7211 (Incremental_input_entry::file_index_): New data member.
7212 (Incremental_binary::process_got_plt): New function.
7213 (Incremental_binary::do_process_got_plt): New function.
7214 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7215 data members.
7216 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7217 (Sized_incremental_binary::set_file_is_unchanged): New function.
7218 (Sized_incremental_binary::file_is_unchanged): New function.
7219 (Sized_incremental_binary::do_process_got_plt): New function.
7220 (Sized_incremental_binary::file_status_): New data member.
7221 (Sized_incremental_binary::main_symtab_loc_): New data member.
7222 (Sized_incremental_binary::main_strtab_loc_): New data member.
7223 * output.cc (Output_data_got::Got_entry::write): Add case
7224 RESERVED_CODE.
7225 (Output_data_got::add_global): Call add_got_entry.
7226 (Output_data_got::add_global_plt): Likewise.
7227 (Output_data_got::add_global_with_rel): Likewise.
7228 (Output_data_got::add_global_with_rela): Likewise.
7229 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7230 (Output_data_got::add_global_pair_with_rela): Likewise.
7231 (Output_data_got::add_local): Call add_got_entry.
7232 (Output_data_got::add_local_plt): Likewise.
7233 (Output_data_got::add_local_with_rel): Likewise.
7234 (Output_data_got::add_local_with_rela): Likewise.
7235 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7236 (Output_data_got::add_local_pair_with_rela): Likewise.
7237 (Output_data_got::reserve_slot): New function.
7238 (Output_data_got::reserve_slot_for_global): New function.
7239 (Output_data_got::add_got_entry): New function.
7240 (Output_data_got::add_got_entry_pair): New function.
7241 (Output_section::add_output_section_data): Edit FIXME.
7242 * output.h
7243 (Output_section_data_build::Output_section_data_build): New
7244 constructor with size parameter.
7245 (Output_data_space::Output_data_space): Likewise.
7246 (Output_data_got::Output_data_got): Initialize new data member; new
7247 constructor with size parameter.
7248 (Output_data_got::add_constant): Call add_got_entry.
7249 (Output_data_got::reserve_slot): New function.
7250 (Output_data_got::reserve_slot_for_global): New function.
7251 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7252 (Output_data_got::add_got_entry): New function.
7253 (Output_data_got::add_got_entry_pair): New function.
7254 (Output_data_got::free_list_): New data member.
7255 * target.h (Sized_target::init_got_plt_for_update): New function.
7256 (Sized_target::register_global_plt_entry): New function.
7257 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7258 Initialize new data member; call init; add constructor with PLT count.
7259 (Output_data_plt_x86_64::init): New function.
7260 (Output_data_plt_x86_64::add_relocation): New function.
7261 (Output_data_plt_x86_64::reserve_slot): New function.
7262 (Output_data_plt_x86_64::free_list_): New data member.
7263 (Target_x86_64::init_got_plt_for_update): New function.
7264 (Target_x86_64::register_global_plt_entry): New function.
7265 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7266 incremental updates.
7267 (Output_data_plt_x86_64::add_relocation): New function.
7268 * testsuite/object_unittest.cc (Object_test): Set default options.
7269
ec69d6da
ILT
72702011-05-16 Ian Lance Taylor <iant@google.com>
7271
7272 * options.h (class General_options): Make -i a synonym for -r.
7273
732e31de
ILT
72742011-05-16 Ian Lance Taylor <iant@google.com>
7275
7276 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7277
403676b5
CC
72782011-05-10 Cary Coutant <ccoutant@google.com>
7279
7280 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7281 strip_all (-s).
7282
5b7b7d6e
ILT
72832011-05-06 Ian Lance Taylor <iant@google.com>
7284
7285 * layout.cc (Layout::layout): If the output section flags change,
7286 update the ordering.
7287
f0f9babf
CC
72882011-04-25 Cary Coutant <ccoutant@google.com>
7289
7290 * incremental-dump.cc (dump_incremental_inputs): Print local
7291 symbol info for each input file.
7292 * incremental.cc
7293 (Output_section_incremental_inputs::set_final_data_size): Add local
7294 symbol info to input file entries in incremental info.
7295 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7296 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7297 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7298 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7299 implementation.
7300 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7301 (Sized_incr_relobj::do_relocate): Write the local symbols.
7302 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7303 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7304 Adjust size of input file header.
7305 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7306 (Incremental_inputs_reader::get_local_symbol_count): New function.
7307 (Incremental_inputs_reader::get_input_section): Adjust size of input
7308 file header.
7309 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7310 (Sized_incr_relobj::This): New typedef.
7311 (Sized_incr_relobj::sym_size): New const data member.
7312 (Sized_incr_relobj::Local_symbol): New struct.
7313 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7314 (Sized_incr_relobj::do_local_symbol_offset): New function.
7315 (Sized_incr_relobj::local_symbol_count_): New data member.
7316 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7317 (Sized_incr_relobj::local_symbol_index_): New data member.
7318 (Sized_incr_relobj::local_symbol_offset_): New data member.
7319 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7320 (Sized_incr_relobj::local_symbols_): New data member.
7321 * object.h (Relobj::output_local_symbol_count): New function.
7322 (Relobj::local_symbol_offset): New function.
7323 (Relobj::do_output_local_symbol_count): New function.
7324 (Relobj::do_local_symbol_offset): New function.
7325 (Sized_relobj::do_output_local_symbol_count): New function.
7326 (Sized_relobj::do_local_symbol_offset): New function.
7327
d0a9ace3
ILT
73282011-04-22 Vladimir Simonov <sv@sw.ru>
7329
7330 * descriptors.cc (set_close_on_exec): New function.
7331 (Descriptors::open): Use set_close_on_exec.
7332 * output.cc (S_ISLNK): Define if not defined.
7333
94a3fc8b
CC
73342011-04-22 Cary Coutant <ccoutant@google.com>
7335
7336 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7337 global symbol map.
7338 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7339 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7340 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7341 relocations.
7342 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7343 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7344 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7345 * incremental.h
7346 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7347 function.
7348 (Incremental_binary::apply_incremental_relocs): New function.
7349 (Incremental_binary::do_apply_incremental_relocs): New function.
7350 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7351 data member.
7352 (Sized_incremental_binary::add_global_symbol): New function.
7353 (Sized_incremental_binary::global_symbol): New function.
7354 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7355 (Sized_incremental_binary::symbol_map_): New data member.
7356 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7357 * target.h (Sized_target::apply_relocation): New function.
7358 * target-reloc.h (apply_relocation): New function.
7359 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7360
c87e4302
DK
73612011-04-22 Doug Kwan <dougkwan@google.com>
7362
7363 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7364 flag of a SHT_ARM_EXIDX section.
2e702c99 7365 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7366 * testsuite/Makefile.in: Regenerate.
7367 * testsuite/arm_exidx_test.s: New file.
7368 * testsuite/arm_exidx_test.sh: Same.
7369
e7782cf6
CC
73702011-04-20 Cary Coutant <ccoutant@google.com>
7371
7372 PR gold/12689
7373 * archive.h (Incremental_archive_entry::Archive_member):
7374 Initialize arg_serial_ (second constructor).
7375
308ecdc7
ILT
73762011-04-17 Ian Lance Taylor <iant@google.com>
7377
7378 * object.cc (Relocate_info::location): Simplify location string.
7379 * errors.cc (Errors::error_at_location): Don't print program
7380 name.
7381 (Errors::warning_at_location): Likewise.
7382 (Errors::undefined_symbol): Likewise.
7383 * testsuite/debug_msg.sh: Update accordingly.
7384
bec5b579
CC
73852011-04-14 Cary Coutant <ccoutant@google.com>
7386
7387 * gold/layout.cc (Layout::symtab_section_offset): New function.
7388 * gold/layout.h (Layout::symtab_section_offset): New function.
7389 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7390
88597d34
ILT
73912011-04-12 Ian Lance Taylor <iant@google.com>
7392
7393 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7394 with MREMAP_MAYMOVE.
7395 * output.h (class Output_file): Add map_is_allocated_ field.
7396 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7397 not available, provide stubs. If mremap is not available, #define
7398 it to gold_mremap.
7399 (MREMAP_MAYMOVE): Define if not defined.
7400 (Output_file::Output_file): Initialize map_is_allocated_.
7401 (Output_file::resize): Check map_is_allocated_.
7402 (Output_file::map_anonymous): If mmap fails, use malloc.
7403 (Output_file::unmap): Don't do anything for an anonymous map.
7404 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7405 is not available, provide stubs.
7406 (File_read::View::~View): Use free rather than delete[].
7407 (File_read::make_view): Use malloc rather than new[]. If mmap
7408 fails, use malloc.
7409 (File_read::find_or_make_view): Use malloc rather than new[].
7410 * gold.h: Remove HAVE_REMAP code.
7411 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7412 exists. Rename mremap to gold_mremap. If mmap is not available
7413 don't do anything.
7414 * configure, config.in: Rebuild.
7415
11e361bc
ILT
74162011-04-11 Ian Lance Taylor <iant@google.com>
7417
7418 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7419 initialize local variable v.
7420
cdc29364
CC
74212011-04-11 Cary Coutant <ccoutant@google.com>
7422
7423 * archive.cc (Archive::include_member): Adjust call to
7424 report_object.
7425 (Add_archive_symbols::run): Track argument serial numbers.
7426 (Lib_group::include_member): Likewise.
7427 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7428 * archive.h (Incremental_archive_entry::Archive_member):
7429 Initialize arg_serial_.
7430 (Archive_member::arg_serial_): New data member.
7431 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7432 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7433 incremental link.
7434 (Sized_dynobj::do_for_all_local_got_entries): New function.
7435 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7436 function.
7437 * fileread.cc (get_mtime): New function.
7438 * fileread.h (get_mtime): New function.
7439 * gold.cc (queue_initial_tasks): Check for incremental update.
7440 (process_incremental_input): New function.
7441 (queue_middle_tasks): Don't force valid target for incremental
7442 update.
7443 * incremental-dump.cc (find_input_containing_global): Adjust
7444 size of symbol info entry.
7445 (dump_incremental_inputs): Dump argument serial number and
7446 in_system_directory flag; bias shndx by 1; print symbol names
7447 when dumping per-file symbol lists; use new symbol info readers.
7448 * incremental.cc
7449 (Output_section_incremental_inputs:update_data_size): New function.
7450 (Sized_incremental_binary::setup_readers): Setup input readers
7451 for each input file; build maps for files added from libraries
7452 and scripts.
7453 (Sized_incremental_binary::check_input_args): New function.
7454 (Sized_incremental_binary::do_check_inputs): Build map of argument
7455 serial numbers to input arguments.
7456 (Sized_incremental_binary::do_file_has_changed): Rename
7457 do_file_is_unchanged to this; compare file modification times.
7458 (Sized_incremental_binary::do_init_layout): New function.
7459 (Sized_incremental_binary::do_reserve_layout): New function.
7460 (Sized_incremental_binary::do_get_input_reader): Remove.
7461 (Sized_incremental_binary::get_symtab_view): New function.
7462 (Incremental_checker::can_incrementally_link_output_file): Remove.
7463 (Incremental_inputs::report_command_line): Exclude --debug options.
7464 (Incremental_inputs::report_archive_begin): Add parameter; track
7465 argument serial numbers; don't put input file entry for archive
7466 before archive members.
7467 (Incremental_inputs::report_archive_end): Put input file entry
7468 for archive after archive members.
7469 (Incremental_inputs::report_object): Add parameter; track argument
7470 serial numbers and in_system_directory flag.
7471 (Incremental_inputs::report_script): Add parameter; track argument
7472 serial numbers.
7473 (Output_section_incremental_inputs::set_final_data_size): Adjust
7474 size of symbol info entry; check for forwarding symbols.
7475 (Output_section_incremental_inputs::write_input_files): Write
7476 in_system_directory flag and argument serial number.
7477 (Output_section_incremental_inputs::write_info_blocks): Map section
7478 indices between incremental info and original input file; store
7479 input section index for each symbol.
7480 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7481 change operator() to visit().
7482 (class Global_got_offset_visitor): Likewise.
7483 (class Global_symbol_visitor_got_plt):
7484 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7485 classes.
7486 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7487 (Sized_incr_relobj::do_read_symbols): New function.
7488 (Sized_incr_relobj::do_layout): New function.
7489 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7490 (Sized_incr_relobj::do_add_symbols): New function.
7491 (Sized_incr_relobj::do_should_include_member): New function.
7492 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7493 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7494 (Sized_incr_relobj::do_section_size): New function.
7495 (Sized_incr_relobj::do_section_name): New function.
7496 (Sized_incr_relobj::do_section_contents): New function.
7497 (Sized_incr_relobj::do_section_flags): New function.
7498 (Sized_incr_relobj::do_section_entsize): New function.
7499 (Sized_incr_relobj::do_section_address): New function.
7500 (Sized_incr_relobj::do_section_type): New function.
7501 (Sized_incr_relobj::do_section_link): New function.
7502 (Sized_incr_relobj::do_section_info): New function.
7503 (Sized_incr_relobj::do_section_addralign): New function.
7504 (Sized_incr_relobj::do_initialize_xindex): New function.
7505 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7506 (Sized_incr_relobj::do_read_relocs): New function.
7507 (Sized_incr_relobj::do_gc_process_relocs): New function.
7508 (Sized_incr_relobj::do_scan_relocs): New function.
7509 (Sized_incr_relobj::do_count_local_symbols): New function.
7510 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7511 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7512 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7513 (Sized_incr_relobj::do_relocate): New function.
7514 (Sized_incr_relobj::do_set_section_offset): New function.
7515 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7516 (Sized_incr_dynobj::do_read_symbols): New function.
7517 (Sized_incr_dynobj::do_layout): New function.
7518 (Sized_incr_dynobj::do_add_symbols): New function.
7519 (Sized_incr_dynobj::do_should_include_member): New function.
7520 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7521 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7522 (Sized_incr_dynobj::do_section_size): New function.
7523 (Sized_incr_dynobj::do_section_name): New function.
7524 (Sized_incr_dynobj::do_section_contents): New function.
7525 (Sized_incr_dynobj::do_section_flags): New function.
7526 (Sized_incr_dynobj::do_section_entsize): New function.
7527 (Sized_incr_dynobj::do_section_address): New function.
7528 (Sized_incr_dynobj::do_section_type): New function.
7529 (Sized_incr_dynobj::do_section_link): New function.
7530 (Sized_incr_dynobj::do_section_info): New function.
7531 (Sized_incr_dynobj::do_section_addralign): New function.
7532 (Sized_incr_dynobj::do_initialize_xindex): New function.
7533 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7534 (make_sized_incremental_object): New function.
7535 (Incremental_library::copy_unused_symbols): New function.
7536 (Incremental_library::do_for_all_unused_symbols): New function.
7537 * incremental.h (enum Incremental_input_flags): New type.
7538 (class Incremental_checker): Remove.
7539 (Incremental_input_entry::Incremental_input_entry): Add argument
7540 serial number.
7541 (Incremental_input_entry::arg_serial): New function.
7542 (Incremental_input_entry::set_is_in_system_directory): New function.
7543 (Incremental_input_entry::is_in_system_directory): New function.
7544 (Incremental_input_entry::arg_serial_): New data member.
7545 (Incremental_input_entry::is_in_system_directory_): New data member.
7546 (class Script_info): Move here from script.h.
7547 (Script_info::Script_info): Add filename parameter.
7548 (Script_info::filename): New function.
7549 (Script_info::filename_): New data member.
7550 (Incremental_script_entry::Incremental_script_entry): Add argument
7551 serial number.
7552 (Incremental_object_entry::Incremental_object_entry): Likewise.
7553 (Incremental_object_entry::add_input_section): Build list of input
7554 sections with map to original shndx.
7555 (Incremental_object_entry::get_input_section_index): New function.
7556 (Incremental_object_entry::shndx_): New data member.
7557 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7558 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7559 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7560 serial number.
7561 (Incremental_inputs::report_archive_begin): Likewise.
7562 (Incremental_inputs::report_object): Likewise.
7563 (Incremental_inputs::report_script): Likewise.
7564 (class Incremental_global_symbol_reader): New class.
7565 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7566 and store flags and input file type.
7567 (Incremental_input_entry_reader::arg_serial): New function.
7568 (Incremental_input_entry_reader::type): Extract type from flags.
7569 (Incremental_input_entry_reader::is_in_system_directory): New function.
7570 (Incremental_input_entry_reader::get_input_section_count): Call
7571 accessor function for type.
7572 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7573 function for type; adjust size of global symbol entry.
7574 (Incremental_input_entry_reader::get_global_symbol_count): Call
7575 accessor function for type.
7576 (Incremental_input_entry_reader::get_object_count): Likewise.
7577 (Incremental_input_entry_reader::get_object_offset): Likewise.
7578 (Incremental_input_entry_reader::get_member_count): Likewise.
7579 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7580 (Incremental_input_entry_reader::get_member_offset): Likewise.
7581 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7582 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7583 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7584 (Incremental_input_entry_reader::get_global_symbol_reader): New
7585 function.
7586 (Incremental_input_entry_reader::get_output_symbol_index): New
7587 function.
7588 (Incremental_input_entry_reader::type_): Remove.
7589 (Incremental_input_entry_reader::flags_): New data member.
7590 (Incremental_inputs_reader::input_file_offset): New function.
7591 (Incremental_inputs_reader::input_file_index): New function.
7592 (Incremental_inputs_reader::input_file): Call input_file_offset.
7593 (Incremental_inputs_reader::input_file_at_offset): New function.
7594 (Incremental_relocs_reader::get_r_type): Reformat.
7595 (Incremental_relocs_reader::get_r_shndx): Reformat.
7596 (Incremental_relocs_reader::get_r_offset): Reformat.
7597 (Incremental_relocs_reader::data): New function.
7598 (Incremental_binary::Incremental_binary): Initialize new data members.
7599 (Incremental_binary::check_inputs): Add cmdline parameter.
7600 (Incremental_binary::file_is_unchanged): Remove.
7601 (Input_reader::arg_serial): New function.
7602 (Input_reader::get_unused_symbol_count): New function.
7603 (Input_reader::get_unused_symbol): New function.
7604 (Input_reader::do_arg_serial): New function.
7605 (Input_reader::do_get_unused_symbol_count): New function.
7606 (Input_reader::do_get_unused_symbol): New function.
7607 (Incremental_binary::input_file_count): New function.
7608 (Incremental_binary::get_input_reader): Change signature to use
7609 index instead of filename.
7610 (Incremental_binary::file_has_changed): New function.
7611 (Incremental_binary::get_input_argument): New function.
7612 (Incremental_binary::get_library): New function.
7613 (Incremental_binary::get_script_info): New function.
7614 (Incremental_binary::init_layout): New function.
7615 (Incremental_binary::reserve_layout): New function.
7616 (Incremental_binary::output_file): New function.
7617 (Incremental_binary::do_check_inputs): New function.
7618 (Incremental_binary::do_file_is_unchanged): Remove.
7619 (Incremental_binary::do_file_has_changed): New function.
7620 (Incremental_binary::do_init_layout): New function.
7621 (Incremental_binary::do_reserve_layout): New function.
7622 (Incremental_binary::do_input_file_count): New function.
7623 (Incremental_binary::do_get_input_reader): Change signature.
7624 (Incremental_binary::input_args_map_): New data member.
7625 (Incremental_binary::library_map_): New data member.
7626 (Incremental_binary::script_map_): New data member.
7627 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7628 new data members.
7629 (Sized_incremental_binary::output_section): New function.
7630 (Sized_incremental_binary::inputs_reader): Add const.
7631 (Sized_incremental_binary::symtab_reader): Add const.
7632 (Sized_incremental_binary::relocs_reader): Add const.
7633 (Sized_incremental_binary::got_plt_reader): Add const.
7634 (Sized_incremental_binary::get_symtab_view): New function.
7635 (Sized_incremental_binary::Inputs_reader): New typedef.
7636 (Sized_incremental_binary::Input_entry_reader): New typedef.
7637 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7638 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7639 (Sized_incremental_binary::do_file_has_changed): New function.
7640 (Sized_incremental_binary::do_init_layout): New function.
7641 (Sized_incremental_binary::do_reserve_layout): New function.
7642 (Sized_input_reader::Inputs_reader): Remove.
7643 (Sized_input_reader::Input_entry_reader): Remove.
7644 (Sized_input_reader::do_arg_serial): New function.
7645 (Sized_input_reader::do_get_unused_symbol_count): New function.
7646 (Sized_input_reader::do_get_unused_symbol): New function.
7647 (Sized_incremental_binary::do_input_file_count): New function.
7648 (Sized_incremental_binary::do_get_input_reader): Change signature;
7649 use index instead of filename.
7650 (Sized_incremental_binary::section_map_): New data member.
7651 (Sized_incremental_binary::input_entry_readers_): New data member.
7652 (class Sized_incr_relobj): New class.
7653 (class Sized_incr_dynobj): New class.
7654 (make_sized_incremental_object): New function.
7655 (class Incremental_library): New class.
7656 * layout.cc (Free_list::num_lists): New static data member.
7657 (Free_list::num_nodes): New static data member.
7658 (Free_list::num_removes): New static data member.
7659 (Free_list::num_remove_visits): New static data member.
7660 (Free_list::num_allocates): New static data member.
7661 (Free_list::num_allocate_visits): New static data member.
7662 (Free_list::init): New function.
7663 (Free_list::remove): New function.
7664 (Free_list::allocate): New function.
7665 (Free_list::dump): New function.
7666 (Free_list::print_stats): New function.
7667 (Layout_task_runner::run): Resize output file for incremental updates.
7668 (Layout::Layout): Initialize new data members.
7669 (Layout::set_incremental_base): New function.
7670 (Layout::init_fixed_output_section): New function.
7671 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7672 incremental updates.
7673 (Layout::create_gold_note): Do not create gold note section for
7674 incremental updates.
7675 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7676 for incremental updates.
7677 (Layout::set_section_offsets): For incremental updates, allocate space
7678 from free list.
7679 (Layout::create_symtab_sections): Layout with offsets relative to
7680 start of section; for incremental updates, allocate space from free
7681 list.
7682 (Layout::create_shdrs): For incremental updates, allocate space from
7683 free list.
7684 (Layout::finish_dynamic_section): For incremental updates, do not
7685 check --as-needed (fixed in subsequent patch).
7686 * layout.h (class Free_list): New class.
7687 (Layout::set_incremental_base): New function.
7688 (Layout::incremental_base): New function.
7689 (Layout::init_fixed_output_section): New function.
7690 (Layout::allocate): New function.
7691 (Layout::incremental_base_): New data member.
7692 (Layout::free_list_): New data member.
7693 * main.cc (main): Print Free_list statistics.
7694 * object.cc (Relobj::finalize_incremental_relocs): Add
7695 clear_counts parameter; clear counts only when clear_counts is set.
7696 (Sized_relobj::Sized_relobj): Initialize new base class.
7697 (Sized_relobj::do_layout): Don't report special sections.
7698 (Sized_relobj::do_for_all_local_got_entries): New function.
7699 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7700 symtab_off to all symbol table offsets.
7701 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7702 * object.h (class Got_offset_list): Move to top of file.
7703 (Object::Object): Allow case where input_file == NULL.
7704 (Object::~Object): Likewise.
7705 (Object::input_file): Assert that input_file != NULL.
7706 (Object::lock): Allow case where input_file == NULL.
7707 (Object::unlock): Likewise.
7708 (Object::is_locked): Likewise.
7709 (Object::token): Likewise.
7710 (Object::release): Likewise.
7711 (Object::is_incremental): New function.
7712 (Object::get_mtime): New function.
7713 (Object::for_all_local_got_entries): New function.
7714 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7715 (Object::set_is_in_system_directory): New function.
7716 (Object::is_in_system_directory): New function.
7717 (Object::do_is_incremental): New function.
7718 (Object::do_get_mtime): New function.
7719 (Object::do_for_all_local_got_entries): New function.
7720 (Object::is_in_system_directory_): New data member.
7721 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7722 (class Sized_relobj_base): New class.
7723 (class Sized_relobj): Derive from Sized_relobj_base.
7724 (class Sized_relobj::Symbols): Redeclare from base class.
7725 (class Sized_relobj::local_got_offset_list): Remove.
7726 (class Sized_relobj::Output_sections): Redeclare from base class.
7727 (class Sized_relobj::do_for_all_local_got_entries): New function.
7728 (class Sized_relobj::write_local_symbols): Add offset parameter.
7729 (class Sized_relobj::local_symbol_offset_): Update comment.
7730 (class Sized_relobj::local_dynsym_offset_): Update comment.
7731 * options.cc (Input_arguments::add_file): Remove const.
7732 * options.h (Input_file_argument::Input_file_argument):
7733 Initialize arg_serial_ (all constructors).
7734 (Input_file_argument::set_arg_serial): New function.
7735 (Input_file_argument::arg_serial): New function.
7736 (Input_file_argument::arg_serial_): New data member.
7737 (Input_arguments::Input_arguments): Initialize file_count_.
7738 (Input_arguments::add_file): Remove const.
7739 (Input_arguments::number_of_input_files): New function.
7740 (Input_arguments::file_count_): New data member.
7741 (Command_line::number_of_input_files): Call
7742 Input_arguments::number_of_input_files.
7743 * output.cc (Output_segment_headers::Output_segment_headers):
7744 Set current size.
7745 (Output_section::Input_section::current_data_size): New function.
7746 (Output_section::Output_section): Initialize new data members.
7747 (Output_section::add_input_section): Don't do merge sections for
7748 an incremental link; allocate space from free list for an
7749 incremental update.
7750 (Output_section::add_output_section_data): Allocate space from
7751 free list for an incremental update.
7752 (Output_section::update_data_size): New function.
7753 (Output_section::set_fixed_layout): New function.
7754 (Output_section::reserve): New function.
7755 (Output_segment::set_section_addresses): Remove const.
7756 (Output_segment::set_section_list_addresses): Remove const; allocate
7757 space from free list for an incremental update.
7758 (Output_segment::set_offset): Adjust size of RELRO segment for an
7759 incremental update.
7760 * output.h (Output_data::current_data_size): Move here from
7761 child classes.
7762 (Output_data::pre_finalize_data_size): New function.
7763 (Output_data::update_data_size): New function.
7764 (Output_section_headers::update_data_size): new function.
7765 (Output_section_data_build::current_data_size): Move to Output_data.
7766 (Output_data_strtab::update_data_size): New function.
7767 (Output_section::current_data_size): Move to Output_data.
7768 (Output_section::set_fixed_layout): New function.
7769 (Output_section::has_fixed_layout): New function.
7770 (Output_section::reserve): New function.
7771 (Output_section::update_data_size): New function.
7772 (Output_section::has_fixed_layout_): New data member.
7773 (Output_section::free_list_): New data member.
7774 (Output_segment::set_section_addresses): Remove const.
7775 (Output_segment::set_section_list_addresses): Remove const.
7776 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7777 New function.
7778 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7779 New function.
7780 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7781 parameter when calling Add_symbols constructor; store argument
7782 serial number for members of a lib group.
7783 (Add_symbols::locks): Allow case where token == NULL.
7784 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7785 (Read_member::~Read_member): New function.
7786 (Read_member::is_runnable): New function.
7787 (Read_member::locks): New function.
7788 (Read_member::run): New function.
7789 (Check_script::~Check_script): New function.
7790 (Check_script::is_runnable): New function.
7791 (Check_script::locks): New function.
7792 (Check_script::run): New function.
7793 (Check_library::~Check_library): New function.
7794 (Check_library::is_runnable): New function.
7795 (Check_library::locks): New function.
7796 (Check_library::run): New function.
7797 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7798 (Add_symbols::library_): New data member.
7799 (class Read_member): New class.
7800 (class Check_script): New class.
7801 (class Check_library): New class.
7802 * reloc.cc (Read_relocs::is_runnable): Allow case where
7803 token == NULL.
7804 (Read_relocs::locks): Likewise.
7805 (Scan_relocs::locks): Likewise.
7806 (Relocate_task::locks): Likewise.
7807 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7808 to clear counters.
7809 (Sized_relobj::incremental_relocs_scan): Fix comment.
7810 (Sized_relobj::do_relocate): Pass output file offset to
7811 write_local_symbols.
7812 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7813 from class declaration.
7814 * script.cc (read_input_script): Allocate Script_info; pass
7815 argument serial number to report_script.
7816 * script.h (class Script_info): Move to incremental.h.
7817 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7818 * symtab.h (Symbol_table::add_from_incrobj): New function.
7819 (Symbol_table::set_file_offset): New function.
7820
b961d0d7
CC
78212011-04-05 Cary Coutant <ccoutant@google.com>
7822
7823 * incremental-dump.cc (dump_incremental_inputs): Change signature
7824 to take a Sized_incremental_binary; change caller. Use readers
7825 in Sized_incremental_binary.
7826 * incremental.cc
7827 (Sized_incremental_binary::find_incremental_inputs_sections):
7828 Rename do_find_incremental_inputs_sections to this.
7829 (Sized_incremental_binary::setup_readers): New function.
7830 (Sized_incremental_binary::do_check_inputs): Check
7831 has_incremental_info_ flag; move setup code to setup_readers;
7832 use input readers.
7833 (Sized_incremental_binary::do_file_is_unchanged): New function.
7834 (Sized_incremental_binary::do_get_input_reader): New function.
7835 * incremental.h (class Incremental_binary): Move to end of file.
7836 (Incremental_binary::file_is_unchanged): New function.
7837 (Incremental_binary::do_file_is_unchanged): New function.
7838 (Incremental_binary::Input_reader): New class.
7839 (Incremental_binary::get_input_reader): New function.
7840 (class Sized_incremental_binary): Move to end of file.
7841 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7842 input section reader classes.
7843 (Sized_incremental_binary::has_incremental_info): New function.
7844 (Sized_incremental_binary::inputs_reader): New function.
7845 (Sized_incremental_binary::symtab_reader): New function.
7846 (Sized_incremental_binary::relocs_reader): New function.
7847 (Sized_incremental_binary::got_plt_reader): New function.
7848 (Sized_incremental_binary::do_file_is_unchanged): New function.
7849 (Sized_incremental_binary::Sized_input_reader): New class.
7850 (Sized_incremental_binary::get_input_reader): New function.
7851 (Sized_incremental_binary::find_incremental_inputs_sections):
7852 Rename do_find_incremental_inputs_sections to this.
7853 (Sized_incremental_binary::setup_readers): New function.
7854 (Sized_incremental_binary::has_incremental_info_): New data member.
7855 (Sized_incremental_binary::inputs_reader_): New data member.
7856 (Sized_incremental_binary::symtab_reader_): New data member.
7857 (Sized_incremental_binary::relocs_reader_): New data member.
7858 (Sized_incremental_binary::got_plt_reader_): New data member.
7859 (Sized_incremental_binary::current_input_file_): New data member.
7860
a869183f
PP
78612011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7862
7863 PR gold/12640
7864 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7865 violation.
7866
78672011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7868
7869 * archive.cc (Archive::include_member): Adjust call to report_object.
7870 (Add_archive_symbols::run): Add script_info to call to
7871 report_archive_begin.
7872 (Lib_group::include_member): Adjust call to report_object.
7873 (Add_lib_group_symbols::run): Adjust call to report_object.
7874 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7875 blocks. Add object count for script input files.
7876 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7877 script_info parameter; change all callers.
7878 (Incremental_inputs::report_object): Add script_info parameter;
7879 change all callers.
7880 (Incremental_inputs::report_script): Store backpointer to
7881 incremental info entry.
7882 (Output_section_incremental_inputs::set_final_data_size): Record
7883 additional information for scripts.
7884 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7885 * incremental.h (Incremental_script_entry::add_object): New function.
7886 (Incremental_script_entry::get_object_count): New function.
7887 (Incremental_script_entry::get_object): New function.
7888 (Incremental_script_entry::objects_): New data member; adjust
7889 constructor.
7890 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7891 (Incremental_inputs::report_object): Add script_info parameter.
7892 (Incremental_inputs_reader::get_object_count): New function.
7893 (Incremental_inputs_reader::get_object_offset): New function.
7894 * options.cc (Input_arguments::add_file): Return reference to
7895 new input argument.
7896 * options.h (Input_argument::set_script_info): New function.
7897 (Input_argument::script_info): New function.
7898 (Input_argument::script_info_): New data member; adjust all
7899 constructors.
7900 (Input_file_group::add_file): Return reference to new input argument.
7901 (Input_file_lib::add_file): Likewise.
7902 (Input_arguments::add_file): Likewise.
7903 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7904 * script.cc (Parser_closure::Parser_closure): Add script_info
7905 parameter; adjust all callers.
7906 (Parser_closure::script_info): New function.
7907 (Parser_closure::script_info_): New data member.
7908 (read_input_script): Report scripts earlier to incremental info.
7909 (script_add_file): Set script_info in Input_argument.
7910 (script_add_library): Likewise.
7911 * script.h (Script_options::Script_info): Rewrite class.
7912
a869183f 79132011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7914
7915 * archive.cc (Library_base::should_include_member): Move
7916 method here from class Archive.
7917 (Archive::Archive): Initialize base class.
7918 (Archive::should_include_member): Move to base class.
7919 (Archive::do_for_all_unused_symbols): New function.
7920 (Add_archive_symbols::run): Remove redundant access to
7921 incremental_inputs.
7922 (Lib_group::Lib_group): Initialize base class.
7923 (Lib_group::do_filename): New function.
7924 (Lib_group::include_member): Pass pointer to Lib_group to
7925 report_object.
7926 (Lib_group::do_for_all_unused_symbols): New function.
7927 (Add_lib_group_symbols::run): Report archive information for
7928 incremental links.
7929 * archive.h (class Library_base): New base class.
7930 (class Archive): Derive from Library_base.
7931 (Archive::filename): Move to base class.
7932 (Archive::set_incremental_info): Likewise.
7933 (Archive::incremental_info): Likewise.
7934 (Archive::Should_include): Likewise.
7935 (Archive::should_include_member): Likewise.
7936 (Archive::Armap_entry): Remove.
7937 (Archive::Unused_symbol_iterator): Remove.
7938 (Archive::unused_symbols_begin): Remove.
7939 (Archive::unused_symbols_end): Remove.
7940 (Archive::do_filename): New function.
7941 (Archive::do_get_mtime): New function.
7942 (Archive::do_for_all_unused_symbols): New function.
7943 (Archive::task_): Move to base class.
7944 (Archive::incremental_info_): Likewise.
7945 (class Lib_group): Derive from Library_base.
7946 (Lib_group::do_filename): New function.
7947 (Lib_group::do_get_mtime): New function.
7948 (Lib_group::do_for_all_unused_symbols): New function.
7949 (Lib_group::task_): Move to base class.
7950 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7951 function.
7952 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7953 function.
7954 * incremental.cc (Incremental_inputs::report_archive_begin):
7955 Use Library_base; call library's get_mtime; add incremental inputs
7956 entry before members.
7957 (class Unused_symbol_visitor): New class.
7958 (Incremental_inputs::report_archive_end): Use Library_base; use
7959 visitor class to record unused symbols; don't add incremental inputs
7960 entry after members.
7961 (Incremental_inputs::report_object): Use Library_base.
7962 * incremental.h
7963 (Incremental_archive_entry::Incremental_archive_entry): Remove
7964 unused Archive parameter.
7965 (Incremental_inputs::report_archive_begin): Use Library_base.
7966 (Incremental_inputs::report_archive_end): Likewise.
7967 (Incremental_inputs::report_object): Likewise.
7968 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7969 function.
7970 * object.h (Object::for_all_global_symbols): New function.
7971 (Object::do_for_all_global_symbols): New function.
7972 (Sized_relobj::do_for_all_global_symbols): New function.
7973 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7974 function.
7975 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7976 function.
7977
61ab3e40
ILT
79782011-03-27 Ian Lance Taylor <iant@google.com>
7979
7980 * archive.cc (Archive::interpret_header): Return -1 if something
7981 goes wrong. Change callers accordingly.
7982
30e1f9e6
CC
79832011-03-25 Cary Coutant <ccoutant@google.com>
7984
7985 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7986 * testsuite/Makefile.in: Regenerate.
7987
9370ce59 79882011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7989
7990 * plugin.cc (get_view): New.
7991 (Plugin::load): Pass get_view to the plugin.
7992 (Plugin_manager::get_view): New.
7993
9312bb0a
ILT
79942011-03-21 Ian Lance Taylor <iant@google.com>
7995
7996 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7997 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7998
7e12ba9e
ST
79992011-03-21 Sriraman Tallam <tmsriram@google.com>
8000
8001 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8002 Change == to -eq.
8003 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8004 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8005 Change == to -eq.
8006 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8007 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8008
fd7a005d
ILT
80092011-03-14 Ian Lance Taylor <iant@google.com>
8010
8011 * script-sections.cc (Sort_output_sections::script_compare):
8012 Rename from is_before, change return type.
8013 (Sort_output_sections::operator()): Adjust accordingly.
8014
ed16fd1b
ILT
80152011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8016
8017 PR gold/12572
8018 * testsuite/odr_violation2.cc: Add comment to make all error line
8019 numbers double digits.
8020 * testsuite/debug_msg.sh: Adjust expected errors.
8021
71ff8986
ILT
80222011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8023
8024 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8025 but mark earlier ones as non-canonical
8026 (offset_to_iterator): Update search target and example
8027 (do_addr2line): Return extra lines in a vector*
8028 (format_file_lineno): Extract from do_addr2line
8029 (one_addr2line): Add vector* out-param
8030 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8031 when a lineno entry appeared last for its instruction
8032 (Dwarf_line_info): Add vector* out-param
8033 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8034 * symtab.cc (Odr_violation_compare): Include the lineno in the
8035 comparison again.
8036 (linenos_from_loc): New. Combine the canonical line for an
8037 address with its other lines.
8038 (True_if_intersect): New. Helper functor to make
8039 std::set_intersection a query.
8040 (detect_odr_violations): Compare sets of lines instead of just
8041 one line for each function. This became less deterministic, but
8042 has fewer false positives.
8043 * symtab.h: Declarations.
8044 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8045 mix an optimized and non-optimized object in the same binary
8046 (odr_violation2.so): Same.
8047 * testsuite/Makefile.in: Regenerate from Makefile.am.
8048 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8049 * testsuite/debug_msg.sh: Update line numbers and add
8050 assertions.
8051 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8052 non-optimized context.
8053 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8054 isn't inlined, and use OdrDerived in an optimized context.
8055 * testsuite/odr_header1.h: Defines OdrDerived, where
8056 optimization will change the
8057 first-instruction-in-the-destructor's file and line number.
8058 * testsuite/odr_header2.h: Defines OdrBase.
8059
a19fefdc
ILT
80602011-03-09 Ian Lance Taylor <iant@google.com>
8061
8062 * fileread.cc (File_read::clear_views): Don't delete the whole
8063 file view.
8064
ecb351e9
ILT
80652011-03-08 Ian Lance Taylor <iant@google.com>
8066
8067 PR gold/12525
8068 * fileread.cc: #include <climits>.
8069 (GOLD_IOV_MAX): Define.
8070 (File_read::read_multiple): Limit number of entries by iov_max.
8071 * fileread.h (class File_read): Always set max_readv_entries to
8072 128.
8073
b821d13c
ILT
80742011-03-07 Ian Lance Taylor <iant@google.com>
8075
8076 PR gold/12525
8077 * options.h (class General_options): Add -dy and -dn.
8078
89243142
CC
80792011-03-02 Cary Coutant <ccoutant@google.com>
8080
8081 * testsuite/script_test_9.t: Add TLS segment.
8082
d0773f31
ILT
80832011-03-02 Simon Baldwin <simonb@google.com>
8084
8085 * configure.ac: Add check for gnu_indirect_function support in
8086 the toolchain building binutils.
8087 * configure: Rebuild.
8088
9370ce59 80892011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8090
8091 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8092 plugin only symbols.
8093 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8094 in plugin files as not needed in the symbol table.
8095
4cf7a849
ST
80962011-02-11 Sriraman Tallam <tmsriram@google.com>
8097
8098 * output.cc (Output_section::add_input_section): Delay fill
8099 generation for section ordering.
8100
b578bd7d
ILT
81012011-02-09 Ian Lance Taylor <iant@google.com>
8102
8103 PR gold/12316
8104 * object.h (class Sized_relobj): Remove clear_local_symbols.
8105 * reloc.cc (Sized_relobj::do_relocate): Don't call
8106 clear_local_symbols.
8107
9370ce59 81082011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8109
8110 * plugin.cc (is_visible_from_outside): Return true for symbols
8111 in the -u option.
8112
55382fb7
ILT
81132011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8114
8115 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8116 filename.
8117
4e271fff
ST
81182011-02-02 Sriraman Tallam <tmsriram@google.com>
8119
8120 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8121 to std::string.
4e271fff 8122 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8123 section_name to be std::string.
4e271fff
ST
8124 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8125
d433c3ac
ILT
81262011-01-25 Ian Lance Taylor <iant@google.com>
8127
8128 * script.cc (script_add_extern): Rewrite to use
8129 add_symbol_reference.
8130
880473a6
DK
81312011-01-25 Doug Kwan <dougkwan@google.com>
8132
d433c3ac 8133 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8134
f30f86fa
ILT
81352011-01-24 Ian Lance Taylor <iant@google.com>
8136
8137 * options.h (class General_options): Accept
8138 --no-detect-odr-violations.
8139
8e51a0b9
ILT
81402011-01-24 Ian Lance Taylor <iant@google.com>
8141
8142 * version.cc (version_string): Bump to 1.11.
8143
0f3b89d8
ILT
81442011-01-24 Ian Lance Taylor <iant@google.com>
8145
8146 * plugin.cc (class Plugin_rescan): Define new class.
8147 (Plugin_manager::claim_file): Set any_claimed_.
8148 (Plugin_manager::save_archive): New function.
8149 (Plugin_manager::save_input_group): New function.
8150 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8151 necessary.
8152 (Plugin_manager::new_undefined_symbol): New function.
8153 (Plugin_manager::rescan): New function.
8154 (Plugin_manager::rescannable_defines): New function.
8155 (Plugin_manager::add_input_file): Set any_added_.
8156 * plugin.h (class Plugin_manager): define new fields rescannable_,
8157 undefined_symbols_, any_claimed_, and any_added_. Declare
8158 Plugin_rescan as friend. Declare new functions.
8159 (Plugin_manager::Rescannable): Define type.
8160 (Plugin_manager::Rescannable_list): Define type.
8161 (Plugin_manager::Undefined_symbol_list): Define type.
8162 (Plugin_manager::Plugin_manager): Initialize new fields.
8163 * archive.cc (Archive::defines_symbol): New function.
8164 (Add_archive_symbols::run): Pass archive to plugins if any.
8165 * archive.h (class Archive): Declare defines_symbol.
8166 * readsyms.cc (Input_group::~Input_group): New function.
8167 (Finish_group::run): Pass input_group to plugins if any.
8168 * readsyms.h (class Input_group): Declare destructor.
8169 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8170 any.
8171
3bb951e5
ILT
81722011-01-10 Ian Lance Taylor <iant@google.com>
8173
8174 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8175 section as relro.
8176 (Layout::set_segment_offsets): Reset increase_relro before calling
8177 set_section_addresses a second time.
8178
0aa45fac
CC
81792011-01-04 Cary Coutant <ccoutant@google.com>
8180
8181 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8182 sections before NOBITS sections.
8183
0db46eb4
L
81842011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8185
8186 * version.cc (print_version): Update copyright to 2011.
8187
829c9745
CC
81882010-12-23 Cary Coutant <ccoutant@google.com>
8189
8190 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8191 of OS to this->add. Add OD parameter to second form of the function.
8192
7500420b
ILT
81932010-12-20 Ian Lance Taylor <iant@google.com>
8194
8195 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8196 second of two consecutive entries with same offset.
8197
f8e9a930
RW
81982010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8199
8200 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8201 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8202 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8203 to avoid unneeded links against $(LDADD).
8204 * testsuite/Makefile.in: Regenerate.
8205
2fbb4320
ILT
82062010-12-15 Ian Lance Taylor <iant@google.com>
8207
8208 PR gold/12324
8209 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8210 for R_X86_64_32 and R_X86_64_PC32.
8211 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8212 ver_matching_def_pic.o.
8213 (ver_matching_def_pic.o): New target.
8214
fedb228d
RW
82152010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8216
8217 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8218 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8219 Move definition before File_read::View member definitions.
8220 (File_read::View::~View): Initialize and hold lock before
8221 updating current_mapped_bytes.
8222
9b547ce6
RW
82232010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8224
8225 * dwarf_reader.cc: Remove outdated comment.
8226 * gold-threads.cc: Fix typo in error message.
8227 * archive.cc: Fix typos in comments.
8228 * archive.h: Likewise.
8229 * arm-reloc-property.cc: Likewise.
8230 * arm-reloc-property.h: Likewise.
8231 * arm-reloc.def: Likewise.
8232 * arm.cc: Likewise.
8233 * attributes.h: Likewise.
8234 * cref.cc: Likewise.
8235 * ehframe.cc: Likewise.
8236 * fileread.h: Likewise.
8237 * gold.h: Likewise.
8238 * i386.cc: Likewise.
8239 * icf.cc: Likewise.
8240 * incremental.h: Likewise.
8241 * int_encoding.cc: Likewise.
8242 * layout.h: Likewise.
8243 * main.cc: Likewise.
8244 * merge.h: Likewise.
8245 * object.cc: Likewise.
8246 * object.h: Likewise.
8247 * options.cc: Likewise.
8248 * readsyms.cc: Likewise.
8249 * reduced_debug_output.cc: Likewise.
8250 * reloc.cc: Likewise.
8251 * script-sections.cc: Likewise.
8252 * sparc.cc: Likewise.
8253 * symtab.h: Likewise.
8254 * target-reloc.h: Likewise.
8255 * target.cc: Likewise.
8256 * target.h: Likewise.
8257 * timer.cc: Likewise.
8258 * timer.h: Likewise.
8259 * x86_64.cc: Likewise.
8260
83e17bd5
CC
82612010-12-09 Cary Coutant <ccoutant@google.com>
8262
8263 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8264 stack.
8265 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8266 parameter; change all callers.
8267 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8268 * options.h (warn_execstack): New option.
8269
017257f8
DK
82702010-12-07 Doug Kwan <dougkwan@google.com>
8271
8272 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8273 like function call relocations.
8274
c20cbc06
ILT
82752010-12-07 Ian Lance Taylor <iant@google.com>
8276
8277 * archive.cc (Archive::get_elf_object_for_member): Permit
8278 punconfigured to be NULL.
8279 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8280 (Archive::include_member): Pass NULL to get_elf_object_for_member
8281 if we searched for the archive and this is the first included
8282 object.
8283
4dbfafcc
ILT
82842010-12-01 Ian Lance Taylor <iant@google.com>
8285
8286 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8287 track_relocs_type_ field.
8288 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8289 Set track_relocs_type_.
8290 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8291 contents when using RELA relocs.
8292 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8293 reloc_map_.
8294 * reloc.cc (Track_relocs::next_addend): New function.
8295 * reloc.h (class Track_relocs): Declare next_addend.
8296
e5e19edd
ILT
82972010-12-01 Ian Lance Taylor <iant@google.com>
8298
8299 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8300 virtual destructor.
8301
9a5ce24c
ILT
83022010-12-01 Ian Lance Taylor <iant@google.com>
8303
8304 * README: Update compilers known to work and fail.
8305
c7791212
NC
83062010-11-23 Matthias Klose <doko@ubuntu.com>
8307
8308 * configure.in: For --enable-gold, handle value `default' instead of
8309 `both*'. Always install ld as ld.bfd, install as ld if gold is
8310 not the default.
8311 * configure: Regenerate.
8312
0ad220c9
DK
83132010-11-18 Doug Kwan <dougkwan@google.com>
8314
8315 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8316 and right_alignment to be zero. Store result alignment only if it is
8317 greater than existing alignment.
8318
ab8056e0
CC
83192010-11-16 Cary Coutant <ccoutant@google.com>
8320
8321 PR gold/12220
8322 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8323 Check for ".zdebug_line".
8324
fd064a5b
CC
83252010-11-16 Doug Kwan <dougkwan@google.com>
8326 Cary Coutant <ccoutant@google.com>
8327
8328 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8329 by reference; adjust all callers.
8330 * output.cc (Output_segment::set_section_addresses): Adjust references
8331 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8332 list is empty.
8333 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8334 end at page boundary.
8335
6fc6ea19
CC
83362010-11-16 Cary Coutant <ccoutant@google.com>
8337
8338 PR gold/12220
8339 * layout.cc (Layout::choose_output_section): Transform names of
8340 compressed sections even when using a script with a SECTIONS clause.
8341 (Layout::output_section_name): Remove code to transform
8342 compressed debug section names.
8343 * output.cc (Output_section::add_input_section): Use uncompressed
8344 section size when tracking input sections.
8345
95a2c8d6
RS
83462010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8347
8348 * symtab.h (Symbol::NON_PIC_REF): Remove.
8349 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8350 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8351 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8352 (Symbol::use_plt_offset): Take a flags argument and pass it
8353 directly to needs_dynamic_reloc. Restrict check for undefined
8354 weak symbols to function calls.
8355 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8356 (Target_arm::Scan::global): Use it.
8357 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8358 (Target_arm::Relocate::relocate): Likewise.
8359 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8360 parameter with an r_type parameter. Use get_reference_flags
8361 to get the flags.
8362 (Target_arm::Relocate::relocate): Update accordingly.
8363 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8364 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8365 (Target_i386::Scan::global): Likewise.
8366 (Target_i386::Relocate::relocate): Likewise.
8367 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8368 parameter with an r_type parameter. Use get_reference_flags
8369 to get the flags.
8370 (Target_i386::Relocate::relocate): Update accordingly.
8371 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8372 (Target_powerpc::Scan::global): Use it.
8373 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8374 (Target_powerpc::Relocate::relocate): Likewise.
8375 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8376 (Target_sparc::Scan::global): Use it.
8377 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8378 (Target_sparc::Relocate::relocate): Likewise.
8379 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8380 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8381 (Target_x86_64::Scan::global): Likewise.
8382 (Target_x86_64::Relocate::relocate): Likewise.
8383
f625ae50
DK
83842010-11-08 Doug Kwan <dougkwan@google.com>
8385 Cary Coutant <ccoutant@google.com>
8386
8387 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8388 (Arm_exidx_merge_section::section_contents_): New data member.
8389 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8390 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8391 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8392 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8393 in parameters instead of calling Object::section_contents without
8394 locking.
8395 (Arm_output_section::group_section): New parameter TASK. Pass it
8396 to callees that need locking objects.
8397 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8398 to lock EXIDX input sections. Fix a formatting issue. Call
8399 Arm_exidx_merged_section::build_contents to create merged section
8400 contents.
8401 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8402 to lock object of stub table owner.
8403 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8404 TEXT_SIZE to initialize data member TEXT_SIZE_.
8405 (Arm_exidx_input_section::addralign): Fix typo in comment.
8406 (Arm_exidx_input_section::text_size): New method.
8407 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8408 that require locking objects. Lock objects before scanning for stubs
8409 and updating local symbols.
8410 (Arm_input_section<big_endian>::init): Copy contents of original
8411 input section.
2e702c99 8412 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8413 original input section instead of calling Object::section_contents
8414 without locking.
8415 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8416 size without calling Object::section_size().
8417 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8418 for size. Allocate a buffer for merged EXIDX entries.
8419 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8420 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8421 building code to Arm_exidx_merged_section::build_contetns. Write
8422 out contetns in buffer instead of building it on the fly.
8423 (Arm_relobj::make_exidx_input_section): Also pass text section size
8424 to Arm_exidx_input_section constructor.
8425 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8426 (Arm_dynobj::do_read_symbols): Fix memory leak.
8427 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8428 * target.h: (class Task): Add forward declaration.
8429 (Target::relax): Add new parameter TASK and pass it to
8430 Target::do_relax().
8431 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8432
5f9bcf58
CC
84332010-11-05 Cary Coutant <ccoutant@google.com>
8434
8435 PR gold/10708
8436 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8437 object when reading from the file.
8438 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8439 second layout pass.
8440 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8441 when reading section contents.
8442 (get_section_contents): Likewise.
8443 (icf::find_identical_sections): Likewise.
8444 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8445 object when reading from the file.
8446 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8447 the object when doing deferred section layout.
8448
e597fa08
NC
84492010-11-03 Nick Clifton <nickc@redhat.com>
8450
8451 PR gold/12001
8452 * script.h (class Symbol_assignment: name): New member. Returns
8453 the name of the symbol.
8454 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8455 Returns true if the given symbol name is on the list of
8456 assignments wating to be processed.
8457 * archive.cc (should_incldue_member): If the symbol is undefined,
8458 check to see if it is on the list of symbols pending assignment.
8459
3f9a3278
ILT
84602010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8461
8462 * script-sections.cc (Script_sections::find_memory_region): Check
8463 for a NULL output section pointer.
8464
d06fb4d1
DK
84652010-10-29 Doug Kwan <dougkwan@google.com>
8466
8467 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8468 Output_section::add_relaxed_input_section.
8469 * output.cc (Output_section::add_relaxed_input_section): Add new
8470 arguments LAYOUT and NAME. Set section order index.
8471 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8472 Copy section order index.
8473 * output.h (Output_section::add_relaxed_input_section): Add new
8474 arguments LAYOUT and NAME.
8475
90e24de5
ILT
84762010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8477
8478 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8479 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8480 * testsuite/Makefile.in: Regenerate.
8481
c9484ea5
DK
84822010-10-20 Doug Kwan <dougkwan@google.com>
8483
8484 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8485 without SHF_LINK_ORDER flags.
8486 * layout.cc (Layout::choose_output_section): Do not filter
8487 SHF_LINK_ORDER flag in a relocatable link.
8488
5bc2f5be
CC
84892010-10-17 Cary Coutant <ccoutant@google.com>
8490
8491 * output.h (Output_segment::set_section_addresses): Change function
8492 signature. Update all callers.
8493 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8494 sections.
8495 (Output_segment::set_section_addresses): Align after last TLS
8496 section. Add padding before last relro section instead of after.
8497
0c91cf04
DK
84982010-10-17 Doug Kwan <dougkwan@google.com>
8499
8500 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8501 GOT output section to be writable.
8502
8c21d9d3
CC
85032010-10-14 Cary Coutant <ccoutant@google.com>
8504
8505 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8506 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8507 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8508 mode.
8509 * incremental.cc (report_command_line): Ignore all forms of
8510 --incremental.
8511 * layout.cc (Layout::Layout): Check parameters for incremental link
8512 mode.
8513 * options.cc (General_options::parse_incremental): New function.
8514 (General_options::parse_no_incremental): New function.
8515 (General_options::parse_incremental_full): New function.
8516 (General_options::parse_incremental_update): New function.
8517 (General_options::incremental_mode_): New data member.
8518 (General_options::finalize): Check incremental_mode_.
8519 * options.h (General_options): Update help text for --incremental.
8520 Add --no-incremental, --incremental-full, --incremental-update.
8521 (General_options::Incremental_mode): New enum type.
8522 (General_options::incremental_mode): New function.
8523 (General_options::incremental_mode_): New data member.
8524 * parameters.cc (Parameters::incremental_mode_): New data member.
8525 (Parameters::set_options): Set incremental_mode_.
8526 (Parameters::set_incremental_full): New function.
8527 (Parameters::incremental): New function.
8528 (Parameters::incremental_update): New function.
8529 (set_parameters_incremental_full): New function.
8530 * parameters.h (Parameters::set_incremental_full): New function.
8531 (Parameters::incremental): New function.
8532 (Parameters::incremental_update): New function.
8533 (Parameters::incremental_mode_): New data member.
8534 (set_parameters_incremental_full): New function.
8535 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8536 incremental link mode.
8537 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8538 (Sized_relobj::do_relocate_sections): Likewise.
8539 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8540 option.
8541 * testsuite/Makefile.in: Regenerate.
8542 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8543
bb32aa18 85442010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8545
8546 * script-sections.h (class Script_sections): Make
8547 Sections_elements typedef public.
8548 * script-sections.cc (class Sort_output_sections): Add elements_
8549 field. Add constructor which sets it; change all callers.
8550 (Sort_output_sections::is_before): New function.
8551 (Sort_output_sections::operator()): Call is_before.
8552 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8553 conditional.
8554 * testsuite/script_test_10.sh: New test. Test script section
8555 order.
8556 * testsuite/script_test_10.t: Likewise.
8557 * testsuite/script_test_10.s: Likewise.
8558 * testsuite/Makefile.am: Wrap the cross linker tests and the
8559 common tests into NATIVE_OR_CROSS_LINKER.
8560 (check_SCRIPTS): Add script_test_10.sh.
8561 (check_DATA): Add script_test_10.stdout.
8562 (script_test_10.o, script_test_10): New targets.
8563 (script_test_10.stdout): New target.
8564 * configure, testsuite/Makefile.in: Regenerate.
8565
3cef7179
ILT
85662010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8567
8568 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8569 error for the deprecated relocations.
8570 (Target_arm::Scan::global): Likewise.
8571 (Target_arm::Relocate::relocate): Likewise.
8572
7411e9a8
RS
85732010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8574
8575 * fileread.cc (Input_file::find_file): Initialize *found_name
8576 and *namep when using the fallback search for case 4.
8577
6a9da32a
CC
85782010-10-11 Cary Coutant <ccoutant@google.com>
8579
8580 * options.h (class General_options): Redefine -z lazy as an alias for
8581 the negation of -z now.
8582
ac897c20
ILT
85832010-10-11 Ian Lance Taylor <iant@google.com>
8584
8585 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8586 binding.
8587
ea5cae92
NC
85882010-10-06 Nick Clifton <nickc@redhat.com>
8589
8590 * script-sections.cc(class Memory_region): Remove
8591 current_lma_offset_ field. Rename current_vma_offset_ to
8592 current_offset_. Add last_section_ field.
8593 (Memory_region::get_current_vma_address): Rename to
8594 get_current_address.
8595 (Memory_region::get_current_lma_address): Delete.
8596 (Memory_region::increment_vma_offset): Rename to
8597 increment_offset.
8598 (Memory_region::increment_lma_offset): Delete.
8599 (Memory_region::attributes_compatible): New method. Returns
8600 true if the provided section is compatible with the region.
8601 (Memory_region::get_last_section): New method. Returns the last
8602 section to use the region.
8603 (Memory_region::set_last_section): New method. Stores the last
8604 section to use the region.
8605 (Script_sections::block_in_region): New method. Returns true if
8606 a block of memory is contained within a region.
8607 (Script_sections::find_memory_region): New method. Locates a
8608 memory region to be used to set a VMA or LMA address.
8609 (Output_section_definition::set_section_addresses): Add code to
8610 check for addresses set by memory regions.
8611 (Output_segment::set_section_addresses): Remove memory region
8612 walking code.
8613 (Script_sections::create_segment): Add a warning if a header
8614 segment is created outside of any region.
8615 * script-sections.h (class Script_sections): Add prototypes for
8616 find_memory_region and block_in_region methods.
8617 * testsuite/memory_test.s: Use .long instead of .word.
8618 * testsuite/memory_test.t: Add some more output sections.
8619 * testsuite/memory_test.sh: Update expected output.
8620
a9bfd952
DK
86212010-10-02 Doug Kwan <dougkwan@google.com>
8622
8623 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8624 defintion to symtab.h
8625 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8626 declaration to defintion.
8627
bacff3ab
NC
86282010-10-01 Nick Clifton <nickc@redhat.com>
8629
8630 * expression.cc (eval): Replace dummy argument with NULL.
8631 (eval_maybe_dot): Check for a NULL result section pointer.
8632 (Symbol_expression::value): Likewise.
8633 (Dot_expression::value): Likewise.
8634 (BINARY_EXPRESSION): Likewise.
8635 (Max_expression::value): Likewise.
8636 (Min_expression::value): Likewise.
8637 (Absolute_expression::value): Likewise.
8638 (Addr_expression::value_from_output_section): Likewise.
8639 (Loaddddr_expression::value_from_output_section): Likewise.
8640 (Segment_start_expression::value): Likewise.
8641 * script-sections.cc
8642 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8643 argument with NULL.
8644 (Sections_elememt_dot_assignment::set_section_addresses):
8645 Likewise.
8646 (Output_data_expression::do_write_to_buffer): Likewise.
8647 (Output_section_definition::finalize_symbols): Likewise.
8648 (Output_section_definition::set_section_addresses): Likewise.
8649
f81bc8b5
DK
86502010-09-30 Doug Kwan <dougkwan@google.com>
8651
8652 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8653
c95e9f27
ST
86542010-09-28 Sriraman Tallam <tmsriram@google.com>
8655
8656 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8657 function.
c95e9f27
ST
8658 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8659 virtual function.
8660 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8661 virtual function.
8662 * icf.cc (get_section_contents): Inline merge sections only when
8663 target allows it.
8664
3cac54d2
RW
86652010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8666
8667 * configure: Regenerate.
8668
2904037a
ILT
86692010-09-17 Ian Lance Taylor <iant@google.com>
8670
8671 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8672 * testsuite/Makefile.am (memory_test.o): New target.
8673 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8674 memory_test.t.
8675 * testsuite/Makefile.in: Rebuild.
2904037a 8676
bca7fb63
DK
86772010-09-17 Doug Kwan <dougkwan@google.com>
8678
8679 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8680 defintion if relocation uses GOT entries of the symbol.
8681 * testsuite/icf_safe_test.sh: Fix test.
8682 * testsuite/icf_safe_so_test.sh: Fix test.
8683
4ef28648
CC
86842010-09-16 Cary Coutant <ccoutant@google.com>
8685
8686 * script_sections.cc (class Memory_region): Remove "NULL" from
8687 vector initializations.
8688
793990de
CC
86892010-09-15 Cary Coutant <ccoutant@google.com>
8690
8691 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8692 Resolve forwarding symbols.
8693
81e015e2
DK
86942010-09-15 Doug Kwan <dougkwan@google.com>
8695
8696 * gold/testsuite/script_test_3.t: Add ARM special sections.
8697 * gold/testsuite/script_test_4.t: Same.
8698 * gold/testsuite/script_test_5.t: Same.
8699 * gold/testsuite/script_test_6.t: Same.
8700 * gold/testsuite/script_test_7.t: Same.
8701 * gold/testsuite/script_test_7.t: Same.
8702 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8703
36171d64
CC
87042010-09-14 Cary Coutant <ccoutant@google.com>
8705
8706 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8707 (Target_x86_64::Relocate::relocate_tls): Replace check for
8708 saw_tls_block_reloc_ with test for executable section.
8709
d89051bd
CC
87102010-09-12 Cary Coutant <ccoutant@google.com>
8711
8712 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8713 position-independent executables to shared libraries need dynamic
8714 relocations.
8715 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8716 position-independent executables.
8717 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8718 * testsuite/Makefile.in: Regenerate.
8719
fca41f0f
NC
87202010-09-10 Nick Clifton <nickc@redhat.com>
8721
8722 PR gold/11997
8723 * testsuite/memory_test.t: Discard any sections that are not
8724 needed.
8725
6695e4b3
L
87262010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8727
8728 PR gold/11996
8729 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8730 "This::" to work around a bug in gcc 4.2.
8731
8732 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8733
0f72bf6f
RÁE
87342010-09-09 Rafael Espindola <espindola@google.com>
8735
8736 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8737 sections with different PF_X flags in the same segment.
8738 (Layout::find_first_load_seg): Search all segments to find the first
8739 one.
8740 * options.h (rosegment): New.
8741
87422010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8743
05a79166 8744 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8745
aa98ff75
DK
87462010-09-08 Doug Kwan <dougkwan@google.com>
8747
8748 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8749 (Arm_relobj::do_relocate_sections): Add new parameter for output
8750 file to match the parent.
8751 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8752 of local symbols instead of input values. Update code to track
8753 changes in gold::relocate_section.
8754 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8755 (Sized_relobj::compute_final_local_value_internal): New methods.
8756 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8757 body into private version of Sized_relobj::compute_final_local_value.
8758 Call the inline method.
8759 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8760 merged symbol value if there is one.
8761 (Symbol_value::has_output_value): New method defintiion.
8762 (Sized_relobj::Compute_final_local_value_status): New enum type.
8763 (Sized_relobj::compute_final_local_value): New methods.
8764 (Sized_relobj::compute_final_local_value_internal): New methods.
8765 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8766 and arm_cortex_a8.sh.
8767 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8768 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8769 New tests.
8770 * Makefile.in: Regenerate.
8771 * testsuite/arm_bl_out_of_range.s: Update test.
8772 * testsuite/thumb_bl_out_of_range.s: Ditto.
8773 * testsuite/thumb_blx_out_of_range.s: Ditto.
8774 * testsuite/arm_branch_out_of_range.sh: New file.
8775 * testsuite/arm_cortex_a8.sh: Ditto.
8776 * testsuite/arm_cortex_a8_b.s: Ditto.
8777 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8778 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8779 * testsuite/arm_cortex_a8_bl.s: Ditto.
8780 * testsuite/arm_cortex_a8_blx.s: Ditto.
8781 * testsuite/arm_cortex_a8_local.s: Ditto.
8782 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8783 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8784
05a79166
L
87852010-09-08 Rafael Espindola <espindola@google.com>
8786
8787 * Makefile.am (memory_test.stdout): Run readelf with -W.
8788 * Makefile.in: Regenerate.
8789 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8790 64 bit output.
8791
33dbc701
RÁE
87922010-09-08 Rafael Espindola <espindola@google.com>
8793
8794 * script-sections.cc (Script_sections::add_memory_region): Convert
8795 field precision to int.
8796 * script.cc (script_set_section_region, script_set_section_region):
8797 Convert field precision to int.
8798
731ca54a
RÁE
87992010-09-08 Rafael Espindola <espindola@google.com>
8800
8801 * arm.cc (do_finalize_sections): Create the __exidx_start and
8802 __exdix_end symbols even when the section is missing.
8803
7f8cd844
NC
88042010-09-08 Nick Clifton <nickc@redhat.com>
8805
8806 * README: Remove claim that MEMORY is not supported.
8807 * expression.cc (script_exp_function_origin)
8808 (script_exp_function_length): Move from here to ...
8809 * script.cc: ... here.
8810 (script_set_section_region, script_add_memory)
8811 (script_parse_memory_attr, script_include_directive): New
8812 functions.
8813 * script-sections.cc
8814 (class Memory_region): New class.
8815 (class Output_section_definition): Add set_memory_region,
8816 set_section_vma, set_section_lma and get_section_name methods.
8817 (class Script_Sections): Add add_memory_region,
8818 find_memory_region, find_memory_region_origin,
8819 find_memory_region_length and set_memory_region methods.
8820 Have set_section_addresses method walk the list of set memory
8821 regions.
8822 Extend the print methos to display memory regions.
8823 * script-sections.h: Add prototypes for new methods.
8824 Add enum for MEMORY region attributes.
8825 * yyscript.y: Add support for parsing MEMORY regions.
8826 * script-c.h: Add prototypes for new functions.
8827 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8828 * testsuite/Makefile.in: Regenerate.
8829 * testsuite/memory_test.sh: New script.
8830 * testsuite/memory_test.s: New assembler source file.
8831 * testsuite/memory_test.t: New linker script.
8832
a4649286
DK
88332010-08-27 Doug Kwan <dougkwan@google.com>
8834
8835 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8836 reference override an existing dynamic weak reference.
8837 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8838 * testsuite/Makefile.in: Regenerate.
8839 * testsuite/dyn_weak_ref.sh: New file.
8840 * testsuite/dyn_weak_ref_1.c: Ditto.
8841 * testsuite/dyn_weak_ref_2.c: Ditto.
8842
b56648ad
ILT
88432010-08-27 Ian Lance Taylor <iant@google.com>
8844
8845 * incremental.h (class Incremental_input_entry): Add virtual
8846 destructor.
8847
809313cb
ILT
88482010-08-27 Ian Lance Taylor <iant@google.com>
8849
8850 * testsuite/start_lib_test_3.c: Mark t3 as used.
8851
11e32464
NC
88522010-08-27 Nick Clifton <nickc@redhat.com>
8853
8854 * options.cc (version_script): Fix small typo in previous
8855 whitespace tidyup.
8856
ca09d69a
NC
88572010-08-25 Nick Clifton <nickc@redhat.com>
8858
8859 * archive.cc: Formatting fixes: Remove whitespace between
8860 typename and following asterisk. Remove whitespace between
8861 function name and opening parenthesis.
8862 * archive.h: Likewise.
8863 * arm.cc: Likewise.
8864 * attributes.cc: Likewise.
8865 * attributes.h: Likewise.
8866 * common.cc: Likewise.
8867 * copy-relocs.cc: Likewise.
8868 * dirsearch.h: Likewise.
8869 * dynobj.cc: Likewise.
8870 * ehframe.cc: Likewise.
8871 * ehframe.h: Likewise.
8872 * expression.cc: Likewise.
8873 * fileread.cc: Likewise.
8874 * fileread.h: Likewise.
8875 * gc.h: Likewise.
8876 * gold-threads.cc: Likewise.
8877 * gold.cc: Likewise.
8878 * i386.cc: Likewise.
8879 * icf.h: Likewise.
8880 * incremental-dump.cc: Likewise.
8881 * incremental.cc: Likewise.
8882 * layout.cc: Likewise.
8883 * layout.h: Likewise.
8884 * main.cc: Likewise.
8885 * merge.cc: Likewise.
8886 * merge.h: Likewise.
8887 * object.cc: Likewise.
8888 * object.h: Likewise.
8889 * options.cc: Likewise.
8890 * options.h: Likewise.
8891 * output.cc: Likewise.
8892 * output.h: Likewise.
8893 * plugin.cc: Likewise.
8894 * plugin.h: Likewise.
8895 * powerpc.cc: Likewise.
8896 * reloc.cc: Likewise.
8897 * script-c.h: Likewise.
8898 * script-sections.cc: Likewise.
8899 * script.cc: Likewise.
8900 * stringpool.cc: Likewise.
8901 * symtab.cc: Likewise.
8902 * symtab.h: Likewise.
8903 * target.cc: Likewise.
8904 * timer.cc: Likewise.
8905 * timer.h: Likewise.
8906 * version.cc: Likewise.
8907 * x86_64.cc: Likewise.
8908
b8fa8750
NC
89092010-08-24 Nick Clifton <nickc@redhat.com>
8910
8911 PR 11899
8912 * layout.cc (segment_precedes): Sort segments by their physical
8913 addresses, if they have been set.
8914
9919d93b
CC
89152010-08-23 Cary Coutant <ccoutant@google.com>
8916
8917 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8918 symbols data.
8919 (Lib_group::include_member): Unlock object after deleting its
8920 symbols data.
8921 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8922 the bug fixed here.
8923
97b4be1c
CC
89242010-08-19 Neil Vachharajani <nvachhar@google.com>
8925 Cary Coutant <ccoutant@google.com>
8926
8927 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8928 constructor, and set_blocker.
8929 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8930 readsyms_blocker_.
8931 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8932 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8933 * testsuite/Makefile.am (start_lib_test): New test case.
8934 * testsuite/Makefile.in: Regenerate.
8935 * testsuite/start_lib_test_main.c: New file.
8936 * testsuite/start_lib_test_1.c: New file.
8937 * testsuite/start_lib_test_2.c: New file.
8938 * testsuite/start_lib_test_3.c: New file.
8939
dd0b1884
ILT
89402010-08-19 Ian Lance Taylor <iant@google.com>
8941
8942 * Makefile.in: Rebuild with automake 1.11.1.
8943 * aclocal.m4: Likewise.
8944 * testsuite/Makefile.in: Likewise.
8945
7223e9ca
ILT
89462010-08-19 Ian Lance Taylor <iant@google.com>
8947
8948 PR 10893
8949 * i386.cc (class Output_data_plt_i386): Update declarations.
8950 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8951 local_ifuncs_ fields.
8952 (Target_i386::do_plt_section_for_global): New function.
8953 (Target_i386::do_plt_section_for_local): New function.
8954 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8955 parameter; change all callers. Initialize global_ifuncs_ and
8956 local_ifuncs_. If doing a static link define __rel_iplt_start and
8957 __rel_iplt_end.
8958 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8959 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8960 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8961 symbols.
8962 (Target_i386::make_plt_section): New function, broken out of
8963 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8964 (Target_i386::make_plt_entry): Call make_plt_section.
8965 (Target_i386::make_local_ifunc_plt_entry): New function.
8966 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8967 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8968 R_386_IRELATIVE to switch.
8969 (Target_i386::Scan::global): Likewise.
8970 (Target_i386::Relocate::relocate): Likewise.
8971 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8972 switch.
8973 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8974 (Target_x86_64::do_plt_section_for_global): New function.
8975 (Target_x86_64::do_plt_section_for_local): New function.
8976 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8977 parameter; change all callers. If doing a static link define
8978 __rela_iplt_start and __rela_iplt_end.
8979 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8980 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8981 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8982 to point to .plt.
8983 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8984 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8985 switch.
8986 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8987 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8988 R_X86_64_IRELATIVE to switch.
8989 (Target_x86_64::Scan::global): Likewise.
8990 (Target_x86_64::Relocate::relocate): Likewise.
8991 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8992 switch.
8993 * target.h (class Target): Add plt_section_for_global and
8994 plt_section_for_local functions. Add do_plt_section_for_global
8995 and do_plt_section_for_local virtual functions.
8996 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8997 clarifying comments.
8998 (Symbol::use_plt_offset): Handle IFUNC symbol.
8999 * object.cc (Sized_relobj::Sized_relobj): Initialize
9000 local_plt_offsets_.
9001 (Sized_relobj::local_has_plt_offset): New function.
9002 (Sized_relobj::local_plt_offset): New function.
9003 (Sized_relobj::set_local_plt_offset): New function.
9004 (Sized_relobj::do_count): Handle IFUNC symbol.
9005 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9006 a bit away from input_shndx_ field. Add set_is_func_symbol and
9007 is_ifunc_symbol functions.
9008 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9009 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9010 local_plt_offsets_ field.
9011 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9012 * output.h (class Output_section_data): Add non-const
9013 output_section function.
9014 (class Output_data_got): Update declarations.
9015 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9016 Add use_plt_offset parameter to global and local constructors.
9017 Change all callers. Change local_sym_index_ field to 31 bits.
9018 Change GSYM_CODE and CONSTANT_CODE accordingly.
9019 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9020 doing a static link don't set sh_link field.
9021 (Output_data_got::Got_entry::write): Use PLT offset if
9022 appropriate.
9023 (Output_data_got::add_global_plt): New function.
9024 (Output_data_got::add_local_plt): New function.
9025 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9026 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9027 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9028 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9029 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9030 IFUNC conditional.
9031 * testsuite/ifunc-sel.h: New file.
9032 * testsuite/ifuncmain1.c: New file.
9033 * testsuite/ifuncmain1vis.c: New file.
9034 * testsuite/ifuncmod1.c: New file.
9035 * testsuite/ifuncdep2.c: New file.
9036 * testsuite/ifuncmain2.c: New file.
9037 * testsuite/ifuncmain3.c: New file.
9038 * testsuite/ifuncmod3.c: New file.
9039 * testsuite/ifuncmain4.c: New file.
9040 * testsuite/ifuncmain5.c: New file.
9041 * testsuite/ifuncmod5.c: New file.
9042 * testsuite/ifuncmain6pie.c: New file.
9043 * testsuite/ifuncmod6.c: New file.
9044 * testsuite/ifuncmain7.c: New file.
9045 * configure, testsuite/Makefile.in: Rebuild.
9046
56f75c03
ILT
90472010-08-18 Ian Lance Taylor <iant@google.com>
9048
9049 * incremental.cc
9050 (Output_section_incremental_inputs::write_input_files): Add cast
9051 to avoid signed/unsigned comparison warning.
9052 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9053
55455f89
CC
90542010-08-12 Cary Coutant <ccoutant@google.com>
9055
9056 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9057
e2054bcb
ILT
90582010-08-13 Ian Lance Taylor <iant@google.com>
9059
9060 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9061
74f67560
DK
90622010-08-12 Cary Coutant <ccoutant@google.com>
9063 Doug Kwan <dougkwan@google.com>
9064
9065 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9066 defintion overrides non-weak undef, remember that the original undef
9067 is not weak.
9068 * symtab.cc (Symbol_table::sized_write_global): For undef without
9069 an original weak binding, set binding to global in output.
9070 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9071 * testsuite/Makefile.in: Regenerate.
9072 * testsuite/strong_ref_weak_def.sh: New file.
9073 * testsuite/strong_ref_weak_def_1.c: Ditto.
9074 * testsuite/strong_ref_weak_def_2.c: Ditto.
9075
d1238d12
CC
90762010-08-12 Cary Coutant <ccoutant@google.com>
9077
9078 * testsuite/incremental_test.sh: Rewrite.
9079 * testsuite/incremental_test_1.c: Rewrite.
9080 * testsuite/incremental_test_2.c: Rewrite.
9081
0e70b911
CC
90822010-08-12 Cary Coutant <ccoutant@google.com>
9083
9084 * arm.cc (Target_arm::got_size): Add const.
9085 (Target_arm::got_entry_count): New function.
9086 (Target_arm::plt_entry_count): New function.
9087 (Target_arm::first_plt_entry_offset): New function.
9088 (Target_arm::plt_entry_size): New function.
9089 (Output_data_plt_arm::entry_count): New function.
9090 (Output_data_plt_arm::first_plt_entry_offset): New function.
9091 (Output_data_plt_arm::get_plt_entry_size): New function.
9092 * i386.cc (Target_i386::got_size): Add const.
9093 (Target_i386::got_entry_count): New function.
9094 (Target_i386::plt_entry_count): New function.
9095 (Target_i386::first_plt_entry_offset): New function.
9096 (Target_i386::plt_entry_size): New function.
9097 (Output_data_plt_i386::entry_count): New function.
9098 (Output_data_plt_i386::first_plt_entry_offset): New function.
9099 (Output_data_plt_i386::get_plt_entry_size): New function.
9100 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9101 find_incremental_inputs_sections. Dump incremental_got_plt section.
9102 * incremental.cc: Include target.h.
9103 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9104 parameter. Adjust all callers. Find incremental_got_plt section.
9105 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9106 section.
9107 (Output_section_incremental_inputs::set_final_data_size): Calculate
9108 size of incremental_got_plt section.
9109 (Output_section_incremental_inputs::do_write): Write the
9110 incremental_got_plt section.
9111 (Got_plt_view_info): New struct.
9112 (Local_got_offset_visitor): New class.
9113 (Global_got_offset_visitor): New class.
9114 (Global_symbol_visitor_got_plt): New class.
9115 (Output_section_incremental_inputs::write_got_plt): New function.
9116 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9117 Add parameter. Adjust all callers.
9118 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9119 (Incremental_inputs::got_plt_section): New function.
9120 (Incremental_inputs::got_plt_section_): New data member.
9121 (Incremental_got_plt_reader): New class.
9122 * layout.cc (Layout::create_incremental_info_sections): Add the
9123 incremental_got_plt section.
9124 * object.h (Got_offset_list::get_list): New function.
9125 (Got offset_list::for_all_got_offsets): New function.
9126 (Sized_relobj::local_got_offset_list): New function.
9127 * powerpc.cc (Target_powerpc::got_size): Add const.
9128 (Target_powerpc::got_entry_count): New function.
9129 (Target_powerpc::plt_entry_count): New function.
9130 (Target_powerpc::first_plt_entry_offset): New function.
9131 (Target_powerpc::plt_entry_size): New function.
9132 (Output_data_plt_powerpc::entry_count): New function.
9133 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9134 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9135 * sparc.cc (Target_sparc::got_size): Add const.
9136 (Target_sparc::got_entry_count): New function.
9137 (Target_sparc::plt_entry_count): New function.
9138 (Target_sparc::first_plt_entry_offset): New function.
9139 (Target_sparc::plt_entry_size): New function.
9140 (Output_data_plt_sparc::entry_count): New function.
9141 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9142 (Output_data_plt_sparc::get_plt_entry_size): New function.
9143 * symtab.h (Symbol::got_offset_list): New function.
9144 (Symbol_table::for_all_symbols): New function.
9145 * target.h (Sized_target::got_entry_count): New function.
9146 (Sized_target::plt_entry_count): New function.
9147 (Sized_target::plt_entry_size): New function.
9148 * x86_64.cc (Target_x86_64::got_size): Add const.
9149 (Target_x86_64::got_entry_count): New function.
9150 (Target_x86_64::plt_entry_count): New function.
9151 (Target_x86_64::first_plt_entry_offset): New function.
9152 (Target_x86_64::plt_entry_size): New function.
9153 (Output_data_plt_x86_64::entry_count): New function.
9154 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9155 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9156
09ec0418
CC
91572010-08-12 Cary Coutant <ccoutant@google.com>
9158
9159 * archive.cc: Include incremental.h.
9160 (Archive::Archive): Initialize incremental_info_.
9161 (Archive::include_member): Record archive members in incremental info.
9162 (Add_archive_symbols::run): Record begin and end of an archive in
9163 incremental info.
9164 (Lib_group::include_member): Record objects in incremental info.
9165 * archive.h (Incremental_archive_entry): Forward declaration.
9166 (Archive::set_incremental_info): New member function.
9167 (Archive::incremental_info): New member function.
9168 (Archive::Unused_symbol_iterator): New class.
9169 (Archive::unused_symbols_begin): New member function.
9170 (Archive::unused_symbols_end): New member function.
9171 (Archive::incremental_info_): New data member.
9172 * incremental-dump.cc (find_input_containing_global): New function.
9173 (dump_incremental_inputs): Dump new incremental info sections.
9174 * incremental.cc: Include symtab.h.
9175 (Output_section_incremental_inputs): New class.
9176 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9177 new incremental info sections.
9178 (Sized_incremental_binary::do_check_inputs): Likewise.
9179 (Incremental_inputs::report_archive): Remove.
9180 (Incremental_inputs::report_archive_begin): New function.
9181 (Incremental_inputs::report_archive_end): New function.
9182 (Incremental_inputs::report_object): New function.
9183 (Incremental_inputs::finalize_inputs): Remove.
9184 (Incremental_inputs::report_input_section): New function.
9185 (Incremental_inputs::report_script): Rewrite.
9186 (Incremental_inputs::finalize): Do nothing but finalize string table.
9187 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9188 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9189 (Incremental_inputs::create_data_sections): New function.
9190 (Incremental_inputs::relocs_entsize): New function.
9191 (Output_section_incremental_inputs::set_final_data_size): New function.
9192 (Output_section_incremental_inputs::do_write): New function.
9193 (Output_section_incremental_inputs::write_header): New function.
9194 (Output_section_incremental_inputs::write_input_files): New function.
9195 (Output_section_incremental_inputs::write_info_blocks): New function.
9196 (Output_section_incremental_inputs::write_symtab): New function.
9197 * incremental.h (Incremental_script_entry): Forward declaration.
9198 (Incremental_object_entry): Forward declaration.
9199 (Incremental_archive_entry): Forward declaration.
9200 (Incremental_inputs): Forward declaration.
9201 (Incremental_inputs_header_data): Remove.
9202 (Incremental_inputs_header): Remove.
9203 (Incremental_inputs_header_write): Remove.
9204 (Incremental_inputs_entry_data): Remove.
9205 (Incremental_inputs_entry): Remove.
9206 (Incremental_inputs_entry_write): Remove.
9207 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9208 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9209 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9210 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9211 Likewise.
9212 (Incremental_input_entry): New class.
9213 (Incremental_script_entry): New class.
9214 (Incremental_object_entry): New class.
9215 (Incremental_archive_entry): New class.
9216 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9217 (Incremental_inputs::report_inputs): Remove.
9218 (Incremental_inputs::report_archive): Remove.
9219 (Incremental_inputs::report_archive_begin): New function.
9220 (Incremental_inputs::report_archive_end): New function.
9221 (Incremental_inputs::report_object): Change prototype.
9222 (Incremental_inputs::report_input_section): New function.
9223 (Incremental_inputs::report_script): Change prototype.
9224 (Incremental_inputs::get_reloc_count): New function.
9225 (Incremental_inputs::set_reloc_count): New function.
9226 (Incremental_inputs::create_data_sections): New function.
9227 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9228 (Incremental_inputs::inputs_section): New function.
9229 (Incremental_inputs::symtab_section): New function.
9230 (Incremental_inputs::relocs_section): New function.
9231 (Incremental_inputs::get_stringpool): Add const.
9232 (Incremental_inputs::command_line): Add const.
9233 (Incremental_inputs::inputs): Remove.
9234 (Incremental_inputs::command_line_key): New function.
9235 (Incremental_inputs::input_file_count): New function.
9236 (Incremental_inputs::input_files): New function.
9237 (Incremental_inputs::relocs_entsize): New function.
9238 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9239 (Incremental_inputs::finalize_inputs): Remove.
9240 (Incremental_inputs::Input_info): Remove.
9241 (Incremental_inputs::lock_): Remove.
9242 (Incremental_inputs::inputs_): Change type.
9243 (Incremental_inputs::inputs_map_): Remove.
9244 (Incremental_inputs::current_object_entry_): New data member.
9245 (Incremental_inputs::inputs_section_): New data member.
9246 (Incremental_inputs::symtab_section_): New data member.
9247 (Incremental_inputs::relocs_section_): New data member.
9248 (Incremental_inputs::reloc_count_): New data member.
9249 (Incremental_inputs_reader): New class.
9250 (Incremental_symtab_reader): New class.
9251 (Incremental_relocs_reader): New class.
9252 * layout.cc (Layout::finalize): Move finalization of incremental info
9253 and creation of incremental info sections to follow finalization of
9254 symbol table. Set offsets for postprocessing sections.
9255 (Layout::create_incremental_info_sections): Call
9256 Incremental_inputs::create_data_sections. Add incremental symtab
9257 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9258 sections to layout after input sections.
9259 * layout.h (struct Timespec): Forward declaration.
9260 (Layout::incremental_inputs): Add const.
9261 (Layout::create_incremental_info_sections): Add parameter.
9262 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9263 * object.cc: Include incremental.h.
9264 (Relobj::finalize_incremental_relocs): New function.
9265 (Sized_relobj::do_layout): Record input sections in incremental info.
9266 * object.h (Object::output_section): New function.
9267 (Object::output_section_offset): Moved from Relobj.
9268 (Object::get_incremental_reloc_base): New function.
9269 (Object::get_incremental_reloc_count): New function.
9270 (Object::do_output_section): New function.
9271 (Object::do_output_section_offset): Moved from Relobj.
9272 (Object::do_get_incremental_reloc_base): New function.
9273 (Object::do_get_incremental_reloc_count): New function.
9274 (Object::Object): Initialize new data members.
9275 (Relobj::output_section): Renamed do_output_section and moved to
9276 protected.
9277 (Relobj::output_section_offset): Moved to Object.
9278 (Relobj::do_get_incremental_reloc_base): New function.
9279 (Relobj::do_get_incremental_reloc_count): New function.
9280 (Relobj::allocate_incremental_reloc_counts): New function.
9281 (Relobj::count_incremental_reloc): New function.
9282 (Relobj::finalize_incremental_relocs): New function.
9283 (Relobj::next_incremental_reloc_index): New function.
9284 (Relobj::reloc_counts_): New data member.
9285 (Relobj::reloc_bases_): New data member.
9286 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9287 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9288 (Sized_relobj::incremental_relocs_scan): New function.
9289 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9290 (Sized_relobj::incremental_relocs_write): New function.
9291 (Sized_relobj::incremental_relocs_write_reltype): New function.
9292 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9293 incremental link.
9294 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9295 archives and object files elsewhere.
9296 (Add_symbols::run): Report object files here.
9297 (Finish_group::run): Report end of archive at end of group.
9298 * reloc.cc: Include layout.h, incremental.h.
9299 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9300 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9301 (Sized_relobj::incremental_relocs_scan): New function.
9302 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9303 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9304 (Sized_relobj::incremental_relocs_write): New function.
9305 (Sized_relobj::incremental_relocs_write_reltype): New function.
9306 * script.cc (read_input_script): Rewrite test for incremental link.
9307 Change call to Incremental_inputs::report_script.
9308 * symtab.h (Symbol_table::first_global_index): New function.
9309 (Symbol_table::output_count): New function.
9310
ce0d1972
DK
93112010-08-12 Doug Kwan <dougkwan@google.com>
9312
9313 * arm.cc (Target_arm::merge_object_attributes): Check command line
9314 options --no-wchar-size-warning and --no-enum-size-warning.
9315 * options.h (General_options): Add ld-compatible options
9316 --no-enum-size-warning and --no-wchar-size-warning.
9317
6e5710ce
ILT
93182010-08-04 Ian Lance Taylor <iant@google.com>
9319
9320 * x86_64.cc (Target_x86_64::Scan::local): Use
9321 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9322 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9323 (Target_x86_64::Scan::global): Likewise.
9324 (Target_x86_64::Relocate::relocate): Likewise.
9325 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9326 Likewise.
9327
fef830db
CC
93282010-08-03 Cary Coutant <ccoutant@google.com>
9329
9330 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9331 to reserve space in merged_strings vector. Keep total input size
9332 for stats.
9333 (Output_merge_string::do_print_merge_stats): Print total input size.
9334 * merge.h (Output_merge_string): Add input_size_ field.
9335 * stringpool.cc (Stringpool_template::string_length): Move
9336 implementations out of Stringpool_template class and place in
9337 stringpool.h.
9338 * stringpool.h (string_length): Move out of Stringpool_template.
9339
1e3811b0
ILT
93402010-08-03 Ian Lance Taylor <iant@google.com>
9341
9342 PR 11712
9343 * layout.cc (relaxation_loop_body): If address of load segment is
9344 set, adjust address to include headers if possible.
9345
7af0c620
ILT
93462010-08-03 Ian Lance Taylor <iant@google.com>
9347
9348 * version.cc (version_string): Bump to 1.10.
9349
22f0da72
ILT
93502010-08-03 Ian Lance Taylor <iant@google.com>
9351
9352 PR 11805
9353 * layout.h (enum Output_section_order): Define.
9354 (class Layout): Update declarations.
9355 * layout.cc (Layout::get_output_section): Add order parameter.
9356 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9357 is_first_non_relro parameters. Change all callers.
9358 (Layout::choose_output_section): Likewise.
9359 (Layout::add_output_section_data): Likewise.
9360 (Layout::make_output_section): Likewise. Set order.
9361 (Layout::default_section_order): New function.
9362 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9363 * output.cc (Output_section::Output_section): Initialize order_.
9364 Don't initialize deleted fields.
9365 (Output_segment::Output_segment): Don't initialize deleted
9366 fields.
9367 (Output_segment::add_output_section_to_load): New function
9368 replacing add_output_section. Change all callers to call this or
9369 add_output_section_to_nonload.
9370 (Output_segment::add_output_section_to_nonload): New function.
9371 (Output_segment::remove_output_section): Rewrite.
9372 (Output_segment::add_initial_output_data): Likewise.
9373 (Output_segment::has_any_data_sections): Likewise.
9374 (Output_segment::is_first_section_relro): Likewise.
9375 (Output_segment::maximum_alignment): Likewise.
9376 (Output_segment::has_dynamic_reloc): New function replacing
9377 dynamic_reloc_count. Change all callers.
9378 (Output_segment::has_dynamic_reloc_list): New function replacing
9379 dynamic_reloc_count_list. Change all callers.
9380 (Output_segment::set_section_addresses): Rewrite.
9381 (Output_segment::set_offset): Rewrite.
9382 (Output_segment::find_first_and_last_list): Remove.
9383 (Output_segment::set_tls_offsets): Rewrite.
9384 (Output_segment::first_section_load_address): Likewise.
9385 (Output_segment::output_section_count): Likewise.
9386 (Output_segment::section_with_lowest_load_address): Likewise.
9387 (Output_segment::write_section_headers): Likewise.
9388 (Output_segment::print_sections_to_map): Likewise.
9389 * output.h (class Output_data): Remove dynamic_reloc_count_
9390 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9391 (Output_data::add_dynamic_reloc): Rewrite.
9392 (Output_data::has_dynamic_reloc): New function.
9393 (Output_data::dynamic_reloc_count): Remove.
9394 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9395 is_last_relro_, is_first_non_relro_, is_interp_,
9396 is_dynamic_linker_section_ fields. Add order and set_order
9397 functions. Remove is_relro_local, set_is_relro_local,
9398 is_last_relro, set_is_last_relro, is_first_non_relro,
9399 set_is_first_non_relro functions, is_interp, set_is_interp,
9400 is_dynamic_linker_section, and set_is_dynamic_linker_section
9401 functions.
9402 (class Output_segment): Change Output_data_list from std::list to
9403 std:;vector. Add output_lists_ field. Remove output_data_ and
9404 output_bss_ fields. Update declarations.
9405
3ff2ccb0
ILT
94062010-08-02 Ian Lance Taylor <iant@google.com>
9407
9408 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9409 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9410 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9411
88a4108b
ILT
94122010-08-02 Ian Lance Taylor <iant@google.com>
9413
9414 PR 11855
9415 * script.cc (Script_options::Script_options): Initialize
9416 symbol_definitions_ and symbol_references_.
9417 (Script_options::add_symbol_assignment): Update
9418 symbol_definitions_ and symbol_references_.
9419 (Script_options::add_symbol_reference): New function.
9420 (script_symbol): New function.
9421 * script.h (class Script_options): Add symbol_definitions_ and
9422 symbol_references_ fields.
9423 (Script_options::referenced_const_iterator): New type.
9424 (Script_options::referenced_begin): New function.
9425 (Script_options::referenced_end): New function.
9426 (Script_options::is_referenced): New function.
9427 (Script_options::any_unreferenced): New function.
9428 * script-c.h (script_symbol): Declare.
9429 * yyscript.y (exp): Call script_symbol.
9430 * symtab.cc: Include "script.h".
9431 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9432 Change all callers. Check symbols referenced by scripts.
9433 (Symbol_table::add_undefined_symbols_from_command_line): Add
9434 layout parameter. Change all callers.
9435 (Symbol_table::do_add_undefined_symbols_from_command_line):
9436 Likewise. Break out loop body. Check symbols referenced by
9437 scripts.
9438 (Symbol_table::add_undefined_symbol_from_command_line): New
9439 function broken out of
9440 do_add_undefined_symbols_from_command_line.
9441 * symtab.h (class Symbol_table): Update declarations.
9442 * archive.cc: Include "layout.h".
9443 (Archive::should_include_member): Add layout parameter. Change
9444 all callers. Check for symbol mentioned in expression.
9445 * archive.h (class Archive): Update declaration.
9446 * object.cc (Sized_relobj::do_should_include_member): Add layout
9447 parameter.
9448 * object.h (Object::should_include_member): Add layout parameter.
9449 Change all callers.
9450 (Object::do_should_include_member): Add layout parameter.
9451 (class Sized_relobj): Update declaration.
9452 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9453 parameter.
9454 * dynobj.h (class Sized_dynobj): Update declaration.
9455 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9456 layout parameter.
9457 * plugin.h (class Sized_pluginobj): Update declaration.
9458
5f1ab67a
ILT
94592010-08-02 Ian Lance Taylor <iant@google.com>
9460
9461 PR 11866
9462 * output.cc (Output_segment::set_offset): Search for the first and
9463 last sections rather than assuming that the list is in order.
9464 (Output_segment::find_first_and_last_list): New function.
9465 * output.h (class Output_segment): Update declarations.
9466 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9467 (relro_strip_test_SOURCES): New variable.
9468 (relro_strip_test_DEPENDENCIES): New variable.
9469 (relro_strip_test_LDFLAGS): New variable.
9470 (relro_strip_test_LDADD): New variable.
9471 (relro_strip_test.so): New target.
9472
a8df5856
ILT
94732010-08-02 Ian Lance Taylor <iant@google.com>
9474
9475 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9476 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9477 (Target_i386::got_tlsdesc_section): New function.
9478 (Target_i386::got_section): Create space for GOT entries for
9479 TLSDESC relocations.
9480 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9481 R_386_TLS_GOTDESC.
9482 (Target_i386::Scan::global): Likewise.
9483 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9484 using TLSDESC GOT.
9485 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9486 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9487 (Target_x86_64::got_tlsdesc_section): New function.
9488 (Target_x86_64::got_section): Create space for GOT entries for
9489 TLSDESC relocations.
9490 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9491 R_386_TLS_GOTDESC.
9492 (Target_x86_64::Scan::global): Likewise.
9493 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9494 using TLSDESC GOT.
9495
0c10a0a6
ILT
94962010-08-02 Ian Lance Taylor <iant@google.com>
9497
9498 * testsuite/final_layout.sh: Use dc to convert from hex to
9499 decimal.
9500
41cbeecc
ST
95012010-07-29 Sriraman Tallam <tmsriram@google.com>
9502
9503 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9504 paramter to the call to gold::gc_process_relocs.
9505 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9506 paramter to the call to gold::gc_process_relocs.
9507 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9508 parameter to the call to gold::gc_process_relocs.
9509 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9510 template parameter to the call to gold::gc_process_relocs.
9511 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9512 paramter to the call to gold::gc_process_relocs.
9513 * gc.h (get_embedded_addend_size): New function.
9514 (gc_process_relocs): Save the size of the reloc for use by ICF.
9515 * icf.cc (get_section_contents): Get the addend from the text section
9516 for SHT_REL relocation sections.
9517 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9518 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9519 * int_encoding.h (read_from_pointer): New overloaded function.
9520 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9521 * testsuite/icf_sht_rel_addend_test.sh: New file.
9522 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9523 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9524
6ea55b82
RW
95252010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9526
9527 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9528 * Makefile.in: Regenerate.
9529 * testsuite/Makefile.in: Regenerate.
9530
9691462b
ILT
95312010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9532
9533 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9534 * gold/testsuite/debug_msg.cc: Likewise.
9535 * gold/testsuite/odr_violation1.cc
9536 * gold/testsuite/odr_violation2.cc
9537
76897331
CC
95382010-07-21 Cary Coutant <ccoutant@google.com>
9539
9540 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9541 string, and length fields.
9542 (Output_merge_string::Merged_strings_list): New type.
9543 (Output_merge_string::Merged_strings_lists): New typedef.
9544 (Output_merge_string): Replace merged_strings_ with
9545 merged_strings_lists_.
9546 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9547 Merged_strings_list per input object and section. Don't store pointer
9548 to the string. Don't store length with each merged string entry.
9549 (Output_merge_string::finalize_merged_data): Loop over list of merged
9550 strings lists. Recompute length of each merged string.
9551
78384e8f
CC
95522010-07-15 Cary Coutant <ccoutant@google.com>
9553
9554 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9555 here.
9556
783659f9
ILT
95572010-07-14 Ian Lance Taylor <iant@google.com>
9558
9559 * descriptors.cc (Descriptors::open): Report correct name in error
9560 message.
9561
131687b4
DK
95622010-07-13 Doug Kwan <dougkwan@google.com>
9563
9564 * arm.cc (Arm_input_section::Arm_input_section): For a
9565 SHT_ARM_EXIDX section, always keeps the input sections.
9566 (Arm_input_section::set_exidx_section_link): New method.
9567 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9568 has_errors_ to false.
9569 (Arm_exidx_input_section::has_errors,
9570 Arm_exidx_input_section::set_has_errors): New methods.
9571 (Arm_exidx_input_section::has_errors_): New data member.
9572 (Arm_relobj::get_exidx_shndx_list): New method.
9573 (Arm_output_section::append_text_sections_to_list): Do not skip
9574 section without SHF_EXECINSTR.
9575 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9576 errors.
2e702c99 9577 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9578 section header. Make error messages more verbose. Check for
9579 a non-executable section linked to an EXIDX section.
9580 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9581 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9582 check that there is no deferred EXIDX section if we exit early.
9583 Instead of not making an EXIDX section in case of an error, make one
9584 and set the has_errors flag of it.
9585 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9586 in a relocatable link.
9587 (Target_arm::do_relax): Look for the EXIDX output section instead of
9588 assuming that it is called .ARM.exidx.
2e702c99 9589 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9590 section list. Do not check for SHF_EXECINSTR section flags but
9591 skip any input section with errors.
9592 * output.cc (Output_section::Output_section): Initialize
9593 always_keeps_input_sections_ to false.
9594 (Output_section::add_input_section): Check for
9595 always_keeps_input_sections_.
9596 * output.h (Output_section::always_keeps_input_sections,
9597 Output_section::set_always_keeps_input_sections): New methods.
9598 (Output_section::always_keeps_input_sections): New data member.
9599
69517287
RÁE
96002010-07-13 Rafael Espindola <espindola@google.com>
9601
9602 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9603 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9604
82742395
ILT
96052010-07-13 Philip Herron <herron.philip@googlemail.com>
9606 Ian Lance Taylor <iant@google.com>
9607
9608 * output.h (Output_section_lookup_maps::add_merge_section):
9609 Correct check of whether value was inserted.
9610 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9611 (Output_section_lookup_maps::add_relaxed_input_section):
9612 Likewise.
9613 * arm.cc (Target_arm::got_section): Remove used local os.
9614 * i386.cc (Target_i386::got_section): Likewise.
9615 * x86_64.cc (Target_x86_64::got_section): Likewise.
9616 * sparc.cc (Target_sparc::got_section): Likewise.
9617 (Target_sparc::relocate): Remove unused local have_got_offset.
9618 * powerpc.cc (Target_powerpc::relocate): Likewise.
9619
f2d707b5
ILT
96202010-07-13 Ian Lance Taylor <iant@google.com>
9621
241531d6
ILT
9622 * compressed_output.cc (zlib_decompress): Fix signature in
9623 !HAVE_ZLIB_H case.
9624
f2d707b5
ILT
9625 * archive.cc (Archive::include_member): Unlock an external member
9626 of a thin archive. Don't bother to delete an object we know is
9627 NULL.
9628
a2e47362
CC
96292010-07-12 Cary Coutant <ccoutant@google.com>
9630
9631 * compressed_output.cc (zlib_decompress): New function.
9632 (get_uncompressed_size): New function.
9633 (decompress_input_section): New function.
9634 * compressed_output.h (get_uncompressed_size): New function.
9635 (decompress_input_section): New function.
9636 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9637 Handle compressed debug sections.
9638 * layout.cc (is_compressed_debug_section): New function.
9639 (Layout::output_section_name): Map compressed section names to
9640 canonical names.
9641 * layout.h (is_compressed_debug_section): New function.
9642 (is_debug_info_section): Recognize compressed debug sections.
9643 * merge.cc: Include compressed_output.h.
9644 (Output_merge_data::do_add_input_section): Handle compressed
9645 debug sections.
9646 (Output_merge_string::do_add_input_section): Handle compressed
9647 debug sections.
9648 * object.cc: Include compressed_output.h.
9649 (Sized_relobj::Sized_relobj): Initialize new data members.
9650 (build_compressed_section_map): New function.
9651 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9652 * object.h (Object::section_is_compressed): New method.
9653 (Object::do_section_is_compressed): New method.
9654 (Sized_relobj::Compressed_section_map): New type.
9655 (Sized_relobj::do_section_is_compressed): New method.
9656 (Sized_relobj::compressed_sections_): New data member.
9657 * output.cc (Output_section::add_input_section): Handle compressed
9658 debug sections.
9659 * reloc.cc: Include compressed_output.h.
9660 (Sized_relobj::write_sections): Handle compressed debug sections.
9661
ce279a62
CC
96622010-07-08 Cary Coutant <ccoutant@google.com>
9663
9664 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9665 weak when resolving to a dynamic def.
9666 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9667 for weak undef/dynamic def cases. Adjust callers.
9668 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9669 undef_binding_weak_.
9670 (Symbol_table::sized_write_globals): Adjust symbol binding.
9671 (Symbol_table::sized_write_symbol): Add binding parameter.
9672 * symtab.h (Symbol::set_undef_binding): New method.
9673 (Symbol::is_undef_binding_weak): New method.
9674 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9675 (Symbol_table::should_override): Add new parameter.
9676 (Symbol_table::sized_write_symbol): Add new parameter.
9677
9678 * testsuite/weak_undef_file1.cc: Add new test case.
9679 * testsuite/weak_undef_file2.cc: Fix header comment.
9680 * testsuite/weak_undef_test.cc: Add new test case.
9681
b2286c10
DK
96822010-06-29 Doug Kwan <dougkwan@google.com>
9683
9684 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9685 Initialize USE_SYMBOL_.
9686 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9687 definition.
9688 (Arm_reloc_property::uses_symbol_): New data member declaration.
9689 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9690 uses symbol value and symbol is undefined but not weakly undefined.
9691
4802450a
RÁE
96922010-06-28 Rafael Espindola <espindola@google.com>
9693
9694 * plugin.cc (Plugin::load): Use dlerror.
9695
e5ca47ba
ILT
96962010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9697
9698 * symtab.cc (detect_odr_violations): When reporting an ODR
9699 violation, report an object where the symbol is defined.
9700
8a75a161
DK
97012010-06-25 Doug Kwan <dougkwan@google.com>
9702
9703 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9704 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9705 definition.
9706 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9707 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9708 target hook to detect function points.
9709 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9710 * icf.h (Icf::check_section_for_function_pointers): Change type of
9711 parameter SECTION_NAME to const reference to std::string. Use
9712 target hook to determine if section may have unsafe pointers.
9713 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9714 method definition.
9715
42218b9f
RÁE
97162010-06-21 Rafael Espindola <espindola@google.com>
9717
9718 * fileread.cc (Input_file::find_fie): New
9719 (Input_file::open): Use Input_file::find_fie.
9720 * fileread.h (Input_file::find_fie): New
9721 * plugin.cc (set_extra_library_path): New.
9722 (Plugin::load): Add set_extra_library_path to the transfer vector.
9723 (Plugin_manager::set_extra_library_path): New.
9724 (Plugin_manager::add_input_file): Use the extra search path if set.
9725 (set_extra_library_path(): New.
9726 * plugin.h (Plugin_manager): Add set_extra_library_path and
9727 extra_search_path_.
9728
a0506cca
CC
97292010-06-19 Cary Coutant <ccoutant@google.com>
9730
9731 * layout.cc (gdb_sections): Add .debug_types.
9732 (lines_only_debug_sections): Likewise.
9733
6508b958
RÁE
97342010-06-18 Rafael Espindola <espindola@google.com>
9735
9736 * plugin.cc (add_input_file,add_input_library)
9737 (Plugin_manager::add_input_file): Make filename arguments const.
9738 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9739 const.
9740
3e235302
DK
97412010-06-16 Doug Kwan <dougkwan@google.com>
9742
9743 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9744 .ARM.attributes section if we have not merged any input
9745 attributes sections.
9746
106e8a6c
DK
97472010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9748
9749 * arm.cc: Allow combining objects with no EABI version
9750 information.
9751
91ff43fe
RÁE
97522010-06-15 Rafael Espindola <espindola@google.com>
9753
9754 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9755
68ed838c
ILT
97562010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9757
9758 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9759 (struct iovec): Correct !HAVE_READV definition.
9760
f3a2388f
CC
97612010-06-10 Cary Coutant <ccoutant@google.com>
9762
9763 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9764 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9765 reloc sections.
9766 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9767
9768 PR 11683
9769 * symtab.h (Symbol::is_placeholder): New member function.
9770 * target-reloc.h (relocate_section): Check for placeholder symbols.
9771
9772 * testsuite/Makefile.am (plugin_test_8): New test.
9773 (plugin_test_9): New test.
9774 * testsuite/Makefile.in: Regenerate.
9775
e1df38aa
NC
97762010-06-09 Nick Clifton <nickc@redhat.com>
9777
9778 * yyscript.y (input_list_element): Allow strings prefixed with
9779 the '-' character. Treat these as libraries.
9780 * script.cc (script_add_library): New function. Adds a library
9781 specified by "-l<name>" found in an input script.
9782 * script-c.h: Add prototype for script_add_library.
9783
25bbe950
DK
97842010-06-07 Doug Kwan <dougkwan@google.com>
9785
9786 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9787 Restrict stub-group size to be within long conditional branch
9788 range when working around cortex-A8 erratum.
9789
0f32ea4c
ILT
97902010-06-07 Damien Diederen <dd@crosstwine.com>
9791
9792 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9793 #ifdef typo.
9794
8fe2a369
ST
97952010-06-03 Sriraman Tallam <tmsriram@google.com>
9796
9797 PR gold/11658
9798 * output.cc
9799 (Output_section::Input_section_sort_entry::compare_section_ordering):
9800 Change to return non-zero correctly.
9801 (Output_section::Input_section_sort_section_order_index_compare
9802 ::operator()): Change to fix ambiguity in comparisons.
9803
6e9ba2ca
ST
98042010-06-01 Sriraman Tallam <tmsriram@google.com>
9805
9806 * gold.h (is_wildcard_string): New function.
9807 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9808 (Layout::layout_eh_frame): Ditto.
9809 (Layout::find_section_order_index): New method.
9810 (Layout::read_layout_from_file): New method.
9811 * layout.h (Layout::find_section_order_index): New method.
9812 (Layout::read_layout_from_file): New method.
9813 (Layout::input_section_position_): New private member.
9814 (Layout::input_section_glob_): New private member.
9815 * main.cc (main): Call read_layout_from_file here.
9816 * options.h (--section-ordering-file): New option.
9817 * output.cc (Output_section::input_section_order_specified_): New
9818 member.
9819 (Output_section::Output_section): Initialize new member.
9820 (Output_section::add_input_section): Add new parameter.
9821 Keep input sections when --section-ordering-file is used.
9822 (Output_section::set_final_data_size): Sort input sections when
9823 section ordering file is specified.
9824 (Output_section::Input_section_sort_entry): Add new parameter.
9825 Check sorting type.
9826 (Output_section::Input_section_sort_entry::compare_section_ordering):
9827 New method.
9828 (Output_section::Input_section_sort_compare::operator()): Change to
9829 consider section_order_index.
9830 (Output_section::Input_section_sort_init_fini_compare::operator()):
9831 Change to consider section_order_index.
9832 (Output_section::Input_section_sort_section_order_index_compare
9833 ::operator()): New method.
9834 (Output_section::sort_attached_input_sections): Change to sort
9835 according to section order when specified.
e1df38aa
NC
9836 (Output_section::add_input_section<32, true>): Add new parameter.
9837 (Output_section::add_input_section<64, true>): Add new parameter.
9838 (Output_section::add_input_section<32, false>): Add new parameter.
9839 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9840 * output.h (Output_section::add_input_section): Add new parameter.
9841 (Output_section::input_section_order_specified): New
9842 method.
9843 (Output_section::set_input_section_order_specified): New method.
9844 (Input_section::Input_section): Initialize section_order_index_.
9845 (Input_section::section_order_index): New method.
9846 (Input_section::set_section_order_index): New method.
9847 (Input_section::section_order_index_): New member.
9848 (Input_section::Input_section_sort_section_order_index_compare): New
9849 struct.
9850 (Output_section::input_section_order_specified_): New member.
9851 * script-sections.cc (is_wildcard_string): Delete and move modified
9852 method to gold.h.
9853 (Output_section_element_input::Output_section_element_input): Modify
9854 call to is_wildcard_string.
9855 (Output_section_element_input::Input_section_pattern
9856 ::Input_section_pattern): Ditto.
9857 (Output_section_element_input::Output_section_element_input): Ditto.
9858 * testsuite/Makefile.am (final_layout): New test case.
9859 * testsuite/Makefile.in: Regenerate.
9860 * testsuite/final_layout.cc: New file.
9861 * testsuite/final_layout.sh: New file.
9862
3537c84b
RÁE
98632010-06-01 Rafael Espindola <espindola@google.com>
9864
9865 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9866
105b6afd
RÁE
98672010-06-01 Rafael Espindola <espindola@google.com>
9868
9869 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9870 visibility of symbols.
9871
29e11421
DK
98722010-05-27 Doug Kwan <dougkwan@google.com>
9873
9874 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9875 from start of output section instead of address for a local symbol
9876 in a merged or relaxed section when doing a relocatable link.
9877
5e0f337e
RÁE
98782010-05-26 Rafael Espindola <espindola@google.com>
9879
703d02da 9880 PR 11604
5e0f337e
RÁE
9881 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9882 adding sections the garbage collector removed.
9883 * gold/testsuite/Makefile.am: Add test.
9884 * gold/testsuite/Makefile.in: Regenerate.
9885 * gold/testsuite/plugin_test_7.sh: New.
9886 * gold/testsuite/plugin_test_7_1.c: New.
9887 * gold/testsuite/plugin_test_7_2.c: New.
9888
f4187277
RÁE
98892010-05-26 Rafael Espindola <espindola@google.com>
9890
9891 * script-sections.cc (Output_section_definition::set_section_addresses):
9892 Check for --section-start.
9893
5c388529
DK
98942010-05-26 Doug Kwan <dougkwan@google.com>
9895
9896 * arm.cc (Arm_scan_relocatable_relocs): New class.
9897 (Target_arm::relocate_special_relocatable): New method.
9898 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9899 (Arm_relocate_functions::thumb_branch_common): Same.
9900 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9901 instead of Default_scan_relocatable_relocs.
9902 * target-reloc.h (relocate_for_relocatable): Let target handle
9903 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9904 * target.h (Sized_target::relocate_special_relocatable): New method.
9905
bca1c3ae
ILT
99062010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9907
9908 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9909
0439c796
DK
99102010-05-23 Doug Kwan <dougkwan@google.com>
9911
9912 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9913 instead of a cast.
9914 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9915 with a direct branch, not a conditional branch, to a stub.
9916 * merge.cc (Output_merge_base::record_input_section): New method
9917 defintion.
9918 (Output_merge_data::do_add_input_section): Record input section if
9919 keeps-input-sections flag is set.
9920 (Output_merge_string::do_add_input_section): Ditto.
9921 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9922 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9923 INPUT_SECTIONS_.
9924 (Output_merge_base::keeps_input_sections,
9925 Output_merge_base::set_keeps_input_sections,
9926 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9927 method definitions.
9928 (Output_merge_base::Input_sections): New type declaration.
9929 (Output_merge_base::input_sections_begin,
9930 Output_merge_base::input_sections_end,
9931 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9932 (Output_merge_base::bool keeps_input_sections_,
9933 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9934 Output_merge_base::input_sections_): New data members.
9935 (Output_merge_data::do_set_keeps_input_sections): New method
9936 defintion.
9937 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9938 * output.cc (Output_section::Input_section::relobj): Move method
9939 defintion from class declaration to here and handle merge sections.
9940 (Output_section::Input_section::shndx): Ditto.
9941 (Output_section::Output_section): Remove initializations of removed
9942 data members and initialize new data member LOOKUP_MAPS_.
9943 (Output_section::add_input_section): Set keeps-input-sections flag
9944 for a newly created merge output section as appropriate. Adjust code
9945 to use Output_section_lookup_maps class.
9946 (Output_section::add_relaxed_input_section): Adjst code for lookup
9947 maps code refactoring.
2e702c99 9948 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9949 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9950 class. If adding input section to a newly created merge output
9951 section fails, remove the new merge section.
9952 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9953 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9954 (Output_section::find_merge_section): Ditto.
0439c796 9955 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9956 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9957 Output_section_lookup_maps class.
9958 (Output_section::get_input_sections): Export merge sections. Adjust
9959 code to use Output_section_lookup_maps class.
9960 (Output_section:::add_script_input_section): Adjust code to use
9961 Output_section_lookup_maps class. Update lookup maps for merge
9962 sections also.
9963 (Output_section::discard_states): Use Output_section_lookup_maps.
9964 (Output_section::restore_states): Same.
9965 * output.h (Merge_section_properties): Move class defintion out of
9966 Output_section.
9967 (Output_section_lookup_maps): New class.
9968 (Output_section::Input_section::is_merge_section): New method
9969 defintion.
9970 (Output_section::Input_section::relobj): Move defintion out of class
9971 defintion. Declare method only.
9972 (Output_section::Input_section::shndx): Ditto.
9973 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9974 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9975 (Output_section::Merge_section_by_properties_map,
9976 Output_section::Output_section_data_by_input_section_map,
9977 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9978 Remove types.
2e702c99 9979 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9980 KEEPS_INPUT_SECTIONS.
9981 (Output_section::build_lookup_maps): New method declaration.
9982 (Output_section::merge_section_map_,
9983 Output_section::merge_section_by_properties_map_,
9984 Output_section::relaxed_input_section_map_,
9985 Output_section::is_relaxed_input_section_map_valid_): Remove data
9986 members.
9987 (Output_section::lookup_maps_): New data member.
9988
76295588
L
99892010-05-21 Doug Kwan <dougkwan@google.com>
9990
9991 PR gold/11619
9992 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9993 avoid a compilation error.
9994
d103a984
RÁE
99952010-05-19 Rafael Espindola <espindola@google.com>
9996
9997 * script-sections.cc (Output_section_definition::allocate_to_segment):
9998 Update the phdrs_list even when the output section is NULL.
9999 * testsuite/Makefile.am: Add test.
10000 * testsuite/Makefile.in: Regenerate.
10001 * testsuite/script_test_9.cc: New.
10002 * testsuite/script_test_9.sh: New.
10003 * testsuite/script_test_9.t: New.
10004
6625d24e
DK
100052010-05-19 Doug Kwan <dougkwan@google.com>
10006
10007 * arm.cc (Arm_input_section::original_size): New method.
10008 (Arm_input_section::do_addralign): Add a cast.
10009 (Arm_input_section::do_output_offset): Remove static cast.
10010 (Arm_input_section::original_addralign,
10011 Arm_input_section::original_size_): Change type to uint32_t.
10012 (Arm_input_section::init): Add safe casts for section alignment
10013 and size.
10014 (Arm_input_section::set_final_data_size): Do not set address and
10015 offset of stub table.
10016 (Arm_output_section::fix_exidx_coverage): Change use of of
10017 Output_section::Simple_input_section to that of
10018 Output_section::Input_section.
10019 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10020 except for the first pass.
10021 * output.cc (Output_section::get_input_sections): Change type of
10022 input_sections to std::list<Input_section>.
10023 (Output_section::add_script_input_section): Rename from
10024 Output_section::add_simple_input_section. Change type of SIS
10025 parameter from Simple_input_section to Input_section.
10026 * output.h (Output_section::Simple_input_section): Remove class.
10027 (Output_section::Input_section): Change class visibility to public.
10028 (Output_section::Input_section::addralign): Use stored alignments
10029 for special input sections if set.
10030 (Output_section::Input_section::set_addralign): New method.
10031 (Output_section::get_input_sections): Change parameter type from
10032 list of Simple_input_section to list of Input_section.
10033 (Output_section::add_script_input_section): Rename from
10034 Output_section::add_simple_input_section. Change first parameter's
10035 type from Simple_input_section to Input_section and remove the
10036 second and third parameters.
10037 * script-sections.cc (Input_section::Input_section_list): Change
10038 type to list of Output_section::Input_section/
10039 (Input_section_info::Input_section_info): Change parameter type of
10040 INPUT_SECTION to Output_section::Input_section.
10041 (Input_section_info::input_section): Change return type.
10042 (Input_section_info::input_section_): Change type to
10043 Output_section::Input_section.
10044 (Output_section_element_input::set_section_addresses): Adjust code
10045 to use Output_section::Input_section instead of
10046 Output_section::Simple_input_section. Adjust code for renaming
10047 of Output_section::add_simple_input_section.
10048 (Orphan_output_section::set_section_addresses): Ditto.
10049
e1e82ea4
RW
100502010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10051
10052 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10053 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10054
91e75c8a
RÁE
100552010-05-18 Rafael Espindola <espindola@google.com>
10056
10057 * options.cc (General_options::finalize): Handle -nostdlib.
10058 * options.h (nostdlib): New option.
10059 * script.cc (script_add_search_dir): Handle -nostdlib.
10060
da59ad79
DK
100612010-05-12 Doug Kwan <dougkwan@google.com>
10062
10063 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10064 attributes section only if there no attributes section after merging.
10065 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10066 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10067 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10068 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10069 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10070 and arm_attr_merge_7.stdout.
10071 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10072 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10073 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10074 arm_attr_merge_7b.o): New rules.
10075 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10076 arm_attr_merge_7
10077 * testsuite/Makefile.in: Regenerate.
10078 * testsuite/arm_attr_merge.sh: New file.
10079 * testsuite/arm_attr_merge_[67][ab].s: Same.
10080
3e01a7fd
NC
100812010-05-05 Nick Clifton <nickc@redhat.com>
10082
10083 * po/es.po: Updated Spanish translation.
10084
7ad2014a
L
100852010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10086
10087 * Makefile.am (install-exec-local): Properly install gold as
10088 default cross linker.
10089 * Makefile.in: Regenerated.
10090
4fda8867
NC
100912010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10092 Nick Clifton <nickc@redhat.com>
10093
10094 * configure.ac (install_as_default): Define and set to false
10095 unless --enable-gold or --enable-gold=both/gold has been
10096 specified.
10097 * configure: Regenerate.
10098
10099 * Makefile.am (install-exec-local): Install the executable as
10100 'ld.gold'. If install_as_default is true then also install it as
10101 'ld'.
10102 * Makefile.in: Regenerated.
10103
bd288ea2
ILT
101042010-04-24 Ian Lance Taylor <iant@google.com>
10105
10106 * layout.cc (Layout::layout_reloc): In relocatable link don't
10107 combine reloc sections for grouped sections.
10108
ef38fd8a
ST
101092010-04-23 Sriraman Tallam <tmsriram@google.com>
10110
10111 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10112 sections that are not ordinary to icf.
10113 * icf.cc (get_section_contents): Handle relocation pointing to section
10114 with no object or shndx information.
10115 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10116 * testsuite/Makefile.in: Regenerate.
10117 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10118 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10119
f6973bdc
ILT
101202010-04-22 Ian Lance Taylor <iant@google.com>
10121
10122 * expression.cc (Expression::Expression_eval_info): Add
10123 result_alignment_pointer field.
10124 (Expression::eval_with_dot): Add result_alignment_pointer
10125 parameter. Change all callers.
10126 (Expression::eval_maybe_dot): Likewise.
10127 (class Binary_expression): Add alignment_pointer parameter to
10128 left_value and right_value. Change all callers.
10129 (BINARY_EXPRESSION): Set result alignment.
10130 (class Trinary_expression): Add alignment_pointer parameter to
10131 arg2_value and arg3_value. Change all callers.
10132 (Trinary_cond::value): Set result alignment.
10133 (Max_expression::value, Min_expression::value): Likewise.
10134 (Align_expression::value): Likewise.
10135 * script-sections.cc (class Sections_element): Add dot_alignment
10136 parameter to set_section_addresses virtual function. Update
10137 instantiations.
10138 (class Output_section_element): Likewise.
10139 (Script_sections::create_segments): Add dot_alignment parameter.
10140 Change all callers.
10141 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10142 (Script_sections::set_phdrs_clause_addresses): Likewise.
10143 * script-sections.h: Update declarations.
10144 * script.h: Update declarations.
10145 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10146 min_p_align.
10147 * testsuite/script_test_3.t: Set large alignment.
10148 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10149 segment has expected alignment.
10150
9c9c98a5
NC
101512010-04-22 Nick Clifton <nickc@redhat.com>
10152
10153 * po/gold.pot: Updated by the Translation project.
10154 * po/vi.po: Updated Vietnamese translation.
10155
2253bfba
L
101562010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10157
10158 * testsuite/Makefile.am (check_PROGRAMS): Add
10159 icf_virtual_function_folding_test.
10160 * testsuite/Makefile.in: Regenerated.
10161
85fdf906
AH
101622010-04-15 Andrew Haley <aph@redhat.com>
10163
10164 * options.h (merge_exidx_entries): New option.
10165 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10166 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10167 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10168 (Target_arm::merge_exidx_entries): New function.
10169 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10170 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10171 to Arm_exidx_fixup constructor.
10172 Add new arg, merge_exidx_entries.
10173 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10174 Arm_output_section::fix_exidx_coverage.
10175
ce97fa81
ST
101762010-04-18 Sriraman Tallam <tmsriram@google.com>
10177
10178 * icf.cc (get_section_contents): Check for preemptible functions.
10179 Ignore addend when appropriate.
10180 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10181 section folded.
10182 (add_from_relobj): Check for section folded.
10183 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10184 * symtab.h (should_add_dynsym_entry): Add new parameter.
10185 * target-reloc.h (scan_relocs): Check for section folded.
10186 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10187 Check reloc types for function pointers in shared objects.
10188 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10189 case.
10190 (icf_preemptible_functions_test): New test case.
10191 (icf_string_merge_test): New test case.
10192 * testsuite.Makefile.in: Regenerate.
10193 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10194 bar_glob. Refactor code.
10195 * testsuite/icf_preemptible_functions_test.cc: New file.
10196 * testsuite/icf_preemptible_functions_test.sh: New file.
10197 * testsuite/icf_string_merge_test.cc: New file.
10198 * testsuite/icf_string_merge_test.sh: New file.
10199 * testsuite/icf_virtual_function_folding_test.cc: New file.
10200 * testsuite/icf_virtual_function_folding_test.sh: New file.
10201
04ceb17c
DK
102022010-04-14 Doug Kwan <dougkwan@google.com>
10203
10204 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10205 for local symbol recounting if we remove a section due to ICF.
10206 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10207 there are no regular objects in input.
10208
153e7da4
DK
102092010-04-13 Doug Kwan <dougkwan@google.com>
10210
10211 * arm.cc (Arm_input_section::set_final_data_size): Compute
10212 accurate final data size instead of using current data size.
10213
4dbd9faf
DK
102142010-04-09 Doug Kwan <dougkwan@google.com>
10215
10216 * layout.cc (Layout::choose_output_section): Handle script section
10217 types.
10218 (Layout::make_output_section_for_script): Add section type parameter.
10219 Handle script section types.
10220 * layout.h (Layout::make_output_section_for_script): Add section
10221 type parameter.
10222 * output.cc (Output_section::Output_section): Initialize data member
10223 is_noload_.
10224 (Output_section::do_reset_address_and_file_offset): Do not set address
10225 to 0 if section is a NOLOAD section.
10226 * output.h (Output_section::is_noload): New method.
10227 (Output_section::set_is_noload): Ditto.
10228 (Output_section::is_noload_): New data member.
10229 * script-c.h (Script_section_type): New enum type.
10230 (struct Parser_output_section_header): Add new file section_type.
10231 * script-sections.cc (Sections_element::output_section_name): Add
10232 parameter for returning script section type.
10233 (Output_section_definition::output_section_name): Ditto.
10234 (Output_section_definition::section_type)P; New method.
10235 (Output_section_definiton::script_section_type_name): Ditto.
10236 (Output_section_definition::script_section_type_): New data member.
10237 (Output_section_definition::Output_section_definition): Initialize
10238 data member Output_section_definition::script_section_type_.
10239 (Output_section_definition::create_sections): Pass script section type
10240 to Layout::make_output_section_for_script.
10241 (Output_section_definition::output_section_name): Return script
10242 section type to caller.
10243 (Output_section_definition::set_section_address): Do not advance
10244 dot value and load address if section type is NOLOAD. Set address
10245 of NOLOAD sections regardless of section flags.
10246 (Output_section_definition::print): Print section type if it is
10247 not SCRIPT_SECTION_TYPE_NONE.
10248 (Output_section_definition::section_type): New method.
10249 (Output_section_definition::script_section_type_name): Ditto.
10250 (Script_sections::output_section_name): Add new parameter
10251 PSECTION_TYPE for returning script section type. Pass it to
10252 section elements. Handle discard sections.
10253 (Sort_output_sections::operator()): Handle NOLOAD sections.
10254 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10255 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10256 returning script section type.
10257 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10258 INFO and NOLOAD.
10259 * yyscript.y (union): Add new field SECTION_TYPE.
10260 (COPY, DSECT, INFO, NOLOAD): New tokens.
10261 (opt_address_and_section_type): Change type to output_section_header.
10262 (section_type): New non-terminal
10263 (section_header): Handle section type.
2253bfba 10264 (opt_address_and_section_type): Return section type value.
4dbd9faf 10265
721ea635
L
102662010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10267
10268 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10269 * testsuite/plugin_common_test_2.c (foo): Likewise.
10270
6bf924b0
DK
102712010-04-08 Doug Kwan <dougkwan@google.com>
10272
10273 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10274 Output_merge_data.
10275 * output.cc (Output_section::add_merge_input_section): Simplify
10276 code and return status of Output_merge_base::add_input_section.
e1df38aa 10277 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10278 returns true.
10279
24af6f92
DK
102802010-04-07 Doug Kwan <dougkwan@google.com>
10281
10282 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10283 if section is marked as containing instructions but has no mapping
10284 symbols.
10285 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10286 correct section index.
10287 (Arm_relobj::find_linked_text_section): Ditto.
10288
00698fc5
CC
102892010-04-07 Cary Coutant <ccoutant@google.com>
10290
10291 * archive.cc (include_member): Destroy Read_symbols_data object before
10292 releasing file.
10293 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10294 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10295 (Read_symbols_data::~Read_symbols_data) New destructor.
10296 (Section_relocs::Section_relocs) New constructor.
10297 (Section_relocs::~Section_relocs) New destructor.
10298 (Read_relocs_data::Read_relocs_data) New constructor.
10299 (Read_relocs_data::~Read_relocs_data) New destructor.
10300 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10301 pointers to NULL after deleting.
10302
7296d933
DK
103032010-04-07 Doug Kwan <dougkwan@google.com>
10304
10305 * arm.cc: Replace "endianity" with "endianness" in comments.
10306 (Arm_exidx_cantunwind): Ditto.
10307 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10308 (Arm_relobj::merge_flags_and_attributes): New method.
10309 (Arm_relobj::merge_flags_and_attributes_): New data member.
10310 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10311 (Arm_relobj::scan_sections_for_stubs): Ditto.
10312 (Arm_relobj::do_read_symbols): Check to see if we really want to
10313 merge processor-specific flags and attributes. Exit early if
10314 an object is empty except for section names and the undefined symbol.
10315 (Target_arm::do_finalize_sections): Move check for ELF format to
10316 Arm_relobj::do_read_symbols. Merge processor specific flags and
10317 attributes from a regular object only when we have determined that
10318 it is aapropriate. Do not create an .ARM.attributes section in
10319 output if there is no regular input object.
10320 (Target_arm::merge_processor_specific_flags): Check
10321 --warn-mismatch before printing any error.
10322 (Target_arm::merge_object_attributes): Ditto.
10323 * gold.cc (queue_middle_tasks): Handle the case in which there is
10324 no regular object in input.
10325 * options.cc (General_options::parse_EB): New method.
10326 (General_options::parse_EL): Same.
10327 (General_options::General_options): Initialize endianness_.
10328 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10329 New options.
10330 (General_options::Endianness): New enum.
10331 (General_options::endianness): New method.
10332 (General_options::endianness_): New data member.
10333 * parameters.cc (Parameters::set_options): Check target endianness.
10334 (Parameters::set_target_once): Ditto.
10335 (Parameters::check_target_endianness): New method.
10336 (parameters_force_valid_target): If either -EL or -EB is specified,
10337 use it to define endianness of default target.
10338 * parameters.h (Parameters::check_target_endianness): New method
10339 declaration.
10340 * target.h (class Target): Change "endianity" to "endianness"
10341 in comments.
10342
efc8d4f2
RW
103432010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10344
10345 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10346 * configure: Regenerate.
10347 * Makefile.in: Regenerate.
10348 * testsuite/Makefile.in: Regenerate.
10349
be234d88
CC
103502010-04-06 Cary Coutant <ccoutant@google.com>
10351
10352 gcc PR lto/42757
10353 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10354 prevailing definitions of common symbols.
10355 * testsuite/plugin_test_6.sh: New test case.
10356 * testsuite/plugin_common_test_1.c: New test case.
10357 * testsuite/plugin_common_test_2.c: New test case.
10358 * testsuite/Makefile.am (plugin_test_6): New test case.
10359 * testsuite/Makefile.in: Regenerate.
10360
bd32c6bd
NC
103612010-04-06 Nick Clifton <nickc@redhat.com>
10362
10363 * po/vi.po: New Vietnamese translation.
10364
323c532f
DK
103652010-03-30 Doug Kwan <dougkwan@google.com>
10366
10367 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10368
4fcd97eb
DK
103692010-03-25 Doug Kwan <dougkwan@google.com>
10370
10371 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10372 to avoid a conversion warning on a 32-bit host.
10373
4ebf39db
ILT
103742010-03-24 Ian Lance Taylor <iant@google.com>
10375
10376 * testsuite/script_test_3.t: Add a TLS segment.
10377 * testsuite/Makefile.am (check_PROGRAMS): Add
10378 tls_phdrs_script_test.
10379 (tls_phdrs_script_test_SOURCES): Define.
10380 (tls_phdrs_script_test_DEPENDENCIES): Define.
10381 (tls_phdrs_script_test_LDFLAGS): Define.
10382 (tls_phdrs_script_test_LDADD): Define.
10383 * testsuite/Makefile.in: Rebuild.
10384
4a599bdd
CC
103852010-03-23 Cary Coutant <ccoutant@google.com>
10386
10387 * fileread.cc (find_or_make_view): Fix comment.
10388
6c93b22c
ILT
103892010-03-23 Ian Lance Taylor <iant@google.com>
10390
10391 * script-sections.cc (class Orphan_section_placement): Define
10392 PLACE_TLS and PLACE_TLS_BSS.
10393 (Orphan_section_placement::Orphan_section_placement): Initialize
10394 new places.
10395 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10396 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10397 (tls_script_test_SOURCES): Define.
10398 (tls_script_test_DEPENDENCIES): Define.
10399 (tls_script_test_LDFLAGS): Define.
10400 (tls_script_test_LDADD): Define.
10401 * testsuite/Makefile.in: Rebuild.
10402
a2c7281b
DK
104032010-03-22 Doug Kwan <dougkwan@google.com>
10404
10405 * arm.cc (Arm_relocate_functions::abs8,
10406 Arm_relocate_functions::abs16): Use correct check for overflow
10407 specified in the ARM ELF specs.
10408 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10409 target of a BLX instruction specially.
10410 (Reloc_stub::stub_type_for_reloc): Ditto.
10411 (Relocate::relocate): Use symbolic names instead of numeric relocation
10412 codes to report error.
10413 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10414 workaround.
10415 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10416 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10417 thumb2_blx_out_of_range.stdout
10418 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10419 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10420 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10421 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10422 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10423 thumb2_blx_in_range, thumb2_blx_in_range.o,
10424 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10425 thumb2_blx_out_of_range.o): New rules.
2e702c99 10426 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10427 thumb2_blx_in_range and thumb2_blx_out_of_range.
10428 * testsuite/Makefile.in: Regenerate.
10429 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10430 * testsuite/thumb_blx_in_range.s: New file.
10431 * testsuite/thumb_blx_out_of_range.s: New file.
10432
b0193076
RÁE
104332010-03-22 Rafael Espindola <espindola@google.com>
10434
10435 * archive.cc (Should_include): Move to archive.h.
10436 (should_include_member): Make it a member of Archive.
10437 (Lib_group): New.
10438 (Add_lib_group_symbols): New.
10439 * archive.h: Include options.h.
10440 (Archive_member): Moved from Archive.
10441 (Should_include): Moved from archive.cc.
10442 (Lib_group): New.
10443 (Add_lib_group_symbols): New.
10444 * dynobj.cc (do_should_include_member): New.
10445 * dynobj.h (do_should_include_member): New.
10446 * gold.cc (queue_initial_tasks): Update call to queue.
10447 * main.cc (main): Print lib group stats.
10448 * object.cc (do_should_include_member): New.
10449 * object.h: Include archive.h.
10450 (Object::should_include_member): New.
10451 (Object::do_should_include_member): New.
10452 (Sized_relobj::do_should_include_member): New.
10453 * options.cc (General_options::parse_start_lib): New.
10454 (General_options::parse_end_lib): New.
10455 (Input_arguments::add_file): Handle lib groups.
10456 (Input_arguments::start_group): Check we are not in a lib.
10457 (Input_arguments::start_lib): New.
10458 (Input_arguments::end_lib): New.
10459 * options.h (General_options): Add start_lib and end_lib.
10460 (Input_argument::lib_): New.
10461 (Input_argument::lib): New.
10462 (Input_argument::is_lib): New.
10463 (Input_file_lib): New.
10464 (Input_arguments::in_lib_): New.
10465 (Input_arguments::in_lib): New.
10466 (Input_arguments::start_lib): New.
10467 (Input_arguments::end_lib_): New.
10468 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10469 in unused members as preempted.
10470 (Sized_pluginobj::do_should_include_member): New.
10471 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10472 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10473 return the blocker.
10474 (Read_symbols::do_whole_lib_group): New.
10475 (Read_symbols::do_lib_group): New.
10476 (Read_symbols::do_read_symbols): Handle lib groups.
10477 (Read_symbols::get_name): Handle lib groups.
10478 * readsyms.h (Read_symbols): Add an archive member pointer.
10479 (Read_symbols::do_whole_lib_group): New.
10480 (Read_symbols::do_lib_group): New.
10481 (Read_symbols::member_): New.
10482 * script.cc (read_input_script): Update call to queue_soon.
10483
d099120c
DK
104842010-03-19 Doug Kwan <dougkwan@google.com>
10485
10486 * arm.cc (Stub_table::Stub_table): Initialize new data members
10487 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10488 (Stub_table::add_reloc_stub): Assign stub offset and update
10489 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10490 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10491 New data members.
2e702c99 10492 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10493 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10494 instead of going over all reloc stubs.
2e702c99 10495 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10496 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10497 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10498 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10499 Stringpool_template::offset_.
10500 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10501 Stringpool_template::offset_ to zero.
10502
1aa37384
DK
105032010-03-15 Doug Kwan <dougkwan@google.com>
10504
10505 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10506 offset_.
10507 (Stringpool_template::new_key_offset): New method.
10508 (Stringpool_template::add_string): Assign offsets when adding new
10509 strings.
10510 (Stringpool_template::set_string_offsets): Do not set string offsets
10511 when not optimizing.
10512 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10513 member size_.
2e702c99
RM
10514 (Chunked_vector::clear): Clear size_.
10515 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10516 (Chunked_vector::size): Return size_.
10517 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10518 (Chunked_vector::size_): New data member.
1aa37384
DK
10519 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10520 (Stringpool_template::new_key_offset): New method declaration.
10521 (Stringpool_template::offset_): New data member.
10522
b672b057
RÁE
105232010-03-15 Rafael Espindola <espindola@google.com>
10524
10525 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10526 Add_symbols' constructor.
10527 * readsyms.h (Add_symbols): Remove the input_group member.
10528
b6848d3c
ILT
105292010-03-10 Ian Lance Taylor <iant@google.com>
10530
10531 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10532 target to ask whether a reference to a symbol requires a stack
10533 split.
10534 * target.h (Target::is_call_to_non_split): New function.
10535 (Target::do_is_call_to_non_split): Declare virtual function.
10536 * target.cc: Include "symtab.h".
10537 (Target::do_is_call_to_non_split): New function.
10538 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10539
a2a5469e
CC
105402010-03-10 Cary Coutant <ccoutant@google.com>
10541
10542 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10543 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10544 (File_read::open[2]): Add whole_file_view_ to list of views.
10545 (File_read::make_view): Remove test of whole_file_view_.
10546 (File_read::find_or_make_view): Create whole_file_view_ if
10547 necessary.
10548 (File_read::clear_views): Replace bool parameter with enum;
10549 adjust all callers. Don't delete views with permanent data;
10550 do delete cached views and views from archives if
10551 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10552 if clearing the corresponding view.
10553 * fileread.h (File_read::Clear_views_mode): New enum.
10554 (File_read::View::is_permanent_view): New method.
10555 (File_read::clear_views): Replace bool parameter
10556 with enum; adjust all callers.
10557 * options.h (General_options): Change keep_files_mapped option;
10558 add map_whole_files.
10559 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10560 releasing the file.
10561 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10562 the file.
10563
8861f32b
DM
105642010-03-10 David S. Miller <davem@davemloft.net>
10565
10566 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10567
d62d0f5f
ST
105682010-03-09 Sriraman Tallam <tmsriram@google.com>
10569
10570 * icf.cc (get_section_contents): Add '@' marker after processing the
10571 merge reloc.
10572
9177756d
DK
105732010-03-08 Doug Kwan <dougkwan@google.com>
10574
10575 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10576 due to a conversion warning.
10577 (Arm_relobj::update_output_local_symbol_count): Check for local
10578 symbol with unset output index.
10579
9e9e071b
ILT
105802010-03-05 Ian Lance Taylor <iant@google.com>
10581
10582 * options.h (class General_options): Add --spare-dynamic-tags.
10583 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10584 --spare-dynamic-tags.
10585
a81ee015
ILT
105862010-03-05 Ian Lance Taylor <iant@google.com>
10587
10588 * incremental.cc: Include "libiberty.h".
10589
44ec90b9
RO
105902010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10591
10592 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10593 function, is_info_ member.
10594 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10595 (Versions::Versions): Update caller.
10596 (Versions::define_base_version): Likewise.
10597 (Versions::add_def): Likewise.
10598
0897ed3b
ST
105992010-03-03 Sriraman Tallam <tmsriram@google.com>
10600
10601 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10602 (Scan::possible_function_pointer_reloc): New function.
10603 (Scan::local_reloc_may_be_function_pointer): Change to call
10604 possible_function_pointer_reloc.
10605 (Scan::global_reloc_may_be_function_pointer): Ditto.
10606 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10607 relocations in ".data.rel.ro._ZTV" section.
10608 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10609 * testsuite/icf_safe_so_test.cc: Ditto.
10610 * testsuite/icf_safe_test.cc: Ditto.
10611 * testsuite/icf_safe_test.sh: Ditto.
10612
d3bbad62
ILT
106132010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10614 Ian Lance Taylor <iant@google.com>
10615
10616 * target-reloc.h (relocate_section): Check the symbol table index
10617 for -1U before setting the local symbol index.
10618 (scan_relocatable_relocs): If copying the relocation, record that
10619 the local symbol is required.
10620 * object.h (Symbol_value::is_output_symtab_index_set): New
10621 function.
10622 (Symbol_value::may_be_discarded_from_output_symtab): New
10623 function.
10624 (Symbol_value::has_output_symtab_entry): New function.
10625 (Symbol_value::needs_output_symtab_entry): Remove.
10626 (Symbol_value::output_symtab_index): Make sure the symbol index is
10627 set.
10628 (Symbol_value::set_output_symtab_index): Make sure the symbol
10629 index is not set. Make sure the new index is valid.
10630 (Symbol_value::set_must_have_output_symtab_entry): New function.
10631 (Symbol_value::has_output_dynsym_entry): New function.
10632 (Symbol_value::set_output_dynsym_index): Make sure the new index
10633 is valid.
10634 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10635 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10636 local symbol if permitted.
10637 (Sized_relobj::do_finalize_local_symbols): Call
10638 is_output_symtab_index_set rather than needs_output_symtab_entry.
10639 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10640 rather than needs_output_symtab_entry. Call
10641 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10642 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10643 is_output_symtab_index_set rather than needs_output_symtab_entry.
10644 * testsuite/discard_locals_relocatable_test.c: New file.
10645 * testsuite/discard_locals_test.sh: Test -r.
10646 * testsuite/Makefile.am (check_DATA): Add
10647 discard_locals_relocatable_test1.syms,
10648 discard_local_relocatable_test2.syms.
10649 (MOSTLYCLEANFILES): Likewise. Also add
10650 discard_locals_relocatable_test1.lout and
10651 discard_locals_relocatable_test2.out.
10652 (discard_locals_relocatable_test1.syms): New target.
10653 (discard_locals_relocatable_test.o): New target.
10654 (discard_locals_relocatable_test1.out): New target.
10655 (discard_locals_relocatable_test2.syms): New target.
10656 (discard_locals_relocatable_test2.out): New target.
10657 (various): Add missing ../ld-new dependencies.
10658 * testsuite/Makefile.in: Rebuild.
10659
7e8ccf26
NC
106602010-03-03 Nick Clifton <nickc@redhat.com>
10661
10662 * po/fi.po: New Finnish translation.
10663
2a0ff005
DK
106642010-03-01 Doug Kwan <dougkwan@google.com>
10665
10666 * layout.cc (Layout::Layout): Force section types of .init_array*,
10667 .preinit_array* and .fini_array* sections.
10668 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10669 Fix check of return value of std::string::find.().
10670 (Output_section::Input_section_sort_compare::operator()): Remove
10671 comment about .init_array.
10672 (Output_section::Input_section_sort_init_fini_compare::operator()):
10673 New method.
10674 (Output_section::sort_attached_input_sections): Handle .init_array
10675 and .fini_array specially.
10676 * output.h (Output_section::Inut_section_sort_compare): Update
10677 comment.
10678 (Output_section::Input_section_sort_init_fini_compare): New struct.
10679
c3e4ae29
DK
106802010-02-26 Doug Kwan <dougkwan@google.com>
10681
10682 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10683 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10684 * testsuite/debug_msg.sh: Avoid matching source line number for
10685 use of global variable undef_int.
10686
2fd9ae7a
DK
106872010-02-26 Doug Kwan <dougkwan@google.com>
10688
10689 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10690 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10691 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10692 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10693 * options.cc (General_options::General_options): Initialize member
10694 fix_v4bx_.
10695 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10696 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10697 and rm_no_fix_v4bx.stdout
10698 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10699 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10700 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10701 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10702 and arm_no_fix_v4bx.
10703 * Makefile.in: Regenerate.
10704 * testsuite/arm_fix_v4bx.s: New file.
10705 * testsuite/arm_fix_v4bx.sh: Ditto.
10706
67ec7d0b
DK
107072010-02-24 Doug Kwan <dougkwan@google.com>
10708
10709 * arm.cc (Target_arm::got_section): Make the .got section the first
10710 non RELRO section in the data segment.
10711 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10712 suffixes of section names.
10713
10165461
DK
107142010-02-24 Doug Kwan <dougkwan@google.com>
10715
10716 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10717 flags and attributes merging if an input file is a binary file.
10718 * fileread.cc (Input_file::open): Record format of original file.
10719 * fileread.h (Input_file::Format): New enum type.
2e702c99 10720 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10721 (Input_file::format): New method definition.
10722 (Input_file::format_):: New data member.
10723
4a54abbb
DK
107242010-02-24 Doug Kwan <dougkwan@google.com>
10725
10726 * arm.cc (Arm_output_data_got): New class.
10727 (ARM_TCB_SIZE): New constant
10728 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10729 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10730 If user uses a script with a SECTIONS clause, issue only a warning
10731 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10732 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10733 garbage collection.
10734 (Target_arm::got_mode_index_entry): Handle static linking.
10735 (Target_arm::Scan::local): Ditto.
10736 (Target_arm::Scan::global): Ditto.
10737 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10738 all incorrectly implemented relocations.
e1df38aa 10739 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10740 Arm_output_section::fix_exidx_coverage.
10741 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10742 from ".ARM.exidx." and ".ARM.extab.".
10743
ca419a6f
ILT
107442010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10745
10746 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10747 section if it does not already exist.
10748 * attributes.cc (Attributes_section_data::Attributes_section_data):
10749 Don't crash if size is zero.
10750
135b9c78
ILT
107512010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10752 Ian Lance Taylor <iant@google.com>
10753
10754 * gold.cc (queue_middle_tasks): If no input files were opened,
10755 exit.
10756 * workqueue.h (Task_function::Task_function): Assert that there is
10757 a blocker.
10758
bb0bfe4f
DK
107592010-02-22 Doug Kwan <dougkwan@google.com>
10760
10761 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10762 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10763 types to avoid warnings due to different uint64_t implementations
10764 on different hosts.
10765
2a2b6d42
DK
107662010-02-21 Doug Kwan <dougkwan@google.com>
10767
10768 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10769 handling of the maximum backward branch offset.
2e702c99 10770 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10771 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10772 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10773 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10774 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10775 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10776 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10777 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10778 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10779 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10780 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10781 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10782 thumb2_bl_out_of_range.o): New rules.
10783 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10784 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10785 thumb2_bl_out_of_range
10786 * testsuite/Makefile.in: Regenerate.
10787 * testsuite/arm_bl_in_range.s: New file.
10788 * testsuite/arm_bl_out_of_range.s: Ditto.
10789 * testsuite/arm_branch_in_range.sh: Ditto.
10790 * testsuite/arm_branch_range.t: Ditto.
10791 * testsuite/thumb2_branch_range.t: Ditto.
10792 * testsuite/thumb_bl_in_range.s: Ditto.
10793 * testsuite/thumb_bl_out_of_range.s: Ditto.
10794 * testsuite/thumb_branch_range.t: Ditto.
10795
b487ad64
ST
107962010-02-20 Sriraman Tallam <tmsriram@google.com>
10797
10798 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10799 Add reloc offset information.
10800 * icf.cc (get_section_contents): Change iterators to point to the new
10801 vectors. Add reloc offset information to the contents.
10802 * icf.h (Icf::Sections_reachable_info): New typedef.
10803 (Icf::Sections_reachable_list): New typedef.
10804 (Icf::Offset_info): New typedef.
10805 (Icf::Reloc_info): New struct typedef.
10806 (Icf::Reloc_info_list): New typedef.
10807 (Icf::symbol_reloc_list): Delete method.
10808 (Icf::addend_reloc_list): Delete method.
10809 (Icf::section_reloc_list): Delete method.
10810 (Icf::reloc_info_list): New method.
10811 (Icf::reloc_info_list_): New member.
10812
f96accdf
DK
108132010-02-19 Doug Kwan <dougkwan@google.com>
10814
10815 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10816 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10817 * arm.cc (Arm_relocation_functions): New forward declaration.
10818 (Target_arm::Target_arm): Initialize new data members
10819 got_mod_index_offset_ and tls_base_symbol_defined_.
10820 (Target_arm::Relocate::relocate_tls): New method.
10821 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10822 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10823 New methods.
2e702c99 10824 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10825 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10826 (Target_arm::got_mod_index_offset_,
10827 Target_arm::tls_base_symbol_defined_): New data members.
10828 (Target_arm::Scan::local, Target::Scan::global,
10829 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10830 relocations.
10831
c8761b9a
DK
108322010-02-18 Doug Kwan <dougkwan@google.com>
10833
10834 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10835 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10836 text section as a parameter becuase some broken tools may not set
10837 the link in section header.
10838 (Target_arm::has_got_section): New method.
10839 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10840 without any mapping symbol as data only. Remove warning.
10841 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10842 link in its section header, try to discover the link by inspecting the
10843 REL31 relocation at the beginning of the section.
10844 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10845 in error message.
10846 (Target_arm::Scan::global): Treat any reference to the symbol
10847 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10848
21bb3914
ST
108492010-02-12 Sriraman Tallam <tmsriram@google.com>
10850
10851 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10852 (Scan::global_reloc_may_be_function_pointer): New function.
10853 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10854 (Scan::global_reloc_may_be_function_pointer): New function.
10855 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10856 (Scan::global_reloc_may_be_function_pointer): New function.
10857 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10858 (Scan::global_reloc_may_be_function_pointer): New function.
10859 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10860 (Scan::global_reloc_may_be_function_pointer): New function.
10861 (Scan::possible_function_pointer_reloc): New function.
10862 (Target_x86_64::can_check_for_function_pointers): New function.
10863 * gc.h (gc_process_relocs): Scan relocation types to determine if
10864 function pointers were taken for targets that support it.
10865 * icf.cc (Icf::find_identical_sections): Include functions for
10866 folding in safe ICF whose pointer is not taken.
10867 * icf.h (Secn_fptr_taken_set): New typedef.
10868 (fptr_section_id_): New member.
10869 (section_has_function_pointers): New function.
10870 (set_section_has_function_pointers): New function.
10871 (check_section_for_function_pointers): New function.
10872 * options.h: Fix comment for safe ICF option.
10873 * target.h (can_check_for_function_pointers): New function.
10874 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10875 Modify icf_safe_test for X86-64.
10876 * testsuite/Makefile.in: Regenerate.
10877 * testsuite/icf_safe_so_test.cc: New file.
10878 * testsuite/icf_safe_so_test.sh: New file.
10879 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10880 (main): Change to take pointer to function kept_func_3.
10881 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10882 folding is done correctly for X86-64.
10883
0da6fa6c
DM
108842010-02-12 David S. Miller <davem@davemloft.net>
10885
10886 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10887 is_symbolless parameter.
10888 (Output_reloc<SHT_REL>::is_symbolless): New.
10889 (Output_reloc<SHT_REL>::is_symbolless_): New.
10890 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10891 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10892 (Output_reloc<SHT_RELA>::is_symbolless): New.
10893 (Output_data_reloc::add_global): Handle is_symbolless.
10894 (Output_data_reloc::add_global_relative): Likewise.
10895 (Output_data_reloc::add_local): Likewise.
10896 (Output_data_reloc::add_local_relative): Likewise.
10897 (Output_data_reloc::add_symbolless_global_addend): New.
10898 (Output_data_reloc::add_symbolless_local_addend): New.
10899 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10900 is_symbolless.
10901 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10902 instead of ->is_relative_
10903 (Output_reloc::write): Likewise.
10904 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10905 (Output_reloc::write_rel): Simplify.
10906
10907 * sparc.cc (Target_sparc::Scan::local): Use
10908 ->add_symbolless_local_addend as needed.
10909 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10910 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10911 based upon relocation offset.
10912
e4782e83
DK
109132010-02-11 Doug Kwan <dougkwan@google.com>
10914
10915 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10916 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10917 beginning of function.
10918 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10919 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10920 parameter is_32bit in calls to should_apply_static_reloc.
10921 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10922 (check_DATA): Add arm_abs_global.stdout.
10923 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10924 arm_abs_global.stdout): New rules.
10925 (MOSTLLYCLEANFILES): Add arm_abs_global
10926 * Makefile.in: Regenerate.
10927 * testsuite/arm_abs_global.s: New file.
10928 * testsuite/arm_abs_global.sh: Ditto.
10929 * testsuite/arm_abs_lib.s: Ditto.
10930
93ceb764
ILT
109312010-02-11 Ian Lance Taylor <iant@google.com>
10932
10933 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10934 Read_relocs task.
10935 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10936 Allocate_commons_task first.
10937 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10938 task, rather than symtab_lock_.
10939 (Gc_process_relocs::~Gc_process_relocs): New function.
10940 (Gc_process_relocs::is_runnable): Check this_blocker_.
10941 (Gc_process_relocs::locks): Use next_blocker_ rather than
10942 blocker_.
10943 (Scan_relocs::~Scan_relocs): New function.
10944 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10945 symtab_lock_.
10946 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10947 next_blocker_.
10948 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10949 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10950 constructor accordingly.
10951 (class Gc_process_relocs): Likewise.
10952 (class Scan_relocs): Likewise.
10953 * common.h (class Allocate_commons_task): Remove symtab_lock_
10954 field, and corresponding constructor parameter.
10955 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10956 symtab_lock_.
10957 (Allocate_commons_task::locks): Likewise.
10958
114dfbe1
ILT
109592010-02-11 Ian Lance Taylor <iant@google.com>
10960
10961 * gold-threads.h (class Once): Define.
10962 (class Initialize_lock): Rewrite as child of Once.
10963 * gold-threads.cc (class Once_initialize): Define.
10964 (once_pointer_control): New static variable.
10965 (once_pointer, once_arg): New static variables.
10966 (c_run_once): New static function.
10967 (Once::Once, Once::run_once, Once::internal_run): New functions.
10968 (class Initialize_lock_once): Remove.
10969 (initialize_lock_control): Remove.
10970 (initialize_lock_pointer): Remove.
10971 (initialize_lock_once): Remove.
10972 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10973 (Initialize_lock::initialize): Rewrite.
10974 (Initialize_lock::do_run_once): New function.
10975 * archive.cc (Archive::interpret_header): Only clear name if it is
10976 not already empty.
10977 * fileread.cc: Include "gold-threads.h"
10978 (file_counts_lock): New static variable.
10979 (file_counts_initialize_lock): Likewise.
10980 (File_read::release): Only increment counts when using --stats.
10981 Use a lock around the increment.
10982 * parameters.cc (class Set_parameters_target_once): Define.
10983 (set_parameters_target_once): New static variable.
10984 (Parameters::Parameters): Move here from parameters.h.
10985 (Parameters::set_target): Rewrite.
10986 (Parameters::set_target_once): New function.
10987 (Parameters::clear_target): Move here and rewrite.
10988 * parameters.h (class Parameters): Update declarations. Add
10989 set_parameters_target_once_ field.
10990 (Parameters::Parameters): Move to parameters.cc.
10991 (Parameters::clear_target): Likewise.
10992 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10993 task.
10994 (Start_group::~Start_group): New function.
10995 (Start_group::is_runnable): New function.
10996 (Start_group::locks, Start_group::run): New functions.
10997 (Finish_group::run): Change saw_undefined to size_t.
10998 * readsyms.h (class Start_group): Define.
10999 (class Finish_group): Change saw_undefined_ field to size_t.
11000 (Finish_group::Finish_group): Remove saw_undefined and
11001 this_blocker parameters. Change all callers.
11002 (Finish_group::set_saw_undefined): New function.
11003 (Finish_group::set_blocker): New function.
11004 * symtab.h (class Symbol_table): Change saw_undefined to return
11005 size_t. Change saw_undefined_ field to size_t.
11006 * target-select.cc (Set_target_once::do_run_once): New function.
11007 (Target_selector::Target_selector): Initialize set_target_once_
11008 field. Don't initialize lock_ and initialize_lock_ fields.
11009 (Target_selector::instantiate_target): Rewrite.
11010 (Target_selector::set_target): New function.
11011 * target-select.h (class Set_target_once): Define.
11012 (class Target_selector): Update declarations. Make
11013 Set_target_once a friend. Remove lock_ and initialize_lock_
11014 fields. Add set_target_once_ field.
11015
fa17a3f4
ILT
110162010-02-10 Ian Lance Taylor <iant@google.com>
11017
11018 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11019 queueing any tasks.
11020 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11021 (queue_middle_tasks): Add all blockers before queueing any tasks.
11022 (queue_final_tasks): Likewise.
11023 * token.h (Task_token::add_blockers): New function.
11024 * object.h (Input_objects::number_of_relobjs): New function.
11025
c7177d31
ILT
110262010-02-10 Ian Lance Taylor <iant@google.com>
11027
5de0e392
ILT
11028 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11029 shared, not if not position independent.
11030 * x86_64.cc (Relocate::relocate_tls): Likewise.
11031 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11032 (tls_pie_pic_test): New target.
11033 * testsuite/Makefile.in: Rebuild.
11034
c7177d31
ILT
11035 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11036 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11037 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11038 * testsuite/Makefile.in: Rebuild.
11039
684b268a
DM
110402010-02-09 David S. Miller <davem@davemloft.net>
11041
11042 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11043 R_SPARC_RELATIVE using ->add_local_relative().
11044 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11045
612a8d3d
DM
11046 * output.h (Output_data_dynamic::add_section_size): New method
11047 that takes two Output_data objects.
11048 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11049 entry param. Handle it in initializers.
11050 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11051 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11052 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11053 arg.
11054 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11055 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11056 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11057 for dynrel_includes_plt.
11058 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11059 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11060 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11061 before .rela.plt
11062 (Target_sparc::do_finalize_sections): Update to pass true for
11063 dynrel_includes_plt.
11064 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11065 output before .rela.plt
11066 (Target_powerpc::do_finalize_sections): Update to pass true for
11067 dynrel_includes_plt when 32-bit.
11068
cb1be87e
DK
110692010-02-08 Doug Kwan <dougkwan@google.com>
11070
11071 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11072 method.
11073 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11074 Arm_relobj::scan_section_for_cortex_a8_stubs,
11075 Arm_relobj::do_relocation_section): Instead of calling
11076 Output_section::output_address, use faster
11077 Arm_relobj::simple_input_section_output_address.
11078
705b5121
DM
110792010-02-08 David S. Miller <davem@davemloft.net>
11080
11081 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11082 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11083 relocation helper function.
11084
024c4466
DM
11085 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11086 just like R_SPARC_GOT{10,13,22}.
11087 (Target_sparc::Scan::local): Likewise.
11088 (Target_sparc::Relocate:relocate): Likewise.
11089
9109c078
ILT
110902010-02-06 Ian Lance Taylor <iant@google.com>
11091
11092 * configure.ac: Rewrite targetobjs duplicate removal code to use
11093 only shell constructs.
11094 * configure: Rebuild.
11095
cf846138
DK
110962010-02-05 Doug Kwan <dougkwan@google.com>
11097
11098 PR 11247
11099 * arm.cc (Arm_relobj::section_is_scannable): New method.
11100 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11101 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11102
6cfaf60b
DK
111032010-02-04 Doug Kwan <dougkwan@google.com>
11104
11105 PR 11247
11106 * arm-reloc-property.cc (cstdio): Include.
11107 * configure.ac (targetobjs): Remove duplicates.
11108 * configure: Regenerate.
11109 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11110 big and little endian version for a given address size.
11111
5c57f1be
DK
111122010-02-03 Doug Kwan <dougkwan@google.com>
11113
11114 * arm-reloc-property.cc
11115 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11116 definition.
11117 * arm-reloc-property.h
11118 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11119 New method definition.
11120 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11121 declaration.
11122 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11123 overflow to N.
11124 (GOT_PREL): Change implemented to Y.
11125 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11126 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11127 (Arm_relocate_functions::movw_abs_nc): Remove method.
11128 (Arm_relocate_functions::movt_abs): Ditto.
11129 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11130 (Arm_relocate_functions::thm_movt_abs): Ditto.
11131 (Arm_relocate_functions::movw_rel_nc): Ditto.
11132 (Arm_relocate_functions::movw_rel): Ditto.
11133 (Arm_relocate_functions::movt_rel): Ditto.
11134 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11135 (Arm_relocate_functions:thm_movw_rel): Ditto.
11136 (Arm_relocate_functions:thm_movt_rel): Ditto.
11137 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11138 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11139 New method definitions.
11140 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11141 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11142 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11143 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11144 (Target_arm::Relocate::relocate): Check for non-static or
11145 unimplemented relocation code and exit early. Change calls to
11146 Target_arm::reloc_uses_thumb_bit and
11147 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11148 instead. Refactor code to handle similar relocations to increase
11149 code sharing. Remove check for unsupported relocation code in switch
11150 statement.
11151 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11152 relocation property table to find out size. Change error message to
11153 print out the name of a relocation code instead of the numeric value.
11154 (Target_arm::scan_reloc_for_stub): Use relocation property table
11155 instead of calling Target_arm::reloc_uses_thumb_bit().
11156
218c5831
DK
111572010-02-02 Doug Kwan <dougkwan@google.com>
11158
11159 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11160 types of relaxed input section.
11161
0d31c79d
DK
111622010-02-02 Doug Kwan <dougkwan@google.com>
11163
11164 * Makefile.am (HFILES): Add arm-reloc-property.h.
11165 (DEFFILES): New.
2e702c99
RM
11166 (TARGETSOURCES): Add arm-reloc-property.cc
11167 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11168 (libgold_a_SOURCES): $(DEFFILES)
11169 * Makefile.in: Regenerate.
11170 * arm-reloc-property.cc: New file.
11171 * arm-reloc-property.h: New file.
11172 * arm-reloc.def: New file.
11173 * arm.cc: Update comments.
11174 (arm-reloc-property.h): New included header.
11175 (arm_reloc_property_table): New global variable.
11176 (Target_arm::do_select_as_default_target): New method definition.
11177 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11178 arm-reloc-property to targ_extra_obj.
11179 * parameters.cc (set_parameters_target): Call
11180 Target::select_as_default_target().
11181 * target.h (Target::select_as_default_target): New method definition.
11182 (Target::do_select_as_default_target): Same.
11183
546c7457
DK
111842010-02-01 Doug Kwan <dougkwan@google.com>
11185
11186 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11187 first_output_text_section_.
11188 (Arm_exidx_fixup::first_output_text_section): New method definition.
11189 (Arm_exidx_fixup::first_output_text_section_): New data member.
11190 (Arm_exidx_fixup::process_exidx_section): Record the first text
11191 output section seen.
11192 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11193 and entsize in output section header.
11194
11b861d5
DK
111952010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11196
11197 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11198 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11199 (Arm_relocate_functions::thm_alu11): New Method.
11200 (Arm_relocate_functions::thm_pc8): New Method.
11201 (Arm_relocate_functions::thm_pc12): New Method.
11202 (Target_arm::Scan::local): Handle the relocations.
11203 (Target_arm::Scan::global): Likewise.
11204 (Target_arm::Relocate::relocate): Likewise.
11205 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11206
c9a2c125
DK
112072010-01-29 Doug Kwan <dougkwan@google.com>
11208
11209 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11210 of relocation types as ld.
11211
1521477a
DK
112122010-01-29 Doug Kwan <dougkwan@google.com>
11213
11214 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11215 to public.
11216 (Arm_relocate_functions::thumb_branch_common): Ditto.
11217 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11218 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11219 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11220 Arm_relocate_functions::jump24): Remove.
11221 (Target_arm::Relocate::relocate): Adjust code to call
11222 Arm_relocation_functions::arm_branch_common and
11223 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11224 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11225
e7eca48c
DK
112262010-01-29 Doug Kwan <dougkwan@google.com>
11227
11228 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11229 output_local_symbol_count_needs_update_.
11230 (Arm_relobj::output_local_symbol_count_needs_update,
11231 Arm_relobj::set_output_local_symbol_count_needs_update,
11232 Arm_relobj::update_output_local_symbol_count): New methods.
11233 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11234 member.
11235 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11236 of pointed function as in a R_ARM_PREL31 relocation.
11237 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11238 for output local symbol count updating.
11239 (Target_arm::do_relax): Update output local symbol counts in objects
11240 if necessary.
11241 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11242
02961d7e
ILT
112432010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11244
11245 * arm.cc: Added support for the ARM relocations:
11246 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11247 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11248 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11249 movw_prel_nc).
11250 (Arm_relocate_functions::movw_rel): New method.
11251 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11252 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11253 thm_movw_prel_nc).
11254 (Arm_relocate_functions::thm_movw_rel): New method.
11255 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11256 thm_movt_prel).
11257 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11258 relocations.
11259 (Target_arm::Scan::global): Likewise.
11260 (Target_arm::Relocate::relocate): Likewise.
11261 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11262 Likewise.
11263
b10d2873
ILT
112642010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11265
11266 * arm.cc: Added support for ARM group relocations.
11267 (Target_arm::reloc_needs_sym_origin): New method.
11268 (Arm_relocate_functions::calc_grp_kn): New method.
11269 (Arm_relocate_functions::calc_grp_residual): New method.
11270 (Arm_relocate_functions::calc_grp_gn): New method.
11271 (Arm_relocate_functions::arm_grp_alu): New Method.
11272 (Arm_relocate_functions::arm_grp_ldr): New Method.
11273 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11274 (Arm_relocate_functions::arm_grp_ldc): New Method.
11275 (Target_arm::Scan::local): Handle the ARM group relocations.
11276 (Target_arm::Scan::global): Likewise.
11277 (Target_arm::Relocate::relocate): Likewise.
11278 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11279 Likewise.
11280
2b328d4e
DK
112812010-01-26 Doug Kwan <dougkwan@google.com>
11282
11283 * arm.cc (set): Include.
11284 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11285 pointer type.
2e702c99 11286 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11287 (Arm_output_section::append_text_sections_to_list): New method.
11288 (Arm_output_section::fix_exidx_coverage): Ditto.
11289 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11290 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11291 Relobj::set_section_offset() instead of
11292 Sized_relobj::invalidate_section_offset().
2e702c99 11293 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11294 parameter for section headers. Ignore relocation sections for
11295 unallocated sections and EXIDX sections.
11296 (Target_arm::fix_exidx_coverage): New method.
11297 (Target_arm::output_section_address_less_than): New type.
11298 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11299 linked text section instead of the EXIDX section.
11300 (Arm_output_section::create_stub_group): Add an assertion to check
11301 that this is not an EXIDX output section.
11302 (Arm_output_section::append_text_sections_to_list): New method.
11303 (Arm_output_section::fix_exidx_coverage): Ditto.
11304 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11305 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11306 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11307 first pass.
11308 (Target_arm::fix_exidx_coverage): New method.
11309 * object.h (Relobj::set_output_section): New method.
11310 (Sized_relobj::invalidate_section_offset): Remove method.
11311 (Sized_relobj::do_invalidate_section_offset): Remove method.
11312 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11313
c7f3c371
DK
113142010-01-25 Doug Kwan <dougkwan@google.com>
11315
11316 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11317 Fix warning due to signed and unsigned comparison on a 32-bit host.
11318
8923b24c
DK
113192010-01-22 Doug Kwan <dougkwan@google.com>
11320
11321 * arm.cc (Target_arm::do_relax): Record an output section for section
11322 offset adjustment it contains any stub table that has changed.
11323 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11324 offsets in an output section if necessary.
11325 * output.cc (Output_section::Output_section): Initialize
11326 section_offsets_need_adjustments_.
11327 (Output_section::add_input_section_for_script): Renamed to
11328 Output_section::add_simple_input_section.
11329 (Output_section::save_states): Add a comment.
11330 (Output_section::discard_states): New method defintion.
11331 (Output_section::adjust_section_offsets): Same.
11332 * output.h (Output_section::add_input_section_for_script): Renamed to
11333 Output_section::add_simple_input_section.
11334 (Output_section::discard_states): New method declaration.
11335 (Output_section::adjust_section_offsets): Same.
11336 (Output_section::section_offsets_need_adjustment,
11337 Output_section::set_section_offsets_need_adjustment): New method
11338 definitions.
11339 (Output_section::section_offsets_need_adjustment_): New data member.
11340 * script-sections.cc
11341 (Output_section_element_input::set_section_address): Adjust code for
11342 renaming of Output_section::add_input_section_for_script.
11343 (Orphan_output_section::set_section_address): Same.
11344
9b2fd367
DK
113452010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11346
11347 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11348 Fix_v4bx enum values .
11349 * gold/options.h (General_options): New option definitions.
11350 (General_options::fix_v4bx): New method.
11351 (General_options::Fix_v4bx): New enum.
11352 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11353 (General_options::parse_fix_v4bx_interworking): New method.
11354
80d0d023
DK
113552010-01-22 Doug Kwan <dougkwan@google.com>
11356
11357 * arm.cc (Arm_exidx_fixup): New class.
11358
af2cdeae
DK
113592010-01-21 Doug Kwan <dougkwan@google.com>
11360
11361 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11362 classes.
11363 (Arm_exidx_section_offset_map): New type.
11364
993d07c1
DK
113652010-01-21 Doug Kwan <dougkwan@google.com>
11366
11367 * arm.cc (Arm_exidx_input_section): New class.
11368 (Arm_relobj::exidx_input_section_by_link,
11369 Arm_relobj::exidx_input_section_by_shndx,
11370 Arm_relobj::make_exidx_input_section): New methods.
11371 (read_arm_attributes_section): Remove.
11372 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11373 information about them.
11374 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11375 to here.
11376
5ac169d4
DK
113772010-01-20 Doug Kwan <dougkwan@google.com>
11378
11379 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11380 Input_section_specifier to Section_id.
11381 (Target_arm::new_arm_input_section: Adjust code for change of key
11382 type.
11383 (Target_arm::find_arm_input_section): Ditto.
11384 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11385 (Section_id): Remove.
11386 (Garbage_collection::Section_id_hash): Remove.
11387 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11388 (Section_id): Remove.
11389 (Icf::Section_id_hash): Remove.
11390 * object.h (Section_id, Const_section_id, Section_id_hash,
11391 Const_section_id_hash): New type definitions.
11392 * output.cc (Output_section::add_relaxed_input_section): Change to
11393 use Const_section_id instead of Input_section_specifier as key type.
11394 (Output_section::add_merge_input_section): Ditto.
11395 (Output_section::build_relaxation_map): Change to use Section_id
11396 instead of Input_section_specifier as key type.
2e702c99 11397 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11398 Ditto.
11399 (Output_section::convert_input_sections_to_relaxed_sections): Change
11400 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11401 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11402 (Output_section::find_relaxed_input_section): Ditto.
11403 * output.h (Input_section_specifier): Remove class.
11404 (Output_section::Output_section_data_by_input_section_map): Change
11405 key type to Const_section_id.
11406 (Output_section::Output_relaxed_input_section_by_input_section_map):
11407 Ditto.
11408 (Output_section::Relaxation_map): Change key type to Section_id.
11409
a2162063
ILT
114102010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11411
11412 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11413 (class Arm_v4bx_stub): New class.
11414 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11415 (Stub_factory::make_arm_v4bx_stub): New method.
11416 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11417 (Stub_table::empty): Handle v4bx stubs.
11418 (Stub_table::add_arm_v4bx_stub): New method.
11419 (Stub_table::find_arm_v4bx_stub): New method.
11420 (Arm_relocate_functions::v4bx): New method.
11421 (Target_arm::fix_v4bx): New method.
11422 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11423 (Stub_table::relocate_stubs): Likewise.
11424 (Stub_table::do_write): Likewise.
11425 (Stub_table::update_data_size_and_addralign): Likewise.
11426 (Stub_table::finalize_stubs): Likewise.
11427 (Target_arm::Scan::local): Likewise.
11428 (Target_arm::Scan::global): Likewise.
11429 (Target_arm::do_finalize_sections): Likewise.
11430 (Target_arm::Relocate::relocate): Likewise.
11431 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11432 Likewise.
11433 (Target_arm::scan_reloc_for_stub): Likewise.
11434 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11435
5696ab0b
ILT
114362010-01-19 Ian Lance Taylor <iant@google.com>
11437
11438 * output.cc (Output_section_headers::do_sized_write): Write large
11439 segment count to sh_info field.
11440 (Output_file_header::do_sized_write): For large segment count,
11441 write PN_XNUM to e_phnum field.
11442
800d0f56
ILT
114432010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11444
11445 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11446 (Arm_relocate_functions::thm_jump8): New function.
11447 (Arm_relocate_functions::thm_jump11): New function.
11448 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11449 R_ARM_THM_JUMP11.
11450 (Target_arm::Scan::global): Likewise.
11451 (Target_arm::Relocate::relocate): Likewise.
11452 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11453 Likewise.
11454
41263c05
DK
114552010-01-14 Doug Kwan <dougkwan@google.com>
11456
11457 * arm.cc (map, utility): Include headers.
11458 (Target_arm::apply_cortex_a8_workaround): New method.
11459 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11460 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11461 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11462 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11463 the --[no-]fix-cortex-a8 command line options.
11464 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11465 (Target_arm::relocate_stub): Use addend in instruction template.
11466 * options.h (DEFINE_bool): Set the user-set flag.
11467 (General_options): Add --[no-]-fix-cortex options.
11468 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11469 : Update fast look-up map after conversion.
41263c05 11470
459e9b03
ST
114712010-01-14 Sriraman Tallam <tmsriram@google.com>
11472
11473 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11474 in the first pass of do_layout.
11475
b521dfe4
DK
114762010-01-13 Doug Kwan <dougkwan@google.com>
11477
11478 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11479 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11480 apparent compiler problem of not folding static constant integral
11481 data members of elfcpp::Elf_sizes<32>.
11482
44272192
DK
114832010-01-13 Doug Kwan <dougkwan@google.com>
11484
11485 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11486 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11487 Arm_relobj::scan_section_for_cortex_a8_erratum,
11488 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11489 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11490 sections to scan for relocation stubs into a new method
11491 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11492 relocation and Cortex-A8 stub scanning.
11493 (Target_arm::do_relax): Force stubs to be after stubbed sections
11494 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11495 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11496 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11497
44b71ece
ILT
114982010-01-12 Ian Lance Taylor <iant@google.com>
11499
11500 * target-reloc.h (visibility_error): New inline function.
11501 (relocate_section): Call visibility_error.
11502 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11503 (MOSTLYCLEANFILES): Likewise.
11504 (protected_4_pic.o, protected_3.err): New targets.
11505 * testsuite/protected_4.cc: New file.
11506
a120bc7f
DK
115072010-01-12 Doug Kwan <dougkwan@google.com>
11508
11509 * arm.cc (Cortex_a8_reloc): New class.
11510 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11511 and cortex_a8_relocs_info_.
11512 (Target_arm::fix_cortex_a8): New method definition.
11513 (Target_arm::Cortex_a8_relocs_info): New type.
11514 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11515 New data member declarations.
11516 (Target_arm::scan_reloc_for_stub): Record information about
11517 relocations for THUMB branches that might be exempted from the
11518 Cortex-A8 workaround.
11519 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11520 at the beginning of a relaxation pass.
11521
20138696
DK
115222010-01-12 Doug Kwan <dougkwan@google.com>
11523
11524 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11525 (Arm_relobj::Mapping_symbol_position,
11526 Arm_reloj::Mapping_symbol_position_less,
11527 Arm_relobj::Mapping_symbols_info): New types.
11528 (Target_arm::is_mapping_symbol_name): New method definition.
11529 (Arm_relobj::do_count_local_symbols): Save information about mapping
11530 symbols.
11531
089d69dc
DK
115322010-01-11 Doug Kwan <dougkwan@google.com>
11533
11534 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11535 Arm_relocate_functions::thumb32_branch_upper,
11536 Arm_relocate_functions::thumb32_branch_lower,
11537 Arm_relocate_functions::thumb32_cond_branch_offset,
11538 Arm_relocate_functions::thumb32_cond_branch_upper,
11539 Arm_relocate_functions::thumb32_cond_branch_lower,
11540 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11541 branch offset encoding.
11542 (Arm_relocate_functions::thumb_branch_common): Use new branch
11543 offset encoding methods to avoid code duplication.
11544 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11545 (Stub_addend_reader::operator()): Use new branch encoding method
11546 to avoid code duplication.
11547
99e5bff2
DK
115482010-01-11 Doug Kwan <dougkwan@google.com>
11549
11550 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11551 (Target_arm::do_finalize_sections): Define special EXIDX section
11552 symbols only if referenced.
11553 * gc.h (Garbage_collection::add_reference): New method.
11554 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11555 code duplication.
11556
98e090bd
ILT
115572010-01-11 Ian Lance Taylor <iant@google.com>
11558
d0a91bd8
ILT
11559 * script.cc (Version_script_info::build_expression_list_lookup):
11560 Change complaing about duplicate wildcard match from error to
11561 warning.
11562
98e090bd
ILT
11563 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11564 of 2009-12-30.
11565 (Version_script_info::Version_script_info): Initialize globs_,
11566 default_version_, default_is_global_, and exact_. Don't
11567 initialize globals_ or locals_.
11568 (Version_script_info::build_lookup_tables): Build local symbols
11569 first.
11570 (Version_script_info::unquote): New function.
11571 (Version_script_info::add_exact_match): New function.
11572 (Version_script_info::build_expression_list_lookup): Remove lookup
11573 parameter. Add is_global parameter. Change all callers. Handle
11574 wildcard pattern specially. Unquote pattern. Call
11575 add_exact_match.
11576 (Version_script_info::get_name_to_match): New function.
11577 (Version_script_info::get_symbol_version): New function.
11578 (Version_script_info::get_symbol_version_helper): Remove.
11579 (Version_script_info::check_unmatched_names): Call unquote.
11580 * script.h (class Version_script_info): Change get_symbol_version
11581 to be non-inline and add is_global parameter; change all callers.
11582 Rewrite symbol_is_local. Update declarations. Define struct
11583 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11584 Remove globals_ and locals_ members. Add exact_, globs_,
11585 default_version_, is_global_.
11586 (Version_script_info::Glob): Remove pattern, add expression and
11587 is_global. Update constructor. Change all callers.
11588 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11589 default version.
11590 (Versions::symbol_section_contents): If a symbol is undefined, or
11591 defined in a dynamic object, set the version index to
11592 VER_NDX_LOCAL.
11593 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11594 symbol_is_local.
11595 (Symbol_table::add_from_pluginobj): Likewise.
11596 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11597
d56962d3
DK
115982010-01-11 Doug Kwan <dougkwan@google.com>
11599
11600 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11601 (incremental_dump_LDADD): Add linking option for libintl.
11602 * Makefile.in: Regenerate.
11603
94e6ee91
L
116042010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11605
11606 PR gold/11144
11607 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11608 instead of -Ds.
11609 * testsuite/Makefile.in: Regenerated.
11610
e96c574b
DK
116112010-01-10 Doug Kwan <dougkwan@google.com>
11612
11613 * options.h (DEFINE_var): Use parentheses around argument varname__
11614 in macro body to avoid any unintended subsequent substitutions.
11615
7198066b
ILT
116162010-01-10 Ian Lance Taylor <iant@google.com>
11617
ba4d53bf
ILT
11618 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11619 candidates before doing symbol resolution.
11620
7198066b
ILT
11621 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11622 ODR candidates if only one is weak.
11623
a2beed37
ILT
116242010-01-08 Ian Lance Taylor <iant@google.com>
11625
11626 * script.cc (Version_script_info::build_expression_list_lookup):
11627 Don't warn about ambiguous version, just record the ambiguity.
11628 (Version_script_info::get_symbol_version_helper): Give error if
11629 version is ambiguous.
11630
2fb7225c
DK
116312010-01-08 Doug Kwan <dougkwan@google.com>
11632
11633 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11634 prev_data_size_ and prev_addralign_. Remove initializer for
11635 deleted data member has_been_changed_.
11636 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11637 to determine if the table is empty.
11638 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11639 Remove.
11640 (Stub_table::add_reloc_stub): Define method in class definition
11641 instead of just declaring it there.
11642 (Stub_table::add_cortex_a8_stub): New method definition.
11643 (Stub_table::update_data_size_and_addralign): Ditto.
11644 (Stub_table::finalize_stubs): Ditto.
11645 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11646 (Stub_table::do_addralign_): Return address alignment in the
11647 (Stub_table::do_reset_address_and_file_offset): Define method in
11648 class definition instead of declaring it there. Set current data
11649 size to be the data size of the previous pass.
11650 (Stub_table::set_final_data_size): Use current data size as the
11651 final data size.
11652 (Stub_table::relocate_stub): Change parameter type of stub from
11653 Reloc_stub pointer to Stub pointer.
11654 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11655 (Stub_table::Cortex_a8_stub_list): New typedef.
11656 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11657 Stub_table::prev_addralign_): New data member.
11658 (Arm_relobj::Arm_relobj): Initialize data member
11659 section_has_cortex_a8_workaround_.
11660 (Arm_relobj::section_has_cortex_a8_workaround,
11661 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11662 definitions.
11663 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11664 declarations.
11665 (Target_arm::relocate_stub): Change parameter type of stub from
11666 Reloc_stub pointer to Stub pointer.
11667 (Insn_template::size, Insn_template::alignment): Handle
11668 THUMB16_SPECIAL_TYPE.
11669 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11670 Stub_table::update_data_size_and_addralign,
11671 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11672 definitions.
11673 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11674 (Stub_table::do_write): Ditto.
11675 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11676
880cd20d
ILT
116772010-01-08 Ian Lance Taylor <iant@google.com>
11678
11679 PR 11108
11680 * symtab.h (class Symbol): Remove fields is_target_special_ and
11681 has_plt_offset_. Add field is_defined_in_discarded_section_.
11682 (Symbol::is_defined_in_discarded_section): New function.
11683 (Symbol::set_is_defined_in_discarded_section): New function.
11684 (Symbol::has_plt_offset): Rewrite.
11685 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11686 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11687 Don't initialize is_target_special_ or has_plt_offset_.
11688 Initialize is_defined_in_discarded_section_.
11689 (Symbol_table::add_from_relobj): If appropriate, set
11690 is_defined_in_discarded_section.
11691 * resolve.cc (Symbol::override_base_with_special): Don't test
11692 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11693 * target-reloc.h (relocate_section): Do special handling for
11694 symbols defined in discarded sections for global symbols as well
11695 as local symbols.
11696
2703e3eb
ILT
116972010-01-08 Ian Lance Taylor <iant@google.com>
11698
11699 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11700 the SHT_SYMTAB case.
11701
339d40a3
ILT
117022010-01-08 Ian Lance Taylor <iant@google.com>
11703
11704 * object.cc (Sized_relobj::do_layout): Don't get confused if
11705 layout_eh_frame returns NULL.
11706
abecea76
ILT
117072010-01-08 Ian Lance Taylor <iant@google.com>
11708
11709 PR 11084
11710 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11711 dynamic symbol table, use the normal symbol table.
11712 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11713 symbol table.
11714
6b7dd3f3
ILT
117152010-01-08 Ian Lance Taylor <iant@google.com>
11716
11717 PR 11072
11718 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11719 sections.
11720
36c50e63
L
117212010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11722
11723 * version.cc (print_version): Change to "Copyright 2010".
11724
e291e7b9
ILT
117252010-01-08 Ian Lance Taylor <iant@google.com>
11726
11727 PR 10287
11728 PR 11063
11729 * i386.cc (class Target_i386): Change return type of plt_section
11730 to be non-const.
11731 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11732 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11733 tls_desc_rel_ field.
11734 (Output_data_plt_i386::rel_tls_desc): New function.
11735 (Target_i386::rel_tls_desc_section): New function.
11736 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11737 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11738 R_386_TLS_DESC reloc in rel_tls_desc_section.
11739 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11740 Define struct Tlsdesc_info.
11741 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11742 (Target_x86_64::do_reloc_symbol_index): New function.
11743 (Target_x86_64::add_tlsdesc_info): New function.
11744 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11745 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11746 tlsdesc_rel_ field.
11747 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11748 all callers.
11749 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11750 (Target_x86_64::rela_tlsdesc_section): New function.
11751 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11752 handling.
11753 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11754 (Target_x86_64::do_reloc_addend): New function.
11755 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11756 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11757 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11758 (Output_reloc::type): New function.
11759 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11760 (Output_reloc::is_target_specific): New function.
11761 (Output_reloc::target_arg): New function.
11762 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11763 absolute relocs and target specific relocs.
11764 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11765 add_target_specific.
11766 (class Output_data_reloc) [SHT_RELA]: Likewise.
11767 * output.cc (Output_reloc::Output_reloc): Add four new versions
11768 for absolute relocs and target specific relocs.
11769 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11770 (Output_reloc::get_symbol_index): Likewise.
11771 (Output_reloc::local_section_offset): Check that local_sym_index_
11772 is not TARGET_CODE or 0.
11773 (Output_reloc::symbol_value): Likewise.
11774 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11775 reloc.
11776 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11777 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11778 functions.
11779 * layout.cc (add_target_dynamic_tags): Use output section for
11780 DT_PLTRELSZ and DT_JMPREL.
11781
3a44184e
ILT
117822010-01-07 Ian Lance Taylor <iant@google.com>
11783
11784 PR 11061
11785 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11786 function.
11787 (class Output_data_reloc_generic): Define.
11788 (class Output_data_reloc_base): Change base class to
11789 Output_data_reloc_generic. Change add() method to call
11790 bump_relative_reloc_count for a relative reloc. Remove
11791 sort_relocs_ field.
11792 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11793 to sort_relocs().
11794 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11795 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11796 appropriate.
11797 * layout.h (class Layout): Update declaration.
11798
ea715a34
ILT
117992010-01-07 Ian Lance Taylor <iant@google.com>
11800
11801 * output.h (class Output_data): Add const version of
11802 output_section and do_output_section.
11803 (class Output_section_data): Add const version of
11804 do_output_section.
11805 (class Output_section): Likewise.
11806 * layout.cc (Layout::add_target_dynamic_tags): New function.
11807 * layout.h (class Layout): Update declarations.
11808 * arm.cc (Target_arm::do_finalize_sections): Use
11809 add_target_dynamic_tags.
11810 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11811 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11812 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11813 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11814
659948a4
ILT
118152010-01-07 Ian Lance Taylor <iant@google.com>
11816
11817 PR 11042
11818 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11819 object as needed.
11820
9d3b86f6
ILT
118212010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11822 Ian Lance Taylor <iant@google.com>
11823
11824 PR 11019
11825 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11826 Xindex::read_symtab_xindex.
11827
bb0d3eb0
DK
118282010-01-07 Doug Kwan <dougkwan@google.com>
11829
11830 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11831 (Insn_template::thumb16_bcond_insn): New method declaration.
11832 (Insn_template): Fix spelling.
11833 (Stub::thumb16_special): New method declaration.
11834 (Stub::do_write): Define virtual method which was previously pure
11835 virtual.
11836 (Stub::do_thumb16_special): New method declaration.
11837 (Stub::do_fixed_endian_write): New template member.
11838 (Reloc_stub::do_write): Remove.
11839 (Reloc_stub::do_fixed_endian_write): Remove.
11840 (Cortex_a8_stub): New class definition.
11841 (Stub_factory::make_cortex_a8_stub): New method definition.
11842 (Stub_factory::Stub_factory): Add missing static storage class
11843 qualifier for elf32_arm_stub_a8_veneer_blx.
11844
ffeef7df
ILT
118452010-01-07 Ian Lance Taylor <iant@google.com>
11846
dc3f80fe
ILT
11847 PR 10980
11848 * options.h (class General_options): Add --warn-unresolved-symbols
11849 and --error-unresolved-symbols.
11850 * errors.cc (Errors::undefined_symbol): Implement
11851 --warn-unresolved-symbols.
11852
ffeef7df
ILT
11853 * options.h (class General_options): Add -z text and -z textoff.
11854 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11855
f1ec9ded
ST
118562010-01-06 Sriraman Tallam <tmsriram@google.com>
11857
11858 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11859 (Garbage_collection::cident_sections): New function.
11860 (Garbage_collection::add_cident_section): New function.
11861 (Garbage_collection::cident_sections_): New member.
11862 (gc_process_relocs): Add references to sections whose names are C
11863 identifiers.
11864 * gold.h (cident_section_start_prefix): New constant.
11865 (cident_section_stop_prefix): New constant.
11866 (is_cident): New function.
11867 * layout.cc (Layout::define_section_symbols): Replace string constants
11868 with the newly defined constants.
11869 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11870 C identifiers.
11871 * testsuite/Makefile.am: Add gc_orphan_section_test.
11872 * testsuite/Makefile.in: Regenerate.
11873 * testsuite/gc_orphan_section_test.cc: New file.
11874 * testsuite/gc_orphan_section_test.sh: New file.
11875
6eda8c29
ILT
118762010-01-06 Ian Lance Taylor <iant@google.com>
11877
b9674e17
ILT
11878 PR 10980
11879 * options.h (class General_options): Add --warn-shared-textrel.
11880 * layout.cc (Layout::finish_dynamic_section): Implement
11881 --warn-shared-textrel.
11882
6eda8c29
ILT
11883 PR 10980
11884 * options.h (class General_options): Add --warn-multiple-gp.
11885
32dcd44e
ILT
118862010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11887
11888 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11889 $(THREADSLIB) and $(LIBDL).
11890 * Makefile.in: Rebuild.
11891
a192ba05
ILT
118922010-01-06 Ian Lance Taylor <iant@google.com>
11893
11894 PR 10980
11895 * options.cc (General_options::parse_section_start): New function.
11896 (General_options::section_start): New function.
11897 (General_options::General_options): Initialize all members.
11898 * options.h: Include <map>
11899 (class General_options): Add --section-start. Add section_starts_
11900 member.
11901 * layout.cc (Layout::attach_allocated_section_to_segment): If
11902 --section-start was used, set the address of the segment. Remove
11903 local sort_sections.
11904 (Layout::relaxation_loop_body): If the address of the load segment
11905 has been set by --section-start, don't use it.
11906 * output.h (Output_segment::update_flags_for_output_section): New
11907 function.
11908 * output.cc (Output_segment::add_output_section): Call
11909 update_flags_for_output_section.
11910
dde3f402
ILT
119112010-01-05 Ian Lance Taylor <iant@google.com>
11912
62dfdd4d
ILT
11913 PR 10980
11914 * options.h (class General_options): Add --undefined-version.
11915 * script.cc (struct Version_expression): Add was_matched_by_symbol
11916 field.
11917 (Version_script_info::matched_symbol): New function.
11918 (Version_script_info::get_symbol_version_helper): Call
11919 matched_symbol.
11920 (Version_script_info::check_unmatched_names): New function.
11921 * script.h (class Version_script_info): Update declarations.
11922 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11923
9c4ae156
ILT
11924 * options.h (class General_options): Use DEFINE_bool_alias for
11925 allow_multiple_definition.
11926 * resolve.cc (Symbol_table::should_override): Don't test
11927 allow_multiple_definition.
11928
dde3f402
ILT
11929 PR 10980
11930 * options.h (class General_options): Add --cref.
11931 * main.cc (main): Print cref table if --cref. Don't close mapfile
11932 until after printing cref table.
11933 * cref.cc: Include "symtab.h".
11934 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11935 (Cref_table_compare::operator()): New function.
11936 (Cref_inputs::gather_cref): New function.
11937 (filecol): New static const.
11938 (Cref_inputs::print_cref): New function.
11939 (Cref::print_cref): New function.
11940 * cref.h: Include <cstdio>.
11941 (class Cref): Update declarations.
11942 * mapfile.h (Mapfile::file): New function.
11943 * object.h (class Object): Define Symbols. Declare virtual
11944 do_get_global_symbols.
11945 (Object::get_global_symbols): New function.
11946 * object.cc (Input_objects::add_object): Pass object to cref_ if
11947 --cref.
11948 (Input_objects::archive_start): Likewise.
11949 (Input_objects::archive_stop): Likewise.
11950 (Input_objects::print_cref): New function.
11951 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11952 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11953 --cref.
11954 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11955 function.
11956 * plugin.h (class Sized_pluginobj): Update declarations.
11957
8781f709
ILT
119582010-01-05 Ian Lance Taylor <iant@google.com>
11959
11960 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11961 to is_default_version. Rename insdef to insdefault.
11962 (Symbol_table::add_from_relobj): Rename def to is_default_version
11963 and local to is_forced_local.
11964 (Symbol_table::add_from_pluginobj): Likewise.
11965 (Symbol_table::add_from_dynobj): Likewise.
11966 (Symbol_table::define_special_symbol): Rename insdef to
11967 insdefault.
11968
fe35d28d
ILT
119692010-01-04 Ian Lance Taylor <iant@google.com>
11970
30bc8c46
ILT
11971 PR 10980
11972 * options.h (class General_options): Add
11973 --allow-multiple-definition and -z muldefs.
11974 * resolve.cc (Symbol_table::should_override): Don't warn about a
11975 multiple symbol definition if --allow-multiple-definition or -z
11976 muldefs.
11977
7eaea549
ILT
11978 PR 10980
11979 * options.h (class General_options): Add --add-needed and
11980 --copy-dt-needed-entries. Tweak --as-needed help entry.
11981 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11982 error if --copy-dt-needed-entries aka --add-needed is used and
11983 would cause a change in behaviour.
11984
fe35d28d
ILT
11985 PR 10980
11986 * options.h (class General_options): Add -G as a short version of
11987 --shared. Add no-op options -assert, -g, and -i.
11988
55a2bb35
ST
119892010-01-04 Sriraman Tallam <tmsriram@google.com>
11990
11991 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11992 check for .text or .gnu.linkonce.t sections.
11993 * icf.cc (Icf::find_identical_sections): Ditto.
11994 Change the detection for mangled function name within the section
11995 name.
11996 * icf.h (is_section_foldable_candidate): New function.
11997
719328e1
ILT
119982009-12-30 Ian Lance Taylor <iant@google.com>
11999
12000 PR 10980
12001 * options.h (class General_options): Permit two dashes with
12002 --retain-symbols-file.
12003
d7bb5745
ILT
120042009-12-30 Ian Lance Taylor <iant@google.com>
12005
403a15dd
ILT
12006 PR 10979
12007 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12008 don't put the file header and segment headers in the text
12009 segment.
12010
eda294df
ILT
12011 PR 10979
12012 * common.cc (Sort_commons::operator()): Stabilize sort when both
12013 entries are NULL.
12014 (Symbol_table::do_allocate_commons_list): When allocating common
12015 symbols, skip a symbol which is no longer common.
12016 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12017 an object before checking its type.
12018 * testsuite/common_test_2.c: New file.
12019 * testsuite/common_test_3.c: New file.
12020 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12021 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12022 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12023 (common_test_2_pic.o, common_test_2.so): New targets.
12024 (common_test_3_pic.o, common_test_3.so): New targets.
12025 * testsuite/Makefile.in: Rebuild.
12026
d7bb5745
ILT
12027 PR 10979
12028 * script.cc (read_input_script): If we see a new SECTIONS clause,
12029 and we have added an input section, give an error.
12030 * layout.h (class Layout): Add have_added_input_section function.
12031 Add have_added_input_section_ field.
12032 * layout.cc (Layout::Layout): Initialize
12033 have_added_input_section_.
12034 (Layout::layout): Set have_added_input_section_.
12035 (Layout::layout_eh_frame): Likewise.
12036
fc59c572
ILT
120372009-12-30 Ian Lance Taylor <iant@google.com>
12038
12039 PR 10931
12040 * options.h (class General_options): Add --sort-common option.
12041 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12042 * common.cc (Sort_common): Add sort_order parameter to
12043 constructor. Add sort_order_ field.
12044 (Sort_commons::operator): Check sort_order_.
12045 (Symbol_table::allocate_commons): Determine the sort order.
12046 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12047 Change all callers.
12048 (Symbol_table::do_allocate_commons_list): Likewise.
12049
1c74fab0
ILT
120502009-12-30 Ian Lance Taylor <iant@google.com>
12051
12052 PR 10916
12053 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12054 symbols from this object, don't change the visibility of an
12055 undefined symbol.
12056 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12057
6affe781
ILT
120582009-12-30 Ian Lance Taylor <iant@google.com>
12059
12060 PR 10861
12061 * script.h (class Version_script_info): Define Language enum.
12062 Update declarations. Define Glob, Exact, and Lookup types. Add
12063 new fields globals_, locals_, and is_finalized_.
12064 * script.cc: Various formatting fixes.
12065 (class Parser_closure): Change language_stack_ from a vector of
12066 std::string to one of Version_script_info::Language. Adjust all
12067 uses accordingly.
12068 (class Lazy_demangler): Remove.
12069 (struct Version_expression): Change language from std::string to
12070 Version_script_info::Language.
12071 (Version_script_info::Version_script_info): New function.
12072 (Version_script_info::~Version_script_info): Don't call clear.
12073 (Version_script_info::finalize): New function.
12074 (Version_script_info::build_lookup_tables): New function.
12075 (Version_script_info::build_expression_list_lookup): New
12076 function.
12077 (Version_script_info::get_symbol_version_helper): Rewrite to use
12078 lookup tables.
12079 (Version_script_info::print_expression_list): Adjust to use
12080 Version_script_info::Language.
12081 (script_push_lex_into_version_mode): Check that the version script
12082 has not been finalized.
12083 (version_script_push_lang): Change language string to
12084 Version_script_info::Language.
12085 * options.cc (Command_line::version_script): New function.
12086 * options.h (class General_options): Add finalize_dynamic_list
12087 function. Change version_script from declaration to definition.
12088 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12089 * testsuite/version_script.map: Remove duplicate def of foo.
12090 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12091 version_script.map.
12092 * testsuite/Makefile.in: Rebuild.
12093
818bf354
ILT
120942009-12-30 Ian Lance Taylor <iant@google.com>
12095
12096 PR 10843
12097 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12098 if the input symbol index is 0, make the output symbol index 0.
12099
ebcc8304
ILT
121002009-12-30 Ian Lance Taylor <iant@google.com>
12101
12102 PR 10670
12103 * options.h (class General_options): Add -x/--discard-all.
12104 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12105 --discard-all. If the local symbol needs a dynamic entry, check
12106 that before handling --discard-locals.
12107
176fe33f
ILT
121082009-12-30 Ian Lance Taylor <iant@google.com>
12109
bb321bb1
ILT
12110 PR 10450
12111 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12112 flags to PF_R.
12113 (Output_segment::add_output_section): Don't change the flags if
12114 the type is PT_TLS.
12115
176fe33f
ILT
12116 PR 10450
12117 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12118 GNU hash table if they need a dynamic value. Otherwise, don't add
12119 them if they are defined in a dynamic object or are forced local.
12120
e8cd95c7
ILT
121212009-12-29 Ian Lance Taylor <iant@google.com>
12122
1b81fb71
ILT
12123 PR 10450
12124 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12125 .gnu.hash table for a 32-bit target.
12126
8d6d383d
ILT
12127 PR 10450
12128 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12129 regular and a dynamic object only needs a dynamic symbol table
12130 entry if it is externally visible.
12131
e785ec03
ILT
12132 PR 10450
12133 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12134 constructor. Add global_offset_table_ field.
12135 (Target_i386::got_section): Set global_offset_table_.
12136 (Target_i386::do_finalize_sections): Set global_offset_table_
12137 size.
12138 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12139 in constructor. Add global_offset_table_ field.
12140 (Target_x86_64::got_section): Set global_offset_table_.
12141 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12142 size.
12143
1a2dff53
ILT
12144 * layout.cc (Layout::Layout): Initialize increase_relro_.
12145 (Layout::get_output_section): Add is_relro, is_last_relro, and
12146 is_first_non_relro parameters. Change all callers.
12147 (Layout::choose_output_section): Likewise.
12148 (Layout::add_output_section_data): Likewise.
12149 (Layout::make_output_section): Likewise.
12150 (Layout::set_segment_offsets): Clear increase_relro when using a
12151 linker script.
12152 * layout.h (class Layout): Add increase_relro method. Add
12153 increase_relro_ field. Update declarations.
12154 * output.cc (Output_section::Output_section): Initialize
12155 is_last_relro_ and is_first_non_relro_.
12156 (Output_segment::add_output_section): Group relro sections is
12157 do_sort is true. Handle is_last_relro and is_first_non_relro.
12158 (Output_segment::maximum_alignment): Remove relro handling.
12159 (Output_segment::set_section_addresses): Add increase_relro
12160 parameter. Change all callers. Add initial alignment to align
12161 relro sections on separate page. Remove old relro handling.
12162 (Output_segment::set_section_list_addresses): Remove in_relro
12163 parameter. Change all callers.
12164 (Output_segment::set_offset): Add increase parameter. Change all
12165 callers. Remove old relro handling.
12166 * output.h (class Output_section): Add new methods: is_last_relro,
12167 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12168 Add is_last_relro_ and is_first_non_relro_ fields.
12169 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12170 Create separate .got.plt section. Call increase_relro.
12171 * x86_64.cc (Target_x86_64::got_section): Likewise.
12172 * testsuite/relro_script_test.t: Add .got.plt.
12173
f0ba79e2
ILT
12174 PR 10450
12175 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12176 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12177 (Layout::finalize): Call set_dynamic_symbol_size.
12178 (Layout::set_dynamic_symbol_size): New function.
12179 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12180 set_dynamic_symbol_size.
12181
e8cd95c7
ILT
12182 PR 10450
12183 * output.h (class Output_section): Add is_entsize_zero_ field.
12184 * output.cc (Output_section::Output_section): Initialize
12185 is_entsize_zero_.
12186 (Output_section::set_entsize): If two different entsizes are
12187 requested, force it to zero.
12188 (Output_section::add_input_section): Set flags for .debug_str
12189 before updating section flags. Set entsize.
12190 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12191 and SHF_STRING if all input sections have those flags.
12192
3e1b9a8a
RÁE
121932009-12-29 Rafael Espindola <espindola@google.com>
12194
12195 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12196 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12197 reporting.
3e1b9a8a 12198
3dcad376
ST
121992009-12-29 Sriraman Tallam <tmsriram@google.com>
12200
12201 * options.cc (General_options::parse_version): Allow -v to exit
12202 without an error if there is nothing to link.
12203
084e2665
ILT
122042009-12-29 Ian Lance Taylor <iant@google.com>
12205
12206 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12207 using a version of gcc before 4.1.
12208 * configure: Rebuild.
12209
250acde3
CD
122102009-12-28 Chris Demetriou <cgd@google.com>
12211
12212 * attributes.cc (Output_attributes_section_data::do_write): Use
12213 std::vector::front rather than std::vector::data.
12214
99fff23b
ILT
122152009-12-28 Ian Lance Taylor <iant@google.com>
12216
12217 * symtab.h (class Symbol_table): Add enum Defined.
12218 * resolve.cc (Symbol_table::should_override): Add defined
12219 parameter. Change all callers. Test whether object is NULL
12220 before calling a method on it.
12221 (Symbol_table::report_resolve_problem): Add defined parameter.
12222 Change all callers.
12223 (Symbol_table::should_override_with_special): Likewise.
12224 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12225 parameter. Change all callers.
12226 (Symbol_table::do_define_in_output_data): Likewise.
12227 (Symbol_table::define_in_output_segment): Likewise.
12228 (Symbol_table::do_define_in_output_segment): Likewise.
12229 (Symbol_table::define_as_constant): Likewise.
12230 (Symbol_table::do_define_as_constant): Likewise.
12231 * script.h (class Symbol_assignment): Add is_defsym parameter to
12232 constructor; change all callers.
12233 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12234 parameter. Change all callers. Add is_defsym_ field.
12235 (class Parser_closure): Add parsing_defsym parameter to
12236 constructor; change all callers. Add parsing_defsym accessor
12237 function. Add parsing_defsym_ field.
12238
556bd683
ILT
122392009-12-28 Ian Lance Taylor <iant@google.com>
12240
12241 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12242 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12243
1782c879
ILT
122442009-12-23 Ian Lance Taylor <iant@google.com>
12245
12246 * i386.cc (Target_i386::do_calls_non_split): Recognize
12247 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12248 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12249 -fsplit-stack prologue when using %r11.
1782c879 12250
329ca2b1
ST
122512009-12-21 Sriraman Tallam <tmsriram@google.com>
12252
12253 * options.cc (General_options::parse_version): Make -v continue and do
12254 the link like GNU ld does.
12255
d675ff46
RÁE
122562009-12-17 Rafael Avila de Espindola <espindola@google.com>
12257
12258 * Makefile.am (CCFILES): Add timer.cc.
12259 (HFILES): Add timer.h.
12260 * configure.ac: Check for sysconf and times.
12261 * main.cc: include timer.h.
12262 (main): Use Timer instead of get_run_time.
12263 * timer.cc: New.
12264 * timer.h: New.
12265 * workqueue.cc: include timer.h.
12266 (Workqueue::find_and_run_task):
12267 Report user, sys and wall time.
12268 * Makefile.in: Regenerate.
12269 * config.in: Regenerate.
12270 * configure: Regenerate.
12271
d6344fb5
DK
122722009-12-16 Doug Kwan <dougkwan@google.com>
12273
12274 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12275 sections.
12276 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12277 relaxed input sections.
12278 * output.cc (Output_section::find_relaxed_input_section): Change
12279 return type to Output_relaxed_input_section pointer. Adjust code
12280 for new type of relaxed_input_section_map_.
12281 * output.h (Output_section::find_relaxed_input_section): Change
12282 return type to Output_relaxed_input_section pointer.
12283 (Output_section::Output_relaxed_input_section_by_input_section_map):
12284 New type.
12285 (Output_section::relaxed_input_section_map_): Change type to
12286 Output_section::Output_relaxed_input_section_by_input_section_map.
12287 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12288 input section.
12289
0e0d5469
ILT
122902009-12-15 Ian Lance Taylor <iant@google.com>
12291
12292 * layout.cc (Layout::create_shstrtab): Only write out after input
12293 sections if we are compressing debug sections.
12294
0649a889
ILT
122952009-12-15 Ian Lance Taylor <iant@google.com>
12296
12297 * archive.cc (Archive::add_symbols): Only look up a symbol without
12298 a version if there is, in fact, a version.
12299
2ea97941
ILT
123002009-12-14 Ian Lance Taylor <iant@google.com>
12301
12302 Revert -Wshadow changes, all changes from:
12303 2009-12-11 Doug Kwan <dougkwan@google.com>
12304 2009-12-11 Nick Clifton <nickc@redhat.com>
12305 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12306
b0eec2cc
DK
123072009-12-11 Doug Kwan <dougkwan@google.com>
12308
12309 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12310 due to -Wshadow.
12311 * attributes.cc (Object_attribute::size): Ditto.
12312 (Attributes_section_data::size): Ditto.
12313 (Attributes_section_data::Attributes_section_data): Ditto.
12314 (Output_attributes_section_data::do_write): Ditto.
12315 * attributes.h (Object_attribute::set_type): Ditto.
12316 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12317
91d6fa6a
NC
123182009-12-11 Nick Clifton <nickc@redhat.com>
12319
12320 * archive.cc: Fix shadowed variable warnings.
12321 * arm.cc: Likewise.
12322 * compressed_output.cc: Likewise.
12323 * compressed_output.h: Likewise.
12324 * configure: Likewise.
12325 * dwarf_reader.cc: Likewise.
12326 * dynobj.cc: Likewise.
12327 * dynobj.h: Likewise.
12328 * ehframe.cc: Likewise.
12329 * ehframe.h: Likewise.
12330 * errors.cc: Likewise.
12331 * expression.cc: Likewise.
12332 * fileread.cc: Likewise.
12333 * fileread.h: Likewise.
12334 * freebsd.h: Likewise.
12335 * i386.cc: Likewise.
12336 * icf.cc: Likewise.
12337 * incremental.h: Likewise.
12338 * layout.cc: Likewise.
12339 * layout.h: Likewise.
12340 * mapfile.cc: Likewise.
12341 * merge.cc: Likewise.
12342 * merge.h: Likewise.
12343 * object.cc: Likewise.
12344 * object.h: Likewise.
12345 * options.h: Likewise.
12346 * output.cc: Likewise.
12347 * output.h: Likewise.
12348 * parameters.cc: Likewise.
12349 * plugin.cc: Likewise.
12350 * powerpc.cc: Likewise.
12351 * reduced_debug_output.cc: Likewise.
12352 * reduced_debug_output.h: Likewise.
12353 * reloc.cc: Likewise.
12354 * reloc.h: Likewise.
12355 * resolve.cc: Likewise.
12356 * script-sections.cc: Likewise.
12357 * script.cc: Likewise.
12358 * script.h: Likewise.
12359 * sparc.cc: Likewise.
12360 * symtab.cc: Likewise.
12361 * symtab.h: Likewise.
12362 * target-select.cc: Likewise.
12363 * target-select.h: Likewise.
12364 * token.h: Likewise.
12365 * workqueue.cc: Likewise.
12366 * workqueue.h: Likewise.
12367 * x86_64.cc: Likewise.
12368
a0351a69
DK
123692009-12-10 Doug Kwan <dougkwan@google.com>
12370
12371 * arm.cc (attributes.h): New include.
12372 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12373 (Arm_relobj::~Arm_relobj): Delete object pointed by
12374 attributes_section_data_.
12375 (Arm_relobj::attributes_section_data): New method definition.
12376 (Arm_relobj::attributes_section_data_): New data member declaration.
12377 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12378 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12379 attributes_section_data_.
12380 (Arm_dynobj::attributes_section_data): New method definition.
12381 (Arm_dynobj::attributes_section_data_): New data member declaration.
12382 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12383 initialization value of may_use_blx_ to false.
2e702c99 12384 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12385 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12386 object attributes to compute results instead of hard-coding.
12387 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12388 Target_arm::get_secondary_compatible_arch,
12389 Target_arm::set_secondary_compatible_arch
12390 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12391 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12392 New method declarations.
12393 (Target_arm::get_aeabi_object_attribute): New method definition.
12394 (Target_arm::attributes_section_data_): New data member declaration.
12395 (read_arm_attributes_section): New template definition.
12396 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12397 (Arm_dynobj::do_read_symbols): Ditto.
12398 (Target_arm::do_finalize_sections): Merge attributes sections from
12399 input. Check for BLX use after attributes section merging.
12400 Fix __exidx_start and __exidx_end visibility. Create an
12401 .ARM.attributes section if necessary.
12402 (Target_arm::get_secondary_compatible_arch,
12403 Target_arm::set_secondary_compatible_arch,
12404 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12405 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12406 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12407 New method definitions.
12408
b59befec
ILT
124092009-12-09 Ian Lance Taylor <iant@google.com>
12410
12411 * plugin.cc (Plugin::load): Don't cast from void* to a function
12412 pointer.
12413
1276bc89
ILT
124142009-12-09 Ian Lance Taylor <iant@google.com>
12415
12416 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12417 information fields.
12418
2f2de248
L
124192009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12420
12421 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12422 Replace two_file_shared_1.so with two_file_shared_2.so.
12423 * testsuite/Makefile.in: Regenerated.
12424
4f787271
DK
124252009-12-08 Doug Kwan <dougkwan@google.com>
12426
12427 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12428 (HFILES): Add attributes.h and int_encoding.h.
12429 * Makefile.in: Regenerate.
12430 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12431 function definitions to int_encoding.cc
12432 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12433 prototypes to int_encoding.h
12434 * reduced_debug_output.cc (int_encoding.h): New include.
12435 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12436 function definitions to int_encoding.cc
12437 (insert_into_vector, read_from_pointer): Move template definitions to
12438 int_encoding.h
12439 * attributes.cc: New file.
12440 * attributes.h: New file.
12441 * int_encoding.cc: New file.
12442 * int_encoding.h: New file.
12443
20b52f1a
RÁE
124442009-12-07 Rafael Avila de Espindola <espindola@google.com>
12445
12446 PR gold/11055
12447 * incremental-dump.cc (dump_incremental_inputs): New.
12448 (main): Use dump_incremental_inputs.
12449
53d7974c
L
124502009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12451
12452 PR gold/10893
12453 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12454 checking elfcpp::STT_FUNC.
12455 (Target_i386::Relocate::relocate): Likewise.
12456 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12457
12458 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12459 symbols from shared libraries into normal FUNC symbols.
12460
12461 * symtab.h (Symbol): Add is_func and use it.
12462
05a352e6
DK
124632009-12-05 Doug Kwan <dougkwan@google.com>
12464
12465 * arm.cc (Target_arm::arm_info): Initialize new fields
12466 attributes_section and attributes_vendor.
12467 * i386.cc (Target_i386::i386_info): Same.
12468 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12469 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12470 fields attributes_section and attributes_vendor.
53d7974c 12471 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12472 * target.h (Target::attributes_section, Target::attributes_vendor,
12473 Target::is_attributes_section, Target::attribute_arg_type,
12474 Target::attributes_order): New method definitions.
12475 (Target::Target_info::attributes_section,
12476 Target::Target_info::attributes_vendor): New fields.
12477 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12478 virtual method definitions.
12479 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12480 attributes_section and attributes_vendor.
12481 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12482
f4e5969c
DK
124832009-12-05 Doug Kwan <dougkwan@google.com>
12484
12485 * arm.cc: Update comments about interworking and stub generation.
12486 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12487 considered as non-PIC.
12488 (Arm_relocate_functions::base_abs): Fix formatting.
12489 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12490 of function to use GOT entry address instead of offset.
12491 (Target_arm::Scan::global): Issue an error if a symbol would need a
12492 PLT does not get one because it is untyped. Remove code to create
12493 dynamic symbols for relative branches.
12494 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12495 takes unsigned integer instead of boolean.
12496
1abce4a6
L
124972009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12498
12499 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12500 (two_file_test_LDADD): Likewise.
12501 (common_test_1_LDADD): Likewise.
12502 (exception_test_LDADD) Likewise.
12503 (weak_test_LDADD): Likewise.
12504 (many_sections_test_LDADD): Likewise.
12505 (initpri1_LDADD): Likewise.
12506 (script_test_1_LDADD): Likewise.
12507 (script_test_2_LDADD): Likewise.
12508 (justsyms_LDADD): Likewise.
12509 (binary_test_LDADD): Likewise.
12510 (large_LDADD): Likewise.
12511 * testsuite/Makefile.in: Regenerated.
12512
adcf2816 125132009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12514
adcf2816
L
12515 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12516 (Symbol_table::override_with_special): Likewise.
12517 (Symbol_table::add_from_object): Likewise.
12518
28e67f5d
RÁE
125192009-12-04 Rafael Avila de Espindola <espindola@google.com>
12520
12521 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12522 Don't set the data_offset twice.
12523
ae10a101
RÁE
125242009-12-04 Rafael Avila de Espindola <espindola@google.com>
12525
12526 * testsuite/Makefile.in: Regenerate.
12527
f59f41f3
DK
125282009-12-03 Doug Kwan <dougkwan@google.com>
12529
12530 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12531 (Target_arm::do_finalize_sections): Add parameter for symbol table
12532 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12533 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12534 parameter for symbol table pointer.
12535 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12536 an additional parameter for a pointer to symbol table.
12537 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12538 parameter for a symbol table pointer.
12539 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12540 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12541 Ditto.
12542 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12543 parameter for a symbol table pointer.
12544
ca55d848
RÁE
125452009-12-03 Rafael Avila de Espindola <espindola@google.com>
12546
12547 * incremental.cc (Incremental_inputs_header)
12548 (Incremental_inputs_header_write, Incremental_inputs_entry)
12549 (Incremental_inputs_entry_write): Move ...
12550 * incremental.h (Incremental_inputs_header)
12551 (Incremental_inputs_header_write, Incremental_inputs_entry)
12552 (Incremental_inputs_entry_write): here.
12553
3aec4f9c
RÁE
125542009-12-02 Rafael Avila de Espindola <espindola@google.com>
12555
12556 * incremental.cc (make_sized_incremental_binary): Set the target.
12557 Error if it is incompatible.
12558 * output.h (Output_file): Add filename method.
12559
9c0ae74d
RÁE
125602009-12-02 Rafael Avila de Espindola <espindola@google.com>
12561
12562 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12563 from the get_* methods.
12564
a45500ae
RÁE
125652009-12-02 Rafael Avila de Espindola <espindola@google.com>
12566
12567 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12568 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12569 Write 0 for the data_offset of scripts.
12570
325e6408
RÁE
125712009-12-02 Rafael Avila de Espindola <espindola@google.com>
12572
12573 * testsuite/Makefile.am: Add the incremental_test.sh test.
12574 * testsuite/incremental_test.sh: New.
12575 * testsuite/incremental_test_1.c: New.
12576 * testsuite/incremental_test_2.c: New.
12577
954c3e2e
RÁE
125782009-12-01 Rafael Avila de Espindola <espindola@google.com>
12579
703d02da 12580 * incremental-dump.cc (main): Fix typos.
954c3e2e 12581
f8086623
RÁE
125822009-11-27 Rafael Avila de Espindola <espindola@google.com>
12583
12584 PR gold/11025
12585 * incremental-dump.cc (main): Use llu to print 64 bit values.
12586
3b0dd6ac
L
125872009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12588 H.J. Lu <hongjiu.lu@intel.com>
12589
12590 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12591 $(LIBDL).
12592 (incremental_dump_LDADD): Likewise.
12593 * Makefile.in: Regenerated.
12594
a6d1ef57 125952009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12596
a6d1ef57
DK
12597 Revert:
12598
12599 2009-11-25 Doug Kwan <dougkwan@google.com>
12600
12601 * arm.cc (Target_arm::Target_arm): Move method definition
12602 outside of class definition. Add code to handle
12603 --target1-rel, --target1-abs and --target2= options.
12604 (Target_arm::get_reloc_reloc_type): Change method to be
12605 non-static and const.
12606 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12607 New data member declaration.
12608 (Target_arm::Scan::local, Target_arm::Scan::global,
12609 Target_arm::Relocate::relocate,
12610 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12611 Adjust call to Target_arm::get_real_reloc_type.
12612 (Target_arm::get_real_reloc_type): Use command line options
12613 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12614 * options.h (--target1-rel, --target1-abs, --target2): New
12615 ARM-only options.
12616
50aeb7d4
DK
126172009-11-25 Doug Kwan <dougkwan@google.com>
12618
12619 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12620 class definition. Add code to handle --target1-rel, --target1-abs
12621 and --target2= options.
12622 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12623 and const.
12624 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12625 member declaration.
12626 (Target_arm::Scan::local, Target_arm::Scan::global,
12627 Target_arm::Relocate::relocate,
12628 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12629 call to Target_arm::get_real_reloc_type.
12630 (Target_arm::get_real_reloc_type): Use command line options to
12631 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12632 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12633 options.
12634
51938283
DK
126352009-11-25 Doug Kwan <dougkwan@google.com>
12636
12637 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12638 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12639 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12640 formatting.
12641 (Arm_relocate_functions::thm_call): Replace body with a call to
12642 Arm_relocate_functions::thumb_branch_common.
12643 (Arm_relocate_functions::thm_jump24,
12644 Arm_relocate_functions::thm_xpc22): New method definitions.
12645 (Arm_relocate_functions::thumb_branch_common): New method definition.
12646 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12647 operator.
12648 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12649 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12650
e2b8f3c4
RÁE
126512009-11-24 Rafael Avila de Espindola <espindola@google.com>
12652
12653 * Makefile.am: Build incremental-dump
12654 * Makefile.in: Regenerate.
12655 * incremental-dump.cc: New.
12656 * incremental.cc (Incremental_inputs_header_data,
12657 Incremental_inputs_entry_data): Move to incremental.h
12658 * incremental.h: (Incremental_inputs_header_data,
12659 Incremental_inputs_entry_data): Move from incremental.cc
12660
bcba9aec
RÁE
126612009-11-24 Rafael Avila de Espindola <espindola@google.com>
12662
12663 * incremental.cc (Incremental_inputs_header,
12664 Incremental_inputs_header_write, Incremental_inputs_entry,
12665 Incremental_inputs_entry_write): Add a typedef with the data type.
12666
7c3afe08
RÁE
126672009-11-24 Rafael Avila de Espindola <espindola@google.com>
12668
12669 * incremental.cc (Incremental_inputs_header,
12670 Incremental_inputs_header_write, Incremental_inputs_entry,
12671 Incremental_inputs_entry_write): Update comment about which
12672 type has the filed descriptions.
12673
d204b6e9
DK
126742009-11-15 Doug Kwan <dougkwan@google.com>
12675
12676 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12677 (Arm_relocate_functions::arm_branch_common): Change method defintion
12678 in class definition to a method declaration and update list of formal
12679 parameters.
12680 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12681 Arm_relocation_functions::jump24): Adjust call to
12682 Arm_relocate_functions::arm_branch_common. Update list of formal
12683 parameters.
12684 (Arm_relocate_functions::xpc25): New method definition.
12685 (Arm_relocate_functions::arm_branch_common): Move method defintion
12686 out from class definition. Use stubs for mode-switching and extending
12687 branch ranges.
12688 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12689 specially. Change code to enable use of stubs in ARM branches.
12690
43d12afe
DK
126912009-11-10 Doug Kwan <dougkwan@google.com>
12692
12693 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12694 in method declaration.
12695 (Target_arm::relocate_stub): New method declaration.
12696 (Target_arm::default_target): Change to return a pointer instead of
12697 a const reference.
12698 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12699 Target_arm::default_target.
12700 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12701 method definition.
12702 (Target_arm::relocate_section): Adjust view.
12703 (Target_arm::relocate_stub): New method definition.
12704
ac33a407
DK
127052009-11-10 Doug Kwan <dougkwan@google.com>
12706
12707 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12708 a format warning.
12709 * incremental.cc (open_incremental_binary): Initialized local
12710 variables to avoid warnings.
12711 * object.cc (make_elf_object): Ditto.
12712 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12713 a format warning.
e1df38aa 12714
88ee28e9
L
12715009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12716
12717 PR gold/10930
12718 * testsuite/plugin_test.c: Include "config.h".
12719
2daedcd6
DK
127202009-11-09 Doug Kwan <dougkwan@google.com>
12721
12722 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12723 (arm_symbol_value): Remove.
12724 (Arm_relocate_functions::arm_branch_common,
12725 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12726 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12727 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12728 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12729 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12730 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12731 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12732 Arm_relocate_functions::thm_mobw_abs_nc,
12733 Arm_relocate_functions::thm_mov_abs,
12734 Arm_relocate_functions::movw_prel_nc,
12735 Arm_relocate_functions::thm_movt_abs,
12736 Arm_relocate_functions::movt_prel,
12737 Arm_relocate_functions::thm_movw_prel_nc,
12738 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12739 (Target_arm::Relocate::relocate): Only decompose address into two
12740 parts if relocation type uses the thumb-bit and pass the actual
12741 bit instead of a flag indicating that the thumb-bit is used. Adjust
12742 calls to methods in Arm_relocate_functions for this change.
12743
1276bc89 127442009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12745
12746 PR 10925
12747 * reloc.cc: Instantiate
12748 Sized_relobj::initialize_input_to_output_maps and
12749 Sized_relobj:free_input_to_output_maps.
12750
e53ad1b5
ILT
127512009-11-06 Ian Lance Taylor <iant@google.com>
12752
12753 PR 10876
12754 * defstd.cc (in_segment): Set only_if_ref true for "end".
12755
eb44217c
DK
127562009-11-06 Doug Kwan <dougkwan@google.com>
12757
12758 * arm.cc (class Reloc_stub): Correct a comment.
12759 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12760 (Target_arm::scan_section_for_stubs): New method declaration.
12761 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12762 Change methods from private to protected.
12763 (Target_arm::do_may_relax): New method definition.
12764 (Target_arm::do_relax, Target_arm::group_sections,
12765 Target_arm::scan_reloc_for_stub,
12766 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12767 (Target_arm::arm_input_section_map_): New data member declaration.
12768 (Target_arm::scan_reloc_for_stub,
12769 Target_arm::scan_reloc_section_for_stubs,
12770 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12771 Target_arm::do_relax): New method definitions.
12772
5d329b7d
ILT
127732009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12774
12775 * configure.ac: Check for (struct stat)::st_mtim
12776 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12777 * config.in: Regenerate.
12778 * configure: Regenerate.
12779
96a0d71b
ILT
127802009-11-05 Ian Lance Taylor <iant@google.com>
12781
12782 PR 10910
12783 * output.cc (Output_segment::add_output_section): Add missing
12784 return statement.
12785
594c8e5e
ILT
127862009-11-04 Ian Lance Taylor <iant@google.com>
12787
12788 PR 10880
12789 * object.h (class Object): Add is_needed and set_is_needed
12790 methods. Add is_needed_ field. Make bool fields into bitfields.
12791 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12792 defined in a dynamic object and referenced by a regular object,
12793 set is_needed for the dynamic object.
12794 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12795 if the file is marked with as_needed and it is not needed.
12796
22b127cc
ILT
127972009-11-04 Ian Lance Taylor <iant@google.com>
12798
12799 PR 10887
12800 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12801 tags if data is discarded by linker script.
12802 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12803 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12804 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12805 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12806
f5c870d2
ILT
128072009-11-04 Ian Lance Taylor <iant@google.com>
12808
12809 * layout.cc (Layout::get_output_section): Add is_interp and
12810 is_dynamic_linker_section parameters. Change all callers.
12811 (Layout::choose_output_section): Likewise.
12812 (Layout::make_output_section): Likewise.
12813 (Layout::add_output_section_data): Add is_dynamic_linker_section
12814 parameter. Change all callers.
12815 * layout.h (class Layout): Update declarations.
12816 * output.h (class Output_section): Add is_interp, set_is_interp,
12817 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12818 Add is_interp_, is_dynamic_linker_section_ fields. Change
12819 generate_code_fills_at_write_ to a bitfield.
12820 * output.cc (Output_section::Output_sections): Initialize new
12821 fields.
12822 (Output_segment::add_output_section): Add do_sort parameter.
12823 Change all callers.
12824
1ae4d23b
ILT
128252009-11-03 Ian Lance Taylor <iant@google.com>
12826
12827 PR 10860
12828 * options.h (class General_options): Add --warn-common.
12829 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12830 merging two common symbols.
12831 (Symbol_table::should_override): Handle --warn-common when merging
12832 a common symbol with a defined symbol. Use report_resolve_problem
12833 for multiple definitions.
12834 (Symbol_table::report_resolve_problem): New function.
12835 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12836
55da9579
DK
128372009-11-03 Doug Kwan <dougkwan@google.com>
12838
12839 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12840 stub_factory_.
12841 (Target_arm::stub_factory): New method definition.
12842 (Target_arm::new_arm_input_section,
12843 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12844 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12845 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12846 New type definitions.
12847 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12848 member declarations.
12849 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12850 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12851 New method definitions.
12852
37a9ac43
ILT
128532009-11-03 Ian Lance Taylor <iant@google.com>
12854
12855 * options.h (class General_options): Add --warn_constructors.
12856
b3d6a3d4
ILT
128572009-11-03 Ian Lance Taylor <iant@google.com>
12858
12859 PR 10893
12860 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12861 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12862
934b01dd
ILT
128632009-11-03 Ian Lance Taylor <iant@google.com>
12864
12865 PR 10895
12866 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12867 --msgid-bugs-address.
12868 (install-pdf): New target.
12869 (install-data_yes): Look up one directory to find mkinstalldirs.
12870
03c1939b
L
128712009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12872
12873 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12874 tree.
12875
ebd95253
DK
128762009-10-30 Doug Kwan <dougkwan@google.com>
12877
12878 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12879
e9bbb538
DK
128802009-10-30 Doug Kwan <dougkwan@google.com>
12881
12882 * arm.cc (Stub_addend_reader): New struct template definition
12883 and partial specializations.
12884 (Stub_addend_reader::operator()): New method definition for a
12885 partially specialized template.
12886
d5b40221
DK
128872009-10-30 Doug Kwan <dougkwan@google.com>
12888
12889 * arm.cc (Arm_relobj::processor_specific_flags): New method
12890 definition.
12891 (Arm_relobj::do_read_symbols): New method declaration.
12892 (Arm_relobj::processor_specific_flags_): New data member declaration.
12893 (Arm_dynobj): New class definition.
12894 (Target_arm::do_finalize_sections): Add input_objects parameter.
12895 (Target_arm::do_adjust_elf_header): New method declaration.
12896 (Target_arm::are_eabi_versions_compatible,
12897 (Target_arm::merge_processor_specific_flags): New method declaration.
12898 (Target_arm::do_make_elf_object): New overloaded method definitions
12899 and declaration.
12900 (Arm_relobj::do_read_symbols): New method definition.
12901 (Arm_dynobj::do_read_symbols): Ditto.
12902 (Target_arm::do_finalize_sections): Add input_objects parameters.
12903 Merge processor-specific flags from all input objects.
12904 (Target_arm::are_eabi_versions_compatible,
12905 Target_arm::merge_processor_specific_flags,
12906 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12907 New method definitions.
12908 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12909 Input_objects pointer type parameter.
12910 * layout.cc (Layout::finalize): Pass input objects to target's.
12911 finalize_sections function.
12912 * output.cc (Output_file_header::do_sized_write): Set ELF file
12913 header's processor-specific flags.
12914 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12915 Input_objects pointer type parameter.
12916 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12917 * target.h (Input_objects): New forward class declaration.
12918 (Target::processor_specific_flags,
12919 Target::are_processor_specific_flags_sect): New method definitions.
12920 (Target::finalize_sections): Add input_objects parameter.
12921 (Target::Target): Initialize processor_specific_flags_ and
12922 are_processor_specific_flags_set_.
12923 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12924 parameter.
12925 (Target::set_processor_specific_flags): New method definition.
12926 (Target::processor_specific_flags_,
12927 Target::are_processor_specific_flags_set_): New data member
12928 declarations.
12929 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12930 Input_objects pointer type parameter.
12931
ebabffbd
DK
129322009-10-30 Doug Kwan <dougkwan@google.com>
12933
12934 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12935
ad0f2072
ILT
129362009-10-28 Ian Lance Taylor <iant@google.com>
12937
12938 * object.h (class Relobj): Drop options parameter from
12939 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12940 do_scan_relocs, do_relocate. Change all callers.
12941 (class Sized_relobj): Drop options parameters from
12942 do_gc_process_relocs, do_scan_relocs, do_relocate,
12943 do_relocate_sections, relocate_sections, emit_relocs_scan,
12944 emit_relocs_scan_reltype. Change all callers.
12945 (struct Relocate_info): Remove options field and all references to
12946 it.
12947 * reloc.h (class Read_relocs): Remove options constructor
12948 parameter and options_ field. Change all callers.
12949 (class Gc_process_relocs, class Scan_relocs): Likewise.
12950 (class Relocate_task): Likewise.
12951 * target-reloc.h (scan_relocs): Remove options parameter. Change
12952 all callers.
12953 (scan_relocatable_relocs): Likewise.
12954 * target.h (class Sized_target): Remove options parameter from
12955 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12956 all callers.
12957 * gc.h (gc_process_relocs): Remove options parameter. Change all
12958 callers.
12959 * arm.cc: Update functions to remove options parameters.
12960 * i386.cc: Likewise.
12961 * powerpc.cc: Likewise.
12962 * sparc.cc: Likewise.
12963 * x86_64.cc: Likewise.
12964 * testsuite/testfile.cc: Likewise.
12965
8ffa3667
DK
129662009-10-28 Doug Kwan <dougkwan@google.com>
12967
12968 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12969 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12970 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12971 New method definitions.
12972
40f36857
CC
129732009-10-28 Cary Coutant <ccoutant@google.com>
12974
12975 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12976 (Plugin::cleanup_done_): New member.
12977 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12978 (Plugin_manager::cleanup_done_): Remove.
12979 (Plugin_manager::add_input_file): Edit error message.
12980 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12981 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12982
2c849493
ILT
129832009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12984
12985 * fileread.cc: (File_read::View::~View): Use the new
12986 data_ownership_ filed.
12987 (File_read::~File_read): Dispose the new whole_file_view_.
12988 (File_read::open): Mmap the whole file if needed.
12989 (File_read::open): Use whole_file_view_ instead of contents_.
12990 (File_read::find_view): Use whole_file_view_ if applicable.
12991 (File_read::do_read): Use whole_file_view_ instead of contents_.
12992 (File_read::make_view): Use whole_file_view_ instead of contents_,
12993 update File_read::View::View call.
12994 (File_read::find_or_make_view): Update File_read::View::View
12995 call.
12996 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12997 remove contents_
12998 (File_read::View::Data_ownership): New enum.
12999 (File_read::View::View): Replace bool mapped_ with Data_ownership
13000 argument.
13001 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13002 (File_read::View::data_ownership_): New field.
13003 (File_read::contents_): Remove (replaced by whole_file_view_).
13004 (File_read::whole_file_view_): New field.
13005 * options.h (class General_options): Add --keep-files-mapped.
13006
24998053
CC
130072009-10-27 Cary Coutant <ccoutant@google.com>
13008
13009 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13010 * testsuite/Makefile.am (plugin_test_5): New test case.
13011 * testsuite/Makefile.in: Regenerate.
13012
72adc4fa
DK
130132009-10-25 Doug Kwan <dougkwan@google.com>
13014
13015 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13016 from private to protected to allow access by child class.
13017 (Sized_relobj::do_relocate_sections): New method declaration.
13018 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13019 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13020 Sized_relobj::relocate_sections. Instantiate template explicitly
13021 for different target sizes and endianity.
13022
07f508a2
DK
130232009-10-24 Doug Kwan <dougkwan@google.com>
13024
13025 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13026 (Arm_input_section::as_arm_input_section): New method.
13027 (Arm_output_section): New class definition.
13028 (Arm_output_section::create_stub_group,
13029 Arm_output_section::group_sections): New method definitions.
13030
10ad9fe5
DK
130312009-10-22 Doug Kwan <dougkwan@google.com>
13032
13033 * arm.cc (Arm_input_section): New class definition.
13034 (Arm_input_section::init, Arm_input_section:do_write,
13035 Arm_input_section::set_final_data_size,
13036 Arm_input_section::do_reset_address_and_file_offset): New method
13037 definitions.
13038
56ee5e00
DK
130392009-10-21 Doug Kwan <dougkwan@google.com>
13040
13041 * arm.cc (Stub_table, Arm_input_section): New forward class
13042 declarations.
13043 (Stub_table): New class defintion.
13044 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13045 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13046 New method definition.
13047
b569affa
DK
130482009-10-21 Doug Kwan <dougkwan@google.com>
13049
13050 * arm.cc: Update copyright comments.
13051 (Target_arm): New forward class template declaration.
13052 (Arm_address): New type.
13053 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13054 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13055 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13056 constants.
13057 (Insn_template): Same.
13058 (DEF_STUBS): New macro.
13059 (Stub_type): New enum type.
13060 (Stub_template): New class definition.
13061 (Stub): Same.
13062 (Reloc_stub): Same.
13063 (Stub_factory): Same.
13064 (Target_arm::Target_arm): Initialize may_use_blx_ and
13065 should_force_pic_veneer_.
13066 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13067 Target_arm::should_force_pic_veneer,
13068 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13069 Target_arm::using_thumb_only, Target_arm:;default_target): New
13070 method defintions.
13071 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13072 New data member declarations.
13073 (Insn_template::size, Insn_template::alignment): New method defintions.
13074 (Stub_template::Stub_template): New method definition.
13075 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13076 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13077 (Stub_factory::Stub_factory): New method definition.
13078 * gold.h (string_hash): New template.
13079 * output.h (Input_section_specifier::hash_value): Use
13080 gold::string_hash.
13081 (Input_section_specifier::string_hash): Remove.
13082 * stringpool.cc (Stringpool_template::string_hash): Use
13083 gold::string_hash.
13084
6c172549
DK
130852009-10-20 Doug Kwan <dougkwan@google.com>
13086
13087 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13088 symbols of relaxed input sections.
13089 * output.h (Output_section::find_relaxed_input_section): Make
13090 method public.
13091
c5617f2f
DK
130922009-10-16 Doug Kwan <dougkwan@google.com>
13093
13094 * dynobj.cc (Versions::Versions): Initialize version_script_.
13095 Only insert base version symbol definition for a shared object
13096 if version script defines any version versions.
13097 (Versions::define_base_version): New method definition.
13098 (Versions::add_def): Check that base version is not needed.
13099 (Versions::add_need): Define base version lazily.
13100 * dynobj.h (Versions::define_base_version): New method declaration.
13101 (Versions::needs_base_version_): New data member declaration.
13102 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13103 (check_DATA): Add no_version_test.stdout.
13104 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13105 New make rules.
13106 * testsuite/Makefile.in: Regenerate.
13107 * testsuite/no_version_test.c: New file.
13108 * testsuite/no_version_test.sh: Ditto.
13109
3c12dcdb
DK
131102009-10-16 Doug Kwan <dougkwan@google.com>
13111
13112 * expression.cc (class Segment_start_expression): New class definition.
13113 (Segment_start_expression::value): New method definition.
13114 (script_exp_function_segment_start): Return a new
13115 Segment_start_expression.
13116 * gold/script-c.h (script_saw_segment_start_expression): New function
13117 prototype.
13118 * script-sections.cc (Script_sections::Script_sections): Initialize
13119 SAW_SEGMENT_START_EXPRESSION_ to false.
13120 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13121 and -Tbbs options to specify section addresses if given in
13122 command line and no SEGMENT_START expression is seen in a script.
13123 * script-sections.h (Script_sections::saw_segment_start_expression,
13124 Script_sections::set_saw_segment_start_expression): New method
13125 definition.
13126 (Script_sections::saw_segment_start_expression_): New data member
13127 declaration.
13128 * script.cc (script_saw_segment_start_expression): New function.
13129 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13130 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13131 script_test_7.sh and script_test_8.sh.
13132 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13133 script_test_8.stdout.
13134 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13135 (script_test_6, script_test_6.stdout, script_test_7,
13136 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13137 * Makefile.in: Regenerate.
13138 * testsuite/script_test_6.sh: New file.
13139 * testsuite/script_test_6.t: Same.
13140 * testsuite/script_test_7.sh: Same.
13141 * testsuite/script_test_7.t: Same.
13142 * testsuite/script_test_8.sh: Same.
13143
64b1ae37
DK
131442009-10-16 Doug Kwan <dougkwan@google.com>
13145
13146 * output.cc (Output_segment::set_section_list_address): Cast
13147 expressions to unsigned long long type to avoid format warnings.
13148
661be1e2
ILT
131492009-10-15 Ian Lance Taylor <iant@google.com>
13150
12edd763 13151 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13152 dot assignment to script_sections_.
12edd763
ILT
13153 * script-sections.cc (Script_sections::add_dot_assignment):
13154 Initialize if necessary.
13155
68b6574b
ILT
13156 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13157 program headers with no load segment if there is a linker script.
13158
661be1e2
ILT
13159 * layout.cc (Layout::set_segment_offsets): Align the file offset
13160 to the segment aligment for -N or -n with no load segment.
13161 * output.cc (Output_segment::add_output_section): Don't crash if
13162 the first section is a TLS section.
13163 (Output_segment::set_section_list_addresses): Print an error
13164 message if the address moves backward in a linker script.
13165 * script-sections.cc
13166 (Output_section_element_input::set_section_addresses): Don't
13167 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13168 (Orphan_output_section::set_section_addresses): Likewise.
13169
f15f61a7
DK
131702009-10-15 Doug Kwan <dougkwan@google.com>
13171
13172 * layout.cc (Layout::finish_dynamic_section): Generate tags
13173 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13174 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13175 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13176
82bb573a
ILT
131772009-10-14 Ian Lance Taylor <iant@google.com>
13178
13179 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13180 fields.
13181 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13182 data_shdr fields of relinfo.
13183 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13184 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13185 R_386_TLS_LDO_32, adjust based on section flags.
13186 (Target_i386::Relocate::fix_up_ldo): Remove.
13187
374ad285
ILT
131882009-10-13 Ian Lance Taylor <iant@google.com>
13189
13190 Add support for -pie.
13191 * options.h (class General_options): Add -pie and
13192 --pic-executable.
13193 (General_options::output_is_position_independent): Test -pie.
13194 (General_options::output_is_executable): Return true if not shared
13195 and not relocatable.
13196 (General_options::output_is_pie): Remove.
13197 * options.cc (General_options::finalize): Reject incompatible uses
13198 of -pie.
13199 * gold.cc (queue_middle_tasks): A -pie link is not static.
13200 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13201 * symtab.cc (Symbol::final_value_is_known): Return false if
13202 output_is_position_independent.
13203 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13204 output_is_position_independent.
13205 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13206 output_is_position_independent.
13207 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13208 output_is_position_independent.
13209 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13210 two_file_pie_test.
13211 (basic_pie_test.o, basic_pie_test): New targets.
13212 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13213 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13214 (two_file_pie_test): New target.
13215 * testsuite/Makefile.in: Rebuild.
13216 * README: Remove note saying that -pie is not supported.
13217
c6585162
ILT
132182009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13219
13220 * options.h (class General_options): Add -init and -fini.
13221 * layout.cc (Layout::finish_dynamic_section): Emit
13222 given init and fini functions.
13223
032ce4e9
ST
132242009-10-13 Sriraman Tallam <tmsriram@google.com>
13225
13226 * gc.h (gc_process_relocs): Check if icf is enabled using new
13227 function.
13228 * gold.cc (queue_initial_tasks): Likewise.
13229 (queue_middle_tasks): Likewise.
13230 * object.cc (do_layout): Likewise.
13231 * symtab.cc (is_section_folded): Likewise.
13232 * main.cc (main): Likewise.
13233 * reloc.cc (Read_relocs::run): Likewise.
13234 (Sized_relobj::do_scan_relocs): Likewise.
13235 * icf.cc (is_function_ctor_or_dtor): New function.
13236 (Icf::find_identical_sections): Check if function is ctor or dtor when
13237 safe icf is chosen.
13238 * options.h (General_options::icf): Change option to be an enum.
13239 (Icf_status): New enum.
13240 (icf_enabled): New method.
13241 (icf_safe_folding): New method.
13242 (set_icf_status): New method.
13243 (icf_status_): New variable.
13244 * (options.cc) (General_options::finalize): Set icf_status_.
13245 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13246 icf_test and icf_keep_unique_test to use the --icf enum flag.
13247 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13248 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13249
f345227a
ST
132502009-10-12 Sriraman Tallam <tmsriram@google.com>
13251
13252 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13253 includes to gc.h and icf.h.
13254 * arm.cc: Include gc.h.
13255 * gold.cc: Likewise.
13256 * i386.cc: Likewise.
13257 * powerpc.cc: Likewise.
13258 * sparc.cc: Likewise.
13259 * x86_64.cc: Likewise.
13260 * gc.h: Include icf.h.
13261
1c7814ed
ILT
132622009-10-11 Ian Lance Taylor <iant@google.com>
13263
13264 * plugin.cc: Include "gold.h" before other header files.
13265
ae3b5189
CD
132662009-10-10 Chris Demetriou <cgd@google.com>
13267
13268 * options.h (Input_file_argument::Input_file_type): New enum.
13269 (Input_file_argument::is_lib_): Replace with...
13270 (Input_file_argument::type_): New member.
13271 (Input_file_argument::Input_file_argument): Take Input_file_type
13272 'type' rather than boolean 'is_lib' as second argument.
13273 (Input_file_argument::is_lib): Use type_.
13274 (Input_file_argument::is_searched_file): New function.
13275 (Input_file_argument::may_need_search): Handle is_searched_file.
13276 * options.cc (General_options::parse_library): Support -l:filename.
13277 (General_options::parse_just_symbols): Update for Input_file_argument
13278 changes.
13279 (Command_line::process): Likewise.
13280 * archive.cc (Archive::get_file_and_offset): Likewise.
13281 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13282 * script.cc (read_script_file, script_add_file): Likewise.
13283 * fileread.cc (Input_file::Input_file): Likewise.
13284 (Input_file::will_search_for): Handle is_searched_file.
13285 (Input_file::open): Likewise.
13286 * readsyms.cc (Read_symbols::get_name): Likewise.
13287 * testsuite/Makefile.am (searched_file_test): New test.
13288 * testsuite/Makefile.in: Regenerate.
13289 * testsuite/searched_file_test.cc: New file.
13290 * testsuite/searched_file_test_lib.cc: New file.
13291
f3048a1d
ILT
132922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13293 Ian Lance Taylor <iant@google.com>
13294
13295 * descriptor.cc: Include <cstdio> and "binary-io.h".
13296 (Descriptors::open): Open the files in binary mode always.
13297 * script.cc (Lex::get_token): Treat \r as whitespace.
13298
d4780e57
ILT
132992009-10-09 Ian Lance Taylor <iant@google.com>
13300
13301 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13302
d9a893b8
ILT
133032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13304 Ian Lance Taylor <iant@google.com>
13305
13306 * configure.ac: Check for readv function also.
13307 * fileread.cc (readv): Define if not HAVE_READV.
13308 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13309 does not exist.
13310 * config.in: Regenerate.
13311 * configure: Regenerate.
13312
c0a62865
DK
133132009-10-09 Doug Kwan <dougkwan@google.com>
13314
13315 * layout.cc (Layout::make_output_section): Call target hook to make
13316 ordinary output section.
13317 (Layout::finalize): Adjust parameter list of call the
13318 Target::may_relax().
13319 * layout.h (class Layout::section_list): New method.
13320 * merge.h (Output_merge_base::entsize): Change visibility to public.
13321 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13322 New methods.
13323 (Output_merge_string::do_is_string): New method.
13324 * object.cc (Sized_relobj::do_setup): renamed from
13325 Sized_relobj::set_up.
13326 * object.h (Sized_relobj::adjust_shndx,
13327 Sized_relobj::initializ_input_to_output_maps,
13328 Sized_relobj::free_input_to_output_maps): Change visibilities to
13329 protected.
13330 (Sized_relobj::setup): Virtualize.
13331 (Sized_relobj::do_setup): New method declaration.
13332 (Sized_relobj::invalidate_section_offset,
13333 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13334 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13335 * options.cc (parse_int): New function.
13336 * options.h (parse_int): New declaration.
13337 (DEFINE_int): New macro.
13338 (stub_group_size): New option.
13339 * output.cc (Output_section::Output_section): Initialize memebers
13340 merge_section_map_, merge_section_by_properties_map_,
13341 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13342 (Output_section::add_input_section): Handled deferred code-fill
13343 generation and remove an old comment.
13344 (Output_section::add_relaxed_input_section): New method definition.
13345 (Output_section::add_merge_input_section): Use merge section by
13346 properties map to speed to search. Update merge section maps
13347 as appropriate.
13348 (Output_section::build_relaxation_map): New method definition.
13349 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13350 Same.
13351 (Output_section::relax_input_section): Renamed to
13352 Output_section::convert_input_sections_to_relaxed_sections and change
13353 interface to take a vector of pointers to relaxed sections.
13354 (Output_section::find_merge_section,
13355 Output_section::find_relaxed_input_section): New method definitions.
13356 (Output_section::is_input_address_mapped,
13357 Output_section::output_offset, Output_section::output_address):
13358 Use output section data maps to speed up searching.
13359 (Output_section::find_starting_output_address): Add comments.
13360 (Output_section::do_write,
13361 Output_section::write_to_postprocessing_buffer): Do code-fill
13362 generation as appropriate.
13363 (Output_section::get_input_sections): Invalidate relaxed input section
13364 map.
13365 (Output_section::restore_states): Adjust type of checkpoint .
13366 Invalidate relaxed input section map.
13367 * output.h (Output_merge_base): New class declaration.
13368 (Input_section_specifier): New class defintion.
13369 (class Output_relaxed_input_section) Change base class to
13370 Output_section_data_build.
13371 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13372 base class initializer.
13373 (Output_section::add_relaxed_input_section): New method declaration.
13374 (Output_section::Input_section): Change visibility to protected.
2e702c99 13375 (Output_section::Input_section::relobj,
c0a62865
DK
13376 Output_section::Input_section::shndx): Handle relaxed input sections.
13377 Output_section::input_sections) Change visibility to protected. Also
13378 define overload to return a non-const pointer.
13379 (Output_section::Merge_section_properties): New class defintion.
13380 (Output_section::Merge_section_by_properties_map,
13381 Output_section::Output_section_data_by_input_section_map,
13382 Output_section::Relaxation_map): New types.
13383 (Output_section::relax_input_section): Rename method to
13384 Output_section::convert_input_sections_to_relaxed_sections and change
13385 interface to take a vector of relaxed section pointers.
13386 (Output_section::find_merge_section,
13387 Output_section::find_relaxed_input_section,
13388 Output_section::build_relaxation_map,
13389 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13390 New method declarations.
13391 (Output_section::merge_section_map_
13392 Output_section::merge_section_by_properties_map_,
13393 Output_section::relaxed_input_section_map_,
13394 Output_section::is_relaxed_input_section_map_valid_,
13395 Output_section::generate_code_fills_at_write_): New data members.
13396 * script-sections.cc
13397 (Output_section_element_input::set_section_addresses): Call
13398 current_data_size and addralign methods of relaxed input sections.
13399 (Orphan_output_section::set_section_addresses): Call current_data_size
13400 and addralign methods of relaxed input sections.
13401 * symtab.cc (Symbol_table::compute_final_value): Extract template
13402 from the body of Symbol_table::sized_finalize_symbol.
13403 (Symbol_table::sized_finalized_symbol): Call
13404 Symbol_table::compute_final_value.
13405 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13406 (Symbol_table::compute_final_value): New templated method declaration.
13407 * target.cc (Target::do_make_output_section): New method defintion.
13408 * target.h (Target::make_output_section): New method declaration.
13409 (Target::relax): Add more parameters for input objects, symbol table
13410 and layout. Adjust call to do_relax.
13411 (Target::do_make_output_section): New method declaration.
13412 (Target::do_relax): Add parameters for input objects, symbol table
13413 and layout.
13414
d446d6c4
ILT
134152009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13416
13417 * pread.c: Include stdio.h.
13418
bc06c745
ILT
134192009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13420
13421 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13422 defined.
13423
75aea3d0
ILT
134242009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13425
13426 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13427 Change read_shndx type to unsigned int.
13428 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13429 int.
13430 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13431 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13432 Change read_shndx type to unsigned int.
13433 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13434 int.
13435 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13436 * layout.cc (Layout::create_symtab_sections): Cast the result of
13437 local_symcount * symsize to off_t in the gold_assert.
13438
be8fcb75
ILT
134392009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13440
13441 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13442 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13443 R_ARM_BASE_ABS.
13444 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13445 (Arm_relocate_functions::thm_abs5): New function.
13446 (Arm_relocate_functions::abs12): New function.
13447 (Arm_relocate_functions::abs16): New function.
13448 (Arm_relocate_functions::base_abs): New function.
13449 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13450 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13451 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13452 R_ARM_BASE_ABS.
13453 (Scan::global): Likewise.
13454 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13455 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13456 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13457 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13458 R_ARM_BASE_ABS.
13459
c2a122b6
ILT
134602009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13461
13462 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13463 (Arm_relocate_functions::movt_prel): New function.
13464 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13465 (Arm_relocate_functions::thm_movt_prel): New function.
13466 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13467 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13468 (Scan::global, Relocate::relocate): Likewise.
13469 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13470
c4aa1e2d
ILT
134712009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13472
13473 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13474 Incremental_checker.
13475 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13476 unsigned int.
13477 (class Incremental_inputs_header): New class.
13478 (Incremental_inputs_header_writer): Edit comment.
13479 (Incremental_inputs_entry): New class.
13480 (Incremental_inputs_entry_writer): Edit comment.
13481 (Sized_incremental_binary::do_find_incremental_inputs_section):
13482 Add *strtab_shndx parameter, fill it.
13483 (Sized_incremental_binary::do_check_inputs): New method.
13484 (Incremental_checker::can_incrementally_link_output_file): Use
13485 Sized_incremental_binary::check_inputs.
13486 (Incremental_inputs::report_command_line): Save command line in
13487 command_line_.
13488 * incremental.h:
13489 (Incremental_binary::find_incremental_inputs_section): New
13490 method.
13491 (Incremental_binary::do_find_incremental_inputs_section): Add
13492 strtab_shndx parameter.
13493 (Incremental_binary::do_check_inputs): New pure virtual method.
13494 (Sized_incremental_binary::do_check_inputs): Declare.
13495 (Incremental_checker::Incremental_checker): Add incremental_inputs
13496 parameter, use it to initialize incremental_inputs_.
13497 (Incremental_checker::incremental_inputs_): New field.
13498 (Incremental_checker::command_line): New method.
13499 (Incremental_checker::inputs): New method.
13500 (Incremental_checker::command_line_): New field.
13501
c549a694
ILT
135022009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13503
13504 * incremental.cc: Include <cstdarg> and "target-select.h".
13505 (vexplain_no_incremental): New function.
13506 (explain_no_incremental): New function.
13507 (Incremental_binary::error): New method.
13508 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13509 method.
13510 (make_sized_incremental_binary): New function.
13511 (open_incremental_binary): New function.
13512 (can_incrementally_link_file): Add checks if output is ELF and has
13513 inputs section.
13514 * incremental.h: Include "elfcpp_file.h" and "output.h".
13515 (Incremental_binary): New class.
13516 (Sized_incremental_binary): New class.
13517 (open_incremental_binary): Declare.
13518 * object.cc (is_elf_object): Use
13519 elfcpp::Elf_recognizer::is_elf_file.
13520 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13521 * output.h (Output_file::filesize): New method.
13522
fd3c5f0b
ILT
135232009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13524
13525 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13526 New function.
13527 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13528 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13529 function.
13530 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13531 function.
13532 (Arm_relocate_functions::movw_abs_nc): New function.
13533 (Arm_relocate_functions::movt_abs): New function.
13534 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13535 (Arm_relocate_functions::thm_movt_abs): New function.
13536 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13537 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13538 (Scan::global): Likewise.
13539 (Relocate::relocate): Likewise.
13540 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13541
7f5309a5
ILT
135422009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13543
13544 * arm.cc (Arm_relocate_functions::got_prel) New function.
13545 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13546 (Relocate::relocate): Likewise.
13547 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13548
364c7fa5
ILT
135492009-10-06 Ian Lance Taylor <iant@google.com>
13550
13551 * options.h (class General_options): Define
13552 split_stack_adjust_size parameter.
13553 * object.h (class Object): Add uses_split_stack_ and
13554 has_no_split_stack_ fields. Add uses_split_stack and
13555 has_no_split_stack accessor functions. Declare
13556 handle_split_stack_section.
13557 (class Reloc_symbol_changes): Define.
13558 (class Sized_relobj): Define Function_offsets. Declare
13559 split_stack_adjust, split_stack_adjust_reltype, and
13560 find_functions.
13561 * object.cc (Object::handle_split_stack_section): New function.
13562 (Sized_relobj::do_layout): Call handle_split_stack_section.
13563 * dynobj.cc (Sized_dynobj::do_layout): Call
13564 handle_split_stack_section.
13565 * reloc.cc (Sized_relobj::relocate_sections): Call
13566 split_stack_adjust for executable sections in split_stack
13567 objects. Pass reloc_map to relocate_section.
13568 (Sized_relobj::split_stack_adjust): New function.
13569 (Sized_relobj::split_stack_adjust_reltype): New function.
13570 (Sized_relobj::find_functions): New function.
13571 * target-reloc.h: Include "object.h".
13572 (relocate_section): Add reloc_symbol_changes parameter. Change
13573 all callers.
13574 * target.h (class Target): Add calls_non_split method. Declare
13575 do_calls_non_split virtual method. Declare match_view and
13576 set_view_to_nop.
13577 * target.cc: Include "elfcpp.h".
13578 (Target::do_calls_non_split): New function.
13579 (Target::match_view): New function.
13580 (Target::set_view_to_nop): New function.
13581 * gold.cc (queue_middle_tasks): Give an error if mixing
13582 split-stack and non-split-stack objects with -r.
13583 * i386.cc (Target_i386::relocate_section): Add
13584 reloc_symbol_changes parameter.
13585 (Target_i386::do_calls_non_split): New function.
13586 * x86_64.cc (Target_x86_64::relocate_section): Add
13587 reloc_symbol_changes parameter.
13588 (Target_x86_64::do_calls_non_split): New function.
13589 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13590 parameter.
13591 * powerpc.cc (Target_powerpc::relocate_section): Add
13592 reloc_symbol_changes parameter.
13593 * sparc.cc (Target_sparc::relocate_section): Add
13594 reloc_symbol_changes parameter.
13595 * configure.ac: Call AM_CONDITIONAL for the default target.
13596 * configure: Rebuild.
13597 * testsuite/Makefile.am (TEST_AS): New variable.
13598 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13599 (check_DATA): Add split_i386 and split_x86_64 files.
13600 (SPLIT_DEFSYMS): Define.
13601 (split_i386_[1234n].o): New targets.
13602 (split_i386_[124]): New targets.
13603 (split_i386_[1234r].stdout): New targets.
13604 (split_x86_64_[1234n].o): New targets.
13605 (split_x86_64_[124]): New targets.
13606 (split_x86_64_[1234r].stdout): New targets.
13607 (MOSTLYCLEANFILES): Add new executables.
13608 * testsuite/split_i386.sh: New file.
13609 * testsuite/split_x86_64.sh: New file.
13610 * testsuite/split_i386_1.s: New file.
13611 * testsuite/split_i386_2.s: New file.
13612 * testsuite/split_i386_3.s: New file.
13613 * testsuite/split_i386_4.s: New file.
13614 * testsuite/split_i386_n.s: New file.
13615 * testsuite/split_x86_64_1.s: New file.
13616 * testsuite/split_x86_64_2.s: New file.
13617 * testsuite/split_x86_64_3.s: New file.
13618 * testsuite/split_x86_64_4.s: New file.
13619 * testsuite/split_x86_64_n.s: New file.
13620 * testsuite/testfile.cc (Target_test): Update relocation_section
13621 function.
13622 * testsuite/Makefile.in: Rebuild.
13623
e8a9fcda
ILT
136242009-10-06 Ian Lance Taylor <iant@google.com>
13625
13626 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13627 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13628 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13629 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13630 the address on ldo_addrs_.
13631 (Target_i386::Relocate::fix_up_ldo): New function.
13632
e99daf92
ILT
136332009-10-06 Rafael Espindola <espindola@google.com>
13634
13635 * plugin.cc (add_input_library): New.
13636 (Plugin::load): Add add_input_library to tv.
13637 (Plugin_manager::add_input_file): Add the is_lib argument.
13638 (add_input_file): Update call to Plugin_manager::add_input_file.
13639 (add_input_library): New.
13640 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13641
966d4097
DK
136422009-09-30 Doug Kwan <dougkwan@google.com>
13643
13644 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13645 symbol and call Symbol::may_need_copy_reloc to determine if
13646 a copy reloc is needed.
13647 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13648 nocopyreloc is given in command line.
13649 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13650 given in command line.
13651 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13652 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13653 of the removed Target_i386::may_need_copy_reloc.
13654 * options.h (copyreloc): New option with default value false.
13655 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13656 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13657 instead of the removed Target_powerpc::may_need_copy_reloc.
13658 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13659 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13660 instead of the removed Target_sparc::may_need_copy_reloc.
13661 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13662 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13663 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13664 instead of the removed Target_x86_64::may_need_copy_reloc.
13665
029ba973
ILT
136662009-09-30 Ian Lance Taylor <iant@google.com>
13667
13668 * object.h (class Object): Remove target_ field, and target,
13669 sized_target, and set_target methods.
13670 (Object::sized_target): Remove.
13671 (class Sized_relobj): Update declarations. Remove sized_target.
13672 * object.cc (Sized_relobj::setup): Remove target parameter.
13673 Change all callers.
13674 (Input_objects::add_object): Don't do anything with the target.
13675 (make_elf_sized_object): Add punconfigured parameter. Change all
13676 callers. Set or test parameter target.
13677 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13678 Change all callers.
13679 * parameters.cc (Parameters::set_target): Change parameter type to
13680 be non-const.
13681 (Parameters::default_target): Remove.
13682 (set_parameters_target): Change parameter type to be non-const.
13683 (parameters_force_valid_target): New function.
13684 (parameters_clear_target): New function.
13685 * parameters.h (class Parameters): Update declarations. Remove
13686 default_target method. Add sized_target and clear_target
13687 methods. Change target_ to be non-const.
13688 (set_parameters_target): Update declaration.
13689 (parameters_force_valid_target): Declare.
13690 (parameters_clear_target): Declare.
13691 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13692 as NULL if we aren't searching.
13693 (Add_symbols::run): Don't check for compatible target.
13694 * fileread.cc (Input_file::open_binary): Call
13695 parameters_force_valid_target.
13696 * gold.cc (queue_middle_tasks): Likewise.
13697 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13698 set_target on object.
13699 * dynobj.h (class Sized_dynobj): Update declarations.
13700 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13701 make_elf_object returns NULL.
13702 (Archive::include_member): Don't check whether object target is
13703 compatible.
13704 * output.cc (Output_section::add_input_section): Get target from
13705 parameters.
13706 (Output_section::relax_input_section): Likewise.
13707 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13708 parameters.
13709 (Sized_relobj::do_scan_relocs): Likewise.
13710 (Sized_relobj::relocate_sections): Likewise.
13711 * resolve.cc (Symbol_table::resolve): Likewise.
13712 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13713 parameter. Change all callers.
13714 (Symbol_table::add_from_object): Get target from parameters.
13715 (Symbol_table::add_from_relobj): Don't check object target.
13716 (Symbol_table::add_from_dynobj): Likewise.
13717 (Symbol_table::define_special_symbol): Get target from
13718 parameters.
13719 * symtab.h (class Symbol_table): Update declaration.
13720 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13721 parameter. Change all callers. Clear parameter target.
13722 (Binary_test): Test target here.
13723 * testsuite/object_unittest.cc (gold_testsuite): Remove
13724 target_test_pointer parameter. Change all callers.
13725 (Object_test): Test target here.
13726
a6a22b83
ILT
137272009-09-26 Ian Lance Taylor <iant@google.com>
13728
13729 * testsuite/initpri1.c: Don't try to use constructor priorities if
13730 compiling with gcc before 4.3.
13731
6a8f49fe
ILT
137322009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13733
13734 * testsuite/retain_symbols_file_test.sh (check_present): Change
13735 output file name to retain_symbols_file_test.stdout.
13736 (check_absent): Likewise.
13737
8c604651
CS
137382009-09-18 Craig Silverstein <csilvers@google.com>
13739
13740 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13741 * options.cc: Include <cerrno> and <fstream>.
13742 (General_options::finalize): Parse -retain-symbols-file tag.
13743 * options.h: New flag.
13744 (General_options): New method should_retain_symbol, new
13745 variable symbols_to_retain.
13746 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13747 should_retain_symbol map.
13748 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13749 * testsuite/Makefile.in: Regenerate.
13750 * testsuite/retain_symbols_file_test.sh: New file.
13751
ca58b19f
NC
137522009-09-18 Nick Clifton <nickc@redhat.com>
13753
13754 * po/es.po: Updated Spanish translation.
13755
20e6d0d6
DK
137562009-09-17 Doug Kwan <dougkwan@google.com>
13757
13758 * debug.h (DEBUG_RELAXATION): New constant.
13759 (DEBUG_ALL): Add DEBUG_RELAXATION.
13760 (debug_string_to_enum): Add relaxation debug option.
13761 * layout.cc
13762 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13763 Layout::Relaxation_debug_check::read_sections,
13764 Layout::Relaxation_debug_check::read_sections): New method definitions.
13765 (Layout::Layout): Initialize data members
13766 record_output_section_data_from_scrips_,
13767 script_output_section_data_list_ and relaxation_debug_check_.
13768 (Layout::save_segments, Layout::restore_segments,
13769 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13770 Layout::relaxation_loop_body): New method definitions.
13771 (Layout::finalize): Support relaxation. Move section layout code to
13772 Layout::relaxation_loop_body.
13773 (Layout::set_asection_address_from_script): Move code for orphan
13774 section placement out.
13775 (Layout::place_orphan_sections_in_script): New method definition.
13776 * layout.h (Output_segment_headers, Output_file_header):
13777 New forward class declarations.
13778 (Layout::~Layout): Define.
13779 (Layout::new_output_section_data_from_script): New method definition.
13780 (Layout::place_orphan_sections_in_script): New method declaration.
13781 (Layout::Segment_states): New type declaration.
13782 (Layout::save_segments, Layout::restore_segments,
13783 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13784 Layout::relaxation_loop_body): New method declarations.
13785 (Layout::Output_section_data_list): New type declaration.
13786 (Layout::Relaxation_debug_check): New class definition.
13787 (Layout::record_output_section_data_from_script_,
13788 Layout::script_output_section_data_list_, Layout::segment_states_,
13789 Layout::relaxation_debug_check_): New data members.
13790 * output.cc: (Output_section_headers::do_size): New method definition.
13791 (Output_section_headers::Output_section_headers): Move size
13792 computation to Output_section_headers::do_size.
13793 (Output_segment_headers::do_size): New method definition.
e1df38aa 13794 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13795 Output_file_header::do_size and call it.
13796 (Output_file_header::do_size): New method definition.
13797 (Output_data_group::Output_data_group): Adjust call to
13798 Output_section_data.
13799 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13800 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13801 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13802 RELAXED_INPUT_SECTION_CODE.
13803 (Output_section::Output_section): Initialize data member checkpoint_.
13804 (Output_section::~Output_section): Delete checkpoint object pointed
13805 by checkpoint_.
13806 (Output_section::add_input_section): Always add an Input_section if
13807 relaxing.
13808 (Output_section::add_merge_input_section): Add assert.
13809 (Output_section::relax_input_section): New method definition.
13810 (Output_section::set_final_data_size): Set load address to zero for
13811 an unallocated section.
13812 (Output_section::do_address_and_file_offset_have_reset_values):
13813 New method definition.
13814 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13815 Handle relaxed input section.
13816 (Output_section::sort_attached_input_sections): Checkpoint input
13817 section list lazily.
13818 (Output_section::get_input_sections): Change type of input_sections to
13819 list of Simple_input_section pointers. Checkpoint input section list
13820 lazily. Also handle relaxed input sections.
13821 (Output_section::add_input_section_for_script): Take a reference to
13822 a Simple_input_section object instead of Relobj pointer and section
13823 index as parameter. Handle relaxed input sections.
13824 (Output_section::save_states, Output_section::restore_states): New
13825 method definitions.
13826 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13827 (Output_data::is_data_size_fixed): New method definition.
13828 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13829 if it is fixed.
13830 (Output_data::address_and_file_offset_have_reset_values): New method
13831 definition.
13832 (Output_data::do_address_and_file_offset_have_reset_values): New method
13833 definition.
13834 (Output_data::set_data_size): Check that data size is not fixed.
13835 (Output_data::fix_data_size): New method definition.
13836 (Output_data::is_data_size_fixed_): New data member.
13837 (Output_section_headers::set_final_data_size): New method definition.
13838 (Output_section_headers::do_size): New method declaration.
13839 (Output_segment_headers::set_final_data_size): New method definition.
13840 (Output_segment_headers::do_size): New method declaration.
13841 (Output_file_header::set_final_data_size)::New method definition.
13842 (Output_file_header::do_size)::New method declaration.
13843 (Output_section_data::Output_section_data): Add new parameter
13844 is_data_size_fixed and use it to fix data size.
13845 (Output_data_const::Output_data_const): Adjust call to base class
13846 constructor and fix data size.
13847 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13848 base class constructor and fix data size.
13849 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13850 base class constructor and fix data size.
13851 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13852 class constructor and fix data size.
13853 (Output_data_group::set_final_data_size): New method definition.
13854 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13855 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13856 class constructor and fix data size.
13857 (Output_relaxed_input_section): New class definition.
13858 (Output_section::Simple_input_section): New class definition.
13859 (Output_section::get_input_sections): Adjust parameter list.
13860 (Output_section::add_input_section_for_script): Same.
13861 (Output_section::save_states, Output_section::restore_states,
13862 Output_section::do_address_and_file_offset_have_reset_values,
13863 (Output_section::Input_section::Input_section): Handle
13864 RELAXED_INPUT_SECTION_CODE. Add new overload for
13865 Output_relaxed_input_section.
13866 (Output_section::Input_section::is_input_section,
13867 Output_section::Input_section::set_output_section): Handle relaxed
13868 input section.
13869 (Output_section::Input_section::is_relaxed_input_section,
13870 Output_section::Input_section::output_section_data,
13871 Output_section::Input_section::relaxed_input_section): New method
13872 definitions.
13873 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13874 value.
13875 (Output_section::Input_section::u1_): Update comments.
13876 (Output_section::Input_section::u2_): Add new union member poris.
13877 (Output_section::Checkpoint_output_section): New classs definition.
13878 (Output_section::relax_input_section): New method declaration.
13879 (Output_section::checkpoint_): New data member.
13880 (Output_segment): Update comments.
13881 (Output_segment::Output_segment): Un-privatize copy constructor.
13882 (Output_segment::operator=): Un-privatize.
13883 * script-sections.cc (Output_section_element::Input_section_list):
13884 Change element type to Output_section::Simple_input_section.
13885 (Output_section_element_dot_assignment::set_section_addresses):
13886 Register output section data for relaxation clean up.
13887 (Output_data_exression::Output_data_expression): Adjust call to base
13888 constructor to fix data size.
13889 (Output_section_element_data::set_section_addresses): Register
13890 Output_data_expression object for relaxation clean up.
13891 (struct Input_section_info): Replace Relobj pointer and section index
13892 pair with Output_section::Simple_input_section and Convert struct to a
13893 class.
13894 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13895 Input_section_info data member to use accessors.
20e6d0d6
DK
13896 (Output_section_element_input::set_section_addresses): Use layout
13897 parameter. Adjust code to use Output_section::Simple_input_section
13898 and Input_secction_info classes. Register filler for relaxation
13899 clean up.
13900 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13901 and section index pair with Output_section::Simple_input_section
13902 class. Adjust code accordingly.
13903 (Phdrs_element::release_segment): New method definition.
13904 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13905 segment list.
13906 (Script_sections::release_segments): New method definition.
13907 * gold/script-sections.h (Script_sections::release_segments): New
13908 method declaration.
13909 * gold/target.h (Target::may_relax, Target::relax,
13910 Target::do_may_relax, Target::do_relax): New method definitions.
13911
5e445df6
ILT
139122009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13913
13914 * arm.cc (has_signed_unsigned_overflow): New function.
13915 (Arm_relocate_functions::abs8): New function.
13916 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13917 (Target_arm::Scan::global): Likewise.
13918 (Target_arm::relocate::relocate): Likewise.
13919 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13920 Likewise.
13921
8c604651 139222009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13923
13924 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13925 * testsuite/Makefile.in: Regenerate.
13926
1e9cc1c2
NC
139272009-09-11 Nick Clifton <nickc@redhat.com>
13928
13929 * po/gold.pot: Updated by the Translation project.
13930
6a89f575
CC
139312009-09-08 Cary Coutant <ccoutant@google.com>
13932
13933 * output.cc (Output_file::open): Add execute permission to empty file.
13934 * testsuite/Makefile.am (permission_test): New test.
13935 * testsuite/Makefile.in: Regenerate.
13936
fdcac5af
ILT
139372009-09-02 Ian Lance Taylor <iant@google.com>
13938
13939 * output.cc (Output_file::resize): Call map_no_anonymous rather
13940 than map.
13941
44453f85
ILT
139422009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13943
13944 * gold.cc: Include "incremental.h".
13945 (queue_initial_tasks): Call Incremental_checker methods.
13946 * incremental.cc: Include "output.h".
13947 (Incremental_checker::can_incrementally_link_output_file): New
13948 method.
13949 * incremental.h (Incremental_checker): New class.
13950
13951 * output.cc (Output_file::open_for_modification): New method.
13952 (Output_file::map_anonymous): Changed return type to bool. Record
13953 map in base_ field.
13954 (Output_file::map_no_anonymous): New method, broken out of map.
13955 (Output_file::map): Use map_no_anonymous and map_anonymous.
13956 * output.h (class Output_file): Update declarations.
13957
293c1386
CC
139582009-08-24 Cary Coutant <ccoutant@google.com>
13959
13960 * options.h (Command_line::Pre_options): New class.
13961 (Command_line::pre_options): New member.
13962 * options.cc (gold::options::ready_to_register): New variable.
13963 (One_option::register_option): Do nothing if not registering options.
13964 Assert if same short option registered twice.
13965 (General_options::General_options): Turn off option registration when
13966 done constructing.
13967 (Command_line::Pre_options::Pre_options): New constructor.
13968
f773f3d2
CC
139692009-08-24 Cary Coutant <ccoutant@google.com>
13970
06a73cfe
CC
13971 * options.h (General_options::no_keep_memory): Remove incorrect
13972 short option.
f773f3d2 13973
a15af8e2
RW
139742009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13975
13976 * Makefile.am (am__skiplex, am__skipyacc): New.
13977 * Makefile.in: Regenerate.
13978
c462b41b
RW
139792009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13980
14ec8efd
RW
13981 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13982 (INCLUDES): ... this.
13983 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13984 (AM_CPPFLAGS): Renamed from ...
13985 (INCLUDE): ... this.
13986 * Makefile.in, testsuite/Makefile.in: Regenerate.
13987
81ecdfbb
RW
13988 * Makefile.in: Regenerate.
13989 * aclocal.m4: Likewise.
13990 * config.in: Likewise.
13991 * configure: Likewise.
13992 * testsuite/Makefile.in: Likewise.
13993
c462b41b
RW
13994 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13995 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13996 * Makefile.in: Regenerate.
13997 * testsuite/Makefile.in: Regenerate.
13998
2da73f13
CC
139992009-08-19 Cary Coutant <ccoutant@google.com>
14000
14001 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14002 symbols in shared libraries overridden by hidden or internal symbols
14003 in the main program.
14004
2db70501
CD
140052009-08-19 Chris Demetriou <cgd@google.com>
14006
14007 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14008 checking source file names in error messages.
14009
f733487b
DK
140102009-08-18 Doug Kwan <dougkwan@google.com>
14011
14012 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14013 an elcpp::Ehdr as parameter. Adjust call to set_target.
14014 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14015 an elfcpp::Ehdr as parameter.
14016 * object.cc (Object::set_target): Remove the version that looks up
14017 a target and sets it.
14018 (Sized_relobj::setup): Take a Target object instead of
14019 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14020 (make_elf_sized_object): Find target and ask target to
14021 make an ELF object.
14022 * object.h: (Object::set_target): Remove the version that looks up
14023 a target and sets it.
14024 (Sized_relobj::setup): Take a Target object instead of
14025 an elfcpp:Ehdr as parameter.
14026 * target.cc: Include dynobj.h.
14027 (Target::do_make_elf_object_implementation): New.
2e702c99 14028 (Target::do_make_elf_object): New.
f733487b
DK
14029 * target.h (Target::make_elf_object): New template declaration.
14030 (Target::do_make_elf_object): New method declarations.
14031 (Target::do_make_elf_object_implementation): New template declaration.
14032
cc70f101
ILT
140332009-08-14 Ian Lance Taylor <iant@google.com>
14034
14035 * gold.h (FUNCTION_NAME): Define.
14036 (gold_unreachable): Use FUNCTION_NAME.
14037
ef5e0cb1
ST
140382009-08-12 Sriraman Tallam <tmsriram@google.com>
14039
14040 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14041 symbol in the --keep-unique list is not found.
14042
48c187ce
ST
140432009-08-12 Sriraman Tallam <tmsriram@google.com>
14044
14045 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14046 been maked as --keep-unique.
14047 (Icf::unfold_section): New function.
14048 * icf.h (Icf::unfold_section): New function.
14049 * options.h (General_options::keep_unique): New option.
14050 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14051 * testsuite/Makefile.in: Regenerate.
14052 * testsuite/icf_keep_unique_test.sh: New file.
14053 * testsuite/icf_keep_unique_test.cc: New file.
14054
645afe0c
CC
140552009-08-12 Cary Coutant <ccoutant@google.com>
14056
14057 PR 10471
14058 * resolve.cc (Symbol_table::resolve): Check for references from
14059 dynamic objects to hidden and internal symbols.
14060 * testsuite/Makefile.am (hidden_test.sh): New test.
14061 * testsuite/Makefile.in: Regenerate.
14062 * testsuite/hidden_test.sh: New script.
14063 * testsuite/hidden_test_1.c: New test source.
14064 * testsuite/hidden_test_main.c: New test source.
14065
11af873f
DK
140662009-08-11 Doug Kwan <dougkwan@google.com>
14067
14068 * arm.cc: Update comments.
14069 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14070 segment to locate the .ARM.exidx section if present.
14071
b9f7d72d
DK
140722009-08-09 Doug Kwan <dougkwan@google.com>
14073
14074 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14075 patch.
14076
ddd3c53c
ST
140772009-08-07 Sriraman Tallam <tmsriram@google.com>
14078 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14079 compiler warnings.
14080
27721062
ST
140812009-08-06 Sriraman Tallam <tmsriram@google.com>
14082
14083 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14084 valid tls_segment only for non-debug-section relocations.
14085 * testsuite/Makefile.am: Add gc_tls_test.
14086 * testsuite/Makefile.in: Regenerate.
14087 * testsuite/gc_tls_test.cc: New file.
14088 * testsuite/gc_tls_test.sh: New file.
14089
ef15dade 140902009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14091
ef15dade
ST
14092 * icf.cc: New file.
14093 * icf.h: New file.
14094 * Makefile.am (CCFILES): Add icf.cc.
14095 (HFILES): Add icf.h
14096 * Makefile.in: Regenerate.
14097 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14098 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14099 section, symbol and addend information for the relocs.
14100 * gold.cc (queue_middle_tasks): Call identical code folding.
14101 * gold.h: Add defines for multimap.
14102 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14103 to the call of finalize_local_symbols.
14104 * main.cc (main): Create object of class Icf.
14105 * object.cc (Sized_relobj::do_layout): Allow this function to be
14106 called twice during icf.
14107 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14108 to sections marked as identical by icf.
14109 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14110 when available.
14111 (Sized_relobj::do_section_entsize): New function.
14112 * object.h (Object::section_entsize): New function.
14113 (Object::do_section_entsize): New pure virtual function.
14114 (Relobj::finalize_local_symbols): Add new parameter.
14115 (Relobj::do_section_entsize): New function.
14116 * options.h (General_options::icf): New option.
14117 (General_options::icf_iterations): New option.
14118 (General_options::print_icf_sections): New option.
14119 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14120 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14121 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14122 icf.
14123 * symtab.cc (Symbol_table::is_section_folded): New function.
14124 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14125 to sections marked as identical by icf.
14126 * symtab.h (Symbol_table::set_icf): New function.
14127 (Symbol_table::icf): New function.
14128 (Symbol_table::is_section_folded): New function.
14129 (Symbol_table::icf_): New data member.
14130 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14131 * testsuite/Makefile.am: Add commands to build icf_test.
14132 * testsuite/Makefile.in: Regenerate.
14133 * testsuite/icf_test.sh: New file.
14134 * testsuite/icf_test.cc: New file.
14135
c3b65ac4
CD
141362009-07-24 Chris Demetriou <cgd@google.com>
14137
14138 * layout.cc (is_compressible_debug_section): Fix incorrect
14139 comment about compressed section names.
14140
1caf2c51
ILT
141412009-07-20 Ian Lance Taylor <ian@airs.com>
14142
14143 PR 10419
14144 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14145
1ef4d87f
ILT
141462009-07-16 Ian Lance Taylor <iant@google.com>
14147
14148 PR 10400
14149 * layout.h: #include <map>.
14150 (class Kept_section): Change from struct to class. Add accessors
14151 and setters. Add section size to Comdat_group mapping. Change
14152 Comdat_group to std::map. Add is_comdat_ field. Add
14153 linkonce_size field in union.
14154 (class Layout): Update declaration of find_or_add_kept_section.
14155 Don't declare find_kept_object.
14156 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14157 parameter. Add object, shndx, is_comdat, and is_group_name
14158 parameters. Change all callers. Adjust for new Kept_section.
14159 (Layout::find_kept_object): Remove.
14160 * object.cc (Sized_relobj::include_section_group): Update use of
14161 Kept_section. Rename secnum to shndx. Only record
14162 Kept_comdat_section if sections are the same size.
14163 (Sized_relobj::include_linkonce_section): Update use of
14164 Kept_section. Only record Kept_comdat_section if sections are the
14165 same size. Set size of linkonce section.
14166 (Sized_relobj::map_to_kept_section): Update call to
14167 get_kept_comdat_section.
14168 * object.h (class Sized_relobj): Rename fields in
14169 Kept_comdat_section to drop trailing underscores; change object
14170 field to Relobj*. Change Kept_comdat_section_table to store
14171 struct rather than pointer.
14172 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14173 Add kept_object and kept_shndx parameters. Change all callers.
14174 (Sized_relobj::get_kept_comdat_section): Change return type to
14175 bool. Add kept_object and kept_shndx parameters. Change all
14176 callers.
14177 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14178 Layout::find_or_add_kept_section.
14179
37c3b7b0
ILT
141802009-07-09 Ian Lance Taylor <iant@google.com>
14181
14182 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14183 Reserve space in the hash table.
14184
98fa85cb
ILT
141852009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14186
14187 * fileread.cc (File_read::get_mtime): New method.
14188 * fileread.h (Timespec): New structure.
14189 (File_read::get_mtime): New method.
14190 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14191 Renamed from timestamp_nsec.
14192 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14193 Elf_Xword.
e1df38aa 14194 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14195 timestamp_nsec.
e1df38aa 14196 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14197 (Incremental_inputs::report_obejct): Save mtime; style fix.
14198 (Incremental_inputs::report_script): Save mtime; style fix.
14199 (Incremental_inputs::finalize_inputs): Style fix.
14200 (Incremental_inputs::finalize): Style fix.
14201 (Incremental_inputs::create_input_section_data): Store inputs
14202 mtime.
14203 * incremental.h (Incremental_inputs::report_script): Add mtime
14204 argument.
14205 (Incremental_inputs::Input_info::Input_info): Intialize only one
14206 union member.
14207 (Incremental_inputs::Input_info::archive): Move to nameless
14208 union.
14209 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14210 (Incremental_inputs::Input_info::script): Move to nameless union.
14211 (Incremental_inputs::mtime): New field.
14212 * script.cc (read_input_script): Pass file mtime to
14213 Incremental_input.
14214 * script.h (Script_info::inputs): Style fix.
14215
c9d70757
ILT
142162009-07-01 Ian Lance Taylor <ian@airs.com>
14217
14218 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14219 instead of 32.
14220
9c547ec3
ILT
142212009-06-24 Ian Lance Taylor <iant@google.com>
14222
14223 PR 10156
14224 * layout.cc (Layout::choose_output_section): If we find an
14225 existing section, update the flags.
14226 (Layout::create_notes): New function, broken out of
14227 Layout::finalize.
14228 (Layout::finalize): Don't create note sections.
14229 (Layout::create_note): Don't crash if linker script discards
14230 section.
14231 (Layout::create_gold_note): Likewise.
14232 (Layout::create_build_id): Likewise. Don't set
14233 after_input_sections on the section.
14234 (Layout::create_executable_stack_info): Remove target parameter.
14235 Change caller.
14236 * layout.h (class Layout): Declare create_notes. Update
14237 declaration of create_executable_stack_info.
14238 * gold.cc (queue_middle_tasks): Call create_notes.
14239 * output.cc (Output_section::update_flags_for_input_section): Move
14240 here from output.h. If SHF_ALLOC flag is newly set, mark address
14241 invalid.
14242 * output.h (Output_data::mark_address_invalid): New function.
14243 (class Output_section): Only declare, not define,
14244 update_flags_for_input_section. Remove set_flags.
14245
55458500
ILT
142462009-06-24 Ian Lance Taylor <iant@google.com>
14247
14248 * script-sections.cc (Output_section_definition::
14249 set_section_addresses): Rename shadowing local load_address to
14250 laddr.
14251
1307d6cd
ILT
142522009-06-24 Ian Lance Taylor <iant@google.com>
14253
14254 PR 10244
14255 * reloc.cc (relocate_sections): Skip empty relocation sections.
14256
ec3f783e
ILT
142572009-06-23 Ian Lance Taylor <iant@google.com>
14258
14259 PR 10156
14260 * layout.cc (Layout::create_note): Use choose_output_section
14261 rather than make_output_section.
14262
459c9f1c
ILT
142632009-06-23 Ian Lance Taylor <iant@google.com>
14264
14265 PR 10237
14266 * options.cc (General_options::parse_V): Set printed_version_.
14267 (General_options::General_options): Initialize printed_version_.
14268 * options.h (class General_options): Add printed_version_ field.
14269 * gold.cc (queue_initial_tasks): If there are no input files,
14270 don't give a fatal error if we printed the version information.
14271 (queue_middle_tasks): If using -r with a shared object, give a
14272 fatal error rather than an ordinary error.
14273
1518dc8f
ILT
142742009-06-23 Ian Lance Taylor <iant@google.com>
14275
14276 PR 10219
14277 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14278 (Layout::make_output_section): Set have_stabstr_section_ if we see
14279 a .stab*str section.
14280 (Layout::finalize): Call link_stabs_sections.
14281 (Layout::link_stabs_sections): New file.
14282 * layout.h (class Layout): Add have_stabstr_section_ field.
14283 Declare link_stabs_sections.
14284
3d857b98
DK
142852009-06-23 Doug Kwan <dougkwan@google.com>
14286
14287 * Makefile.am (libgold_a_LIBADD): New.
14288 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14289 * Makefile.in: Regenerate.
3d857b98
DK
14290 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14291 * configure: Regenerate.
14292 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14293 * fileread.cc: Include sys/state.h
14294 * gold.h: Declare memmem and strndup if found missing.
14295 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14296
0639a6f6
ILT
142972009-06-23 Ian Lance Taylor <iant@google.com>
14298
14299 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14300 * configure: Rebuild.
14301
8d63875c
ILT
143022009-06-23 Ian Lance Taylor <iant@google.com>
14303
14304 PR 10147
14305 * object.cc (Object::section_contents): Don't try to get a view if
14306 the section has length zero.
14307 (Object::handle_gnu_warning_section): If the section is empty, use
14308 the name of the section as the warning.
14309
f7c8a183
ILT
143102009-06-23 Ian Lance Taylor <iant@google.com>
14311
14312 PR 10133
14313 * stringpool.h (class Stringpool_template): Add optimize_ field.
14314 (Stringpool_template::set_optimize): New function.
14315 * stringpool.cc (Stringpool_template::Stringpool_template):
14316 Initialize optimize_ field.
14317 (Stringpool_template::set_string_offsets): Test local optimize
14318 fild rather than parameter.
14319 * layout.cc (Layout::Layout): Call set_optimize on the section
14320 name stringpool.
14321
e6a307ba
ILT
143222009-06-22 Ian Lance Taylor <iant@google.com>
14323
14324 PR 10030
14325 * yyscript.y: Parse TARGET.
14326 * script.cc (script_set_target): New function.
14327 * script-c.h (script_set_target): Declare.
14328 * options.cc (General_options::string_to_object_format): Rename
14329 from string_to_object_format in anonymous namespace. Change
14330 callers.
14331 * options.h (class General_options): Declare
14332 string_to_object_format.
14333
3ee173de
ILT
143342009-06-22 Ian Lance Taylor <iant@google.com>
14335
14336 * script-sections.cc (Script_sections::create_segments): Don't put
14337 program headers in a PT_LOAD segment if -n or -N.
14338
143392009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14340
14341 PR 10141
14342 * options.h (class General_options): Add -z lazy and -z now. Sort
14343 -z options into alphabetical order.
14344 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14345
cd6739a1 143462009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14347
14348 * layout.cc (Layout::make_output_section): Call
14349 Target::new_output_section.
14350 (Layout::attach_allocated_section_to_segment): Put large section
14351 sections in a separate load segment with the large segment flag
14352 set.
14353 (Layout::segment_precedes): Sort large data segments after other
14354 load segments.
14355 (align_file_offset): New static function.
14356 (Layout::set_segment_offsets): Use align_file_offset.
14357 * output.h (class Output_section): Add is_small_section_ and
14358 is_large_section_ fields.
14359 (Output_section::is_small_section): New function.
14360 (Output_section::set_is_small_section): New function.
14361 (Output_section::is_large_section): New function.
14362 (Output_section::set_is_large_section): New function.
14363 (Output_section::is_large_data_section): New function.
14364 (class Output_segment): Add is_large_data_segment_ field.
14365 (Output_segment::is_large_data_segment): New function.
14366 (Output_segment::set_is_large_data_segment): New function.
14367 * output.cc (Output_section::Output_section): Initialize new
14368 fields.
14369 (Output_segment::Output_segment): Likewise.
14370 (Output_segment::add_output_section): Add assertion that large
14371 data sections always go in large data segments. Force small data
14372 sections to the end of the list of data sections. Force small BSS
14373 sections to the start of the list of BSS sections. For large BSS
14374 sections to the end of the list of BSS sections.
14375 * symtab.h (class Symbol): Declare is_common_shndx.
14376 (Symbol::is_defined): Check Symbol::is_common_shndx.
14377 (Symbol::is_common): Likewise.
14378 (class Symbol_table): Define enum Commons_section_type. Update
14379 declarations. Add small_commons_ and large_commons_ fields.
14380 * symtab.cc (Symbol::is_common_shndx): New function.
14381 (Symbol_table::Symbol_table): Initialize new fields.
14382 (Symbol_table::add_from_object): Put small and large common
14383 symbols in the right list.
14384 (Symbol_table::sized_finalized_symbol): Check
14385 Symbol::is_common_shndx.
14386 (Symbol_table::sized_write_globals): Likewise.
14387 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14388 common symbol lists. Don't call do_allocate_commons_list if the
14389 list is empty.
14390 (Symbol_table::do_allocate_commons_list): Remove is_tls
14391 parameter. Add comons_section_type parameter. Change all
14392 callers. Handle small and large common symbols.
14393 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14394 Symbol::is_common_shndx.
14395 * resolve.cc (symbol_to_bits): Likewise.
14396 * target.h (Target::small_common_shndx): New function.
14397 (Target::small_common_section_flags): New function.
14398 (Target::large_common_shndx): New function.
14399 (Target::large_common_section_flags): New function.
14400 (Target::new_output_section): New function.
14401 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14402 small_common_section_flags, and large_common_section_flags
14403 fields.
14404 (Target::do_new_output_section): New virtual function.
14405 * arm.cc (Target_arm::arm_info): Initialize new fields.
14406 * i386.cc (Target_i386::i386_info): Likewise.
14407 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14408 Likewise.
14409 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14410 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14411 (Target_x86_64::do_new_output_section): New function.
14412 * configure.ac: Define conditional MCMODEL_MEDIUM.
14413 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14414 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14415 (large_LDFLAGS): Define.
14416 * testsuite/large.c: New file.
14417 * testsuite/testfile.cc (Target_test::test_target_info):
14418 Initialize new fields.
14419 * configure, testsuite/Makefile.in: Rebuild.
14420
bb04269c
DK
144212009-06-05 Doug Kwan <dougkwan@google.com>
14422
14423 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14424 * Makefile.in: Regenerate.
bb04269c
DK
14425 * i386.cc (class Target_i386): Define new virtual method to
14426 override do_is_local_label_name in parent.
14427 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14428 local symbols if --discard-locals or -X is given.
14429 * options.h (class General_options): Declare new options
14430 '--discard-locals' and '-X' for discarding locals.
14431 * target.h (class Target): Define new methods is_local_label_name.
14432 Declare new virtual method do_is_local_label_name.
14433 * target.cc: New file.
14434 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14435 (check_SCRIPTS): Add discard_locals_test.sh.
14436 (check_DATA): Add discard_local_tests.syms.
14437 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14438 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14439 * testsuite/Makefile.in: Regenerate.
14440 * testsuite/discard_locals_test.c: New file.
14441 * testsuite/discard_locals_test.sh: Same.
14442
805bb01c
DK
144432009-06-05 Doug Kwan <dougkwan@google.com>
14444
14445 * object.cc (Sized_relobj::Sized_relobj): Initialize
14446 discarded_eh_frame_shndx_ to -1U.
14447 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14448 section.
14449 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14450 a discarded .eh_frame section.
14451 (Sized_relobj::do_finalize_local_symbols): Ditto.
14452 * object.h (class Sized_relobj): Declare new member
14453 discarded_eh_frame_shndx_.
14454 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14455 (local_labels_test.o, local_labels_test): New rules.
14456 * testsuite/Makefile.in: Regenerate.
14457
1dcd334d
DK
144582009-06-04 Doug Kwan <dougkwan@google.com>
14459
14460 * layout.cc (Layout::section_name_mapping): Add mapping for
14461 special ARM sections.
14462
96d49306
DK
144632009-06-03 Doug Kwan <dougkwan@google.com>
14464
14465 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14466 (utils::has_overflow): Same.
14467
dff16297
ILT
144682009-06-03 Ian Lance Taylor <iant@google.com>
14469
14470 * layout.cc (Layout::section_name_mapping): New array, replacing
14471 Layout::linkonce_mapping.
14472 (Layout::section_name_mapping_count): New variable, replacing
14473 Layout::linkonce_mapping_count.
14474 (Layout::linkonce_output_name): Remove.
14475 (Layout::output_section_name): Rewrite.
14476 * layout.h (class Layout): Rename Linkonce_mapping to
14477 Section_name_mapping, linkonce_mapping to section_name_mapping,
14478 linkonce_mapping_count to section_name_mapping_count. Don't
14479 declare linkonce_output_name.
14480
c121c671
DK
144812009-06-03 Doug Kwan <dougkwan@google.com>
14482
14483 * gold/arm.cc (namespace utils): New.
14484 (Target_arm::reloc_is_non_pic): Define new method.
14485 (class Arm_relocate_functions): New.
14486 (Target_arm::Relocate::relocate): Handle relocation types used by
14487 Android.
14488
07800fab
ILT
144892009-06-03 Ian Lance Taylor <iant@google.com>
14490
14491 * arm.cc (Target_arm::scan::global): Use || instead of |.
14492
c121c671
DK
144932009-06-02 Doug Kwan <dougkwan@google.com>
14494
14495 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14496 issued_non_pic_error_.
14497 (class Target_arm::Scan): Declare new method check_non_pic.
14498 Define new method symbol_needs_plt_entry.
14499 Declare new data member issued_non_pic_error_.
14500 (class Target_arm::Relocate): Declare new method
14501 should_apply_static_reloc.
14502 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14503 (Target_arm::Scan::check_non_pic): Define new method.
14504 (Target_arm::Scan::local): Handle a small subset of reloc types used
14505 by Android.
14506 (Target_arm::Scan::local): Same.
14507 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14508
b19b0c6d
ILT
145092009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14510
14511 * incremental.cc (Incremental_inputs::report_command_line): Filter
14512 out --incremental-* options.
14513
94cdfcff
DK
145142009-05-29 Doug Kwan <dougkwan@google.com>
14515
14516 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14517 template class.
14518 (class Target_arm): Update comment.
14519 (Target_arm::Target_arm): Initialize new data members GOT_,
14520 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14521 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14522 and Target_arm::rel_dyn_section.
14523 Declare new_enum Target_arm::Got_type.
14524 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14525 and DYNBSS_.
14526 Update commments for member do_dynsym_value.
14527 (Target_arm::got_size, Target_arm::plt_section,
14528 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14529 new methods inside class defintion.
14530 (Target_arm::got_section): Define new method.
14531 (Target_arm::rel_dyn_section): Same.
14532 (Output_data_plt_arm): New template class.
14533 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14534 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14535 (Output_data_plt_arm::add_entry): Same.
14536 (Output_data_plt_arm::first_plt_entry): Define new
14537 static data member for PLT instruction template.
14538 (Output_data_plt_arm::plt_entry): Same.
14539 (Output_data_plt_arm::do_write): Define new method.
14540 (Target_arm::make_plt_entry): Same.
14541 (Target_arm::do_finalize_sections): Same.
14542 (Target_arm::do_dynsym_value): Same.
14543
4a657b0d
DK
145442009-05-28 Doug Kwan <dougkwan@google.com>
14545
14546 * Makefile.am (TARGETSOURCES): Add arm.cc.
14547 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14548 * Makefile.in: Regenerate.
14549 * arm.cc: New file.
14550 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14551
e7ae8c36
DK
145522009-05-26 Doug Kwan <dougkwan@google.com>
14553
14554 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14555 (General_options::check_excluded_libs): Strip off directories in
14556 archive name before matching like GNU ld does.
14557 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14558 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14559 (exclude_libs_test_LDFLAGS): Add linker option
14560 -Wl,--exclude-libs,libexclude_libs_test_3
14561 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14562 an explicit archive without using -l.
14563 (alt/libexclude_libs_test_3.a): New make rule.
14564 * testsuite/Makefile.in: Regenerate.
14565 * testsuite/exclude_libs_test.c : Declare lib3_default().
14566 (main): Call it.
14567 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14568 * exclude_libs_test_3.c: New file.
14569
f12e7348
NC
145702009-05-26 Nick Clifton <nickc@redhat.com>
14571
14572 * po/id.po: New Indonesian translation.
14573 * po/gold.pot: Updated template file.
14574
4daadc0d
ST
145752009-05-22 Sriraman Tallam <tmsriram@google.com>
14576
e1df38aa 14577 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14578 gc_comdat_test files. Add -Wl,--gc-sections to build
14579 gc_comdat_test.
14580 * testsuite/Makefile.in: Regenerate.
14581 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14582
531813ad
ST
145832009-05-21 Sriraman Tallam <tmsriram@google.com>
14584
14585 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14586 kept comdat section was garbage collected.
14587 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14588 * testsuite/Makefile.in: Regenerate.
14589 * testsuite/gc_comdat_test.sh: New file.
14590 * testsuite/gc_comdat_test_1.cc: New file.
14591 * testsuite/gc_comdat_test_2.cc: New file.
14592
65514900
CC
145932009-05-19 Doug Kwan <dougkwan@google.com>
14594
14595 * archive.cc (Archive::Archive): Move constructor from archive.h
14596 to here. Initialize no_export_.
14597 (Archive::get_elf_object_for_member): Set no_export flag of object.
14598 * archive.h (Archive::Archive): Move constructor body to
14599 archive.cc.
14600 (Archive::no_export): New method.
14601 (Archive::no_export_): New field.
14602 * object.h (Object::Object): Initialize no_export_ to false.
14603 (Object::no_export, Object::set_no_export): New methods.
14604 (Object::no_export_): New field.
14605 * options.cc (General_options::parse_exclude_libs): New method.
14606 (General_options::check_excluded_libs) Same.
14607 * options.h (exclude_libs): New option.
14608 (General_options::check_excluded_libs): New method declaration.
14609 (General_options::excluded_libs_): New field.
14610 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14611 default or protected visibility if an object has no-export flag set.
14612 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14613 (check_SCRIPTS): Add exclude_libs_test.sh.
14614 (check_DATA): Add exclude_libs_test.syms.
14615 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14616 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14617 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14618 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14619 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14620 libexclude_libs_test_2.a): New rules.
14621 * testsuite/Makefile.in: Regenerate.
14622 * testsuite/exclude_libs_test.c: New file.
14623 * testsuite/exclude_libs_test.sh: Ditto.
14624 * testsuite/exclude_libs_test_1.c: Ditto.
14625 * testsuite/exclude_libs_test_2.c: Ditto.
14626
1b77ea50
ILT
146272009-05-15 Ian Lance Taylor <iant@google.com>
14628
14629 * configure.ac: Check for declarations for cases where libiberty.h
14630 checks HAVE_DECL_xxx.
14631 * configure, config.in: Rebuild.
14632
072fe7ce
ILT
146332009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14634
14635 * gold.h (Incremental_argument_list): Remove (invalid) forward
14636 declaration.
14637 * incremental.cc (Incremental_inputs::report_achive): New method.
14638 (Incremental_inputs::report_object): New method.
14639 (Incremental_inputs::report_script): New method.
14640 (Incremental_inputs::finalize_inputs): New method.
14641 (Incremental_inputs::finalize): Call finalize_inputs().
14642 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14643 Create inputs entries.
14644 * incremental.h (Incremental_input_type): New enum.
14645 (Incremental_inputs::Incremental_input): Initialize new fields.
14646 (Incremental_inputs::report_inputs): New method.
14647 (Incremental_inputs::report_achive): New method.
14648 (Incremental_inputs::report_object): New method.
14649 (Incremental_inputs::report_script): New method.
14650 (Incremental_inputs::finalize_inputs): New method.
14651 (Incremental_inputs::Input_info): New struct.
14652 (Incremental_inputs::Input_info_map): New typedef.
14653 (Incremental_inputs::lock_): New field.
14654 (Incremental_inputs::Inputs_): New field.
14655 (Incremental_inputs::Inputs_map): New field.
14656 * main.cc (main): Call Incremental_input::report_inputs.
14657 * options.h (Input_argument_list): Typedef moved from
14658 Input_arguments.
14659 (Input_file_group::Files): Remove, use ::Input_argument_list.
14660 (Input_file_group::Input_argument_list): Remove, use
14661 ::Input_argument_list.
14662 * plugin.cc (Plugin_manager::add_input_file): Add error in
14663 incremental build.
14664 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14665 functions.
14666 * script.cc (read_input_script): Call
14667 Incremental_input::report_script.
14668 * script.h (Script_info): New class.
14669
b0481b0b
ILT
146702009-04-27 Ian Lance Taylor <iant@google.com>
14671
14672 * x86_64.cc (do_adjust_output_section): Set entsize to
14673 plt_entry_size.
14674
b22a5a41 146752009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14676
14677 * output.cc (Output_file::close): After short writes, continue
14678 writing from the correct offset in the buffer being written.
14679
40fde488
CD
146802009-04-23 Chris Demetriou <cgd@google.com>
14681
14682 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14683 * configure: Regenerate.
14684 * config.in: Regenerate.
14685 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14686 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14687
3ce2c28e
ILT
146882009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14689
14690 * incremental.cc (Incremental_inputs_header_data): Renamed from
14691 Incremental_input_header_data.
14692 (Incremental_inputs_header_data::data_size): New field.
14693 (Incremental_inputs_header_data::put_input_file_count): Renamed
14694 from input_file_count.
14695 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14696 from command_line_offset.
14697 (Incremental_inputs_header_data::put_reserved): Renamed from
14698 put_reserved.
14699 (Incremental_inputs_entry_data): Renamed from
14700 Incremental_input_entry_data.
14701 (Incremental_inputs_entry_data::data_size): New field.
14702 (Incremental_inputs::report_command_line): New method.
14703 (Incremental_inputs::finalize): New method.
14704 (Incremental_inputs::create_incremental_inputs_data): New method.
14705 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14706 * incremental.h: New file.
14707 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14708 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14709 incremental builds.
703d02da 14710 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14711 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14712 (Layout::create_incremental_info_sections): New method.
14713 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14714 * main.cc (main): Notify Incremental_input of the command line.
14715
e55bde5e
ILT
147162009-04-01 Ian Lance Taylor <iant@google.com>
14717 Mikolaj Zalewski <mikolajz@google.com>
14718
14719 * gold.h (reserve_unordered_map): Define, three versions, one for
14720 each version of Unordered_map.
14721 * layout.cc (Layout::Layout): Remove options parameter. Add
14722 number_of_input_files parameter. Don't initialize options_.
14723 Initialize number_of_input_files_ and resized_signatures_. Move
14724 sections_are_attached_.
14725 (Layout::layout_group): Reserve space for group_signatures_.
14726 (Layout::find_or_add_kept_section): Change name parameter to be a
14727 reference. Resize signatures_ map when it gets large enough.
14728 (Layout::layout_eh_frame): Use parameters->options() instead of
14729 this->options_.
14730 (Layout::make_output_section): Likewise.
14731 (Layout::attach_allocated_section_to_segment): Likewise.
14732 (Layout::finalize, Layout::create_executable_stack): Likewise.
14733 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14734 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14735 * layout.h (class Layout): Update declarations. Remove options_
14736 field. Add number_of_input_files_ and resized_signatures_
14737 fields. Move sections_are_attached_ field.
14738 * main.cc (main): Pass number of input files to Layout
14739 constructor. Don't pass options.
14740
154b857c
ILT
147412009-03-30 Ian Lance Taylor <iant@google.com>
14742
14743 * ffsll.c (ffsll): Correct implementation.
14744
2f35ab9b
ILT
147452009-03-27 Ian Lance Taylor <iant@google.com>
14746
fd03461a
ILT
14747 * ffsll.c: New file.
14748 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14749 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14750 * ftruncate.c (ftruncate): Declare before definition.
14751 * mremap.c (mremap): Likewise.
14752 * pread.c (pread): Likewise.
14753 * configure, Makefile.in, config.in: Rebuild.
14754
2f35ab9b
ILT
14755 * mremap.c: New file.
14756 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14757 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14758 (mremap): Declare if HAVE_MREMAP is not defined.
14759 * configure, Makefile.in, config.in: Rebuild.
14760
33aea2fd
CC
147612009-03-27 Cary Coutant <ccoutant@google.com>
14762
14763 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14764 position independent.
14765 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14766 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14767
6d479619
CC
147682009-03-24 Cary Coutant <ccoutant@google.com>
14769
14770 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14771 an executable.
14772 (needs_dynamic_reloc): Likewise.
14773
afc06bb8
ILT
147742009-03-24 Ian Lance Taylor <iant@google.com>
14775
14776 * yyscript.y (file_cmd): Recognize EXTERN.
14777 (extern_name_list, extern_name_list_body): New nonterminals.
14778 * script.cc (script_add_extern): Define.
14779 * script-c.h (script_add_extern): Declare.
14780
f6060a4d
ILT
147812009-03-24 Rafael Avila de Espindola <espindola@google.com>
14782
14783 * object.cc (is_elf_object): Define.
14784 * object.h (is_elf_object): Declare.
14785 * archive.cc (Archive::get_elf_object_for_member): Call
14786 is_elf_object.
33aea2fd 14787 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14788
26736d8e
ILT
147892009-03-24 Elliott Hughes <enh@google.com>
14790
14791 * output.cc (Output_file::map_anonymous): Define.
14792 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14793 try an anonymous one. Report the size if the mmap fails.
14794 * output.h (class Output_file): Declare map_anonymous.
14795
22fd9730
ILT
147962009-03-24 Ian Lance Taylor <iant@google.com>
14797
14798 * target-select.cc (instantiate_target): Don't acquire the lock if
14799 the instantiated_target_ field has already been set.
14800
cb010894
ILT
148012009-03-23 Ian Lance Taylor <iant@google.com>
14802
7f055c20
ILT
14803 * gold-threads.h (class Initialize_lock): Define.
14804 * gold-threads.cc (class Initialize_lock_once): Define.
14805 (initialize_lock_control): New static variable.
14806 (initialize_lock_pointer): New static variable.
14807 (initialize_lock_once): New static function.
14808 (Initialize_lock::Initialize_lock): Define.
14809 (Initialize_lock::initialize): Define.
14810 * target-select.h: Include "gold-threads.h".
14811 (class Target_selector): Add lock_ and initialize_lock_ fields.
14812 Don't define instantiate_target, just declare it.
14813 * target-select.cc (Target_selector::Target_selector): Initialize
14814 new fields.
14815 (Target_selector::instantiate_target): Define.
14816 * descriptors.h: Include "gold-threads.h".
14817 (class Descriptors): Add initialize_lock_ field.
14818 * descriptors.cc (Descriptors::Descriptors): Initialize new
14819 field.
14820 (Descriptors::open): Use initialize_lock_ field
14821 * errors.h (class Errors): Add initialize_lock_ field.
14822 * errors.cc (Errors::Errors): Initialize new field.
14823 (Errors::initialize_lock): Use initialize_lock_ field.
14824 * powerpc.cc (class Target_selector_powerpc): Remove
14825 instantiated_target_ field. In do_recognize call
14826 instantiate_target rather than do_instantiate_target. In
14827 do_instantiate_target just allocate a new target.
14828 * sparc.cc (class Target_selector_sparc): Likewise.
14829
36959681
ILT
14830 * freebsd.h: New file.
14831 * i386.cc: Include "freebsd.h".
14832 (Target_i386): Derive from Target_freebsd rather than
14833 Sized_target.
14834 (Target_selector_i386): Derive from Target_selector_freebsd rather
14835 than Target_selector.
14836 * x86_64.cc: Include "freebsd.h".
14837 (Target_x86_64): Derive from Target_freebsd rather than
14838 Sized_target.
14839 (Target_selector_x86_64): Derive from Target_selector_freebsd
14840 rather than Target_selector.
14841 * target.h (class Target): Add adjust_elf_header and
14842 do_adjust_elf_header.
14843 * output.cc (Output_file_header:: do_sized_write): Call target
14844 adjust_elf_header routine.
14845 * configure.tgt: Set targ_osabi.
14846 * configure.ac: Define GOLD_DEFAULT_OSABI.
14847 * parameters.cc (Parameters::default_target): Pass
14848 GOLD_DEFAULT_OSABI to select_target.
14849 * target-select.h (class Target_selector): Make instantiate_target
14850 protected rather than private.
14851 * Makefile.am (HFILES): Add freebsd.h.
14852 * configure, Makefile.in, config.in: Rebuild.
14853
cb010894
ILT
14854 * merge.cc (do_add_input_section): Correct pend value. Change
14855 message about last entry not being null terminated from error to
14856 warning.
14857
0e879927
ILT
148582009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14859
14860 * incremental.cc: New file.
14861 * Makefile.am (CCFILES): Add incremental.cc.
14862 * Makefile.in: Rebuild.
14863
41105937
PP
148642009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14865
14866 * layout.cc (Layout::output_section_name): Preserve names
14867 of '.note.' sections.
e1df38aa 14868
60439920
ILT
148692009-03-19 Ian Lance Taylor <iant@google.com>
14870
14871 * descriptors.cc (Descriptors::open): Check that the options are
14872 valid before using them.
14873
0d371ad3
ILT
148742009-03-18 Ian Lance Taylor <iant@google.com>
14875
14876 * script-sections.h: Include <list>.
14877 (class Script_sections): Change Sections_elements from std::vector
14878 to std::list. Typedef public Elements_iterator. Add
14879 orphan_section_placement_, data_segment_align_start_, and
14880 saw_data_segment_align_ fields. Remove data_segment_align_index_
14881 field.
14882 * script-sections.cc (class Orphan_section_placement): New class.
14883 (class Sections_element): Add virtual functions is_relro and
14884 orphan_section_init. Remove virtual function place_orphan_here.
14885 (class Output_section_definition): Add is_relro and
14886 orphan_section_init. Remove place_orphan_here.
14887 (class Orphan_output_section): Likewise.
14888 (Script_sections::Script_sections): Update for field changes.
14889 (Script_sections::data_segment_align): Set saw_data_segment_align_
14890 and data_segment_align_start_, not data_segment_align_index.
14891 (Script_sections::data_segment_relro_end): Check
14892 saw_data_segment_align_. Use data_segment_align_start_ rather
14893 than data_segment_align_index_.
14894 (Script_sections::place_orphan): Rewrite to use
14895 Orphan_section_placement.
14896
9201d894
ILT
148972009-03-17 Ian Lance Taylor <iant@google.com>
14898
9c5b8369
ILT
14899 * archive.cc (Archive::add_symbols): Check for a version attached
14900 to the symbol name in the archive map.
14901 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14902 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14903 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14904 (ver_test_11.a): New target.
14905 * testsuite/Makefile.in: Rebuild.
14906
9201d894
ILT
14907 * configure.ac: Check for chsize and posix_fallocate. Replace
14908 ftruncate.
14909 * ftruncate.c: New file, from gnulib.
14910 * output.cc (posix_fallocate): Define dummy version if not
14911 HAVE_POSIX_FALLOCATE.
14912 (Output_file::map): Call posix_fallocate rather than lseek and
14913 write.
14914 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14915 * configure, Makefile.in, config.in: Rebuild.
14916
ef4ab7a8 149172009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14918
ef4ab7a8
PP
14919 * layout.h (Layout::create_note): Add section_name parameter.
14920 * layout.cc (Layout::create_note): Likewise.
14921 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14922
8c500701
ILT
149232009-03-17 Ian Lance Taylor <iant@google.com>
14924
e85b18e1
ILT
14925 * descriptors.cc: Include "options.h".
14926 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14927 (Descriptors::open): Always use O_CLOEXEC when opening a new
14928 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14929 then set FD_CLOEXEC.
14930
9efe6174
ILT
14931 * sparc.cc (class Target_sparc): Add has_got_section.
14932 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14933 make sure we have a GOT section.
14934
14935 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14936 (Target_sparc::Scan::local): Likewise.
14937 (Target_sparc::Scan::global): Likewise.
14938 (Target_sparc::Relocate::relocate): Likewise.
14939 (Target_sparc::Relocate::relocate_tls): Likewise.
14940
8c500701
ILT
14941 * symtab.cc (Symbol_table::define_default_version): New function,
14942 broken out of add_from_object.
14943 (Symbol_table::add_from_object): Call define_default_version.
14944 (Symbol_table::define_special_symbol): Add resolve_oldsym
14945 parameter. Change all callers. If the version for a symbol comes
14946 from a version script, resolve it with the symbol with the same
14947 name with no version. Also add the symbol without a version if
14948 appropriate.
14949 (do_define_in_output_data): If resolving with oldsym, don't delete
14950 sym.
14951 (do_define_in_output_segment): Likewise.
14952 (do_define_as_constant): Likewise.
14953 * symtab.h (class Symbol_table): Update declarations.
14954
f1ed28fb
ILT
149552009-03-13 Ian Lance Taylor <iant@google.com>
14956
15f8229b
ILT
14957 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14958 (Read_symbols::requeue): New function.
14959 (Read_symbols::do_read_symbols): If make_elf_object fails because
14960 the target type is not configured, and the file was searched for,
14961 issue a warning and retry with the next directory.
14962 (Add_symbols::run): If the file has an incompatible format, and
14963 it was searched for, requeue the Read_symbols task. On error,
14964 release the object.
14965 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14966 dirindex parameter to constructor. Change all callers. Declare
14967 incompatible_warning and requeue.
14968 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14969 input_argument_ and input_group_ fields. Add them to
14970 constructor. Change all callers.
14971 (class Read_script): Add dirindex_ field. Add it to constructor.
14972 Change all callers.
14973 * archive.cc (Archive::setup): Remove input_objects parameter.
14974 Change all callers.
14975 (Archive::get_file_and_offset): Likewise.
14976 (Archive::read_all_symbols): Likewise.
14977 (Archive::read_symbols): Likewise.
14978 (Archive::get_elf_object_for_member): Remove input_objects
14979 parameter. Add punconfigured parameter. Change all callers.
14980 (Archive::add_symbols): Change return type to bool. Check return
14981 value of include_member.
14982 (Archive::include_all_members): Likewise.
14983 (Archive::include_member): Change return type to bool. Return
14984 false if first included object has incompatible target. Set
14985 included_member_ field.
14986 (Add_archive_symbols::run): If add_symbols returns false, requeue
14987 Read_symbols task.
14988 * archive.h (class Archive): Add included_member_ field.
14989 Initialize it in constructor. Add input_file and searched_for
14990 methods. Update declarations.
14991 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14992 input_argument_ fields. Add them to constructor. Change all
14993 callers.
14994 * script.cc: Include "target-select.h".
14995 (class Parser_closure): Add skip_on_incompatible_target_ and
14996 found_incompatible_target_ fields. Add
14997 skip_on_incompatible_target parameter to constructor. Change all
14998 callers. Add methods skip_on_incompatible_target,
14999 clear_skip_on_incompatible_target, found_incompatible_target, and
15000 set_found_incompatible_target.
15001 (read_input_script): Add dirindex parameter. Change all callers.
15002 If parser finds an incompatible target, requeue Read_symbols
15003 task.
15004 (script_set_symbol): Clear skip_on_incompatible_target in
15005 closure.
15006 (script_add_assertion, script_parse_option): Likewise.
15007 (script_start_sections, script_add_phdr): Likewise.
15008 (script_check_output_format): New function.
15009 * script.h (read_input_script): Update declaration.
15010 * script-c.h (script_check_output_format): Declare.
15011 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15012 (ignore_cmd): Remove OUTPUT_FORMAT.
15013 * fileread.cc (Input_file::Input_file): Add explicit this.
15014 (Input_file::will_search_for): New function.
15015 (Input_file::open): Add pindex parameter. Change all callers.
15016 * fileread.h (class Input_file): Add input_file_argument method.
15017 Declare will_search_for. Update declarations.
15018 * object.cc (make_elf_object): Add punconfigured parameter.
15019 Change all callers.
15020 * object.h (class Object): Make input_file public. Add
15021 searched_for method.
15022 (make_elf_object): Update declaration.
15023 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15024 restart search.
15025 * dirsearch.h (class Dirsearch): Update declaration.
15026 * options.h (class General_options): Add --warn-search-mismatch.
15027 * parameters.cc (Parameters::is_compatible_target): New function.
15028 * parameters.h (class Parameters): Declare is_compatible_target.
15029 * workqueue.cc (Workqueue::add_blocker): New function.
15030 * workqueue.h (class Workqueue): Declare add_blocker.
15031
f1ed28fb
ILT
15032 * fileread.cc (Input_file::open): Remove options parameter.
15033 Change all callers.
15034 (Input_file::open_binary): Likewise.
15035 * script.cc (read_input_script): Likewise.
15036 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15037 options parameter from constructor. Change all callers.
15038 (class Read_script): Likewise.
15039 * fileread.h (class Input_file): Update declarations.
15040 * script.h (read_input_script): Update declaration.
15041
34dd024a
NC
150422009-03-10 Nick Clifton <nickc@redhat.com>
15043
15044 * po/es.po: New Spanish translation.
15045
6d71b17c
CC
150462009-03-06 Cary Coutant <ccoutant@google.com>
15047
15048 * options.cc (parse_short_option): Keep dash_z from registering itself.
15049
031cdbed
ILT
150502009-03-03 Ian Lance Taylor <iant@google.com>
15051
15052 PR 9918
15053 * target-reloc.h (relocate_section): Pass output_section to
15054 relocate.
15055 * i386.cc (Target_i386::should_apply_static_reloc): Add
15056 output_section parameter. Change all callers.
15057 (Target_i386::Relocate::relocate): Add output_section parameter.
15058 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15059 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15060 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15061 * testsuite/two_file_shared.sh: New script.
15062 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15063 (check_DATA): Add two_file_shared.dbg.
15064 (two_file_shared.dbg): New target.
15065 * testsuite/Makefile.in: Rebuild.
15066
15d5fa16
ILT
150672009-03-01 Ian Lance Taylor <iant@google.com>
15068
15069 * configure.ac: Check for byteswap.h.
15070 * configure: Rebuild.
15071 * config.in: Rebuild.
15072
8a4c0b0d
ILT
150732009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15074
15075 * layout.cc (Layout::find_or_add_kept_section): New function.
15076 (Layout::add_comdat): Removed.
15077 * layout.h (struct Kept_section): Move out of class Layout.
15078 Remove trailing underscores from field names. Add group_sections
15079 field. Rename group_ field to is_group. Change all uses.
15080 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15081 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15082 comdat_groups_ field.
15083 (Sized_relobj::include_section_group): Use
15084 find_or_add_kept_section and Kept_section::group_sections.
15085 (Sized_relobj::include_linkonce_section): Likewise.
15086 * object.cc (class Sized_relobj): Don't define Comdat_group or
15087 Comdat_group_table. Remove find_comdat_group and
15088 add_comdat_group. Remove comdat_groups_ field.
15089 * plugin.cc (include_comdat_group): Use
15090 Layout::find_or_add_kept_section.
15091
b4ecf66b
ILT
150922009-02-28 Ian Lance Taylor <iant@google.com>
15093
14359ca0
ILT
15094 * README: --gc-sections and map files are now supported. Document
15095 some build requirements.
15096
b4ecf66b
ILT
15097 PR 6992
15098 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15099 relocatable link set the value of the section symbol to zero.
15100 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15101 relocatable link don't include the section address in the local
15102 symbol value.
15103
0602e05a
ILT
151042009-02-27 Ian Lance Taylor <iant@google.com>
15105
fd9d194f
ILT
15106 PR 6811
15107 * options.h (class Search_directory): Add is_system_directory.
15108 (class General_options): Declare is_in_system_directory.
15109 * options.cc (get_relative_sysroot): Make static.
15110 (get_default_sysroot): Make static.
15111 (General_optoins::is_in_system_directory): New function.
15112 * fileread.cc (Input_file::is_in_system_directory): New function.
15113 * fileread.h (class Input_file): Declare is_in_system_directory.
15114 * object.h (class Object): Add is_in_system_directory.
15115 (class Input_objects): Remove system_library_directory_ field.
15116 * object.cc (Input_objects::add_object): Don't set
15117 system_library_directory_.
15118 (input_objects::found_in_system_library_directory): Remove.
15119 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15120 parameter. Change all callers.
15121 (Symbol_table::sized_write_globals): Likewise.
15122 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15123 Call Object::is_in_system_directory.
15124 * symtab.h (class Symbol_table): Update declarations.
15125
61edd21f
ILT
15126 PR 5990
15127 * descriptors.h (Open_descriptor): Add is_on_stack field.
15128 * descriptors.cc (Descriptors::open): If the descriptor is on the
15129 top of the stack, remove it. Initialize is_on_stack field.
15130 (Descriptors::release): Only add pod to stack if it is not on the
15131 stack already.
15132 (Descriptors::close_some_descriptor): Clear stack_next and
15133 is_on_stack fields.
15134
e29e076a
ILT
15135 PR 7091
15136 * output.cc (Output_section::find_starting_output_address): Rename
15137 from starting_output_address; add PADDR parameter; change return
15138 type.
15139 * output.h (class Output_section): Declare
15140 find_starting_output_address instead of starting_output_address.
15141 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15142 section symbol for which we can't find a merge section.
15143
0602e05a
ILT
15144 PR 9836
15145 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15146 hidden or internal, force the symbol to be local.
15147 * resolve.cc (Symbol::override_visibility): Define.
15148 (Symbol::override_base): Use override_visibility.
15149 (Symbol_table::resolve): Likewise.
15150 (Symbol::override_base_with_special): Likewise.
15151 (Symbol_table::override_with_special): If the visibility is hidden
15152 or internal, force the symbol to be local.
15153 * symtab.h (class Symbol): Add set_visibility and
15154 override_visibility.
15155 * testsuite/ver_test_1.sh: New file.
15156 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15157 (check_DATA): Add ver_test_1.syms.
15158 (ver_test_1.syms): New target.
15159 * testsuite/Makefile.in: Rebuild.
15160
401a9a73
CC
151612009-02-25 Cary Coutant <ccoutant@google.com>
15162
15163 * layout.cc (Layout::choose_output_section): Don't rename sections
15164 when using a linker script that has a SECTIONS clause.
15165 * Makefile.in: Regenerate.
15166
15167 * testsuite/Makefile.am (script_test_5.sh): New test case.
15168 * testsuite/Makefile.in: Regenerate.
15169 * testsuite/script_test_5.cc: New file.
15170 * testsuite/script_test_5.sh: New file.
15171 * testsuite/script_test_5.t: New file.
15172
f488e4b0
CC
151732009-02-13 Rafael Avila de Espindola <espindola@google.com>
15174
15175 * archive.cc (Archive::include_member): Update calls to add_symbols.
15176 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15177 the Layout argument.
15178 * dynobj.h (do_add_symbols): Add the Layout argument.
15179 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15180 Layout argument.
15181 * object.h (Object::add_symbols): Add the Layout argument.
15182 (Object::do_add_symbols): Add the Layout argument.
15183 (Sized_relobj::do_add_symbols): Add the Layout argument.
15184 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15185 Unify the two versions.
15186 (Add_plugin_symbols): Remove.
15187 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15188 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15189 (Add_plugin_symbols): Remove.
15190 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15191 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15192 (Add_symbols::run): Make it work with Pulginobj.
15193
89dd1680
ILT
151942009-02-06 Ian Lance Taylor <iant@google.com>
15195
15196 * object.cc (Sized_relobj::do_layout): Make info message start
15197 with lower case letter.
15198
266d0a74
ILT
151992009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15200
602b464e
ILT
15201 * binary.cc: Fix file comment.
15202
266d0a74
ILT
15203 * options.h (enum Incremental_disposition): Define.
15204 (class General_options): Add new options: --incremental,
15205 --incremental_changed, --incremental_unchanged,
15206 --incremental_unknown. Add incremental_disposition_ and
15207 implicit_incremental_ fields.
15208 (General_options::incremental_disposition): New function.
15209 (class Position_dependent_options): Add incremental_disposition
15210 option.
15211 (Position_dependent_options::copy_from_options): Set incremental
15212 dispositions.
15213 * options.cc (General_options::parse_incremental_changed): New
15214 function.
2e702c99
RM
15215 (General_options::parse_incremental_unchanged): New function.
15216 (General_options::parse_incremental_unknown): New function.
15217 (General_options::General_options): Initialize new fields
266d0a74 15218 incremental_disposition_ and implicit_incremental_.
2e702c99 15219 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15220 without --incremental.
15221
f073bbf7
CD
152222009-02-06 Chris Demetriou <cgd@google.com>
15223
15224 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15225 pointer and to report location as the file name associated with
15226 the symbol.
15227 (gold_undefined_symbol_at_location): New function to replace the
15228 old gold_undefined_symbol functionality.
15229 * target-reloc.h (relocate_section): Update to use
15230 gold_undefined_symbol_at_location.
15231 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15232 Call gold_undefined_symbol function rather than gold_error.
15233 * errors.h (Errors::undefined_symbol): Take location as a
15234 string, rather than calculating it from a relocation.
15235 * errors.cc (Errors::fatal): Print "fatal error:" before the
15236 formatted message.
15237 (Errors::error, Errors::error_at_location): Print "error: "
15238 before the formatted message.
15239 (Errors::undefined_symbol): Take location as a string, rather
15240 than calculating it from a relocation.
15241 (gold_undefined_symbol_at_location): New function akin to
15242 old gold_undefined_symbol, calculates location from relocation.
15243 (gold_undefined_symbol): Change to take only a Symbol pointer
15244 and to report location as the file name associated with the symbol.
15245 * testsuite/debug_msg.sh: Update for changed error messages.
15246 * testsuite/undef_symbol.sh: Likewise.
15247
8e94a90c
ILT
152482009-02-04 Duncan Sands <baldrick@free.fr>
15249
15250 PR 9812
15251 * reduced_debug_output.h
15252 (Output_reduced_debug_abbrev_section::failed): Use format for
15253 gold_warning.
15254 (Output_reduced_debug_info_section::faild): Likewise.
15255
88a0e15b
ILT
152562009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15257
15258 * script.cc (Lazy_demangler): New class.
2e702c99 15259 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15260 symbol only once.
15261
5efc7cd2
CC
152622009-01-29 Cary Coutant <ccoutant@google.com>
15263
15264 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15265 to __tls_get_addr.
15266 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15267
e0ebcf42
ILT
152682009-01-28 Ian Lance Taylor <iant@google.com>
15269
5efc7cd2 15270 * version.cc (version_string): Bump to 1.9.
75fe7426 15271
e0ebcf42
ILT
15272 * gold.h: Include <cstring> and <stdint.h>.
15273 * version.cc: Include <cstdio>.
15274 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15275 warning.
15276 * reduced_debug_output.cc (insert_into_vector): Rename from
15277 Insert_into_vector; change all callers. Use Swap_unaligned to
15278 avoid aliasing issue; remove union since it is unnecessary.
15279
8e2813be 152802009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15281
15282 * Makefile.am (CCFILES): Add gc.cc.
15283 (HFILES): Add gc.h.
15284 * Makefile.in: Regenerate.
15285 * gold.cc (Gc_runner): New class.
15286 (queue_initial_tasks): Call garbage collection related tasks
15287 when corresponding options are invoked.
15288 (queue_middle_gc_tasks): New function.
15289 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15290 processed early before laying out sections during garbage collection.
15291 * gold.h (queue_middle_gc_tasks): New function.
15292 (is_prefix_of): Move from "layout.cc".
15293 * i386.cc (Target_i386::gc_process_relocs): New function.
15294 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15295 * main.cc (main): Create object of class "Garbage_collection".
15296 * object.cc (Relobj::copy_symbols_data): New function.
15297 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15298 (Sized_relobj::do_layout): Allow this function to be called twice
15299 during garbage collection and defer layout of section during the
6d03d481
ST
15300 first call.
15301 * object.h (Relobj::get_symbols_data): New function.
15302 (Relobj::is_section_name_included): New function.
15303 (Relobj::copy_symbols_data): New function.
15304 (Relobj::set_symbols_data): New function.
15305 (Relobj::get_relocs_data): New function.
15306 (Relobj::set_relocs_data): New function.
15307 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15308 (Relobj::gc_process_relocs): New function.
15309 (Relobj::do_gc_process_relocs): New pure virtual function.
15310 (Relobj::sd_): New data member.
15311 (Sized_relobj::is_output_section_offset_invalid): New function.
15312 (Sized_relobj::do_gc_process_relocs): New function.
15313 * options.h (General_options::gc_sections): Modify to not be a no-op.
15314 (General_options::print_gc_sections): New option.
15315 * plugin.cc (Plugin_finish::run): Remove function call to
15316 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15317 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15318 * reloc.cc (Read_relocs::run): Add task to process relocs and
15319 determine unreferenced sections when doing garbage collection.
15320 (Gc_process_relocs): New class.
15321 (Sized_relobj::do_gc_process_relocs): New function.
15322 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15323 sections that are garbage collected.
15324 * reloc.h (Gc_process_relocs): New class.
15325 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15326 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15327 symbols whose corresponding sections are garbage collected.
15328 (Symbol_table::Symbol_table): Add new parameter for the garbage
15329 collection object.
15330 (Symbol_table::gc_mark_undef_symbols): New function.
15331 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15332 (Symbol_table::gc_mark_dyn_syms): New function.
15333 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15334 as garbage.
15335 (Symbol_table::add_from_object): Likewise.
15336 (Symbol_table::add_from_relobj): When building shared objects, do not
15337 treat externally visible symbols as garbage.
15338 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15339 table information for static and relocatable links.
15340 * symtab.h (Symbol_table::set_gc): New function.
15341 (Symbol_table::gc): New function.
15342 (Symbol_table::gc_mark_undef_symbols): New function.
15343 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15344 (Symbol_table::gc_mark_dyn_syms): New function.
15345 (Symbol_table::gc_): New data member.
e1df38aa 15346 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15347 function.
15348 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15349 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15350
3b293544
CF
153512009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15352
15353 * options.h (General_options::gc_sections): Define as a no-op for now.
15354 (General_options::no_keep_memory): Ditto.
15355 (General_options::Bshareable): Define.
15356 * options.cc (General_options::finalize): Honor -Bshareable.
15357
83d22aa8
AS
153582009-01-20 Andreas Schwab <schwab@suse.de>
15359
15360 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15361 read the value in the contents, since we don't use it. Use the
15362 template endianness when writing.
15363 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15364
cd536b21
AS
153652009-01-19 Andreas Schwab <schwab@suse.de>
15366
15367 * configure.tgt (powerpc64-*): Fix targ_obj.
15368
99e9a495
ILT
153692009-01-15 Ian Lance Taylor <iant@google.com>
15370
15371 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15372 local symbols when stripping all symbols.
15373
bbbfea06
CC
153742009-01-14 Cary Coutant <ccoutant@google.com>
15375
99e9a495 15376 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15377
0f7c0701
CC
153782009-01-14 Cary Coutant <ccoutant@google.com>
15379
15380 * archive.cc (Archive::get_elf_object_for_member): Remove call
15381 to File_read::claim_for_plugin.
15382 * descriptors.cc (Descriptors::open): Remove reference to
15383 is_claimed.
15384 (Descriptors::claim_for_plugin): Remove.
15385 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15386 (Descriptors::is_claimed): Remove.
15387 (claim_descriptor_for_plugin): Remove.
15388 * fileread.cc (File_read::claim_for_plugin): Remove.
15389 * fileread.h (File_read::claim_for_plugin): Remove.
15390 (File_read::descriptor): Reopen descriptor if necessary.
15391 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15392 (Plugin_manager::all_symbols_read): Add task parameter. Change
15393 all callers.
15394 (Plugin_manager::get_input_file): New function.
15395 (Plugin_manager::release_input_file): New function.
15396 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15397 corresponding data member.
15398 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15399 and pass to base constructor. Change all callers.
15400 (get_input_file, release_input_file): New functions.
15401 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15402 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15403 (Plugin_manager::all_symbols_read): Add task parameter.
15404 (Plugin_manager::get_input_file): New function.
15405 (Plugin_manager::release_input_file): New function.
15406 (Plugin_manager::task_): New data member.
15407 (Pluginobj::Pluginobj): Add filesize parameter.
15408 (Pluginobj::filename): New function.
15409 (Pluginobj::descriptor): New function.
15410 (Pluginobj::filesize): New function.
15411 (Pluginobj::filesize_): New data member.
15412 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15413 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15414 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15415
15416 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15417 with archive libraries.
15418 * testsuite/Makefile.in: Regenerate.
15419 * testsuite/plugin_test.c (struct sym_info): New type.
15420 (get_input_file, release_input_file): New static variables.
15421 (onload): Capture new transfer vector entries.
15422 (claim_file_hook): Stop reading at end of file according to filesize.
15423 Factor out parsing of readelf output into separate function.
15424 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15425 APIs and get the source file name from the symbol table. Convert
15426 source file name to corresponding object file name. Print info
15427 message when adding new input files.
15428 (parse_readelf_line): New function.
15429 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15430 * testsuite/plugin_test_2.sh: Likewise.
15431 * testsuite/plugin_test_3.sh: Likewise.
15432 * testsuite/plugin_test_4.sh: New test case.
15433
62a6d109
ILT
154342009-01-07 Ian Lance Taylor <iant@google.com>
15435
15436 * version.cc (version_string): Bump to 1.8.
15437
483620e8
CC
154382008-12-23 Cary Coutant <ccoutant@google.com>
15439
15440 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15441 * plugin.cc (Plugin_manager::finish): Rename as
15442 layout_deferred_objects. Move cleanup to separate function.
15443 (Plugin_manager::cleanup): New function.
15444 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15445 separately.
15446 * plugin.h (Plugin_manager::finish): Rename as
15447 layout_deferred_objects.
15448 (Plugin_manager::cleanup): New function.
15449 (Plugin_manager::cleanup_done): New field.
15450
d66a9eb3
CC
154512008-12-23 Cary Coutant <ccoutant@google.com>
15452
15453 * plugin.cc (is_visible_from_outside): New function.
15454 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15455 so we don't return "IR only" status for exported symbols or -r links.
15456
15457 * testsuite/Makefile.am (plugin_test_3): New test case.
15458 * testsuite/Makefile.in: Regenerate.
15459 * testsuite/plugin_test_3.sh: New file.
15460
5995b570
CC
154612008-12-22 Cary Coutant <ccoutant@google.com>
15462
15463 * object.cc (Sized_relobj::layout_section): New function.
15464 (Sized_relobj::do_layout): Defer layout of input sections until after
15465 plugin has provided replacement files.
15466 (Sized_relobj::do_layout_deferred_sections): New function.
15467 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15468 (Relobj::layout_deferred_sections): New function.
15469 (Relobj::do_layout_deferred_sections): New function.
15470 (Sized_relobj::do_layout_deferred_sections): New function.
15471 (Sized_relobj::layout_section): New function.
15472 (Sized_relobj::Deferred_layout): New structure.
15473 (Sized_relobj::deferred_layout_): New field.
15474 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15475 Change all callers. Layout deferred sections.
15476 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15477 references.
15478 (Plugin_hook::run): Move code from do_plugin_hook inline.
15479 (Plugin_hook::do_plugin_hook): Remove.
15480 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15481 (Plugin_manager::finish): Renamed, was cleanup.
15482 (Plugin_manager::should_defer_layout): New function.
15483 (Plugin_manager::add_deferred_layout_object): New function.
15484 (Plugin_manager::Deferred_layout_list): New type.
15485 (Plugin_manager::deferred_layout_objects_): New field.
15486 (Plugin_hook::do_plugin_hook): Remove.
15487
ee769c88
ILT
154882008-12-17 Ian Lance Taylor <iant@google.com>
15489
15490 * options.h (class General_options): Add --no case for
15491 --export-dynamic.
15492
abc8dcba
CC
154932008-12-16 Cary Coutant <ccoutant@google.com>
15494
15495 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15496 vector.
15497 (Plugin_manager::claim_file): Create plugin object even if
15498 plugin did not call the add_symbols callback.
15499 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15500 asking for more symbols than were added.
15501 * testsuite/Makefile.am (plugin_test_1): Add test case with
15502 no global symbols.
15503 (empty.syms): New target.
15504 * testsuite/Makefile.in: Regenerate.
15505 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15506 message. Don't call add_symbols if no globals.
15507 (all_symbols_read_hook): Don't provide replacement for empty
15508 claimed file.
15509
b0074644
ILT
155102008-12-12 Ian Lance Taylor <iant@google.com>
15511
68943102
ILT
15512 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15513 r_type == 0 for a local symbol with r_sym == 0.
15514 (scan_relocatable_relocs): Pass r_sym to
15515 local_non_section_strategy.
15516 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15517 r_sym parameter.
15518
b0074644
ILT
15519 * configure.ac: Update test for TLS descriptors: they are
15520 supported as of glibc 2.9.
15521 * configure: Rebuild.
15522
c2508178
ILT
155232008-12-11 Ian Lance Taylor <iant@google.com>
15524
15525 PR 7091
15526 * target-reloc.h (Default_scan_relocatable_relocs): For each
15527 function, map r_type == 0 to RELOC_DISCARD.
15528
2756a258
CC
155292008-12-10 Cary Coutant <ccoutant@google.com>
15530
15531 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15532 object to override a kept COMDAT group from a plugin object.
15533
bb6f53d3
ILT
155342008-12-09 Ian Lance Taylor <iant@google.com>
15535
fbc558e1
ILT
15536 PR 7088
15537 * yyscript.y (file_cmd): Handle INPUT.
15538
bb6f53d3
ILT
15539 * testsuite/initpri1.c: Change all declarations to be full
15540 prototypes by adding void, to avoid compiler warnings.
15541
4674ecfc
CC
155422008-12-05 Rafael Avila de Espindola <espindola@google.com>
15543
15544 * options.cc (General_options::parse_plugin_opt): New.
15545 (General_options::add_plugin): The argument now is just the filename.
15546 (General_options::add_plugin_option): New.
15547 * options.h (plugin_opt): New.
15548 (add_plugin): Change argument name.
15549 (add_plugin_option): New.
15550 * plugin.cc (Plugin::load): Don't parse the plugin option.
15551 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15552 (Plugin::add_option): New.
15553 (Plugin::args_): Change type.
15554 (Plugin::filename_): New.
15555 (Plugin_manager::add_plugin_option): New.
15556 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15557 * testsuite/Makefile.in: Regenerate.
15558
fd06b4aa
CC
155592008-12-05 Cary Coutant <ccoutant@google.com>
15560
15561 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15562 Handle --strip-lto-sections option.
15563 * options.h (strip_lto_sections): New option.
15564
6c52134c
CC
155652008-12-01 Cary Coutant <ccoutant@google.com>
15566
15567 * plugin.cc (ld_plugin_message): Change format parameter to const.
15568 Fix mismatch between new[] and delete.
15569
a45248e0
CC
155702008-11-14 Cary Coutant <ccoutant@google.com>
15571
15572 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15573 instead of -1U.
15574
c82fbeee
CS
155752008-11-05 Craig Silverstein <csilvers@google.com>
15576
15577 * options.cc (General_options::parse_dynamic_list): New function.
15578 * options.h (General_options): New flags dynamic_list,
15579 dynamic_list_data, dynamic_list_cpp_new, and
15580 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15581 (General_options::in_dynamic_list): New function.
15582 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15583 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15584 (Lex::can_continue_name): Likewise.
15585 (yylex): Likewise.
15586 (read_script_file): New parameter script_options.
15587 (read_dynamic_list): New function.
15588 (Script_options::define_dynamic_list): New function.
15589 (dynamic_list_keyword_parsecodes): New variable.
15590 (dynamic_list_keywords): New variable.
15591 * script.h (Script_options::define_dynamic_list): New function
15592 prototype.
15593 (read_dynamic_list): New function prototype.
15594 * symtab.cc (strprefix): New macro.
15595 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15596 dynamic_list_data, dynamic_list_cpp_new, and
15597 dynamic_list_cpp_typeinfo.
15598 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15599 (dynamic_list_expr): New rule.
15600 (dynamic_list_nodes): Likewise.
15601 (dynamic_list_node): Likewise.
15602 * testsuite/Makefile.am (dynamic_list): New test.
15603 * testsuite/Makefile.in: Regenerated.
15604 * testsuite/dynamic_list.t: New file.
15605 * testsuite/dynamic_list.sh: New file.
15606
e0bb29a5
CS
156072008-11-05 Craig Silverstein <csilvers@google.com>
15608
15609 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15610 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15611 (t11_last): Likewise.
15612 * testsuite/ver_test_6.c (main): Likewise.
15613
4e1e25e0
CC
156142008-10-07 Cary Coutant <ccoutant@google.com>
15615
15616 * options.c (General_options::finalize): Add check for -static and
15617 -shared.
15618 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15619 is not empty.
15620
92f03fcb
CC
156212008-10-02 Cary Coutant <ccoutant@google.com>
15622
15623 * plugin.cc (make_sized_plugin_object): Fix conditional
15624 compilation to work when not all targets are enabled.
15625
fbd8a257
CC
156262008-09-29 Cary Coutant <ccoutant@google.com>
15627
15628 * archive.cc (Archive::get_file_and_offset): Use filename instead
15629 of name to get library path.
15630 (Archive::include_member): Unlock external member of a thin archive.
15631
15632 * testsuite/Makefile.am (TEST_AR): New variable.
15633 (thin_archive_test_1): New test.
15634 (thin_archive_test_2): New test.
81636b3f
CC
15635 * testsuite/Makefile.in: Regenerate.
15636 * testsuite/thin_archive_main.cc: New file.
15637 * testsuite/thin_archive_test_1.cc: New file.
15638 * testsuite/thin_archive_test_2.cc: New file.
15639 * testsuite/thin_archive_test_3.cc: New file.
15640 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15641
eff45813
CC
156422008-09-29 Cary Coutant <ccoutant@google.com>
15643
15644 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15645 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15646 instead of -1U.
15647 (Sized_relobj::do_finalize_local_symbols): Likewise.
15648 (Sized_relobj::map_to_kept_section): Likewise.
15649 * object.h (Sized_relobj::invalid_address): New constant.
15650 (Sized_relobj::do_output_section_offset): Check for invalid_address
15651 and return -1ULL.
15652 * output.cc (Output_reloc::local_section_offset): Use constant
15653 invalid_address instead of -1U.
15654 (Output_reloc::get_address): Likewise.
15655 (Output_section::output_address): Change -1U to -1ULL.
15656 * output.h (Output_reloc::invalid_address): New constant.
15657 * reloc.cc (Sized_relobj::write_sections): Use constant
15658 invalid_address instead of -1U.
15659 (Sized_relobj::relocate_sections): Likewise.
15660 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15661 values for merge sections.
15662 * target-reloc.h (relocate_for_relocatable): Use constant
15663 invalid_address instead of -1U.
15664
89fc3421
CC
156652008-09-19 Cary Coutant <ccoutant@google.com>
15666
15667 Add plugin functionality for link-time optimization (LTO).
15668 * configure.ac (plugins): Add --enable-plugins option.
15669 * configure: Regenerate.
15670 * config.in: Regenerate.
15671 * Makefile.am (LIBDL): New variable.
15672 (CCFILES): Add plugin.cc.
15673 (HFILES): Add plugin.h.
15674 (ldadd_var): Add LIBDL.
15675 * Makefile.in: Regenerate.
15676
15677 * archive.cc: Include "plugin.h".
15678 (Archive::setup): Don't preread archive symbols when using a plugin.
15679 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15680 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15681 files.
15682 (Archive::include_member): Add symbols from plugin objects.
15683 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15684 * descriptors.cc (Descriptors::open): Check for file descriptors
15685 abandoned by plugins.
15686 (Descriptors::claim_for_plugin): New function.
15687 * descriptors.h (Descriptors::claim_for_plugin): New function.
15688 (Open_descriptor::is_claimed): New field.
15689 (claim_descriptor_for_plugin): New function.
15690 * fileread.cc (File_read::claim_for_plugin): New function.
15691 * fileread.h (File_read::claim_for_plugin): New function.
15692 (File_read::descriptor): New function.
15693 * gold.cc: Include "plugin.h".
15694 (queue_initial_tasks): Add task to call plugin hooks for generating
15695 new object files.
15696 * main.cc: Include "plugin.h".
15697 (main): Load plugin libraries.
15698 * object.h (Pluginobj): Declare.
15699 (Object::pluginobj): New function.
15700 (Object::do_pluginobj): New function.
15701 (Object::set_target): New function.
15702 * options.cc: Include "plugin.h".
15703 (General_options::parse_plugin): New function.
15704 (General_options::General_options): Initialize plugins_ field.
15705 (General_options::add_plugin): New function.
15706 * options.h (Plugin_manager): Declare.
15707 (General_options): Add --plugin option.
15708 (General_options::has_plugins): New function.
15709 (General_options::plugins): New function.
15710 (General_options::add_plugin): New function.
15711 (General_options::plugins_): New field.
15712 * plugin.cc: New file.
15713 * plugin.h: New file.
15714 * readsyms.cc: Include "plugin.h".
15715 (Read_symbols::do_read_symbols): Check for archive before checking
15716 for ELF file. Call plugin hooks to claim files.
15717 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15718 from a real object file; force override when processing replacement
15719 files.
15720 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15721 (Symbol::init_base_object): Likewise.
15722 (Symbol::init_base_output_data): Likewise.
15723 (Symbol::init_base_output_segment): Likewise.
15724 (Symbol::init_base_constant): Likewise.
15725 (Symbol::init_base_undefined): Likewise.
15726 (Symbol::output_section): Assert that object is not a plugin.
15727 (Symbol_table::add_from_pluginobj): New function.
15728 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15729 undefined.
15730 (Symbol_table::sized_write_globals): Likewise.
15731 (Symbol_table::add_from_pluginobj): Instantiate template.
15732 * symtab.h (Sized_pluginobj): Declare.
15733 (Symbol::in_real_elf): New function.
15734 (Symbol::set_in_real_elf): New function.
15735 (Symbol::in_real_elf_): New field.
15736 (Symbol_table::add_from_pluginobj): New function.
15737
15738 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15739 (LIBDL): New variable.
15740 (LDADD): Add LIBDL.
15741 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15742 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15743 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15744 (MOSTLYCLEANFILES): Likewise.
15745 * testsuite/Makefile.in: Regenerate.
15746 * testsuite/plugin_test.c: New file.
15747 * testsuite/plugin_test_1.sh: New file.
15748 * testsuite/plugin_test_2.sh: New file.
15749
de31bda5
ILT
157502008-09-16 Ian Lance Taylor <iant@google.com>
15751
9c2d0ef9
ILT
15752 * target-reloc.h (relocate_section): Check whether a symbol is
15753 defined by the ABI before reporting an undefined symbol error.
15754 * target.h (Target::is_defined_by_abi): Make parameter const.
15755 (Target::do_is_defined_by_abi): Likewise.
15756 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15757 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15758 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15759 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15760 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15761 * testsuite/Makefile.in: Rebuild.
15762
de31bda5
ILT
15763 * fileread.cc (make_view): Add casts to avoid warning.
15764
9fa33bee
AO
157652008-09-16 Alexandre Oliva <aoliva@redhat.com>
15766
15767 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15768 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15769
183fd0e3
AO
157702008-09-16 Alexandre Oliva <aoliva@redhat.com>
15771
15772 * options.h (General_options::output_is_executable): New.
15773 (General_options::output_is_pie): New.
15774 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15775 for shared libraries.
15776 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15777
7be8330a
CD
157782008-09-11 Chris Demetriou <cgd@google.com>
15779
15780 * options.h (origin): New -z option.
15781 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15782 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15783 in DT_FLAGS_1.
15784
a9caad02
CC
157852008-09-05 Cary Coutant <ccoutant@google.com>
15786
15787 * fileread.cc (File_read::make_view): Add check for attempt to map
15788 beyond end of file.
15789
ae6dce4d
CC
157902008-09-05 Cary Coutant <ccoutant@google.com>
15791
15792 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15793 explicit instantiations.
15794
d7ab2a47
KVH
157952008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15796
15797 PR gold/6858
15798 * options.cc (General_options::finalize): Allow undefined symbols
15799 in shlibs if linking -shared.
15800
15801 PR gold/6859
15802 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15803 symbols as not needing a dynsym entry.
15804
1e52a9c1
CS
158052008-08-20 Craig Silverstein <csilvers@google.com>
15806
15807 * fileread.cc (File_read::open): Do not lock the file unless it
15808 was successfully opened.
15809
d85c80a3
CC
158102008-08-14 Cary Coutant <ccoutant@google.com>
15811
15812 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15813 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15814 * testsuite/tls_test.cc (struct int128): 128-bit struct
15815 for testing TLS relocs with non-zero addend.
15816 (v12): New TLS variable.
15817 (t12): New test.
15818 (t_last): Add check for v12.
15819 * testsuite/tls_test.h (t12): New function.
15820 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15821
2d924fd9
ILT
158222008-08-13 Ian Lance Taylor <iant@google.com>
15823
15824 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15825 set tls_segment_ or relro_segment_.
15826 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15827 when appropriate.
15828 * output.h (Output_section::clear_is_relro): New function.
15829 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15830 sections specially even when output_data_ is empty.
15831 (Output_segment::maximum_alignment): When first section is relro,
15832 only force alignment for PT_LOAD segments.
15833 * script.cc (script_data_segment_align): New function.
15834 (script_data_segment_relro_end): New function.
15835 * script-c.h (script_data_segment_align): Declare.
15836 (script_data_segment_relro_end): Declare.
15837 * script-sections.h (class Script_sections): Declare
15838 data_segment_align and data_segment_relro_end. Add fields
15839 segment_align_index_ and saw_relro_end_.
15840 * script-sections.cc (class Sections_element): Add set_is_relro
15841 virtual function. Add new bool* parameter to place_orphan_here.
15842 Add get_output_section virtual function.
15843 (class Output_section_definition): Add set_is_relro. Add new
15844 bool* parameter to place_orphan_here. Add get_output_section.
15845 Add is_relro_ field.
15846 (Output_section_definition::Output_section_definition): Initialize
15847 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15848 and is_relro_ fields.
15849 (Output_section_definition::place_orphan_here): Add is_relro
15850 parameter.
15851 (Output_section_definition::set_section_addresses): Set relro for
15852 output section.
15853 (Output_section_definition::alternate_constraint): Likewise.
15854 (class Orphan_output_section): Add new bool* parameter to
15855 place_orphan_here. Add get_output_section.
15856 (Orphan_output_section::place_orphan_here): Add is_relro
15857 parameter.
15858 (Script_sections::Script_sections): Initialize
15859 data_segment_align_index_ and saw_relro_end_.
15860 (Script_sections::data_segment_align): New function.
15861 (Script_sections::data_segment_relro_end): New function.
15862 (Script_sections::place_orphan): Set or clear is_relro.
15863 (Script_sections::set_section_addresses): Force alignment of first
15864 TLS section.
15865 * yyscript.y (exp): Call script_data_segment_align and
15866 script_data_segment_relro_end.
15867 * testsuite/relro_script_test.t: New file.
15868 * testsuite/relro_test.cc (using_script): Declare.
15869 (t1, t2): Test using_script.
15870 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15871 (relro_script_test_SOURCES): Define.
15872 (relro_script_test_DEPENDENCIES): Define.
15873 (relro_script_test_LDFLAGS): Define.
15874 (relro_script_test_LDADD): Define.
15875 (relro_script_test.so): New target.
15876 * testsuite/Makefile.in: Rebuild.
15877
f827c9a9
CC
158782008-08-06 Cary Coutant <ccoutant@google.com>
15879
15880 * archive.cc (Archive::total_archives, Archive::total_members)
15881 (Archive::total_members_loaded): New variables.
15882 (Archive::setup): Add parameter. Add option to preread
15883 archive symbols.
15884 (Archive::read_armap): Add counter.
15885 (Archive::get_file_and_offset): New function.
15886 (Archive::get_elf_object_for_member): New function.
15887 (Archive::read_all_symbols): New function.
15888 (Archive::read_symbols): New function.
15889 (Archive::add_symbols): Add counters.
15890 (Archive::include_all_members): Use armap to find members if it's
15891 already built.
15892 (Archive::include_member): Skip reading symbols if already read.
15893 Factored code into Archive::get_file_and_offset and
15894 Archive::get_elf_object_for_member. Changed call to
15895 Mapfile::report_include_archive_member.
15896 (Archive::print_stats): New function.
15897 * archive.h: Declare Object and Read_symbols_data classes.
15898 (Archive::Archive): Add initializers for new members.
15899 (Archive::setup): Add parameter.
15900 (Archive::print_stats): New function.
15901 (Archive::total_archives, Archive::total_members)
15902 (Archive::total_members_loaded): New variables.
15903 (Archive::get_file_and_offset): New function.
15904 (Archive::get_elf_object_for_member): New function.
15905 (Archive::read_all_symbols): New function.
15906 (Archive::read_symbols): New function.
15907 (Archive::Archive_member): New class.
15908 (Archive::members_): New member.
15909 (Archive::num_members_): New member.
15910 * main.cc: Include archive.h.
15911 (main): Call Archive::print_stats.
15912 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15913 archive parameter; member_name is now the fully-decorated name.
15914 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15915 * options.h: (General_options): Add --preread-archive-symbols option.
15916 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15917 Archive::setup.
15918
de4c45bd
ILT
159192008-08-04 Ian Lance Taylor <iant@google.com>
15920
15921 * symtab.h (Symbol::use_plt_offset): New function.
15922 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15923 * powerpc.cc (Relocate::relocate): Likewise.
15924 * sparc.cc (Relocate::relocate): Likewise.
15925 * x86_64.cc (Relocate::relocate): Likewise.
15926 * testsuite/weak_plt.sh: New test.
15927 * testsuite/weak_plt_main.cc: New test.
15928 * testsuite/weak_plt_shared.cc: New test.
15929 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15930 (check_PROGRAMS): Add weak_plt.
15931 (check_DATA): Add weak_plt_shared.so.
15932 (weak_plt_main_pic.o, weak_plt): New targets.
15933 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15934 * testsuite/Makefile.in: Rebuild.
15935
15936 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15937 gcctestdir/ld.
15938 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15939 * testsuite/Makefile.in: Rebuild.
15940
323ee3f4
AM
159412008-08-04 Alan Modra <amodra@bigpond.net.au>
15942
15943 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15944 * Makefile.in: Regenerate.
15945 * po/POTFILES.in: Regenerate.
15946
7c07ecec
ILT
159472008-07-29 Ian Lance Taylor <iant@google.com>
15948
15949 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15950 symbols before other symbols.
15951 * testsuite/script_test_2.cc (test_addr): Declare.
15952 (test_addr_alias): Declare.
15953 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15954 values.
7c07ecec
ILT
15955 * testsuite/script_test_2.t: Define test_addr_alias and
15956 test_addr.
15957
5778530e
ILT
159582008-07-24 Ian Lance Taylor <iant@google.com>
15959
2a00e4fb
ILT
15960 PR 5990
15961 * descriptors.cc: New file.
15962 * descriptors.h: New file.
15963 * gold-threads.h (class Hold_optional_lock): New class.
15964 * fileread.cc: Include "descriptors.h".
15965 (File_read::~File_read): Release descriptor rather than closing
15966 it.
15967 (File_read::open) [file]: Call open_descriptor rather than open.
15968 Set is_descriptor_opened_.
15969 (File_read::open) [memory]: Assert that descriptor is not open.
15970 (File_read::reopen_descriptor): New function.
15971 (File_read::release): Release descriptor.
15972 (File_read::do_read): Make non-const. Reopen descriptor.
15973 (File_read::read): Make non-const.
15974 (File_read::make_view): Reopen descriptor.
15975 (File_read::do_readv): Likewise.
15976 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15977 Update declarations.
15978 * layout.cc: Include "descriptors.h".
15979 (Layout::create_build_id): Use open_descriptor rather than open.
15980 * output.cc: Include "descriptors.h".
15981 (Output_file::open): Use open_descriptor rather than open.
15982 * archive.cc (Archive::const_iterator): Change Archive to be
15983 non-const.
15984 (Archive::begin, Archive::end): Make non-const.
15985 (Archive::count_members): Likewise.
15986 * archive.h (class Archive): Update declarations.
15987 * object.h (Object::read): Make non-const.
15988 * Makefile.am (CCFILES): Add descriptors.cc.
15989 (HFILES): Add descriptors.h.
15990 * Makefile.in: Rebuild.
15991
801647d1
ILT
15992 PR 6716
15993 * gold.h: Always include <clocale>. Add Solaris workarounds
15994 following code in binutils/sysdep.h.
15995
5edd166e
ILT
15996 PR 6048
15997 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15998 this->eh_frame_hdr_ is NULL before using it.
15999
c89ad728
ILT
16000 * dynobj.cc (Versions::Versions): Update comment.
16001
aa86f06b
ILT
16002 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16003 the base version name.
16004
5778530e
ILT
16005 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16006 array size plus one.
16007 (Stringpool_template::set_string_offsets): Subtract one from key
16008 before using it as an array index.
16009 (Stringpool_template::get_offset_with_length): Likewise.
16010 (Stringpool_template::write_to_buffer): Likewise.
16011 * stringpool.h (Stringpool_template::get_offset_from_key):
16012 Likewise.
16013
057ead22
ILT
160142008-07-23 Ian Lance Taylor <iant@google.com>
16015
7f649c59
ILT
16016 PR 6658
16017 * object.h (Merged_symbol_value::value): Do our best to handle a
16018 negative addend.
16019
057ead22
ILT
16020 PR 6647
16021 * script.cc (Version_script_info::get_versions): Don't add empty
16022 version tag to return value.
16023 (Version_script_info::get_symbol_version_helper): Change return
16024 type to bool. Add pversion parameter. Change all callers.
16025 (script_register_vers_node): Don't require a non-NULL tag.
16026 * script.h (class Version_script_info): Update declarations.
16027 (Version_script_info::get_symbol_version): Change return type to
16028 bool. Add version parameter. Change all callers.
16029 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16030 handling. Handle an empty version from a version script.
16031 (Symbol_table::define_special_symbol): Likewise.
16032 * testsuite/ver_test_10.script: New file.
16033 * testsuite/ver_test_10.sh: New file.
16034 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16035 (check_DATA): Add ver_test_10.syms.
16036 (ver_test_10.syms, ver_test_10.so): New target.
16037 * testsuite/Makefile.in: Rebuild.
16038
58e54ac2
CD
160392008-07-23 Simon Baldwin <simonb@google.com>
16040
16041 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16042 to zero for undefined symbols from dynamic libraries.
16043
95d14cd3
ILT
160442008-07-23 Ian Lance Taylor <iant@google.com>
16045
16046 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16047 Change all callers.
16048 * symtab.h (class Symbol_table): Update declaration.
16049 * testsuite/ver_test_9.cc: New file.
16050 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16051 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16052 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16053 (ver_test_9.so, ver_test_9.o): New targets.
16054 * testsuite/Makefile.in: Rebuild.
16055
92de84a6
ILT
160562008-07-22 Ian Lance Taylor <iant@google.com>
16057
34810851
ILT
16058 * options.h (class General_options): Define --check-sections.
16059 * layout.cc (Layout::set_segment_offsets): Handle
16060 --check-sections.
16061
af6156ef
ILT
16062 * options.h (class General_options): Define -n/--nmagic and
16063 -N/--omagic.
16064 * options.cc (General_options::finalize): For -n/--nmagic or
16065 -N/--omagic, set -static.
16066 * layout.cc (Layout::attach_allocated_section_to_segment): If
16067 -N/--omagic, don't put read-only and read-write sections in
16068 different segments.
16069 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16070 finding a read-only segment.
16071 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16072 don't set the minimum segment alignment to the common page size,
16073 and don't set the file offset to the address modulo the page size.
16074 * script-sections.cc (Script_sections::create_segments): If
16075 -n/--omagic, don't put read-only and read-write sections in
16076 different segments.
16077
92de84a6
ILT
16078 * cref.cc: New file.
16079 * cref.h: New file.
16080 * options.h (class General_options): Add --print-symbol-counts.
16081 * main.cc (main): Issue defined symbol report if requested.
16082 * archive.cc (Archive::interpret_header): Make into a const member
16083 function.
16084 (Archive::add_symbols): Call Input_objects::archive_start and
16085 archive_stop.
16086 (Archive::const_iterator): Define new class.
16087 (Archive::begin, Archive::end): New functions.
16088 (Archive::include_all_members): Rewrite to use iterator.
16089 (Archive::count_members): New function.
16090 * archive.h (class Archive): Update declarations.
16091 (Archive::filename): New function.
16092 * object.cc: Include "cref.h".
16093 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16094 (Sized_relobj::do_get_global_symbol_counts): New function.
16095 (Input_objects::add_object): Add object to cross-referencer.
16096 (Input_objects::archive_start): New function.
16097 (Input_objects::archive_stop): New function.
16098 (Input_objects::print_symbol_counts): New function.
16099 * object.h: Declare Cref and Archive.
16100 (Object::get_global_symbol_counts): New function.
16101 (Object::do_get_global_symbol_counts): New pure virtual function.
16102 (class Sized_relobj): Add defined_count_ field. Update
16103 declarations.
16104 (class Input_objects): Add cref_ field. Update constructor.
16105 Update declarations.
16106 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16107 defined_count_.
16108 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16109 symbol counts.
16110 (Sized_dynobj::do_get_global_symbol_counts): New function.
16111 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16112 defined_count_. Update declarations. Define Symbols typedef.
16113 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16114 parameter. Change all callers.
16115 (Symbol_table::add_from_dynobj): Add sympointers and defined
16116 parameters. Change all callers.
16117 * symtab.h (class Symbol_table): Update declarations.
16118 * Makefile.am (CCFILES): Add cref.cc.
16119 (HFILES): Add cref.h.
16120 * Makefile.in: Rebuild.
16121
3f7c5e1d
CD
161222008-07-22 Simon Baldwin <simonb@google.com>
16123
16124 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16125 to zero when writing undefined symbols.
16126
e0b64032
ILT
161272008-07-22 Ian Lance Taylor <iant@google.com>
16128
16129 * output.cc (Output_section::add_input_section): Don't try to
16130 merge empty merge sections.
16131
096b02cf
CS
161322008-07-21 Craig Silverstein <csilvers@google.com>
16133
16134 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16135 Include symbol version in error message.
cd536b21 16136
1d1f116d
CD
161372008-07-20 Chris Demetriou <cgd@google.com>
16138
cd536b21 16139 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16140 (RANDOM_SEED_CFLAGS): New substituted variable.
16141 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16142 * configure: Rebuild.
16143 * Makefile.in: Likewise.
16144 * testsuite/Makefile.in: Likewise.
16145
a18f591e
ILT
161462008-07-18 Ian Lance Taylor <iant@google.com>
16147
16148 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16149 where we see NAME/NULL and NAME/VERSION as separate symbols.
16150 * testsuite/ver_test_main.cc (main): Call t4.
16151 (t4, t4_2a): Define.
16152 * testsuite/ver_test_2.cc (t4_2): Define.
16153 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16154 * testsuite/ver_test_4.cc (t4_2a): Define.
16155 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16156 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16157
c6e3f6ed
ILT
161582008-07-17 Ian Lance Taylor <iant@google.com>
16159
16160 * dynobj.cc (Versions::add_def): If we give an error about a
16161 missing version, go ahead and create the version anyhow.
16162
ef9beddf
ILT
161632008-07-10 Ian Lance Taylor <iant@google.com>
16164
16165 Handle output sections with more than 0x7fffffff bytes.
16166 * object.h (class Relobj): Change map_to_output_ to
16167 output_sections_, and just keep a section pointer. Change all
16168 uses. Move comdat group support to Sized_relobj.
16169 (Relobj::is_section_specially_mapped): Remove.
16170 (Relobj::output_section): Remove poff parameter. Change all
16171 callers.
16172 (Relobj::output_section_offset): New function.
16173 (Relobj::set_section_offset): Rewrite.
16174 (Relobj::map_to_output): Remove.
16175 (Relobj::output_sections): New function.
16176 (Relobj::do_output_section_offset): New pure virtual function.
16177 (Relobj::do_set_section_offset): Likewise.
16178 (class Sized_relobj): Add section_offsets_ field. Add comdat
16179 group support from Relobj. Update declarations.
16180 (Sized_relobj::get_output_section_offset): New function.
16181 (Sized_relobj::do_output_section_offset): New function.
16182 (Sized_relobj::do_set_section_offset): New function.
16183 * object.cc (Relobj::output_section_address): Remove.
16184 (Sized_relobj::Sized_relobj): Initialize new fields.
16185 (Sized_relobj::include_section_group): Cast find_kept_object to
16186 Sized_relobj.
16187 (Sized_relobj::include_linkonce_section): Likewise.
16188 (Sized_relobj::do_layout): Use separate arrays for output section
16189 and output offset.
16190 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16191 output_sections.
16192 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16193 output_sections and section_offsets.
16194 (Sized_relobj::write_local_symbols): Likewise.
16195 (map_to_kept_section): Compute output address directly.
16196 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16197 output_sections and section_offsets.
16198 (Sized_relobj::write_sections): Likewise.
16199 (Sized_relobj::relocate_sections): Likewise.
16200 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16201 * output.h (class Output_reloc): Update declarations. Change
16202 u2_.relobj to Sized_relobj*.
16203 (class Output_data_reloc): Change add functions to use
16204 Sized_relobj*.
16205 * output.cc (Output_reloc::Output_reloc): Change relobj to
16206 Sized_relobj*.
16207 (Output_reloc::local_section_offset): Change return type to
16208 Elf_Addr. Use get_output_section_offset.
16209 (Output_reloc::get_address): Likewise.
16210 (Output_section::is_input_address_mapped): Don't call
16211 is_section_specially_mapped.
16212 (Output_section::output_offset): Likewise.
16213 (Output_section::output_address): Likewise.
16214 (Output_section::starting_output_address): Likewise.
16215 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16216 parameter to Sized_relobj*.
16217 (Copy_relocs::need_copy_reloc): Likewise.
16218 (Copy_relocs::save): Likewise.
16219 * copy-relocs.h (class Copy_relocs): Update declarations.
16220 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16221 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16222 * target-reloc.h (relocate_for_relocatable): Change
16223 offset_in_output_section type to Elf_Addr. Change code that uses
16224 it as well.
16225 * layout.cc (Layout::layout): Always set *off.
16226 * mapfile.cc (Mapfile::print_input_section): Use
16227 output_section_offset.
16228 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16229 Sized_relobj*.
16230 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16231 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16232 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16233
5cb66f97
ILT
162342008-07-03 Ian Lance Taylor <iant@google.com>
16235
16236 * layout.cc (Layout::include_section): Do not discard unrecognized
16237 SHT_STRTAB sections.
16238
afe47622
CS
162392008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16240
16241 * script.cc (Lex::can_continue_name): Make '?' allowable in
16242 version-script names.
16243 * testsuite/version_script.map: Change glob pattern to use '?'
16244
5adf9721
ILT
162452008-06-30 Manish Singh <yosh@gimp.org>
16246
16247 PR 6585
16248 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16249 Correct typo.
16250
e6fde208
ILT
162512008-06-30 Ian Lance Taylor <iant@google.com>
16252
16253 PR 6660
16254 PR 6682
16255 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16256 versions]: Don't try to read the value in the contents, since we
16257 don't use it. Use the template endianness when writing.
16258
3f2e6a2d
CC
162592008-06-25 Cary Coutant <ccoutant@google.com>
16260
16261 * fileread.cc (File_read::make_view): Assert on zero-length view.
16262 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16263 symbol table when there are no symbols to read.
16264
c43d3a48
CS
162652008-06-23 Craig Silverstein <csilvers@google.com>
16266
16267 * version.cc (version_string): Bump to 1.7
16268
5f494ea0
CS
162692008-06-18 Craig Silverstein <csilvers@google.com>
16270
16271 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16272 constant 0xFFFF to type Valtype.
16273 (Powerpc_relocate_functions::rel16_ha): Likewise.
16274
c42e122e
ILT
162752008-06-17 Ian Lance Taylor <iant@google.com>
16276
f34787f8
ILT
16277 * output.h (Output_section::Input_section): Initialize p2align_ to
16278 zero for Output_section_data constructors.
16279 (Output_section::Input_section::addralign): If not an input
16280 section, return the alignment of the Output_section_data.
16281 * testsuite/copy_test.cc: New file.
16282 * testsuite/copy_test_1.cc: New file.
16283 * testsuite/copy_test_2.cc: New file.
16284 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16285 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16286 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16287 (copy_test_1_pic.o, copy_test_1.so): New targets.
16288 (copy_test_2_pic.o, copy_test_2.so): New targets.
16289 * testsuite/Makefile.in: Rebuild.
16290
c42e122e
ILT
16291 * script-sections.cc (Script_sections::place_orphan): Initialize
16292 local variable exact.
16293
ce3ac18a
DE
162942008-06-13 David Edelsohn <edelsohn@gnu.org>
16295
16296 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16297
42cacb20
DE
162982008-06-12 David Edelsohn <edelsohn@gnu.org>
16299 David S. Miller <davem@davemloft.net>
16300
16301 * powerpc.cc: New file.
16302 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16303 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16304 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16305 * Makefile.in: Rebuild.
16306
7b308235
ILT
163072008-06-09 Ian Lance Taylor <iant@google.com>
16308
16309 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16310 <exception>.
16311 (throwing, orig_terminate): New static variables.
16312 (terminate_handler): New static function.
16313 (t2): Set terminate handler.
16314
f0b886e3
ILT
163152008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16316
16317 PR 6584
cd536b21 16318 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16319 alignment.
16320
3e90f135
CC
163212008-05-30 Cary Coutant <ccoutant@google.com>
16322
16323 * archive.cc (Archive::include_all_members) Correct to step
16324 over symbol table and extended name table in thin archives.
16325
e09ad04a
ILT
163262008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16327
16328 PR 6407
16329 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16330 calculation.
16331
62b01cb5
ILT
163322008-05-28 Caleb Howe <cshowe@google.com>
16333
16334 * reduced_debug_output.cc: New file.
16335 * reduced_debug_output.h: New file.
92de84a6 16336 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16337 * options.cc (General_options::finalize): Add strip_debug_non_line
16338 to the strip heirarchy.
16339 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16340 fields.
16341 * layout.cc: Include "reduced_debug_output.h".
16342 (Layout::Layout): Initialize new fields.
16343 (line_only_debug_sections): New static array.
16344 (is_lines_only_debug_sections): New static inline function.
16345 (Layout::include_section): Handle --strip-debug-non-line.
16346 (Layout::make_output_section): If --strip-debug-non-line, build
16347 new output sections for .debug_abbrev and .debug_info.
16348 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16349 gold. Warn about possible overflow.
16350 (read_signed_LEB_128): Likewise.
16351 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16352 (read_signed_LEB_128): Declare.
16353 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16354 (HFILES): Add reduced_debug_output.h.
16355 * Makefile.in: Rebuild.
16356
7d9e3d98
ILT
163572008-05-21 Ian Lance Taylor <iant@google.com>
16358
16359 * mapfile.cc: New file.
16360 * mapfile.h: New file.
16361 * options.h (class General_options): Add -M/--print-map and -Map.
16362 * options.cc (General_options::finalize): Make -M equivalent to
16363 -Map -.
16364 * main.cc: Include <cstdio> and "mapfile.h".
16365 (main): Open mapfile if requested.
16366 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16367 constructor. Change caller.
16368 (queue_initial_tasks): Add mapfile parameter. Change caller.
16369 (queue_middle_tasks): Likewise.
16370 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16371 declarations.
16372 * archive.cc: Include "mapfile.h".
16373 (Archive::add_symbols): Add mapfile parameter. Change all
16374 callers. Pass mapfile, symbol, and reason to include_member.
16375 (Archive::include_all_members): Add mapfile parameter. Change all
16376 callers.
16377 (Archive::include_member): Add mapfile, sym, and why parameters.
16378 Change all callers. Report inclusion to map file.
16379 * archive.h: Include "fileread.h".
16380 (class Archive): Update declarations.
16381 (Archive::file): New const method.
16382 (class Add_archive_symbols): Add mapfile_ field. Update
16383 constructor. Change all callers.
16384 * readsyms.h (class Read_symbols): Likewise.
16385 (class Finish_group): Likewise.
16386 (class Read_script): Likewise.
16387 * common.cc: Include "mapfile.h".
16388 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16389 all callers.
16390 (Symbol_table::do_allocate_commons): Likewise.
16391 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16392 symbol allocation to mapfile.
16393 * common.h (class Allocate_commons_task): Add mapfile_ field.
16394 Update constructor. Change all callers.
16395 * symtab.h (class Symbol_table): Update declarations.
16396 * layout.cc: Include "mapfile.h".
16397 (Layout_task_runner::run): Print information to mapfile.
16398 (Layout::create_gold_note): Change Output_data_fixed_space to
16399 Output_data_zero_fill.
16400 (Layout::create_build_id): Likewise.
16401 (Layout::print_to_mapfile): New function.
16402 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16403 constructor. Change caller.
16404 (class Layout): Declare print_to_mapfile.
16405 * output.cc (Output_section::Input_section::print_to_mapfile): New
16406 function.
16407 (Output_section::add_input_section): If producing a map, always
16408 add to input_sections_ list.
16409 (Output_section::do_print_to_mapfile): New function.
16410 (Output_segment::print_sections_to_mapfile): New function.
16411 (Output_segment::print_section_list_to_mapfile): New function.
16412 * output.h: Include "mapfile.h".
16413 (Output_data::print_to_mapfile): New function.
16414 (Output_data::do_print_to_mapfile): New virtual function.
16415 (Output_segment_headers::do_print_to_mapfile): New function.
16416 (Output_file_header::do_print_to_mapfile): New function.
16417 (Output_data_const::do_print_to_mapfile): New function.
16418 (class Output_data_const_buffer): Add map_name_ field. Update
16419 constructor. Change all callers. Add do_print_to_mapfile
16420 function.
16421 (class Output_data_fixed_space): Likewise.
16422 (class Output_data_space): Likewise.
16423 (class Output_data_zero_fill): New class.
16424 (Output_data_strtab::do_print_to_mapfile): New function.
16425 (Output_data_reloc_base::do_print_to_mapfile): New function.
16426 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16427 (Output_data_group::do_print_to_mapfile): New function.
16428 (Output_data_got::do_print_to_mapfile): New function.
16429 (Output_data_dynamic::do_print_to_mapfile): New function.
16430 (Output_symtab_xindex::do_print_to_mapfile): New function.
16431 (class Output_section): Declare do_print_to_mapflie. Declare
16432 print_to_mapfile in Input_section.
16433 (class Output_segment): Declare new functions.
16434 * object.h (Sized_relobj::symbol_count): New function.
16435 * script-sections.cc
16436 (Output_section_element_dot_assignment::set_section_addresses):
16437 Change Output_data_fixed_space to Output_data_zero_fill.
16438 (Output_data_expression::do_print_to_mapfile): New function.
16439 * script.cc (read_input_script): Add mapfile parameter. Change
16440 all callers.
16441 * script.h (read_input_script): Update declaration.
16442 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16443 (Eh_frame::do_print_to_mapfile): New function.
16444 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16445 (Output_merge_string::do_print_to_mapfile): New function.
16446 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16447 function.
16448 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16449 function.
16450 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16451 function.
16452 * Makefile.am (CCFILES): Add mapfile.cc.
16453 (HFILES): Add mapfile.h.
16454 * Makefile.in: Rebuild.
16455
9f1d377b
ILT
164562008-05-19 Ian Lance Taylor <iant@google.com>
16457
16458 * options.h (class General_options): Add -z relro.
16459 * layout.cc (Layout::Layout): Initialize relro_segment_.
16460 (Layout::add_output_section_data): Return the output section.
16461 (Layout::make_output_section): Rcognize relro sections and mark
16462 them appropriately.
16463 (Layout::attach_allocated_section_to_segment): Put relro sections
16464 in a PT_GNU_RELRO segment.
16465 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16466 section as relro.
16467 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16468 PT_TLS segments.
16469 (Layout::linkonce_mapping): Map d.rel.ro.local to
16470 .data.rel.ro.local.
16471 (Layout::output_section_name): Us .data.rel.ro.local for any
16472 section which begins with that.
16473 * layout.h (class Layout): Update add_output_section_data
16474 declaration. Add relro_segment_ field.
16475 * output.cc (Output_section::Output_section): Initialize is_relro_
16476 and is_relro_local_ fields.
16477 (Output_segment::add_output_section): Group relro sections.
16478 (Output_segment::is_first_section_relro): New function.
16479 (Output_segment::maximum_alignment): If there is a relro section,
16480 align the segment to the common page size.
16481 (Output_segment::set_section_addresses): Track whether we are
16482 looking at relro sections. If the last section is a relro
16483 section, align to the common page size.
16484 (Output_segment::set_section_list_addresses): Add in_relro
16485 parameter. Change all callers. Align to the page size when
16486 moving from relro to non-relro section.
16487 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16488 segment.
16489 * output.h (class Output_section): Add is_relro_ and
16490 is_relro_local_ fields.
16491 (Output_section::is_relro): New function.
16492 (Output_section::set_is_relro): New function.
16493 (Output_section::is_relro_local): New function.
16494 (Output_section::set_is_relro_local): New function.
16495 (class Output_segment): Update declarations.
16496 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16497 * sparc.cc (Target_sparc::got_section): Likewise.
16498 * x86_64.cc (Target_x86_64::got_section): Likewise.
16499 * testsuite/relro_test_main.cc: New file.
16500 * testsuite/relro_test.cc: New file.
16501 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16502 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16503 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16504 (relro_test.so, relro_test_pic.o): New targets.
16505 * testsuite/Makefile.in: Rebuild.
16506
a984ee1d
ILT
165072008-05-16 Ian Lance Taylor <iant@google.com>
16508
01676dcd
ILT
16509 * output.cc (Output_segment::add_output_section): Remove front
16510 parameter.
16511 * output.h (class Output_segment): Remove
16512 add_initial_output_section and overloaded add_output_section.
16513 Update declaration of remaining add_output_section.
16514 * layout.cc (Layout::create_interp): Call add_output_section
16515 rather than add_initial_output_section.
16516 (Layout::finish_dynamic_section): Likewise.
16517
497897f9
ILT
16518 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16519 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16520 know the dynamic type.
16521 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16522 field. Initialize it in constructor.
16523 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16524 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16525 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16526 reloc.
16527
a984ee1d
ILT
16528 * output.cc (Output_reloc::get_address): Change return type to
16529 Elf_Addr.
16530 * output.h (class Output_reloc): Update get_address declaration.
16531 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16532 for section addresses.
16533
55ba0940
ILT
165342008-05-09 Ian Lance Taylor <iant@google.com>
16535
16536 PR 6493
16537 * gold.cc (gold_nomem): Use return value of write.
16538
75517b77
ILT
165392008-05-08 Ian Lance Taylor <iant@google.com>
16540
16541 * symtab.c (Symbol::init_base_output_data): Add version
16542 parameter. Change all callers.
16543 (Symbol::init_base_output_segment): Likewise.
16544 (Symbol::init_base_constant): Likewise.
16545 (Symbol::init_base_undefined): Likewise.
16546 (Sized_symbol::init_output_data): Likewise.
16547 (Sized_symbol::init_output_segment): Likewise.
16548 (Sized_symbol::init_constant): Likewise.
16549 (Sized_symbol::init_undefined): Likewise.
16550 (Symbol_table::do_define_in_output_data): If the new symbol has a
16551 version, mark it as the default.
16552 (Symbol_table::do_define_in_output_segment): Likewise.
16553 (Symbol_table::do_define_as_constant): Likewise.
16554 * symtab.h (class Symbol): Update declarations.
16555 (class Sized_symbol): Likewise.
16556 * resolve.cc (Symbol::override_version): New function.
c42e122e 16557 (Symbol::override_base): Call override_version.
75517b77
ILT
16558 (Symbol::override_base_with_special): Likewise.
16559 * testsuite/ver_script_8.script: New file.
16560 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16561 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16562 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16563 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16564
f1f70eae
ILT
165652008-05-06 Ian Lance Taylor <iant@google.com>
16566
f3e9c5c5
ILT
16567 PR 6049
16568 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16569 functions.
16570 (class General_options): Remove existing --undefined, and add
16571 --no-undefined instead. Add new --undefined as synonym for -u.
16572 * archive.cc (Archive::add_symbols): Check whether symbol was
16573 named with -u.
16574 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16575 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16576 all uses. Add IS_UNDEFINED. Update declarations to split
16577 different versions of init_base. Declare init_base_undefined.
16578 (Symbol::is_defined): Handle IS_UNDEFINED.
16579 (Symbol::is_undefined): Likewise.
16580 (Symbol::is_weak_undefined): Call is_undefined.
16581 (Symbol::is_absolute): Handle IS_CONSTANT.
16582 (class Sized_symbol): Update declarations to split different
16583 versions of init. Declare init_undefined.
16584 (class Symbol_table): Declare new functions.
16585 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16586 Change all callers.
16587 (Symbol::init_base_output_data): Likewise.
16588 (Symbol::init_base_output_segment): Likewise.
16589 (Symbol::init_base_constant): Likewise.
16590 (Symbol::init_base_undefined): New function.
16591 (Sized_symbol::init_object): Rename from init. Change all
16592 callers.
16593 (Sized_symbol::init_output_data): Likewise.
16594 (Sized_symbol::init_output_segment): Likewise.
16595 (Sized_symbol::init_constant): Likewise.
16596 (Sized_symbol::init_undefined): New function.
16597 (Symbol_table::add_undefined_symbols_from_command_line): New
16598 function.
16599 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16600 function.
16601 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16602 (Symbol::output_section): Likewise.
16603 (Symbol::set_output_section): Likewise.
16604 (Symbol_table::sized_finalize_symbol): Likewise.
16605 (Symbol_table::sized_write_globals): Likewise.
16606 * resolve.cc (Symbol_table::should_override): Likewise.
16607 (Symbol::override_base_with_special): Likewise.
16608
8bdcdf2c
ILT
16609 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16610 symbol, change it to have default visibility.
16611 * testsuite/protected_1.cc: New file.
16612 * testsuite/protected_2.cc: New file.
16613 * testsuite/protected_3.cc: New file.
16614 * testsuite/protected_main_1.cc: New file.
16615 * testsuite/protected_main_2.cc: New file.
16616 * testsuite/protected_main_3.cc: New file.
16617 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16618 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16619 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16620 (protected_1.so): New target.
16621 (protected_1_pic.o, protected_2_pic.o): New targets.
16622 (protected_3_pic.o): New target.
16623 (check_PROGRAMS): Add protected_2.
16624 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16625 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16626 * testsuite/Makefile.in: Rebuild.
16627
2b706932
ILT
16628 * options.h (DEFINE_var): Add set_user_set_##varname__.
16629 (DEFINE_bool_alias): New macro.
16630 (class General_options): Define -Bstatic using DEFINE_bool_alias
16631 rather than DEFINE_special. Add --undefined as an alias for -z
16632 defs.
16633 * options.cc (General_options::parse_Bstatic): Remove.
16634
d82a5bcc
ILT
16635 * options.h (class General_options): Add --fatal-warnings.
16636 * main.cc (main): Implement --fatal-warnings.
16637 * errors.h (Errors::warning_count): New function.
16638
f1f70eae
ILT
16639 * options.h (class General_options): Add -Bsymbolic-functions.
16640 * symtab.h (Symbol::is_preemptible): Check for
16641 -Bsymbolic-functions.
16642
8825ac63
ILT
166432008-05-05 Ian Lance Taylor <iant@google.com>
16644
d98bc257
ILT
16645 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16646 as noVARNAME rather than no-VARNAME.
16647 (class General_options): Add option -z combreloc.
16648 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16649 get_address.
16650 (Output_reloc::sort_before) [SHT_REL]: New function.
16651 (Output_reloc::sort_before) [SHT_RELA]: New function.
16652 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16653 Sort_relocs_comparison.
16654 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16655 parameter. Change all callers.
16656 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16657 sort_relocs parameter. Change all callers.
16658 * output.cc (Output_reloc::get_address): New function, broken out
16659 of write_rel.
16660 (Output_reloc::write_rel): Call it.
16661 (Output_reloc::compare): New function.
16662 (Output_data_reloc_base::do_write): Optionally sort relocs.
16663
60b2b4e7
ILT
16664 * configure.ac: If targ_extra_obj is set, link it in.
16665 * configure.tgt: Initialize all variables.
16666 (x86_64*): Set targ_extra_obj and targ_extra_size.
16667 * configure: Rebuild.
16668
8825ac63
ILT
16669 * object.cc (Sized_relobj::include_section_group): Adjust section
16670 indexes read from group data. Build vector to pass to
16671 layout_group.
16672 * layout.cc (Layout::layout_group): Add flags and shndxes
16673 parameters. Remove contents parameter. Change caller. Update
16674 explicit instantiations.
16675 * layout.h (class Layout): Update layout_group declaration.
16676 * output.cc (Output_data_group::Output_data_group): Add flags and
16677 input_shndxes parameters. Remove contents parameter. Change
16678 caller.
16679 (Output_data_group::do_write): Change input_sections_ to
16680 input_shndxes_.
16681 * output.h (class Output_data_group): Update constructor
16682 declaration. Rename input_sections_ to input_shndxes_.
16683 * testsuite/many_sections_test.cc: Add template.
16684
e94cf127
CC
166852008-04-30 Cary Coutant <ccoutant@google.com>
16686
4418b2d5
CC
16687 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16688
e94cf127
CC
16689 * layout.cc (Layout::include_section): Refactored check for debug
16690 info section.
16691 (Layout::add_comdat): Add new parameters. Change type
16692 of signature parameter. Add object and shndx to signatures table.
16693 (Layout::find_kept_object): New function.
16694 * layout.h: Include <cstring>.
16695 (Layout::is_debug_info_section): New function.
16696 (Layout::add_comdat): Add new parameters.
16697 (Layout::find_kept_object): New function.
16698 (Layout::Kept_section): New struct.
16699 (Layout::Signatures): Change type of map range.
16700 * object.cc (Relobj::output_section_address): New function.
16701 (Sized_relobj::include_section_group): Add new parameters. Change
16702 calls to Layout::add_comdat. Change to build table of kept comdat
16703 groups and table mapping discarded sections to kept sections.
16704 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16705 (Sized_relobj::do_layout): Change calls to include_section_group and
16706 include_linkonce_section.
16707 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16708 value to zero when section is discarded.
16709 (Sized_relobj::map_to_kept_section): New function.
16710 * object.h (Relobj::output_section_address): New function.
16711 (Relobj::Comdat_group): New type.
16712 (Relobj::find_comdat_group): New function.
16713 (Relobj::Comdat_group_table): New type.
16714 (Relobj::Kept_comdat_section): New type.
16715 (Relobj::Kept_comdat_section_table): New type.
16716 (Relobj::add_comdat_group): New function.
16717 (Relobj::set_kept_comdat_section): New function.
16718 (Relobj::get_kept_comdat_section): New function.
16719 (Relobj::comdat_groups_): New field.
16720 (Relobj::kept_comdat_sections_): New field.
16721 (Symbol_value::input_value): Update comment.
16722 (Sized_relobj::map_to_kept_section) New function.
16723 (Sized_relobj::include_linkonce_section): Add new parameter.
16724 * target-reloc.h (Comdat_behavior): New type.
16725 (get_comdat_behavior): New function.
16726 (relocate_section): Add code to map a discarded section to the
16727 corresponding kept section when applying a relocation.
16728
e4e5049b
CS
167292008-04-30 Craig Silverstein <csilvers@google.com>
16730
16731 * dwarf_reader.cc (next_generation_count): New static var.
16732 (Addr2line_cache_entry): New struct.
16733 (addr2line_cache): New static var.
16734 (Dwarf_line_info::one_addr2line): Added caching.
16735 (Dwarf_line_info::clear_addr2line_cache): New function.
16736 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16737 cache-size parameter.
16738 (Dwarf_line_info::one_addr2line_cache): New function.
16739 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16740 new cache-size argument to one_addr2line(), and clear cache.
16741
d09e9154
CC
167422008-04-28 Cary Coutant <ccoutant@google.com>
16743
16744 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16745 R_386_PC8 relocations.
16746
7ef73768
ILT
167472008-04-23 Ian Lance Taylor <iant@google.com>
16748
55438702
ILT
16749 * object.cc (Sized_relobj::include_section_group): Check for
16750 invalid section group.
16751
c165fb93
ILT
16752 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16753 header size.
16754
7ef73768
ILT
16755 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16756 than read for file header.
16757 * archive.cc (Archive::include_member): Likewise.
16758
6194aaab
L
167592008-04-23 Paolo Bonzini <bonzini@gnu.org>
16760
16761 * aclocal.m4: Regenerate.
16762 * configure: Regenerate.
16763
d491d34e
ILT
167642008-04-19 Ian Lance Taylor <iant@google.com>
16765
5ea2bac6
ILT
16766 * version.cc (version_string): Bump to 1.6.
16767
7bc3e21a
ILT
16768 * testsuite/Makefile.am (many_sections_r_test): New target.
16769 (many_sections_r_test_SOURCES): Remove.
16770 (many_sections_r_test_DEPENDENCIES): Remove.
16771 (many_sections_r_test_LDFLAGS): Remove.
16772 (many_sections_r_test_LDADD): Remove.
16773
7fcd3aa9
ILT
16774 * object.cc (Sized_relobj::do_add_symbols): Always pass
16775 local_symbol_count_ to add_from_relobj.
16776
4c94d6ae
ILT
16777 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16778 every thousand variables.
16779 * testsuite/Makefile.in: Rebuild.
16780
d491d34e
ILT
16781 * object.cc (Xindex::initialize_symtab_xindex): New function.
16782 (Xindex::read_symtab_xindex): New function.
16783 (Xindex::sym_xindex_to_shndx): New function.
16784 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16785 available.
16786 (Sized_relobj::do_initialize_xindex): New function.
16787 (Sized_relobj::do_read_symbols): Adjust section links.
16788 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16789 parameter. Change all callers.
16790 (Sized_relobj::include_section_group): Adjust section links and
16791 symbol section indexes.
16792 (Sized_relobj::do_layout): Adjust section links.
16793 (Sized_relobj::do_count_local_symbols): Adjust section links and
16794 symbol section indexes.
16795 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16796 ordinary and special symbols.
16797 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16798 dynsym_xindex parameters. Change all callers. Adjust section
16799 links. Use SHN_XINDEX when needed.
16800 (Sized_relobj::get_symbol_location_info): Adjust section links.
16801 Don't get fooled by special symbols.
16802 * object.h (class Xindex): Define.
16803 (class Object): Add xindex_ parameter. Declare virtual functoin
16804 do_initialize_xindex.
16805 (Object::adjust_sym_shndx): New function.
16806 (Object::set_xindex): New protected function.
16807 (class Symbol_value): Add is_ordinary_shndx_ field.
16808 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16809 (Symbol_value::value): Assert ordinary section.
16810 (Symbol_value::initialize_input_to_output_map): Likewise.
16811 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16812 Change all callers.
16813 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16814 all callers.
16815 (class Sized_relobj): Update declarations.
16816 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16817 parameter. Change all callers.
16818 (Sized_relobj::adjust_shndx): New function.
16819 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16820 field.
16821 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16822 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16823 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16824 (Sized_dynobj::read_dynsym_section): Adjust section links.
16825 (Sized_dynobj::read_dynamic): Likewise.
16826 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16827 section links.
16828 (Sized_dynobj::do_initialize_xindex): New function.
16829 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16830 do_initialize_xindex.
16831 (Sized_dynobj::adjust_shndx): New function.
16832 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16833 dynsym_xindex_ fields.
16834 (Layout::finalize): Add a call to set_section_indexes before
16835 creating the symtab sections.
16836 (Layout::set_section_indexes): Don't do anything if the section
16837 already has a section index.
16838 (Layout::create_symtab_sections): Add shnum parameter. Change
16839 caller. Create .symtab_shndx section if needed.
16840 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16841 caller.
16842 (Layout::allocated_output_section_count): New function.
16843 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16844 needed.
16845 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16846 fields. Update declarations.
16847 (Layout::symtab_xindex): New function.
16848 (Layout::dynsym_xindex): New function.
16849 (class Write_symbols_task): Add layout_ field.
16850 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16851 Change caller.
16852 * output.cc (Output_section_headers::Output_section_headers): Add
16853 shstrtab_section parameter. Change all callers.
16854 (Output_section_headers::do_sized_write): Store overflow values
16855 for section count and section string table section index in
16856 section header zero.
16857 (Output_file_header::do_sized_write): Check for overflow of
16858 section count and section string table section index.
16859 (Output_symtab_xindex::do_write): New function.
16860 (Output_symtab_xindex::endian_do_write): New function.
16861 * output.h (class Output_section_headers): Add shstrtab_section_.
16862 Update declarations.
16863 (class Output_symtab_xindex): Define.
16864 (Output_section::has_out_shndx): New function.
16865 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16866 field.
16867 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16868 Change all callers.
16869 (Sized_symbol::init): Likewise.
16870 (Symbol::output_section): Check for ordinary symbol.
16871 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16872 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16873 callers.
16874 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16875 Change all callers. Simplify handling of symbols from sections
16876 not included in the link.
16877 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16878 distinction.
16879 (Weak_alias_sorter::operator()): Assert that symbols are
16880 ordinary.
16881 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16882 distinction.
16883 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16884 parameters. Change all callers.
16885 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16886 symbol distinction. Use SHN_XINDEX when needed.
16887 (Symbol_table::write_section_symbol): Add symtab_xindex
16888 parameter. Change all callers.
16889 (Symbol_table::sized_write_section_symbol): Likewise. Use
16890 SHN_XINDEX when needed.
16891 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16892 declarations.
16893 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16894 (Symbol::is_defined): Check is_ordinary.
16895 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16896 (Symbol::is_absolute, Symbol::is_common): Likewise.
16897 (class Sized_symbol): Update declarations.
16898 (class Symbol_table): Update declarations.
16899 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16900 parameters. Change all callers.
16901 (Sized_symbol::override): Likewise.
16902 (Symbol_table::override): Likewise.
16903 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16904 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16905 is_ordinary, and orig_st_shndx parameters. Change all callers.
16906 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16907 to be in an ordinary section.
16908 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16909 object and is_ordinary parameters. Change all callers.
16910 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16911 Change all callers. Don't add undefined or non-ordinary symbols
16912 to reloc_map_.
16913 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16914 Change all callers.
16915 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16916 declarations.
16917 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16918 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16919 (Sized_relobj::relocate_sections): Likewise.
16920 * target-reloc.h (scan_relocs): Adjust section symbol index.
16921 (scan_relocatable_relocs): Likewise.
16922 * i386.cc (Scan::local): Check for ordinary symbols.
16923 * sparc.cc (Scan::local): Likewise.
16924 * x86_64.cc (Scan::local): Likewise.
16925 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16926 to symbol_section_and_value.
16927 * testsuite/many_sections_test.cc: New file.
16928 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16929 (check_PROGRAMS): Add many_sections_test.
16930 (many_sections_test_SOURCES): Define.
16931 (many_sections_test_DEPENDENCIES): Define.
16932 (many_sections_test_LDFLAGS): Define.
16933 (BUILT_SOURCES): Add many_sections_define.h.
16934 (many_sections_define.h): New target.
16935 (BUILT_SOURCES): Add many_sections_check.h.
16936 (many_sections_check.h): New target.
16937 (check_PROGRAMS): Add many_sections_r_test.
16938 (many_sections_r_test_SOURCES): Define.
16939 (many_sections_r_test_DEPENDENCIES): Define.
16940 (many_sections_r_test_LDFLAGS): Define.
16941 (many_sections_r_test_LDADD): Define.
16942 (many_sections_r_test.o): New target.
16943 * testsuite/Makefile.in: Rebuild.
16944
c5818ff1
CC
169452008-04-17 Cary Coutant <ccoutant@google.com>
16946
16947 * errors.cc (Errors::info): New function.
16948 (gold_info): New function.
16949 * errors.h (Errors::info): New function.
16950 * gold.h (gold_info): New function.
16951 * object.cc (Input_objects::add_object): Print trace output.
16952 * options.cc (options::parse_set): New function.
16953 (General_options::parse_wrap): Deleted.
16954 (General_options::General_options): Deleted initializer.
16955 * options.h (options::String_set): New typedef.
16956 (options::parse_set): New function.
16957 (DEFINE_set): New macro.
16958 (General_options::wrap): Changed to use DEFINE_set. Changed
16959 callers of any_wrap_symbols and is_wrap_symbol.
16960 (General_options::trace, General_options::trace_symbol):
16961 New options.
16962 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16963 (General_options::wrap_symbols_): Deleted.
16964 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16965
b5be4a7c
DM
169662008-04-17 David S. Miller <davem@davemloft.net>
16967
16968 * options.cc (General_options::parse_V): New function.
16969 * options.h: Add entries for -V and -Qy.
16970
155a0dd7
ILT
169712008-04-17 Ian Lance Taylor <iant@google.com>
16972
16973 * common.cc (Symbol_table::allocate_commons): Remove options
16974 parameter. Change caller.
16975 (Symbol_table::do_allocate_commons): Remove options parameter.
16976 Change caller. Just call do_allocate_commons_list twice.
16977 (Symbol_table::do_allocate_commons_list): New function, broken out
16978 of do_allocate_commons.
16979 * common.h (class Allocate_commons_task): Remove options_ field.
16980 Update constructor.
16981 * symtab.cc (Symbol_table::Symbol_table): Initialize
16982 tls_commons_.
16983 (Symbol_table::add_from_object): Put TLS common symbols on
16984 tls_commons_ list.
16985 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16986 which are IN_OUTPUT_DATA.
16987 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16988 allocate_commons and do_allocate_commons declarations. Declare
16989 do_allocate_commons_list.
16990 * gold.cc (queue_middle_tasks): Update creation of
16991 Allocate_commons_task to not pass options.
16992 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16993 (TLS_TEST_C_FLAGS): New variable.
16994 (tls_test_c_pic.o): New target.
16995 (tls_test_shared.so): Link in tls_test_c_pic.o.
16996 (tls_test_c_pic_ie.o): New target.
16997 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16998 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16999 (tls_test_c.o): New target.
17000 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17001 (tls_pic_test_LDADD): Likewise.
17002 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17003 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17004 (tls_test_c_gnu2.o): New target.
17005 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17006 tls_test_c_gnu2.o.
17007 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17008 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17009 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17010 * testsuite/tls_test.cc: Include "config.h".
17011 (t_last): Call t11_last.
17012 * testsuite/tls_test.h (t11, t11_last): Declare.
17013 * testsuite/tls_test_c.c: New file.
17014 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17015 * configure.ac: Check for OpenMP support.
17016 * configure, config.in, Makefile.in: Rebuild.
17017 * testsuite/Makefile.in: Rebuild.
17018
edfbb029
CC
170192008-04-16 Cary Coutant <ccoutant@google.com>
17020
17021 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17022 (Target_i386::tls_base_symbol_defined_): New field.
17023 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17024 (Target_i386::Scan::global): Likewise.
17025 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17026 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17027 (Target_x86_64::tls_base_symbol_defined_): New field.
17028 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17029 (Target_x86_64::Scan::global): Likewise.
17030
f3c69fca
CC
170312008-04-16 Cary Coutant <ccoutant@google.com>
17032
17033 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17034 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17035 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17036 building shared libraries.
17037 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17038 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17039 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17040 * testsuite/Makefile.in: Rebuild.
17041 * testsuite/weak_undef.h: New file.
17042 * testsuite/weak_undef_file1.cc: Add extra test cases.
17043 * testsuite/weak_undef_file2.cc: Likewise.
17044 * testsuite/weak_undef_test.cc: Likewise.
17045
7c414435
DM
170462008-04-16 David S. Miller <davem@davemloft.net>
17047
32b769e1
DM
17048 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17049 Add issued_non_pic_error_ field. Declare check_non_pic.
17050 (Target_sparc::Scan::check_non_pic): New function.
17051 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17052 (Target_sparc::Scan::global): Likewise.
17053
11936fb1
DM
17054 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17055 * configure: Rebuild.
17056
7c414435
DM
17057 * options.h (DEFINE_enable): New macro.
17058 (new_dtags): New enable option.
17059 (initfirst, interpose, loadfltr, nodefaultlib,
17060 nodelete, nodlopen, nodump): New -z options.
17061 * layout.cc (Layout:finish_dynamic_section): If new
17062 dtags enabled, emit DT_RUNPATH. Also, emit a
17063 DT_FLAGS_1 containing any specified -z flags.
17064
85c7bf8b
ILT
170652008-04-16 Ian Lance Taylor <iant@google.com>
17066
12c0daef
ILT
17067 * copy-relocs.cc: New file.
17068 * copy-relocs.h: New file.
17069 * reloc.cc: Remove Copy_relocs code.
17070 * reloc.h: Likewise.
17071 * reloc-types.h (struct Reloc_types) [both versions]: Add
17072 get_reloc_addend_noerror.
17073 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17074 variants of add_global which take an addend which must be zero.
17075 * i386.cc: Include "copy-relocs.h".
17076 (class Target_i386): Change type of copy_relocs_ to variable,
17077 update initializer.
17078 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17079 Change all callers.
17080 (Target_i386::do_finalize_sections): Change handling of
17081 copy_relocs_.
17082 * sparc.cc: Include "copy-relocs.h".
17083 (class Target_sparc): Change type of copy_relocs_ to variable,
17084 update initializer.
17085 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17086 Change all callers.
17087 (Target_sparc::do_finalize_sections): Change handling of
17088 copy_relocs_.
17089 * x86_64.cc: Include "copy-relocs.h".
17090 (class Target_x86_64): Change type of copy_relocs_ to variable,
17091 update initializer.
17092 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17093 class. Change all callers.
17094 (Target_x86_64::do_finalize_sections): Change handling of
17095 copy_relocs_.
17096 * Makefile.am (CCFILES): Add copy-relocs.cc.
17097 (HFILES): Add copy-relocs.h.
17098
4f4995b6
ILT
17099 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17100
85c7bf8b
ILT
17101 * testsuite/script_test_4.sh: Permit leading zeroes.
17102
4f2a9edd
ILT
171032008-04-15 Ian Lance Taylor <iant@google.com>
17104
e6188289
ILT
17105 * script-sections.cc (Script_sections::create_segments): Use
17106 header_size_adjustment even when there is enough room for the
17107 headers.
17108 * testsuite/script_test_4.sh: New file.
17109 * testsuite/script_test_4.t: New file.
17110 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17111 (check_DATA): Add script_test_4.stdout.
17112 (MOSTLYCLEANFILES): Likewise.
17113 (script_test_4): New target.
17114 (script_test_4.stdout): New target.
17115 * testsuite/Makefile.in: Rebuild.
17116
4f2a9edd
ILT
17117 * sparc.cc: Add definitions for Output_data_plt_sparc class
17118 constants.
17119
f5314dd5
DM
171202008-04-14 David S. Miller <davem@davemloft.net>
17121
17122 * sparc.cc: New file.
17123 * Makefile.am (TARGETSOURCES): Add sparc.cc
17124 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17125 * configure.tgt: Document targ_extra_size and
17126 targ_extra_big_endian. Add entries for sparc-* and
17127 sparc64-*.
17128 * configure.ac: Handle targ_extra_size and
17129 targ_extra_big_endian.
17130 * Makefile.in: Rebuild.
17131 * configure: Likewise.
17132 * po/POTFILES.in: Likewise.
17133 * po/gold.pot: Likewise.
17134
154e0e9a
ILT
171352008-04-14 Ian Lance Taylor <iant@google.com>
17136
17137 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17138 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17139 in the name/type/flags to section mapping. Don't call
17140 allocate_output_section.
17141 (Layout::choose_output_section): Change parameter from adjust_name
17142 to is_input_section. Don't permit input sections after sections
17143 are attached to segments. Don't call allocate_output_section.
17144 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17145 not write_enable_output_section.
17146 (Layout::make_output_section): Don't push to
17147 unattached_section_list_ nor call attach_to_segment. Call
17148 attach_section_to_segment if sections are attached.
17149 (Layout::attach_sections_to_segments): New function.
17150 (Layout::attach_section_to_segment): New function.
17151 (Layout::attach_allocated_section_to_segment): Rename from
17152 attach_to_segment. Remove flags parameter.
17153 (Layout::allocate_output_section): Remove function.
17154 (Layout::write_enable_output_section): Remove function.
17155 * layout.h (class Layout): Update for above changes. Add new
17156 field sections_are_attached_.
17157 * output.h (Output_section::update_flags_for_input_section): New
17158 function.
17159 * output.cc (Output_section::add_input_section): Call
17160 update_flags_for_input_section.
17161 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17162
009a67a2
CC
171632008-04-11 Cary Coutant <ccoutant@google.com>
17164
17165 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17166 thought unnecessary.
17167 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17168
759b1a24
ILT
171692008-04-11 Ian Lance Taylor <iant@google.com>
17170
17171 * output.h (class Output_section_data): Remove inline definition
17172 of set_addralign.
17173 * output.cc (Output_section_data::set_addralign): New function.
17174
c2b45e22
CC
171752008-04-11 Cary Coutant <ccoutant@google.com>
17176
17177 Add support for TLS descriptors for i386 and x86_64.
17178 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17179 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17180 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17181 GOT_TYPE_TLS_DESC.
17182 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17183 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17184 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17185 relocations.
17186 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17187 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17188 Fix problem with initial-exec relocations.
17189 (Target_i386::Relocate::relocate_tls): Likewise.
17190 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17191 relaxation.
17192 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17193 support for section-plus-offset dynamic table entries.
17194 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17195 (Output_data_dynamic::Dynamic_entry): Add support for
17196 section-plus-offset dynamic table entries.
17197 (Output_data_dynamic::Classification): Likewise.
17198 (Output_data_dynamic::classification_): Renamed offset_.
17199 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17200 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17201 (Target_x86_64::make_plt_section): New function.
17202 (Target_x86_64::reserve_tlsdesc_entries): New function.
17203 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17204 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17205 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17206 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17207 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17208 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17209 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17210 add extra PLT entry for TLS descriptors.
17211 (Output_data_plt_x86_64::got_): New field.
17212 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17213 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17214 fields.
17215 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17216 descriptors.
17217 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17218 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17219 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17220 R_386_TLS_DESC_CALL relocations.
17221 (Target_x86_64::Scan::global): Likewise.
17222 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17223 for TLS descriptors.
17224 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17225 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17226 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17227 GD-to-IE relaxation.
17228 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17229 and TLS_DESCRIPTORS.
17230 * Makefile.in: Rebuild.
17231 * configure: Rebuild.
17232 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17233 (tls_test_shared2.so): New target.
17234 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17235 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17236 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17237 (tls_shared_gd_to_ie_test_LDADD): New variable.
17238 (tls_shared_gnu2_gd_to_ie_test): New target.
17239 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17240 New targets.
17241 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17242 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17243 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17244 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17245 (tls_shared_gnu2_test): New target.
17246 (tls_test_gnu2_shared.so): New target.
17247 (tls_shared_gnu2_test_SOURCES): New variable.
17248 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17249 (tls_shared_gnu2_test_LDFLAGS): New variable.
17250 (tls_shared_gnu2_test_LDADD): New variable.
17251 * testsuite/Makefile.in: Rebuild.
17252 * testsuite/Makefile.
17253
83bfb6b7
ILT
172542008-04-11 Ian Lance Taylor <iant@google.com>
17255
17256 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17257 justsyms.t.
17258 * testsuite/Makefile.in: Rebuild.
17259
17260 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17261 long.
17262 * testsuite/script_test_2.cc (main): Adjust test.
17263
706e1f5e
ILT
172642008-04-11 David S. Miller <davem@davemloft.net>
17265 Ian Lance Taylor <iant@google.com>
17266
17267 * options.h (General_options): Add entries for '-Y' and
17268 '-relax'.
17269 * options.cc (General_options:finalize): If -Y was used, add those
17270 entries to the library path instead of the default "/lib" and
17271 "/usr/lib".
17272
7c98e6bb
DM
172732008-04-11 David S. Miller <davem@davemloft.net>
17274
17275 * testsuite/justsyms.t: Start at 0x100.
17276 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17277 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17278 long.
17279 * testsuite/script_test_2.cc: Adjust string and section length
17280 checks.
7c98e6bb 17281
99a37bfd
ILT
172822008-04-09 Ian Lance Taylor <iant@google.com>
17283
2cefc357
ILT
17284 PR gold/5996
17285 * script-sections.cc (Sections_element::allocate_to_segment): Add
17286 orphan parameter.
17287 (Output_section_definition::allocate_to_segment): Likewise.
17288 (Orphan_output_section::allocate_to_segment): Likewise.
17289 (Script_sections::attach_sections_using_phdrs_clause): Don't
17290 propagate non-PT_LOAD segments to orphan sections.
17291 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17292 readelf rather than objdump.
17293 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17294 .interp section and PT_INTERP segment are the same size.
17295 * testsuite/Makefile.in: Rebuild.
17296
99a37bfd
ILT
17297 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17298 aliases for symbols defined in the same object.
17299 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17300 (weak_alias_test_SOURCES): New variable.
17301 (weak_alias_test_DEPENDENCIES): New variable.
17302 (weak_alias_test_LDFLAGS): New variable.
17303 (weak_alias_test_LDADD): New variable.
17304 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17305 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17306 (weak_alias_test_3.o): New target.
17307 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17308 * testsuite/weak_alias_test_main.cc: New file.
17309 * testsuite/weak_alias_test_1.cc: New file.
17310 * testsuite/weak_alias_test_2.cc: New file.
17311 * testsuite/weak_alias_test_3.cc: New file.
17312
780e49c5
ILT
173132008-04-08 Ian Lance Taylor <iant@google.com>
17314
cdb0b8f5
ILT
17315 * options.h (class General_options): Add --noinhibit-exec option.
17316 * main.cc (main): Check --noinhibit-exec.
17317
0864d551
ILT
17318 * options.h (class General_options): Define --wrap as a special
17319 option. Add wrap_symbols_ field.
17320 (General_options::any_wrap_symbols): New function.
17321 (General_options::is_wrap_symbol): New function.
17322 * options.cc (General_options::parse_wrap): New function.
17323 (General_options::General_options): Initialize wrap_symbols_.
17324 * symtab.cc (Symbol_table::wrap_symbol): New function.
17325 (Symbol_table::add_from_object): Handle --wrap.
17326 * symtab.h (class Symbol_table): Declare wrap_symbol.
17327 * target.h (Target::wrap_char): New function.
17328 (Target::Target_info): Add wrap_char field.
17329 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17330 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17331 * testsuite/testfile.cc (Target_test::test_target_info):
17332 Likewise.
17333
789aa6de
ILT
17334 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17335 there is one.
17336
2c38906f
ILT
17337 * layout.h (class Layout): Add added_eh_frame_data_ field.
17338 * layout.cc (Layout::Layout): Initialize new field.
17339 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17340 output section until we find a section we merged successfully.
17341 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17342 that the size be non-zero.
17343
780e49c5
ILT
17344 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17345 qualifier.
17346
7fcd0256
ILT
173472008-04-08 Craig Silverstein <csilvers@google.com>
17348
17349 * configure.ac: Export new conditional variable HAVE_ZLIB.
17350 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17351 on HAVE_ZLIB.
17352 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17353 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17354
6835af53
ILT
173552008-04-07 Ian Lance Taylor <iant@google.com>
17356
e24f324c
ILT
17357 * version.cc (version_string): Set to "1.5".
17358
a036edd8
ILT
17359 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17360 Add issued_non_pic_error_ field. Declare check_non_pic.
17361 (Target_x86_64::Scan::check_non_pic): New function.
17362 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17363 (Target_x86_64::Scan::global): Likewise.
17364
624f8810
ILT
17365 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17366 addend parameter. Change caller. Handle merge sections.
17367 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17368 Address to Addend. Don't add in the result of
17369 local_section_offset, pass down the addend and use the returned
17370 value.
17371 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17372 Update declarations of local_section_offset and symbol_value.
17373 * testsuite/two_file_test_1.cc (t18): New function.
17374 * testsuite/two_file_test_2.cc (f18): New function.
17375 * testsuite/two_file_test_main.cc (main): Call t18.
17376 * testsuite/two_file_test.h (t18, f18): Declare.
17377
6835af53
ILT
17378 * configure.ac: Don't test for objdump, c++filt, or readelf.
17379 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17380 conditionals.
17381 (TEST_READELF): New variable.
17382 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17383 (check_PROGRAMS): Add two_file_strip_test.
17384 (two_file_strip_test): New target.
17385 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17386 (two_file_same_shared_strip_test_SOURCES): New variable.
17387 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17388 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17389 (two_file_same_shared_strip_test_LDADD): New variable.
17390 (two_file_shared_strip.so): New target.
17391 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17392 (ver_test_5.syms, ver_test_7.syms): Likewise.
17393 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17394 (strip_test_3.stdout): Use TEST_OBJDUMP.
17395 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17396
86925eef
CC
173972008-04-04 Cary Coutant <ccoutant@google.com>
17398
17399 * symtab.h (Symbol::is_weak_undefined): New function.
17400 (Symbol::is_strong_undefined): New function.
17401 (Symbol::is_absolute): New function.
17402 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17403 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17404 absolute symbols.
17405 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17406 (weak_undef_test): New target.
17407 * testsuite/Makefile.in: Rebuild.
17408 * testsuite/weak_undef_file1.cc: New file.
17409 * testsuite/weak_undef_file2.cc: New file.
17410 * testsuite/weak_undef_test.cc: New file.
17411
126f3ece
ILT
174122008-04-03 Craig Silverstein <csilvers@google.com>
17413
17414 * compressed_output.h (class Output_compressed_section): Use
17415 unsigned buffer.
17416 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17417 add zlib header.
17418 (zlib_compressed_suffix): Removed.
17419 (Output_compressed_section::set_final_data_size): Use unsigned
17420 buffers.
17421 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17422 Fix linker invocation.
17423 (flagstest_o_specialfile_and_compress_debug_sections):
17424 Likewise.
17425 * testsuite/Makefile.in: Regenerated.
17426
deae2a14
DM
174272008-04-02 David S. Miller <davem@davemloft.net>
17428
17429 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17430 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17431
70752818
ILT
174322008-04-02 Craig Silverstein <csilvers@google.com>
17433
17434 * TODO: New file.
17435
39d0cb0e
ILT
174362008-04-02 Ian Lance Taylor <iant@google.com>
17437
17438 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17439 parameters. Update for new key type to views_. Change all
17440 callers.
17441 (File_read::read): Adjust for byteshift in returned view.
17442 (File_read::add_view): New function, broken out of
17443 find_and_make_view.
17444 (File_read::make_view): New function, broken out of
17445 find_and_make_view.
17446 (File_read::find_or_make_view): Add offset and aligned
17447 parameters. Rewrite accordingly. Change all callers.
17448 (File_read::get_view): Add offset and aligned parameters. Adjust
17449 for byteshift in return value.
17450 (File_read::get_lasting_view): Likewise.
17451 * fileread.h (class File_read): Update declarations.
17452 (class File_read::View): Add byteshift_ field. Add byteshift to
17453 constructor. Add byteshift method.
17454 * archive.h (Archive::clear_uncached_views): New function.
17455 (Archive::get_view): Add aligned parameter. Change all callers.
17456 * object.h (Object::get_view): Add aligned parameter. Change all
17457 callers.
17458 (Object::get_lasting_view): Likewise.
17459
17460 * fileread.cc (File_read::release): Don't call clear_views if
17461 there are multiple objects.
17462 * fileread.h (File_read::clear_uncached_views): New function.
17463 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17464 on the archive.
17465
a1207466
CC
174662008-03-31 Cary Coutant <ccoutant@google.com>
17467
17468 Add thin archive support.
17469 * archive.cc (Archive::armagt): New const.
17470 (Archive::setup): Remove task parameter and calls to unlock.
17471 (Archive::unlock_nested_archives): New function.
17472 (Archive::read_header): Add nested_off parameter. Change
17473 all callers.
17474 (Archive::interpret_header): Likewise.
17475 (Archive::include_all_members): Change to handle thin
17476 archives.
17477 (Archive::include_member): Likewise.
17478 * archive.h (Archive::Archive): Add new parameters and
17479 initializers.
17480 (Archive::armagt): New const.
17481 (Archive::setup): Remove task parameter.
17482 (Archive::unlock_nested_archives): New function.
17483 (Archive::read_header): Add nested_off parameter.
17484 (Archive::interpret_header): Likewise.
17485 (Archive::Nested_archive_table): New typedef.
17486 (Archive::is_thin_archive_): New field.
17487 (Archive::nested_archives_): New field.
17488 (Archive::options_): New field.
17489 (Archive::dirpath_): New field.
17490 (Archive::task_): New field.
17491 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17492 for thin archives. Pass additional parameters to
17493 Archive::Archive. Unlock the archive file after calling
17494 Archive::setup.
cd536b21 17495
479f6503
ILT
174962008-03-29 Ian Lance Taylor <iant@google.com>
17497
686c8caf
ILT
17498 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17499 version symbol to be local.
17500 * testsuite/ver_test_4.sh: New file.
17501 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17502 (check_DATA): Add ver_test_4.syms.
17503 (ver_test_4.syms): New target.
17504 * testsuite/Makefile.in: Rebuild.
17505
ab794b6b
ILT
17506 * output.cc
17507 (Output_section::Input_section_sort_entry::has_priority): New
17508 function.
17509 (Output_section::Input_section_sort_entry::match_file_name): New
17510 function.
17511 (Output_section::Input_section_sort_entry::match_section_name):
17512 Remove.
17513 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17514 Remove.
17515 (Output_section::Input_section_sort_entry::match_section_file):
17516 Remove.
17517 (Output_section::Input_section_sort_compare::operator()): Rewrite
17518 using new Input_section_sort_entry functions. Sort crtbegin and
17519 crtend first. Sort sections with no priority before sections with
17520 a priority.
17521 * testsuite/initpri1.c (d3): Check j != 4.
17522 (cd5): New constructor/destructor function.
17523 (main): Check j != 2.
17524
479f6503
ILT
17525 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17526 new symbol when resolving, don't call set_is_default.
17527 * testsuite/ver_test_7.cc: New file.
17528 * testsuite/ver_test_7.sh: New file.
17529 * testsuite/Makefile.am (ver_test_7.so): New target.
17530 (ver_test_7.o): New target.
17531 (check_SCRIPTS): Add ver_test_7.sh.
17532 (check_DATA): Add ver_test_7.syms.
17533 (ver_test_7.syms): New target.
17534
2fd32231
ILT
175352008-03-28 Ian Lance Taylor <iant@google.com>
17536
17537 * layout.cc (Layout::layout): If we see an input section with a
17538 name that needs sorting, set the must_sort flag for the output
17539 section.
17540 (Layout::make_output_section): If the name of the output section
17541 indicates that it might require sorting, set the may_sort flag.
17542 * output.h (Output_section::may_sort_attached_input_sections): New
17543 function.
17544 (Output_section::set_may_sort_attached_input_sections): New
17545 function.
17546 (Output_section::must_sort_attached_input_sections): New
17547 function.
17548 (Output_section::set_must_sort_attached_input_sections): New
17549 function.
17550 (class Output_section): Declare Input_section_sort_entry. Define
17551 Input_section_sort_compare. Declare
17552 sort_attached_input_sections. Add new fields:
17553 may_sort_attached_input_sections_,
17554 must_sort_attached_input_sections_,
17555 attached_input_sections_are_sorted_.
17556 * output.cc (Output_section::Output_section): Initialize new
17557 fields.
17558 (Output_section::add_input_section): Add an entry to
17559 input_sections_ if may_sort or must_sort are true.
17560 (Output_section::set_final_data_size): Call
17561 sort_attached_input_sections if necessary.
17562 (Output_section::Input_section_sort_entry): Define new class.
17563 (Output_section::Input_section_sort_compare::operator()): New
17564 function.
17565 (Output_section::sort_attached_input_sections): New function.
17566 * configure.ac: Check whether the compiler supports constructor
17567 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17568 * testsuite/initpri1.c: New file.
17569 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17570 CONSTRUCTOR_PRIORITY.
17571 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17572 (initpri1_LDFLAGS): New variable.
17573 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17574
18e6b24e
ILT
175752008-03-27 Ian Lance Taylor <iant@google.com>
17576
49bdd526
ILT
17577 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17578 * testsuite/common_test_1.c: New file.
17579 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17580 (common_test_1_SOURCES): New variable.
17581 (common_test_1_DEPENDENCIES): New variable.
17582 (common_test_1_LDFLAGS): New variable.
17583
18e6b24e
ILT
17584 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17585 and commons_ correctly when NAME/VERSION does not override
17586 NAME/NULL.
17587 * testsuite/ver_test_6.c: New file.
17588 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17589 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17590 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17591
04bf7072
ILT
175922008-03-26 Ian Lance Taylor <iant@google.com>
17593
5871526f
ILT
17594 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17595 of an undefined symbol from a version script.
17596 * testsuite/Makefile.am (ver_test_5.so): New target.
17597 (ver_test_5.o): New target.
17598 (check_SCRIPTS): Add ver_test_5.sh.
17599 (check_DATA): Add ver_test_5.syms.
17600 (ver_test_5.syms): New target.
17601 * testsuite/ver_test_5.cc: New file.
17602 * testsuite/ver_test_5.script: New file.
17603 * testsuite/ver_test_5.sh: New file.
17604 * Makefile.in, testsuite/Makefile.in: Rebuild.
17605
04bf7072
ILT
17606 PR gold/5986
17607 Fix problems building gold with gcc 4.3.0.
17608 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17609 (gold_error_at_location, gold_warning_at_location): Use it.
17610 * configure.ac: Check whether we can compile and use a template
17611 function with a printf attribute.
17612 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17613 when jumping over bytes.
17614 * object.cc: Instantiate Object::read_section_data.
17615 * debug.h: Include <cstring>
17616 * dwarf_reader.cc: Include <algorithm>
17617 * main.cc: Include <cstring>.
17618 * options.cc: Include <cstring>.
17619 * output.cc: Include <cstring>.
17620 * script.cc: Include <cstring>.
17621 * script.h: Include <string>.
17622 * symtab.cc: Include <cstring> and <algorithm>.
17623 * target-select.cc: Include <cstring>.
17624 * version.cc: Include <string>.
17625 * testsuite/testmain.cc: Include <cstdlib>.
17626 * configure, config.in: Rebuild.
17627
874c5b28
ILT
176282008-03-25 Ian Lance Taylor <iant@google.com>
17629
819d6c3a
ILT
17630 * options.cc: Include "../bfd/bfdver.h".
17631 (options::help): Print bug reporting address.
17632
f4b2c6f5
ILT
17633 * version.cc (print_version): Adjust output for current value of
17634 BFD_VERSION_STRING.
17635
17636 * NEWS: New file.
17637
e96caa79
ILT
17638 * options.cc (options::help): Print list of supported targets.
17639 * target-select.h: Include <vector>.
17640 (class Target_selector): Make machine_, size_, and is_big_endian_
17641 fields const. Add bfd_name_ and instantiated_target_ fields.
17642 (Target_selector::Target_selector): Add bfd_name parameter.
17643 (Target_selector::recognize): Make non-virtual, call
17644 do_recognize.
17645 (Target_selector::recognize_by_name): Make non-virtual, call
17646 do_recognize_by_name.
17647 (Target_selector::supported_names): New function.
17648 (Target_selector::bfd_name): New function.
17649 (Target_selector::do_instantiate_target): New pure virtual
17650 function.
17651 (Target_selector::do_recognize): New virtual function.
17652 (Target_selector::do_recognize_by_name): New virtual function.
17653 (Target_selector::instantiate_target): New private function.
17654 (supported_target_names): Declare.
17655 * target-select.cc (Target_selector::Target_selector): Update for
17656 new parameter and fields.
17657 (select_target_by_name): Check that the name matches before
17658 calling recognize_by_name.
17659 (supported_target_names): New function.
17660 * i386.cc (class Target_selector_i386): Update Target_selector
17661 constructor call. Remove recognize and recognize_by_name. Add
17662 do_instantiate_target.
17663 * x86_64.cc (class Target_selector_x86_64): Likewise.
17664 * testsuite/testfile.cc (class Target_selector_test): Update for
17665 changes to Target_selector.
17666
874c5b28
ILT
17667 * README: Rewrite, with some notes on unsupported features.
17668
0a65a3a7
CC
176692008-03-24 Cary Coutant <ccoutant@google.com>
17670
17671 * i386.cc (Target_i386::Got_type): New enum declaration.
17672 (Target_i386::Scan::local): Updated callers of Output_data_got
17673 member functions.
17674 (Target_i386::Scan::global): Likewise.
17675 (Target_i386::Relocate::relocate): Likewise.
17676 (Target_i386::Relocate::relocate_tls): Likewise.
17677 * object.h (Got_offset_list): New class.
17678 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17679 (Sized_relobj::local_got_offset): Likewise.
17680 (Sized_relobj::set_local_got_offset): Likewise.
17681 (Sized_relobj::local_has_tls_got_offset): Removed.
17682 (Sized_relobj::local_tls_got_offset): Removed.
17683 (Sized_relobj::set_local_tls_got_offset): Removed.
17684 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17685 * output.cc (Output_data_got::add_global): Added got_type parameter.
17686 (Output_data_got::add_global_with_rel): Likewise.
17687 (Output_data_got::add_global_with_rela): Likewise.
17688 (Output_data_got::add_global_pair_with_rel): New function.
17689 (Output_data_got::add_global_pair_with_rela): New function.
17690 (Output_data_got::add_local): Added got_type parameter.
17691 (Output_data_got::add_local_with_rel): Likewise.
17692 (Output_data_got::add_local_with_rela): Likewise.
17693 (Output_data_got::add_local_pair_with_rel): New function.
17694 (Output_data_got::add_local_pair_with_rela): New function.
17695 (Output_data_got::add_global_tls): Removed.
17696 (Output_data_got::add_global_tls_with_rel): Removed.
17697 (Output_data_got::add_global_tls_with_rela): Removed.
17698 (Output_data_got::add_local_tls): Removed.
17699 (Output_data_got::add_local_tls_with_rel): Removed.
17700 (Output_data_got::add_local_tls_with_rela): Removed.
17701 * output.h (Output_data_got::add_global): Added got_type parameter.
17702 (Output_data_got::add_global_with_rel): Likewise.
17703 (Output_data_got::add_global_with_rela): Likewise.
17704 (Output_data_got::add_global_pair_with_rel): New function.
17705 (Output_data_got::add_global_pair_with_rela): New function.
17706 (Output_data_got::add_local): Added got_type parameter.
17707 (Output_data_got::add_local_with_rel): Likewise.
17708 (Output_data_got::add_local_with_rela): Likewise.
17709 (Output_data_got::add_local_pair_with_rel): New function.
17710 (Output_data_got::add_local_pair_with_rela): New function.
17711 (Output_data_got::add_global_tls): Removed.
17712 (Output_data_got::add_global_tls_with_rel): Removed.
17713 (Output_data_got::add_global_tls_with_rela): Removed.
17714 (Output_data_got::add_local_tls): Removed.
17715 (Output_data_got::add_local_tls_with_rel): Removed.
17716 (Output_data_got::add_local_tls_with_rela): Removed.
17717 * resolve.cc (Symbol::override_base_with_special): Removed
17718 reference to has_got_offset_ field.
17719 * symtab.cc (Symbol::init_fields): Replaced initialization
17720 of got_offset_ with got_offsets_. Removed initialization
17721 of has_got_offset_
53fcba31 17722 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17723 (Symbol::got_offset): Likewise.
17724 (Symbol::set_got_offset): Likewise.
17725 (Symbol::has_tls_got_offset): Removed.
17726 (Symbol::tls_got_offset): Removed.
17727 (Symbol::set_tls_got_offset): Removed.
17728 (Symbol::got_offset_): Removed.
17729 (Symbol::tls_mod_got_offset_): Removed.
17730 (Symbol::tls_pair_got_offset_): Removed.
17731 (Symbol::got_offsets_): New field.
17732 (Symbol::has_got_offset): Removed.
17733 (Symbol::has_tls_mod_got_offset): Removed.
17734 (Symbol::has_tls_pair_got_offset): Removed.
17735 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17736 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17737 member functions.
17738 (Target_x86_64::Scan::global): Likewise.
17739 (Target_x86_64::Relocate::relocate): Likewise.
17740 (Target_x86_64::Relocate::relocate_tls): Likewise.
17741
bd52eafb
BE
177422008-03-25 Ben Elliston <bje@au.ibm.com>
17743
17744 * yyscript.y: Fix spelling error in comment.
17745
8b105e34
ILT
177462008-03-24 Ian Lance Taylor <iant@google.com>
17747
8ed814a9
ILT
17748 * options.h (class General_options): Define build_id option.
17749 * layout.h (class Layout): Declare write_build_id, create_note,
17750 create_build_id. Add build_id_note_ member.
17751 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17752 "libiberty.h", "md5.h", "sha1.h".
17753 (Layout::Layout): Initialize eh_frame_data_,
17754 eh_frame_hdr_section_, and build_id_note_.
17755 (Layout::finalize): Call create_build_id.
17756 (Layout::create_note): New function, broken out of
17757 Layout::create_gold_note.
17758 (Layout::create_gold_note): Call create_note.
17759 (Layout::create_build_id): New function.
17760 (Layout::write_build_id): New function.
17761 (Close_task_runner::run): Call write_build_id.
17762
8b105e34
ILT
17763 * x86_64.cc: Correct license to GPLv3.
17764
086a1841
ILT
177652008-03-23 Ian Lance Taylor <iant@google.com>
17766
17767 * options.cc: Include "demangle.h".
17768 (parse_optional_string): New function.
17769 (parse_long_option): Handle takes_optional_argument.
17770 (parse_short_option): Update dash_z initializer. Handle
17771 takes_optional_argument.
17772 (General_options::General_options): Initialize do_demangle_.
17773 (General_options::finalize): Set do_demangle_. Handle demangling
17774 style.
17775 * options.h (parse_optional_string): Declare.
17776 (struct One_option): Add optional_arg field. Update constructor.
17777 Update call constructor calls. Add takes_optional_argument
17778 function.
17779 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17780 (DEFINE_optional_string): Define.
17781 (General_options::demangle): Change from DEFINE_bool to
17782 DEFINE_optional_string.
17783 (General_options::no_demangle): New function.
17784 (General_options::do_demangle): New function.
17785 (General_options::set_do_demangle): New function.
17786 (General_options::execstack_status_): Move definition to end of
17787 class definition.
17788 (General_options::static_): Likewise.
17789 (General_options::do_demangle_): New field.
17790 * object.cc (big_endian>::get_symbol_location_info): Call
17791 Options::do_demangle, not Options::demangle.
17792 * symtab.cc (demangle): Likewise.
17793
cbb93e63
ILT
177942008-03-22 Ian Lance Taylor <iant@google.com>
17795
17796 * gold.h: Include <cstddef> and <sys/types.h>
17797 * options.h: Include <cstring>.
17798
ec531623
ILT
177992008-03-21 Ian Lance Taylor <iant@google.com>
17800
17801 * Added source code to GNU binutils.
752937aa 17802\f
b90efa5b 17803Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17804
17805Copying and distribution of this file, with or without modification,
17806are permitted in any medium without royalty provided the copyright
17807notice and this notice are preserved.
17808
17809Local Variables:
17810mode: change-log
17811left-margin: 8
17812fill-column: 74
17813version-control: never
17814End:
This page took 1.198727 seconds and 4 git commands to generate.