Gold: Don't fail on R_386_GOT32X relocation
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
493d4b48
L
12015-10-22 H.J. Lu <hongjiu.lu@intel.com>
2
3 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
4 R_386_GOT32X the same as R_386_GOT32.
5 (Target_i386::Scan::local): Likewise.
6 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
7 (Target_i386::Scan::global): Likewise.
8 (Target_i386::Relocate::relocate): Likewise.
9 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
10 Likewise.
11
0fd15345
L
122015-10-20 H.J. Lu <hongjiu.lu@intel.com>
13
14 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
15 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
16 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
17 x86_64_mov_to_lea1.o.
18 * testsuite/Makefile.in: Regenerated.
19
64571972
L
202015-10-16 H.J. Lu <hongjiu.lu@intel.com>
21
22 PR gold/19119
23 * options.h (General_options): Remove "obsolete" from -m.
24 * parameters.cc (set_parameters_target): Check if input target
25 is compatible with output emulation set by "-m emulation".
26
01f573ad
L
272015-10-13 H.J. Lu <hongjiu.lu@intel.com>
28
29 PR gold/19118
30 * i386.cc (Target_iamcu): New class.
31 (Target_selector_iamcu): Likewise.
32 (Target_iamcu::iamcu_info): New variable.
33 (target_selector_iamcu): Likewise.
34
3b0357da
AS
352015-10-07 Andreas Schwab <schwab@suse.de>
36
37 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
38
9eacb935
CC
392015-10-06 Cary Coutant <ccoutant@gmail.com>
40
41 PR gold/18855
42 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
43 parameter.
44 (Sparc_relocate_functions::gdop_lox10): Likewise.
45 (Target_sparc::Relocate::relocate): Use addend when computing
46 symbol value for R_SPARC_GOTDATA_OP*.
47
3d4fde69
CC
482015-09-07 Cary Coutant <ccoutant@gmail.com>
49
50 PR gold/18930
51 PR gold/18886
52 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
53 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
54
358de988
L
552015-09-02 H.J. Lu <hongjiu.lu@intel.com>
56
57 PR gold/18886
58 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
59 shared libraries into normal FUNC symbols.
60 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
61 symbols aren't from shared libraries.
62
d49044c7
AM
632015-09-02 Alan Modra <amodra@gmail.com>
64
65 PR 18878
66 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
67 (Target_powerpc::Branch_info::make_stub): Determine whether long
68 branch stub is for save/restore function.
69 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
70 (Stub_table): Add need_save_res_.
71 (Stub_table:clear_stubs): Clear need_save_res_.
72 (Stub_table:set_address_and_size): Add save/restore section size.
73 (Stub_table::add_long_branch_entry): Add save_res param. Set
74 need_save_res_, but don't add space for save/restore stubs.
75 (Stub_table::find_long_branch_entry): Return offset to local copy
76 of save/restore func.
77 (Stub_table::do_write): Don't output save/restore stubs. Instead
78 copy the save/restore functions.
79 (Output_data_save_res:contents): New accessor.
80 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
81
7c61d651
CC
822015-08-25 Cary Coutant <ccoutant@gmail.com>
83
84 PR gold/18847
85 * script-sections.cc (Memory_region::set_address): New method.
86 (Script_sections::find_memory_region): Add explicit_only parameter.
87 (Output_section_definition::set_section_addresses): Handle case where
88 script specifies both address and vma region.
89 * script-sections.h (Script_sections::find_memory_region): Add
90 explicit_only parameter.
91
4bfacfd3
CC
922015-08-25 Cary Coutant <ccoutant@gmail.com>
93
94 PR gold/18859
95 * object.cc (Input_objects::add_object): Store objects in a map,
96 indexed by soname; update as-needed flag when necessary.
97 * object.h (Object::clear_as_needed): New method.
98 (Input_objects::so_names_): Change from set to map.
99
1757d35c
CC
1002015-08-25 Cary Coutant <ccoutant@gmail.com>
101
102 PR gold/14746
103 * expression.cc (Expression::Expression_eval_info): Add
104 is_valid_pointer field.
105 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
106 Adjust all callers.
107 (Addr_expression::value_from_output_section): Check whether address
108 is valid.
109 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
110 if evaluation failed due to address that is not yet valid.
111 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
112 parameter.
113
3ac0a36c
CC
1142015-08-25 Cary Coutant <ccoutant@gmail.com>
115
116 PR gold/18866
117 PR gold/18703
118 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
119
9215b98b
AM
1202015-08-20 Alan Modra <amodra@gmail.com>
121
122 PR gold/18846
123 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
124 Subtract os->address() from addend.
125 * powerpc.cc (relocate_relocs): Likewise.
126
40fc1451
SD
1272015-08-12 Simon Dardis <simon.dardis@imgtec.com>
128
129 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
130 lazy_stub_normal_1, lazy_stub_normal_1_n64,
131 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
132 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
133 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
134 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
135 of 'addu/daddu'.
136
37a42ee9
L
1372015-07-27 H.J. Lu <hongjiu.lu@intel.com>
138
139 * configure: Regenerated.
140
ab3b14b0
DK
1412015-07-26 Doug Kwan <dougkwan@google.com>
142
143 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
144 disassembler output format.
145
cdb06167
HS
1462015-07-23 Ian Coolidge <icoolidge@google.com>
147 Plumb --pic-veneer option for gold.
148
149 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
150 generation.
151 * options.h (General_options): Add --pic-veneer option.
152
5b2af7dd
L
1532015-07-22 H.J. Lu <hongjiu.lu@intel.com>
154
155 PR gold/18663
156 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
157 script_test_1a.cc script_test_1b.cc.
158 (script_test_11_r.o): Replace script_test_11.o with
159 script_test_11a.o script_test_11b.o.
160 (script_test_11.o): Removed.
161 (script_test_11a.o): New.
162 (script_test_11b.o): Likewise.
163 * testsuite/Makefile.in: Regenerated.
164 * testsuite/script_test_1.h: New file.
165 * testsuite/script_test_1b.cc: Likewise.
166 * testsuite/script_test_11.h: Likewise.
167 * testsuite/script_test_11b.c: Likewise.
168 * testsuite/script_test_1.cc: Renamed to ...
169 * testsuite/script_test_1a.cc: This.
170 Include "script_test_1.h".
171 (main): Call check_int and check_ptr.
172 * testsuite/script_test_11.c: Renamed to ...
173 * testsuite/script_test_11a.c: This.
174 Include "script_test_11.h".
175 (main): Call ptr_equal.
176
cd78ea77
L
1772015-07-22 H.J. Lu <hongjiu.lu@intel.com>
178
179 PR gold/18628
180 * testsuite/ifuncdep2.c (global): Change protected to hidden.
181 * testsuite/ifuncmod1.c (global): Likewise.
182 * testsuite/ifuncmod5.c (global): Likewise.
183
f945ba50
AM
1842015-07-22 Alan Modra <amodra@gmail.com>
185
186 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
187
5417c94d
CC
1882015-07-21 Cary Coutant <ccoutant@gmail.com>
189
190 PR gold/18548
191 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
192 forced local symbol even when oldsym != NULL.
193 (Symbol_table::do_define_in_output_segment): Likewise.
194 (Symbol_table::do_define_as_constant): Likewise.
195
cb5cf5e2
CC
1962015-07-21 Cary Coutant <ccoutant@gmail.com>
197
b8c6c5ef 198 PR gold/18698
cb5cf5e2
CC
199 * archive.cc (Library_base::should_include_member): Don't use entry
200 point for relocatable links, or if target is not yet valid.
201 * parameters.cc (Parameters::entry): Check target_valid().
202
0ef3814f
HS
2032015-07-20 Han Shen <shenhan@google.com>
204
205 Optimize erratum 843419 fix.
206
207 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
208 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
209 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
210 (E843419_stub): New sub-class of Erratum_stub.
211 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
212 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
213 (AArch64_relobj::create_erratum_stub): Add 1 argument.
214 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
215
2bca0377
HS
2162015-07-20 Han Shen <shenhan@google.com>
217
218 Fix arm elf header flags wrt hardfp bit.
219
220 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
221
f54f5e31
L
2222015-07-20 H.J. Lu <hongjiu.lu@intel.com>
223
224 PR gold/18689
225 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
226 from input group section for relocatable link.
227 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
228 (check_DATA): Add pr18689.stdout.
229 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
230 (pr18689.stdout): New rule.
231 (pr18689a.o): Likewise.
232 (pr18689b.o): Likewise.
233 (pr18689.o): Likewise.
234 * testsuite/pr18689.c: New file.
235 * testsuite/pr18689.sh: Likewise.
236 * testsuite/Makefile.in: Regenerated.
237
c20ceeb2
YW
2382015-07-20 Yiran Wang <yiran@google.com>
239 Cary Coutant <ccoutant@gmail.com>
240
241 PR gold/15574
242 * resolve.cc (Symbol_table): Remove warning about references
243 from shared objects to hidden symbols.
244 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
245 * testsuite/Makefile.in: Regenerate.
246 * testsuite/hidden_test.sh: Check dynamic symbol table; update
247 expected error messages.
248
19a7fe52
L
2492015-07-14 H.J. Lu <hongjiu.lu@intel.com>
250
251 * compressed_output.cc (Output_compressed_section::set_final_data_size):
252 Make --compress-debug-sections=zlib the same as
253 --compress-debug-sections=zlib-gabi.
254 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
255 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
256 ".zdebug_".
257 * testsuite/Makefile.in: Regenerated.
258
fb8b9dbc
L
2592015-07-12 H.J. Lu <hongjiu.lu@intel.com>
260
261 PR gold/18322
262 * compressed_output.cc (zlib_compress): Add argument for
263 compression header size. Set header size to compression header
264 size if it isn't 0. Don't write out the zlib header here.
265 (Output_compressed_section::set_final_data_size): Support
266 zlib-gnu and zlib-gabi compressions. Pass compression header
267 size to zlib_compress and write out compression header. Set
268 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
269 clear the SHF_COMPRESSED bit
270 * options.h (compress_debug_sections): Add zlib-gnu and
271 zlib-gabi.
272 * output.h (Output_section::set_flags): New.
273 * testsuite/Makefile.am (check_PROGRAMS): Add
274 flagstest_compress_debug_sections_none,
275 flagstest_compress_debug_sections_gnu and
276 flagstest_compress_debug_sections_gabi.
277 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
278 flagstest_compress_debug_sections.stdout,
279 flagstest_compress_debug_sections.cmp,
280 flagstest_compress_debug_sections.check,
281 flagstest_compress_debug_sections_gnu.stdout,
282 flagstest_compress_debug_sections_gnu.cmp,
283 flagstest_compress_debug_sections_gnu.check,
284 flagstest_compress_debug_sections_gabi.stdout,
285 flagstest_compress_debug_sections_gabi.cmp and
286 flagstest_compress_debug_sections_gabi.check.
287 (flagstest_compress_debug_sections_none): New.
288 (flagstest_compress_debug_sections_none.stdout): Likewise.
289 (flagstest_compress_debug_sections.stdout): Likewise.
290 (flagstest_compress_debug_sections.check): Likewise.
291 (flagstest_compress_debug_sections.cmp): Likewise.
292 (flagstest_compress_debug_sections_gnu): Likewise.
293 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
294 (flagstest_compress_debug_sections_gnu.check): Likewise.
295 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
296 (flagstest_compress_debug_sections_gabi): Likewise.
297 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
298 (flagstest_compress_debug_sections_gnu.check): Likewise.
299 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
300 * testsuite/Makefile.in: Regenerated.
301
48058663
L
3022015-07-12 H.J. Lu <hongjiu.lu@intel.com>
303
304 PR gold/18321
305 * compressed_output.h (decompress_input_section): Add arguments
306 for ELF class, big endian and sh_flags.
307 * compressed_output.cc (decompress_input_section): Likewise.
308 Support the SHF_COMPRESSED section.
309 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
310 functions.
311 * plugin.h (Pluginobj): Likewise.
312 * layout.cc (Layout::get_output_section_flags): Also clear the
313 SHF_COMPRESSED bit.
314 * object.h (Compressed_section_info): Add flag to store sh_flags.
315 (Object): Add pure virtual elfsize and is_big_endian member
316 functions.
317 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
318 prefix here.
319 (build_compressed_section_map): Check SHF_COMPRESSED for
320 uncompressed size. Store sh_flags in Compressed_section_info.
321 Pass size, big_endian and sh_flags to decompress_input_section.
322 Skip the ".debug"/".zdebug" prefix when passing section name to
323 need_decompressed_section.
324 (Sized_relobj_file<size, big_endian>::do_find_special_section):
325 Don't check ".zdebug_*" sections.
326 (Object::decompressed_section_contents): Pass ELF class, big
327 endian and sh_flags to decompress_input_section.
328 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
329 Likewise.
330 * testsuite/Makefile.am (check_DATA): Add
331 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
332 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
333 gdb_index_test_2_gabi.stdout.
334 (debug_msg_cdebug_gabi.o): New.
335 (odr_violation1_cdebug_gabi.o): Likewise.
336 (odr_violation2_cdebug_gabi.o): Likewise.
337 (debug_msg_cdebug_gabi.err): Likewise.
338 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
339 (gdb_index_test_cdebug_gabi.o): Likewise.
340 (gdb_index_test_2_gabi): Likewise.
341 (gdb_index_test_2_gabi.stdout): Likewise.
342 * testsuite/gdb_index_test_2_gabi.sh: New file.
343 * testsuite/Makefile.in: Regenerated.
344
73854cdd
HS
3452015-07-09 Han Shen <shenhan@google.com>
346
347 Use "gold_info" instead of "gold_warning" for erratum fix.
348
349 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
350 'gold_info'.
351 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
352
61163dfa
HS
3532015-07-09 Han Shen <shenhan@google.com>
354
355 Drop missing symbol warning for arm/aarch64.
356
357 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
358 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
359 symbol warning.
360
b91deca9
HS
3612015-07-07 Han Shen <shenhan@google.com>
362
363 Make gold aarch64 accept long form of mapping symbols.
364
365 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
366 of mapping symbols.
367
15162bef
DK
3682015-06-29 Doug Kwan <dougkwan@google.com>
369
370 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
371 at address expected by test.
372 * testsuite/arm_cortex_a8_b.s: Ditto.
373 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
374 * testsuite/arm_cortex_a8_bl.s: Ditto.
375 * testsuite/arm_cortex_a8_blx.s: Ditto.
376 * testsuite/arm_cortex_a8_local.s: Ditto.
377 * testsuite/arm_fix_v4bx.s: Ditto.
378 * testsuite/arm_unaligned_reloc.s: Ditto.
379 * testsuite/thumb_bl_out_of_range.s: Ditto.
380 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
381 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 382
56b06706
HS
3832015-06-29 Han Shen <shenhan@google.com>
384
385 Patch for erratum 843419 internal error.
386
72f4393d
L
387 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
388 (Erratum_stub::update_erratum_insn): New method.
389 (Stub_table::relocate_stubs): Modified to place relocated insn.
390 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 391
2f0c79aa
HS
3922015-06-12 Han Shen <shenhan@google.com>
393
394 Fix erratum 835769.
395
72f4393d
L
396 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
397 defintion outside class definition.
398 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
399 (AArch64_insn_utilities::aarch64_op31): New member.
400 (AArch64_insn_utilities::aarch64_ra): New member.
401 (AArch64_insn_utilities::aarch64_mac): New member.
402 (AArch64_insn_utilities::aarch64_mlxl): New member.
403 (ST_E_835769): New global enum member.
404 (Stub_table::relocate_stubs): Add 835769 handler.
405 (Stub_template_repertoire::Stub_template_repertoire): Install new
406 stub type.
407 (AArch64_relobj::scan_errata): This func is renamed from
408 scan_erratum_843419.
409 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
410 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
411 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
412 (Target_aarch64::scan_erratum_835769_span): New method.
413 (Target_aarch64::create_erratum_stub): New method.
414 (Target_aarch64::is_erratum_835769_sequence): New method.
415 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
416 code into create_erratum_stub.
417 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 418
5d7908e0
CC
4192015-06-11 Cary Coutant <ccoutant@gmail.com>
420
421 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
422 outside class body.
423 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
424
dd68f8fa
CC
4252015-06-11 Cary Coutant <ccoutant@gmail.com>
426
427 PR gold/17731
428 * layout.cc (corresponding_uncompressed_section_name): New function.
429 (Layout::choose_output_section): Call it.
430 * layout.h (corresponding_uncompressed_section_name): New function.
431 * script-sections.cc (Input_section_info::set_section_name): Check
432 for compressed debug section (.zdebug style).
433
a3a0c391
JY
4342015-06-11 Jing Yu <jingyu@google.com>
435
436 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
437 * testsuite/Makefile.in: Regenerate.
438
970cdef2
DI
4392015-06-11 Davide Italiano <dccitaliano@gmail.com>
440
441 * gold.h (is_cident): Correct typo.
442
a48d0c12
HS
4432015-06-10 Han Shen <shenhan@google.com>
444 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
445
446 Now fixing for 843419 is fully functional.
447
448 The first part of the erratum fix CL is here -
449 https://sourceware.org/ml/binutils/2015-04/msg00229.html
450
451 * aarch64.cc(global enum): New constants representing stub types.
452 (Stub_template): New POD struct.
453 (Stub_template_repertoire): New class.
454 (Stub_base): New class.
455 (Erratum_stub): New class.
456 (Reloc_stub): Refactored to be a subclass of Stub_base.
457 (Reloc_stub::Stub_type): Removed.
458 (Reloc_stub::offset): Moved to Stub_base.
459 (Reloc_stub::set_offset): Moved to Stub_base.
460 (Reloc_stub::destination_address): Moved to Stub_base.
461 (Reloc_stub::set_destination_address): Moved to Stub_base.
462 (Reloc_stub::reset_destination_address): Moved to Stub_base.
463 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
464 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
465 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
466 (Reloc_stub::write): Moved to Stub_base.
467 (Reloc_stub::invalid_offset): Moved to Stub_base.
468 (Reloc_stub::invalid_address): Moved to Stub_base.
469 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
470 (Reloc_stub::stub_insns_): Moved to Stub_base.
471 (Reloc_stub::offset_): Moved to Stub_base.
472 (Reloc_stub::destination_address_): Moved to Stub_base.
473 (Stub_table::The_aarch64_relobj): New typedef.
474 (Stub_table::The_erratum_stub): New typedef.
475 (Stub_table::The_erratum_stub_less): New typedef.
476 (Stub_table::The_erratum_stub_set): New typedef.
477 (Stub_table::The_erratum_stub_set_iter): New typedef.
478 (Stub_table::empty): Added emptiness testing for erratum stubs.
479 (Stub_table::add_erratum_stub): New method to add an erratum stub.
480 (Stub_table::find_erratum_stub): New method.
481 (Stub_table::find_erratum_stubs_for_input_section): New method.
482 (Stub_table::erratum_stub_address): New method.
483 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
484 (Stub_table::do_addralign): Modified to handle erratum stubs.
485 (Stub_table::erratum_stubs_): New member.
486 (Stub_table::erratum_stub_size_): New member.
487 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
488 (Stub_table::do_write): Modified to handle erratum stubs.
489 (AArch64_relobj::The_erratum_stub): New typedef.
490 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
491 (AArch64_relobj::fix_errata): New method.
492 (Target_aarch64::The_reloc_stub_type): Removed.
493 (Target_aarch64::The_erratum_stub): New typede.
494 (AArch64_relocate_functions::construct_b): New method.
495
1e1b2efc
NC
4962015-06-08 Nick Clifton <nickc@redhat.com>
497
498 * po/fr.po: New French Translation.
499
b8cf5075
CC
5002015-06-07 Cary Coutant <ccoutant@gmail.com>
501
502 PR gold/18288
503 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
504 callers. Don't use STT_COMMON to check for common symbols.
505 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
506 symbol that's not in a common section.
507 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
508 common symbols.
509
bdd2d2b7
CC
5102015-06-04 Cary Coutant <ccoutant@gmail.com>
511
512 PR gold/18200
513 * Makefile.am (diststuff): Add target.
514 * Makefile.in: Regenerate.
515
cd3c333f
CC
5162015-06-04 Cary Coutant <ccoutant@gmail.com>
517
518 PR gold/17498
519 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
520 temporary locals in merge sections.
521 * options.cc (General_options::parse_discard_all): New method.
522 (General_options::parse_discard_locals): New method.
523 (General_options::parse_discard_none): New method.
524 (General_options::General_options): Initialize discard_locals_.
525 * options.h (--discard-all): Convert to special option.
526 (--discard-locals): Likewise.
527 (--discard-none): New option.
528 (General_options::discard_all): New method.
529 (General_options::discard_locals): New method.
530 (General_options::discard_sec_merge): New method.
531 (General_options::Discard_locals): New enum.
532 (General_options::discard_locals_): New data member.
533
8086551f
CC
5342015-06-03 Cary Coutant <cary@google.com>
535
536 * script-sections.cc (Script_sections::Script_sections): Initialize
537 segments_created_.
538 (Script_sections::create_note_and_tls_segments): Set flag when
539 segments are created.
540 (Script_sections::expected_segment_count): Count PT_INTERP.
541 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
542 segments are created.
543 * script-sections.h (Script_sections::segments_created_): New data
544 member.
545
374082df
CC
5462015-06-03 Cary Coutant <ccoutant@gmail.com>
547
548 PR gold/15370
549 * script-sections.cc
550 (Output_section_element_input::set_section_addresses): When there
551 are several patterns with no sort spec, put all sections in the same
552 bin.
553 * testsuite/Makefile.am (script_test_12): New testcase.
554 (script_test_12i): New testcase.
555 * testsuite/Makefile.in: Regenerate.
556 * testsuite/script_test_12.t: New test linker script.
557 * testsuite/script_test_12i.t: New test linker script.
558 * testsuite/script_test_12a.c: New test source file.
559 * testsuite/script_test_12b.c: New test source file.
560
775ed62e
CC
5612015-06-02 Cary Coutant <ccoutant@gmail.com>
562
563 * nacl.h (Sniff_file): Switch parameters to get_view to get an
564 aligned view.
565
9c7fe3c5
CC
5662015-06-03 Cary Coutant <ccoutant@gmail.com>
567
72f4393d
L
568 PR gold/17819
569 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
570 separate task to schedule the build id computation.
571 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
572 add Output_file and offset.
573 (Hash_task::run): Get and release the input views.
574 (Hash_task::is_runnable): Always return NULL (always runnable).
575 (Layout::queue_build_id_tasks): Remove.
576 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
577 parameters; use them instead of class members.
578 (Build_id_task_runner::run): New function.
579 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
580 to write_build_id.
581 * layout.h (Layout::queue_build_id_tasks): Remove.
582 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
583 parameters.
584 (Layout::array_of_hashes_): Remove.
585 (Layout::size_of_array_of_hashes_): Remove.
586 (Layout::input_view_): Remove.
587 (Build_id_task_runner): New class.
588 (Close_task_runner::Close_task_runner): Add array_of_hashes and
589 size_of_hashes parameters.
590 (Close_task_runner::array_of_hashes_): New data member.
591 (Close_task_runner::size_of_hashes_): New data member.
592 * testsuite/Makefile.am
593 (flagstest_compress_debug_sections_and_build_id_tree): New test.
594 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 595
400f8944
RÁE
5962015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
597
598 * merge.cc (get_input_merge_map): Update for data structure change.
599 (get_or_make_input_merge_map): Update for data structure change.
600 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
601 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
602
bbec1a5d
AM
6032015-05-16 Alan Modra <amodra@gmail.com>
604
605 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
606 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
607 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
608 (lis_0): Rename from lis_0_0.
609
efc6fa12
CC
6102015-04-29 Cary Coutant <cary@google.com>
611 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
612
613 * gc.h (Garbage_collection::is_section_garbage): Change Object*
614 to Relobj*.
615 (Garbage_collection::add_reference): Likewise.
616 (Garbage_collection::gc_process_relocs): Likewise. Don't push
617 object/shndx pair onto *secvec for dynamic objects. Don't follow
618 relocations pointing to dynamic objects for GC.
619 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
620 (Icf::unfold_section): Likewise.
621 (Icf::is_section_folded): Likewise.
622 (Icf::get_folded_section): Likewise.
623 * icf.h: (Icf::get_folded_section): Likewise.
624 (Icf::unfold_section): Likewise.
625 (Icf::is_section_folded): Likewise.
626 (Icf::section_has_function_pointers): Likewise.
627 (Icf::set_section_has_function_pointers): Likewise.
628 * object.h (Section_id): Likewise.
629 (Const_section_id): Likewise.
630 * output.cc (Output_section::update_section_layout): Likewise.
631 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
632 Likewise.
633 * plugin.cc (update_section_order): Likewise.
634 (unique_segment_for_sections): Likewise.
635 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
636 (Target_powerpc::do_gc_add_reference): Likewise.
637 (Target_powerpc::gc_process_relocs): Likewise.
638 (Target_powerpc::do_gc_add_reference): Likewise.
639 * symtab.cc (Symbol_table::is_section_folded): Likewise.
640 (Symbol_table::gc_mark_symbol): Likewise.
641 * symtab.h: (Symbol_table::is_section_folded): Likewise.
642 * target.h: (Sized_target::gc_add_reference): Likewise.
643 (Sized_target::do_gc_add_reference): Likewise.
644
f9d3ecaa
NC
6452015-04-29 Nick Clifton <nickc@redhat.com>
646
647 * po/fi.po: Updated Finnish translation.
648
faa2211d
AM
6492015-04-28 Alan Modra <amodra@gmail.com>
650
651 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
652 than unsigned int for find_global_entry result temp. Compare
653 against invalid_address.
654 (Target_powerpc::do_plt_address_for_global): Likewise.
655 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
656 on plt call stub existence for debug info. Do assert for plt
657 and global entry stub existence if an alloc section.
658
6ec65f28
AM
6592015-04-28 Alan Modra <amodra@gmail.com>
660
661 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
662 on missing global entry stub due to bogus debug info.
663
7a2a1c79
HS
6642015-04-27 Han Shen <shenhan@google.com>
665
666 * options.h (--fix-cortex-a53-843419): Rename option.
667 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
668 option.
669 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
670
cfbf0e3c
RÁE
6712015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
672
673 PR gold/18327
674 * output.cc (Output_section::is_input_address_mapped): Assume a missing
675 entry is mapped.
676 * testsuite/Makefile.am: Add the eh_test test.
677 * testsuite/Makefile.in: Regenerate.
678 * testsuite/eh_test_a.cc: New test.
679 * testsuite/eh_test_b.cc: New test.
680
6ec65f28
AM
6812015-04-23 Sriraman Tallam <tmsriram@google.com>
682
a100d66f
ST
683 * options.h (--weak-unresolved-symbols): New option.
684 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
685 binding to weak with new option.
686 * symtab.h (is_weak_undefined): Check for new option.
687 (is_strong_undefined): Check for new option.
688 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
689 * testsuite/Makefile.in: Regenerate.
690 * testsuite/weak_unresolved_symbols_test.cc: New file.
691
4b889c30
IC
6922015-04-20 Ian Coolidge <icoolidge@google.com>
693
694 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
695 GNU_UNIQUE.
696
4277535c
RÁE
6972015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
698
699 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
700 push_back.
701 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
702 * object.cc (Sized_relobj_file::do_layout): Use push_back.
703 * powerpc.cc (process_gc_mark): Use push_back.
704 (Target_powerpc::do_gc_mark_symbol): Use push_back.
705 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
706
7a2a1c79 7072015-04-16 Han Shen <shenhan@google.com>
5019d64a 708
6ec65f28
AM
709 * aarch64.cc (AArch64_insn_utilities): New utility class.
710 (AArch64_relobj::Mapping_symbol_position): New struct.
711 (AArch64_relobj::Mapping_symbol_info): New typedef.
712 (AArch64_relobj::do_count_local_symbols): New function overriding
713 parent's implementation.
714 (AArch64_relobj::mapping_symbol_info_): New member
715 (AArch64_relobj::scan_erratum_843419): New method.
716 (Target_aarch64::scan_erratum_843419_span): New method.
717 (Target_aarch64::is_erratum_843419_sequence): New method.
718 * options.h (fix_cortex_a53): New option.
5019d64a 719
a6a17750
CC
7202015-04-09 Cary Coutant <ccoutant@google.com>
721
722 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
723 in a PIE link.
724 * testsuite/Makefile.am (tls_pie_test.sh): New test.
725 * testsuite/Makefile.in: Regenerate.
726 * testsuite/tls_pie_test.sh: New.
727
437ddf0c
CC
7282015-04-09 Cary Coutant <ccoutant@google.com>
729
730 * debug.h (DEBUG_LOCATION): New.
731 (DEBUG_ALL): Include DEBUG_LOCATION.
732 (debug_string_to_enum): Add DEBUG_LOCATION.
733 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
734 output to print correct context.
735 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
736 up to 4 more locations at the beginning of the function.
737 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
738 result before sorting list of line numbers.
739 * testsuite/debug_msg.sh: Allow range of line numbers for
740 canonical results on optimized code.
741
24491327
HS
7422015-04-07 HC Yen <hc.yen@mediatek.com>
743
744 Add AArch32 support for gold linker.
745 gold/
746 * arm.cc: Add V8 arch combine table.
747
7fa5525f
RÁE
7482015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
749
750 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
751
5368dcf2
RÁE
7522015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
753
754 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
755 to find by using the return value of insert.
756
9dbb4b02
RÁE
7572015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
758
759 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
760 constructor call.
761
1fa29f10
IT
7622015-04-06 Ilya Tocar <ilya.tocar@intel.com>
763
764 PR gold/17641
765 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
766 (Target_x86_64::Scan::local): Don't create GOT entry, when we
767 can convert mov to lea.
768 (Target_x86_64::Scan::global): Ditto.
769 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
770 %reg to lea foo(%rip), %reg if possible.
771 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
772 * testsuite/x86_64_mov_to_lea1.s: New.
773 * testsuite/x86_64_mov_to_lea2.s: Ditto.
774 * testsuite/x86_64_mov_to_lea3.s: Ditto.
775 * testsuite/x86_64_mov_to_lea4.s: Ditto.
776 * testsuite/x86_64_mov_to_lea.sh: Ditto.
777
39f3de7c
L
7782015-04-02 H.J. Lu <hongjiu.lu@intel.com>
779
780 * configure: Regenerated.
781
c4fc4724
IT
7822015-04-01 Ilya Tocar <ilya.tocar@intel.com>
783
784 PR gold/17640
785 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
786 (Target_i386::Scan::local): Don't create GOT entry, when we
787 can convert GOT to GOTOFF.
788 (Target_i386::Scan::global): Ditto.
789 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
790 lea foo@GOTOFF(%reg), %reg if possible.
791 * testsuite/Makefile.am (i386_mov_to_lea): New test.
792 * testsuite/i386_mov_to_lea1.s: New.
793 * testsuite/i386_mov_to_lea2.s: Ditto.
794 * testsuite/i386_mov_to_lea3.s: Ditto.
795 * testsuite/i386_mov_to_lea4.s: Ditto.
796 * testsuite/i386_mov_to_lea5.s: Ditto.
797 * testsuite/i386_mov_to_lea.sh: Ditto.
798
918357b9
L
7992015-04-01 H.J. Lu <hongjiu.lu@intel.com>
800
801 * Makefile.am (ZLIB): New.
802 (ZLIBINC): Likewise.
803 (AM_CFLAGS): Add $(ZLIBINC).
804 (AM_CXXFLAGS): Likewise.
805 (ldadd_varldadd_var): Add $(ZLIB).
806 (incremental_dump_LDADD): Likewise.
807 (dwp_LDADD): Likewise.
808 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
809 <zlib.h>.
810 (zlib_compress): Don't check HAVE_ZLIB_H.
811 (zlib_decompress): Likewise.
812 * options.h (compress_debug_sections): Likewise.
813 * configure.ac (AM_CONDITIONAL): Removed.
814 * testsuite/Makefile.am (ZLIB): New.
815 (LDADD): Add $(ZLIB).
816 Don't check HAVE_ZLIB.
817 * Makefile.in: Regenerated.
818 * config.in: Likewise.
819 * configure: Likewise.
820 * testsuite/Makefile.in: Likewise.
821
6b0ad2eb
JY
8222015-03-30 Jing Yu <jingyu@google.com>
823
824 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
825 TLSLD_ADD_DTPREL_LO12_NC.
826 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
827 _TLS_MODULE_BASE_ point to the start of tls segment.
828 (Target_aarch64::optimize_tls_reloc): Add cases for
829 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
830 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
831 (Target_aarch64::Scan::local): Likewise.
832 (Target_aarch64::Scan::global): Likewise.
833 (Target_aarch64::Relocate::relocate): Likewise.
834 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
835 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
836 relocations.
837
0916f9e7
RÁE
8382015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
839
840 * merge.cc (Object_merge_map::add_mapping): call
841 Object_merge_map::Input_merge_map::add_mapping.
842 (Object_merge_map::Input_merge_map::add_mapping): New.
843 (Output_merge_data::do_add_input_section): Call
844 get_or_make_input_merge_map before a loop.
845 (Output_merge_string<Char_type>::finalize_merged_data): Call
846 get_or_make_input_merge_map before a loop.
847 * merge.h (Object_merge_map): Make Input_merge_map public.
848 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
849 (Relobj::get_or_create_merge_map): New.
850 * object.h (Relobj::get_or_create_merge_map): New.
851
282c9750
AM
8522015-03-24 Alan Modra <amodra@gmail.com>
853
854 PR 18147
855 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
856 relocation errors for branches to strong undefined symbols.
857
67f95b96
RÁE
8582015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
859
860 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
861 (Object_merge_map::is_merge_section_for): Remove.
862 (Object_merge_map::find_merge_section): New.
863 * merge.h (Object_merge_map::is_merge_section_for): Remove.
864 (Object_merge_map::find_merge_section): New.
865 (Object_merge_map::get_input_merge_map): Add a const version.
866 * object.cc (Relobj::is_merge_section_for): Remove.
867 (Relobj::find_merge_section): New.
868 * object.h (Relobj::is_merge_section_for): Remove.
869 (Relobj::find_merge_section): New.
870 * output.cc
871 (Output_section::Input_section::is_merge_section_for): Remove.
872 (Output_section::add_merge_input_section): Don't call
873 add_merge_input_section.
874 (Output_section::find_merge_section): Return const. Use
875 object->find_merge_section.
876 (Output_section::build_lookup_maps): Don't build a map for
877 merge sections.
878 (Output_section::is_input_address_mapped): Return false if
879 section is not found.
880 (Output_section::find_starting_output_address): Use
881 find_merge_section instead of is_merge_section_for.
882 (Output_section::add_script_input_section): Don't build a map for
883 merge sections.
884 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
885 (Output_section_lookup_maps::find_merge_section): Remove.
886 (Output_section_lookup_maps::add_merge_input_section) Remove.
887 (Output_section::find_merge_section): Return const.
888
152f7024
CC
8892015-03-22 Cary Coutant <cary@google.com>
890
891 PR gold/18106
892 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
893 non-SIB form of lea, with nop after the call.
894
bccffdfd
CC
8952015-03-21 Cary Coutant <cary@google.com>
896
897 PR gold/14217
898 * output.cc (Output_segment::is_first_section_relro): Don't ignore
899 .tdata section.
900 (Output_segment::set_section_addresses): Don't align size of relro
901 segment for .tbss.
902
1c582fe7
CC
9032015-03-21 Cary Coutant <cary@google.com>
904
905 PR gold/18010
906 * stringpool.cc (Stringpool_template): Don't optimize if section
907 alignment is greater than sizeof(char).
908
410da591
CC
9092015-03-21 Cary Coutant <cary@google.com>
910
911 PR gold/18048
912 * script-c.h (script_include_directive): Add first_token parameter.
913 * script.cc (script_include_directive): Add first_token parameter, and
914 pass it to read_script_file.
915 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
916 (PARSING_MEMORY_DEF): New tokens.
917 (top): Add new productions for INCLUDE files.
918 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
919 Pass PARSING_LINKER_SCRIPT to script_include_directive.
920 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
921 (section_cmd): Pass PARSING_SECTION_CMDS.
922 (file_or_sections_cmd): Remove.
923 (memory_def): Pass PARSING_MEMORY_DEF.
924 * testsuite/Makefile.am (memory_test_2): New test.
925 * testsuite/Makefile.in: Regenerate.
926 * testsuite/memory_test_inc.t: New script file.
927 * testsuite/memory_test_inc_1.t.src: New script file.
928 * testsuite/memory_test_inc_2.t.src: New script file.
929 * testsuite/memory_test_inc_3.t.src: New script file.
930
0d5bbdb0
CC
9312015-03-21 Cary Coutant <cary@google.com>
932
933 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
934 (Sized_relobj_dwo::setup): Build compressed section map.
935 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
936 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
937 section map.
938 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
939 compressed_sections_ field.
940 (build_compressed_section_map): Take Object instead of
941 Sized_relobj_file parameter; add decompress_if_needed parameter.
942 (Sized_relobj_file::do_find_special_sections): Store compressed
943 section map in parent Object.
944 (Sized_relobj_file::do_decompressed_section_contents): Move
945 implementation to Object::decompressed_section_contents.
946 (Sized_relobj_file::do_discard_decompressed_sections): Move
947 implementation to Object::discard_decompressed_sections.
948 * object.h (build_compressed_section_map): Declare.
949 (Object::Object): Add compressed_sections_ field.
950 (Object::section_is_compressed): Move implementation here.
951 (Object::decompressed_section_contents): De-virtualize.
952 (Object::discard_decompressed_sections): De-virtualize.
953 (Object::do_section_is_compressed): Delete.
954 (Object::do_decompressed_section_contents): Delete.
955 (Object::set_compressed_sections): New method.
956 (Object::compressed_sections): New method.
957 (Object::compressed_sections_): New data member.
958 (Compressed_section_info, Compressed_section_map): Move to top of file.
959 (Sized_relobj_file::do_section_is_compressed): Delete.
960 (Sized_relobj_file::do_decompressed_section_contents): Delete.
961 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
962 (Sized_relobj_file::compressed_sections_): Move to Object class.
963
bd9e0d46
CC
9642015-03-21 Cary Coutant <ccoutant@google.com>
965
966 PR gold/18152
967 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
968 deferred objects.
969
943c8b43
CC
9702015-03-11 Cary Coutant <ccoutant@google.com>
971
972 * options.cc (General_options::finalize): Don't allow -z relro
973 with incremental linking.
974 * testsuite/Makefile.am (incremental_test): Add -z norelro.
975 (incremental_test_2): Likewise.
976 (incremental_test_3): Likewise.
977 (incremental_test_4): Likewise.
978 (incremental_test_5): Likewise.
979 (incremental_test_6): Likewise.
980 (incremental_copy_test): Likewise.
981 (incremental_common_test_1): Likewise.
982 (incremental_comdat_test_1): Likewise.
983 * testsuite/Makefile.in: Regenerate.
984
e1663197
CC
9852015-03-09 Cary Coutant <ccoutant@google.com>
986
987 PR gold/14675
988 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
989 return enum indicating whether .eh_frame section is empty, optimizable,
990 unrecognized, or an end marker. Adjust explicit instantiations.
991 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
992 (Eh_frame::add_ehframe_input_section): Change return type.
993 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
994 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
995 to the .eh_frame output section until we see the end marker.
996 (Layout::finalize_eh_frame_section): New.
997 * layout.h: (Layout::finalize_eh_frame_section): New.
998
beb8418f
L
9992015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1000
1001 * output.cc (Relobj::initialize_input_to_output_map<size>):
1002 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1003
48c73428
CC
10042015-03-04 Cary Coutant <ccoutant@google.com>
1005
1006 * parameters.cc (Parameters::set_target_once): Call
1007 Target::select_as_default_target just once from here...
1008 (set_parameters_target): ...instead of from here.
1009
10102015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
1011
1012 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1013 Output_section_data instead of a Merge_map.
1014 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1015 (Eh_frame::read_cie): Use add_merge_mapping instead of
1016 Merge_map::add_mapping.
1017 (Eh_frame::read_fde): Ditto.
1018 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1019 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1020 merge_map_->get_output_offset.
1021 (Eh_frame::do_is_merge_section_for): Delete.
1022 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1023 instead of a Merge_map.
1024 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1025 Merge_map.
1026 (Eh_frame::do_is_merge_section_for): Delete.
1027 (Eh_frame::merge_map_): Delete.
1028 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1029 and use a Output_section_data instead of a Merge_map.
1030 (Object_merge_map::add_mapping): Ditto.
1031 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1032 (Object_merge_map::is_merge_section_for): Pass in and use a
1033 Output_section_data instead of a Merge_map.
1034 (Merge_map): Delete.
1035 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1036 of merge_map_.get_output_offset.
1037 (Output_merge_base::do_is_merge_section_for): Delete.
1038 (Output_merge_data::do_add_input_section): Use
1039 object->add_merge_mapping instead of add_mapping.
1040 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1041 * merge.h (Merge_map): Delete forward declaration.
1042 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1043 instead of a Merge_map.
1044 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1045 (Object_merge_map::is_merge_section_for): Pass in and use a
1046 Output_section_data instead of a Merge_map.
1047 (Input_merge_map::Object_merge_map::merge_map): Replace with
1048 output_data.
1049 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1050 Output_section_data instead of a Merge_map.
1051 (Merge_map): Delete.
1052 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1053 (Output_merge_base::do_is_merge_section_for): Delete.
1054 (Output_merge_base::add_mapping): Delete.
1055 (Output_merge_base::merge_map_): Delete.
1056 * object.cc (Relobj::initialize_input_to_output_map): New.
1057 (Relobj::initialize_input_to_output_map): New.
1058 (Relobj::merge_output_offset): New.
1059 (Relobj::is_merge_section_for): New.
1060 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1061 bits.
1062 * object.h (Relobj::merge_map): Delete.
1063 (initialize_input_to_output_map): New.
1064 (set_merge_map): Delete.
1065 (add_merge_mapping): New.
1066 (merge_output_offset): New.
1067 (is_merge_section_for): New.
1068 * output.cc (Output_section::Input_section::is_merge_section_for):
1069 Use object->is_merge_section_for.
1070 * output.h (Output_section_data::is_merge_section_for): Delete.
1071 (Output_section_data::do_is_merge_section_for): Delete.
1072 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1073 Use object->initialize_input_to_output_map.
1074 (Merged_symbol_value<size>::value_from_output_section): Use
1075 object->merge_output_offset.
1076
48c73428 10772015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1078 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1079
1080 * output.cc (Output_section::add_merge_input_section): Do not
1081 attempt to merge sections with an entsize of 0.
1082
48c73428 10832015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1084
1085 * attributes.h (class Output_attributes_section_data ): Add
1086 do_print_to_mapfile function.
1087
ec86f434
AM
10882015-02-24 Alan Modra <amodra@gmail.com>
1089
1090 PR 18010
1091 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1092 complain if value is not a multiple of four.
1093 (Target_powerpc::Relocate::relocate): Correct handling of
1094 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1095
be66981e
L
10962015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1097
1098 * configure.ac (default_size): Set to 32 for x32.
1099 * configure: Regenerated.
1100
e3ee8ed4
AM
11012015-02-18 Alan Modra <amodra@gmail.com>
1102
1103 PR 17954
1104 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1105 visibility.
1106
3a935c6c
RÁE
11072015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1108
1109 * gc.h (Garbage_collection::add_reference): Don't use find.
1110
e0a1e121
RÁE
11112015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1112
1113 * object.cc (write_local_symbols): avoid std::vector copy.
1114
45a4fb1a
RÁE
11152015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1116
1117 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1118
2d9afefe
MW
11192015-02-09 Mark Wielaard <mjw@redhat.com>
1120
1121 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1122 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1123
e9c1bdad
CC
11242015-02-16 Cary Coutant <ccoutant@google.com>
1125
1126 PR gold/13577
1127 PR gold/16992
1128 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1129 DF_SYMBOLIC if --dynamic-list option is used.
1130 * options.cc (General_options::finalize): --dynamic-list is not
1131 mutually exclusive with -Bsymbolic.
1132 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1133 listed in --dynamic-list.
1134 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1135 -Bsymbolic-functions.
1136 * testsuite/Makefile.in: Regenerate.
1137
0ed4b0bf
CC
11382015-02-16 Cary Coutant <ccoutant@google.com>
1139
1140 PR gold/17971
1141 * incremental.cc: Remove redundant include of "output.h".
1142
1a920511
JY
11432015-02-12 Jing Yu <jingyu@google.com>
1144
1145 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1146 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1147 New relocation.
1148 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1149 TLSLE_MOVW_* relocations.
1150 (Target_aarch64::Scan::global): Likewise.
1151 (Target_aarch64::Relocate::relocate): Likewise.
1152 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1153 for new TLSLE_MOVW_* relocations.
1154
07f107f3
WN
11552015-02-11 Will Newton <will.newton@linaro.org>
1156
1157 PR gold/13321
1158 * arm.cc (Target_arm::make_plt_section): Create an ARM
1159 state mapping symbol at the start of the PLT.
1160
e051a5b5
L
11612015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1162
1163 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1164 Replace two_file_shared_2.so with two_file_shared_1.so.
1165 * testsuite/Makefile.in: Regenerated.
1166
dddcc5b9
AM
11672015-02-09 Alan Modra <amodra@gmail.com>
1168
1169 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1170 plugin_test_thin.a and defsym_test.
1171 * testsuite/Makefile.in: Regenerate.
1172
b39b8b9d
RÁE
11732015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1174
1175 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1176 body.
1177
b66d1c52
CC
11782015-02-04 Peter Collingbourne <pcc@google.com>
1179
1180 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1181 forwarding symbols when computing symbol resolution info for plugins.
1182 * plugin.h (Plugin_manager::symtab): New method.
1183 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1184
23081de0
CC
11852015-02-03 Cary Coutant <ccoutant@google.com>
1186 Peter Collingbourne <pcc@google.com>
1187
1188 PR gold/15660
1189 * archive.cc (Thin_archive_object_unlocker): New class.
1190 (Archive::include_member): Unlock external members of thin archives.
1191 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1192 (plugin_test_2): Likewise.
1193 (plugin_test_3): Likewise.
1194 (plugin_test_4): Likewise.
1195 (plugin_test_5): Likewise.
1196 (plugin_test_6): Likewise.
1197 (plugin_test_7): Likewise.
1198 (plugin_test_8): Likewise.
1199 (plugin_test_9): Likewise.
1200 (plugin_test_10): Likewise.
1201 (plugin_test_11): New test case.
1202 * testsuite/Makefile.in: Regenerate.
1203 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1204 file to decide whether to claim file.
1205 (all_symbols_read_hook): Likewise.
1206 * testsuite/plugin_test_1.sh: Adjust expected output.
1207 * testsuite/plugin_test_2.sh: Likewise.
1208 * testsuite/plugin_test_3.sh: Likewise.
1209 * testsuite/plugin_test_6.sh: Likewise.
1210 * testsuite/plugin_test_tls.sh: Likewise.
1211 * testsuite/plugin_test_11.sh: New testcase.
1212
12132015-02-03 Cary Coutant <ccoutant@google.com>
1214
1215 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1216 file descriptors when debugging enabled. Add debug output.
1217 (Descriptors::release): Add debug output.
1218 (Descriptors::close_some_descriptor): Likewise.
1219 (Descriptors::close_all): Likewise.
1220 * fileread.cc (File_read::lock): Likewise.
1221 (File_read::unlock): Likewise.
1222
24dd5808
CC
12232015-02-02 Cary Coutant <ccoutant@google.com>
1224
1225 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1226 executable output file.
1227
fa89cc82
HS
12282015-01-22 Han Shen <shenhan@google.com>
1229
1230 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1231 (Target_arm::do_plt_address_for_global): New method.
1232 (Target_arm::do_plt_address_for_local): New method.
1233 (Target_arm::rel_irelative_section): New method.
1234 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1235 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1236 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1237 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1238 (Target_arm::Scan::check_non_pic): Add ifunc support.
1239 (Target_arm::Scan::local): Add ifunc support.
1240 (Target_arm::Scan::global): Add ifunc support.
1241 (Target_arm::make_plt_section): New method.
1242 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1243 (Target_arm::make_local_ifunc_plt_entry): New method.
1244 (Target_arm::got_irelative_): New member.
1245 (Target_arm::rel_irelative_): New member.
1246 (Target_arm::got_section): Add creation for got_irelative_.
1247 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1248 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1249 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1250 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1251 (Output_data_plt_arm::IRelative_data): New type.
1252 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1253 (Output_data_plt_arm::add_entry): Add more parameters.
1254 (Output_data_plt_arm::add_relocation): New method.
1255 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1256 (Output_data_plt_arm::rel_irelative): New method.
1257 (Output_data_plt_arm::entry_count): Modified.
1258 (Output_data_plt_arm::address_for_global): New method.
1259 (Output_data_plt_arm::address_for_local): New method.
23081de0 1260gold/
fa89cc82
HS
1261 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1262 (Output_data_plt_arm::insert_irelative_data): New method.
1263 (Output_data_plt_arm::irelative_rel_): New member.
1264 (Output_data_plt_arm::got_): New member.
1265 (Output_data_plt_arm::got_irelative_): New member.
1266 (Output_data_plt_arm::irelative_count_): New member.
1267 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1268 (Output_data_plt_arm::irelative_data_vec_): New member.
1269 (Output_data_plt_arm::do_write): Write out irelative entries.
1270 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1271 more parameters to ctor.
1272 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1273 more parameters to ctor.
1274 * output.h (Output_data_reloc::add_local_relative): New method.
1275 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1276
0f81d3f0
AM
12772015-01-29 Alan Modra <amodra@gmail.com>
1278
1279 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1280 and GOT_TLSGD to LE optimization.
1281
65d92137
CC
12822015-01-28 Cary Coutant <ccoutant@google.com>
1283
1284 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1285 for undef TLS symbols.
1286 (Target_x86_64::Relocate::relocate_tls): Likewise.
1287 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1288
5485698a
CC
12892015-01-25 Cary Coutant <ccoutant@google.com>
1290
1291 * output.cc (Output_segment::set_section_addresses): Fix calculation
1292 of size of relro segment.
1293
b01a4b04
AM
12942015-01-22 Alan Modra <amodra@gmail.com>
1295
1296 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1297 condition for need of ifunc plt entry.
1298 (Target_powerpc::Scan::global <got relocs>): Likewise.
1299
3d0064a9
CC
13002015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1301
1302 * mips.cc (reloc_high): Add r_sym.
1303 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1304 reloc_high constructor.
1305 (Mips_relocate_functions::relgot16_local): Likewise.
1306 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1307 r_type to decide whether LO16 matches HI16.
1308 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1309 rello16 and relgot16_local.
1310
a5cd8f05
CC
13112015-01-09 Cary Coutant <ccoutant@google.com>
1312
1313 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1314 unless alignment is larger than page size.
1315
4fc1b9d4
L
13162015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1317 Cary Coutant <ccoutant@google.com>
1318
1319 PR gold/17729
1320 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1321 (DEFAULT_TARGET_X32): Set for x32.
1322 * x86_64.cc (cmp_insn_32): New.
1323 (lea_r10_insn_32): Likewise.
1324 (lea_r11_insn_32): Likewise.
1325 (cmp_insn_64): Likewise.
1326 (lea_r10_insn_64): Likewise.
1327 (lea_r11_insn_64): Likewise.
1328 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1329 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1330 (check_DATA): Add split_x32 files.
1331 (split_x32_[1234n].o): New targets.
1332 (split_x32_[124]): New targets.
1333 (split_x32_[1234r].stdout): New targets.
1334 * testsuite/split_x32.sh: New file.
1335 * testsuite/split_x32_1.s: Likewise.
1336 * testsuite/split_x32_2.s: Likewise.
1337 * testsuite/split_x32_3.s: Likewise.
1338 * testsuite/split_x32_4.s: Likewise.
1339 * testsuite/split_x32_n.s: Likewise.
1340 * configure: Regenerated.
1341 * testsuite/Makefile.in: Likewise.
1342
e749cab8
L
13432015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1344
1345 PR gold/17809
1346 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1347 x32.
1348
af759df0
AM
13492015-01-02 Alan Modra <amodra@gmail.com>
1350
1351 * version.cc (print_version): Just print current year.
1352 * dwp.cc (print_version): Likewise.
1353
b90efa5b
AM
13542015-01-01 Alan Modra <amodra@gmail.com>
1355
1356 Update year range in copyright notice of all files.
1357
f12d1e8a
AM
13582014-12-25 Alan Modra <amodra@gmail.com>
1359
1360 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1361 new enums.
1362 (Target_arm::merge_object_attributes, ): Likewise.
1363
5c294fee
TG
13642014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1365
1366 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1367 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1368 AEABI_VFP_args_vfp to check that.
1369 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1370 value and replace hardcoded values by enum values.
1371
e30880c2
CC
13722014-12-22 Cary Coutant <ccoutant@google.com>
1373
1374 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1375
bd040da1
L
13762014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1377
1378 PR gold/14608
1379 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1380 to "return i * i * 3;".
1381
e02a4046
CC
13822014-12-16 Cary Coutant <ccoutant@google.com>
1383
1384 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1385 (Mapfile::print_output_data): Use current_data_size() to avoid
1386 assert for sections requiring postprocessing; if address is not valid,
1387 print 0.
1388 (Mapfile::print_output_section): Use current_data_size(); print note
1389 that addresses and sizes are before compression.
1390
add6016b
L
13912014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1392
1393 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1394 Cast current_group_size to unsigned long when reporting error.
1395
0bf32ea9
JY
13962014-12-10 Jing Yu <jingyu@google.com>
1397
1398 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1399 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1400 Update error message.
1401 (Target_aarch64::do_relax): Use absolute value of option
1402 stub_group_size. Replace local variable with class member
1403 stub_group_size_.
1404
cbcb23fa
AM
14052014-12-04 Alan Modra <amodra@gmail.com>
1406
1407 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1408 addend of PLTREL24 reloc when not generating a plt stub. Make
1409 max_branch_offset an "Address".
fbad6518 1410 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1411 (Target_powerpc::Relocate::relocate): Likewise.
1412
1611bc4a
AM
14132014-12-04 Alan Modra <amodra@gmail.com>
1414
1415 PR 17670
1416 * symtab.cc (Symbol::set_undefined): Remove assertion.
1417 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1418 on symbols defined in discarded sections, instead return false.
1419 Rearrange params, update all callers.
1420 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1421 branches to syms in discarded sections.
1422 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1423 undefined and flag as discarded.
1424 (Target_powerpc::Relocate::relocate): Localize variable.
1425
4759c34e
L
14262014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1427
1428 PR gold/17675
1429 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1430 * testsuite/Makefile.in: Regenerated.
1431
1f98a074
AM
14322014-12-03 Alan Modra <amodra@gmail.com>
1433
1434 PR 17566
1435 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1436 when adding dynamic relocations against section symbols.
1437
fb257835
DI
14382014-12-01 Dimitry Ivanov <dimitry@google.com>
1439
1440 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1441 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1442 * options.h (General_options): New -z option (global).
1443
d8e60314
CC
14442014-12-01 Cary Coutant <ccoutant@google.com>
1445
1446 PR gold/17578
1447 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1448 is given.
1449 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1450 given but some inputs require executable stack.
1451
982bbd97
CC
14522014-11-26 Cary Coutant <ccoutant@google.com>
1453
1454 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1455 .debug_str_offsets; strip .debug_gnu_pubnames and
1456 .debug_gnu_pubtypes.
1457 (lines_only_debug_sections): Strip all four new sections.
1458
bb779192
HS
14592014-11-26 Jing Yu <jingyu@google.com>
1460
1461 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1462 register to be x0 when to relax TLSDESC_LD64_LO12.
1463
a3e60ddb
AM
14642014-11-26 Alan Modra <amodra@gmail.com>
1465
1466 * powerpc.cc (struct Stub_table_owner): New.
1467 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1468 unsigned int vector. Update all references.
1469 (powerpc_relobj::set_stub_table): Take an unsigned int param
1470 rather than a Stub_table. Update callers.
1471 (Powerpc_relobj::clear_stub_table): New function.
1472 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1473 stub_group_size_ vars.
1474 (Target_powerpc::new_stub_table): Delete.
1475 (max_branch_delta): New function, extracted from..
1476 (Target_powerpc::Relocate::relocate): ..here..
1477 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1478 status on whether stub created successfully.
1479 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1480 default sizing to..
1481 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1482 reduce on relax failure.
1483 (Target_powerpc::group_sections): Add "no_size_errors" param.
1484 Use stub_group_size_. Set up group info in a temp vector,
1485 before building Stub_table vector. Account for input sections
1486 possibly already converted to relaxed sections.
1487 (Stub_table::init): Delete. Merge into..
1488 (Stub_table::Stub_table): ..here.
1489 (Stub_table::can_reach_stub): New function.
1490 (Stub_table::add_plt_call_entry): Add "from" parameter and
1491 return true iff stub could be reached.
1492 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1493 param too.
1494 (Stub_table::clear_stubs): Add "all" param.
1495
a20605cf
AM
14962014-11-26 Alan Modra <amodra@gmail.com>
1497
1498 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1499 (Target_powerpc::group_sections): Use it.
1500
43b64deb
CC
15012014-11-25 Cary Coutant <ccoutant@google.com>
1502
1503 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1504 (Binary_to_elf::write_symbol): Add st_size parameter.
1505 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1506
c924eb67
CC
15072014-11-25 Cary Coutant <ccoutant@google.com>
1508
1509 PR gold/17639
1510 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1511 (Sized_relobj_file::do_layout): Handle deferred sections properly
1512 during GC pass 1. Don't add reloc sections to deferred list twice.
1513 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1514 (Sized_relobj_file::is_deferred_layout_): New data member.
1515
9d585188
L
15162014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1517
1518 PR gold/17619
1519 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1520 Check PC-relative offset overflow in PLT entry.
1521
3ffaac20
AM
15222014-11-21 Alan Modra <amodra@gmail.com>
1523
1524 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1525 for undefined weaks.
1526
0cfb0717
AM
15272014-11-20 Alan Modra <amodra@gmail.com>
1528
1529 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1530 from --stub-group-size parameter divided by 1024.
1531 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1532 template parameter. Update all uses.
1533 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1534 has_stub_value. Set for long branches. Don't report overflow for
1535 branch to undefined weak symbols. Print info message on
1536 overflowing branch to stub.
1537
f9dffbf0
AM
15382014-11-20 Alan Modra <amodra@gmail.com>
1539
1540 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1541
e88ba8d5
L
15422014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1543
1544 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1545 entry for R_X86_64_GOTPLT64.
1546 (Target_x86_64<size>::Relocate::relocate): Update comments for
1547 R_X86_64_GOTPLT64.
1548
d37ffe25
ED
15492014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1550
1551 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1552 * plugin.h: add lock definition
1553
9726c3c1
HS
15542014-10-29 Han Shen <shenhan@google.com>
1555 Jing Yu <jingyu@google.com>
1556
1557 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1558 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1559 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1560 Symbol::TLS_REF.
1561 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1562 method.
1563 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1564 (Target_aarch64::tls_ld_to_le): New method.
1565 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1566 for 64bit targets.
1567 (Output_data_plt_aarch64::irelative_rel_): New data member.
1568 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1569 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1570 (Output_data_plt_aarch64::add_relocation): New method.
1571 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1572 offset. Add got_irelative size to got size.
1573 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1574 type string with the new typename.
1575 (AArch64_relocate_functions::update_adr): Replace parameter x with
1576 immed.
1577 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1578 (AArch64_relocate_functions::reloc_common): New method.
1579 (AArch64_relocate_funcsions::rela_general): Extract common part out
1580 into reloc_common method.
1581 (AArch64_relocate_functions::rela_general): Likewise.
1582 (AArch64_relocate_functions::pcrela_general): Likewise.
1583 (AArch64_relocate_functions::adr): New method.
1584 (AArch64_relocate_functions::adrp): Calculate immed before calling
1585 update_adr.
1586 (AArch64_relocate_functions::adrp): Likewise.
1587 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1588 comparing x to 0. Calculate immed from ~x when x < 0.
1589 (Target_aarch64::optimize_tls_reloc): Add new cases for
1590 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1591 TLSLD_MOVW_DTPREL_G0_NC.
1592 (Target_aarch64::possible_function_pointer_reloc): Implement this
1593 method.
1594 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1595 comment.
1596 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1597 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1598 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1599 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1600 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1601 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1602 (Target_aarch64::make_plt_entry): Call add_entry with two more
1603 parameters.
1604 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1605 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1606 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1607 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1608 (Target_aarch64::Relocate::relocate_tls): Add cases for
1609 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1610 TLSLD_MOVW_DTPREL_G0_NC.
1611 * testsuite/icf_safe_so_test.cc: Correct test comment.
1612 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1613
80272b8c
AM
16142014-10-22 Alan Modra <amodra@gmail.com>
1615
1616 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1617 thread_starter.
1618
998a69f4
AS
16192014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1620
1621 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1622
aed56ec5
CC
16232014-10-17 Cary Coutant <ccoutant@google.com>
1624
1625 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1626 Add "typename" keyword.
1627
bb779192 16282014-10-15 Han Shen <shenhan@google.com>
72f4393d 1629 Jing Yu <jingyu@google.com>
83a01957
HS
1630
1631 Patch for gold aarch64 backend to support relaxation.
1632 * aarch64-reloc.def: Change format.
1633 * aarch64.cc (class Reloc_stub): New class.
1634 (class Stub_table): New class.
1635 (class AArch64_relobj): New class.
1636 (class AArch64_input_section): New class.
1637 (class AArch64_output_section): New class.
1638 (Target_aarch64::new_stub_table): New method.
1639 (Target_aarch64::new_aarch64_input_section): New method.
1640 (Target_aarch64::find_aarch64_input_section): New method.
1641 (Target_aarch64::scan_section_for_stubs): New method.
1642 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1643 (Target_aarch64::relocate_stub): New method.
1644 (Target_aarch64::current_target): New method.
1645 (Target_aarch64::do_make_elf_object): New method.
1646 (Target_aarch64::do_may_relax): New method.
1647 (Target_aarch64::do_relax): New method.
1648 (Target_aarch64::group_sections): New method.
1649 (Target_aarch64::scan_reloc_for_stub): New method.
1650 (Target_aarch64::do_make_output_section): New method.
1651 (Target_aarch64::stub_tables_): New data member.
1652 (Target_aarch64::aarch64_input_section_map_): New data member.
1653 (AArch64_relocate_functions::maybe_apply_stub): New method.
1654
db4c9594
CC
16552014-09-30 Cary Coutant <ccoutant@google.com>
1656
1657 PR gold/17432
1658 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1659
cd6da036
KC
16602014-09-30 Kito Cheng <kito@0xlab.org>
1661
1662 PR gold/13597
1663 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1664 hash table before sysv-style hash table.
1665
5f772412
ST
16662014-09-29 Sriraman Tallam <tmsriram@google.com>
1667
1668 * options.h (--pic-executable): Add negative to alias to -no-pie.
1669
5efeedf6
CC
16702014-09-26 Cary Coutant <ccoutant@google.com>
1671
1672 PR gold/16773
1673 * object.cc (Sized_relobj_file): Compute value of section symbols
1674 for TLS sections the same as TLS symbols.
1675
1707f183
CC
16762014-09-25 Cary Coutant <ccoutant@google.com>
1677
1678 PR gold/17432
1679 * resolve.cc (Symbol_table::resolve): Override common placeholder
1680 symbols, but adjust sizes.
1681 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1682 symbols to common lists.
1683
00cac886
AM
16842014-09-24 Alan Modra <amodra@gmail.com>
1685
1686 * po/POTFILES.in: Regenerate.
1687
635aa30e 16882014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1689 Cary Coutant <ccoutant@google.com>
635aa30e 1690
71b9b91b 1691 PR gold/14860
635aa30e
CC
1692 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1693 on input_sections_blocker.
1694 * layout.cc (Write_sections_task::locks): Unblock
1695 input_sections_blocker_.
1696 * layout.h (Write_sections_task::Write_sections_task): Add
1697 input_sections_blocker.
1698 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1699 to DEPENDENCIES.
1700 * testsuite/Makefile.in: Regenerate.
1701
c0c71592
RÁE
17022014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1703
1704 * testsuite/Makefile.am (plugin_test_10): New test.
1705 * testsuite/Makefile.in: Regenerate
1706 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1707 * testsuite/plugin_test_10.sh: New file.
1708
6168c2a1
RÁE
17092014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1710
1711 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1712 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1713 during the replacement phase.
1714
3a531937
JY
17152014-09-17 Han Shen <shenhan@google.com>
1716 Jing Yu <jingyu@google.com>
1717
1718 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1719 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1720 * aarch64.cc (Target_aarch64): Add data members
1721 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1722 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1723 constructor.
1724 (Target_aarch64::do_reloc_symbol_index): New method.
1725 (Target_aarch64::do_reloc_addend): New method.
1726 (Target_aarch64::add_tlsdesc_info): New method.
1727 (Target_aarch64::do_dynsym_value): New method.
1728 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1729 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1730 (Target_aarch64::make_data_plt): Add new parameters: got,
1731 got_irelative. Pass them to do_make_data_plt.
1732 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1733 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1734 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1735 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1736 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1737 (Target_aarch64::got_tlsdesc_section): New method.
1738 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1739 (Target_aarch64::define_tls_base_symbol): New method.
1740 (Target_aarch64::reserve_tlsdesc_entries): New method.
1741 (Target_aarch64::got_mod_index_entry): New method.
1742 (Target_aarch64::rela_tlsdesc_section): New method.
1743 (Target_aarch64::rela_irelative_section): New method.
1744 (Target_aarch64::Tlsdesc_info): New struct.
1745 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1746 relocations and tlsdesc relocations.
1747 (Target_aarch64::optimize_tls_reloc): Implement method.
1748 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1749 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1750 in constructor.
1751 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1752 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1753 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1754 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1755 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1756 (Output_data_plt_aarch64::rela_irelative): New method.
1757 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1758 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1759 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1760 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1761 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1762 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1763 (Output_data_plt_aarch64_standard): New member variables:
1764 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1765 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1766 New parameter: got, got_irelative.
1767 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1768 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1769 (Output_data_plt_aarch64::do_write): Replace got_address with
1770 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1771 (AArch64_relocate_functions::update_movnz): New method.
1772 (AArch64_relocate_functions): Correct format.
1773 (AArch64_relocate_functions::movnz): New method.
1774 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1775 before the switch. Add new cases to switch.
00cac886 1776 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1777 tlsgd tlsdesc cases.
1778 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1779 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1780 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1781 Call reloc_name_in_error_message to print unsupported reloc.
1782 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1783 make_data_plt.
1784 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1785 relocs. Fill in some more dynamic tags.
1786 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1787 Skip call tls_get_addr when tlsgd is relaxed.
1788 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1789 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1790 tlsdesc->ie relaxation.
1791
62661c93
SS
17922014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1793
1794 * mips.cc (Target_mips_nacl): New class.
1795 (Target_selector_mips_nacl): New class.
1796 (target_selector_mips32): Rename from target_selector_mips32be and use
1797 Target_selector_mips_nacl instead of Target_selector_mips.
1798 (target_selector_mips32el): Rename from target_selector_mips32 and use
1799 Target_selector_mips_nacl instead of Target_selector_mips.
1800 (target_selector_mips64): Rename from target_selector_mips64be and use
1801 Target_selector_mips_nacl instead of Target_selector_mips.
1802 (target_selector_mips64el): Rename from target_selector_mips64 and use
1803 Target_selector_mips_nacl instead of Target_selector_mips.
1804 (Target_mips::mips_info): Add const attribute.
1805
54674d38
CC
18062014-09-02 Cary Coutant <ccoutant@google.com>
1807
1808 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1809 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1810 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1811 (Sized_incr_dynobj::do_section_name): Likewise.
1812 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1813 (Sized_incr_dynobj::do_section_name): Likewise.
1814 * object.h (Object::section_name): Likewise.
1815 (Object::do_section_name): Likewise.
1816 (Sized_relobj_file::do_section_name): Likewise.
1817 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1818 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1819
9860cbcf
CC
18202014-09-02 Cary Coutant <ccoutant@google.com>
1821
1822 PR gold/17005
1823 * ehframe.cc (Fde::write): Add output_offset parameter.
1824 (Cie::write): Likewise.
1825 (Eh_frame::set_final_data_size): Account for offset within output
1826 section.
1827 (Eh_frame::do_sized_write): Likewise.
1828 * ehframe.h (Fde::write): Add output_offset parameter.
1829 (Cie::write): Likewise.
1830 * output.cc (Output_section::Input_section_sort_entry): Remove
1831 section_has_name_; add output_section_name parameter. Use
1832 output section name for non-input sections.
1833 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1834 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1835 (Output_section::Input_section_sort_compare): Remove logic for
1836 sections without names.
1837 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1838 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1839 Likewise.
1840 (Output_section::Input_section_sort_section_name_compare): Likewise.
1841
8e33481e
HS
18422014-08-29 Han Shen <shenhan@google.com>
1843 Jing Yu <jingyu@google.com>
1844
1845 * aarch64-reloc-property.cc
1846 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1847 reference reloc property in the table.
1848 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1849 3 other entries.
1850 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1851 2 new overloaded methods.
1852 (Output_data_got_aarch64::do_write): Add code to write out
1853 static relocs.
1854 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1855 static relocs.
1856 (Output_data_got_aarch64::static_relocs): New vector to
1857 hold static relocs.
1858 (Target_aarch64::TCB_SIZE): New const static memeber.
1859 (Target_aarch64::tcb_size): New method.
1860 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1861 (Target_aarch64::Relocate::relocate_tls): New method.
1862 (Target_aarch64::Scan::local): Add code handling new reloc types.
1863 (Target_aarch64::Scan::global): Add code handling new reloc types.
1864
81233653
ST
18652014-08-13 Sriraman Tallam <tmsriram@google.com>
1866
1867 * options.h (-no-pie): Add option.
1868
9363c7c3
JY
18692014-08-08 Jing Yu <jingyu@google.com>
1870 Han Shen <shenhan@google.com>
1871
1872 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1873 (DEFFILES): add aarch64-reloc.def.
1874 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1875 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1876 * Makefile.in: Regenerate.
1877 * aarch64-reloc-property.cc: New file.
1878 * aarch64-reloc-property.h: New file.
1879 * aarch64-reloc.def: New file.
1880 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1881 with tab to make the format consistent.
1882 (Output_data_got_aarch64::symbol_table_): New method.
1883 (Target_aarch64::do_plt_address_for_global): New method.
1884 (Target_aarch64::do_plt_address_for_local): New method.
1885 (Target_aarch64::do_select_as_default_target): New method.
1886 (Target_aarch64::do_make_data_plt): New method.
1887 (Target_aarch64::make_data_plt): New method.
1888 (Output_data_plt_aarch64::has_irelative_section): New method.
1889 (Output_data_plt_aarch64::address_for_global): New method.
1890 (Output_data_plt_aarch64::address_for_local): New method.
1891 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1892 (Output_data_plt_aarch64::add_entry): Implement contents.
1893 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1894 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1895 the got_pov entry to plt0.
1896 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1897 Implement contents.
1898 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1899 (AArch64_howto): New struct.
1900 (aarch64_howto[]): New static const array.
1901 (AArch64_relocate_functions): New class.
1902 (Target_aarch64::Scan::get_reference_flags): Remove method.
1903 (Target_aarch64::Scan::local): Implement to support a few relocations.
1904 (Target_aarch64::Scan::global): Implement to support a few relocations.
1905 (Target_aarch64::make_plt_section): Implement contents.
1906 (Target_aarch64::make_plt_entry): Implement contents.
1907 (Target_aarch64::do_finalize_sections): Implement contents.
1908 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1909 (Target_aarch64::relocate_section): Implement contents.
1910
ad9fe6c1
AM
19112014-08-06 Alan Modra <amodra@gmail.com>
1912
1913 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1914
7cd4e5b7
AM
19152014-08-06 Alan Modra <amodra@gmail.com>
1916
1917 PR 13227
1918 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1919
5ad9b0a7
ST
19202014-07-21 Sriraman Tallam <tmsriram@google.com>
1921
1922 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1923 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1924
e051745c
CC
19252014-07-08 Cary Coutant <ccoutant@google.com>
1926
1927 * expression.cc (struct Expression::Expression_eval_info): Add
1928 new fields type_pointer, vis_pointer, and nonvis_pointer.
1929 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1930 nonvis_pointer parameters. Adjust all calls.
1931 (Symbol_expression::value): Update type, visibility, and nonvis bits
1932 in caller.
1933 * script.cc (Symbol_assignment::sized_finalize): Update type,
1934 visibility, and remaining st_other bits for new symbol.
1935 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1936 vis_pointer, and nonvis_pointer parameters.
1937 * symtab.h (Symbol::set_type): New method.
1938
1939 * testsuite/Makefile.am (defsym_test): New test.
1940 * testsuite/Makefile.in: Regenerate.
1941 * testsuite/defsym_test.c: New file.
1942 * testsuite/defsym_test.sh: New file.
1943
f35c4853
CC
19442014-07-08 Cary Coutant <ccoutant@google.com>
1945
1946 PR gold/15639
1947 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1948 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1949 (Sized_dynobj::base_read_symbols): ...new method.
1950 * object.h (Sized_relobj_file::base_read_symbols): New method.
1951 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1952 (Sized_relobj_file::base_read_symbols): ...new method.
1953 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1954 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1955 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1956
2900af2d
AM
19572014-07-04 Alan Modra <amodra@gmail.com>
1958
1959 * po/POTFILES.in: Regenerate.
1960
053a4d68
JY
19612014-07-02 Jing Yu <jingyu@google.com>
1962
1963 * aarch64.cc: New file
1964 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1965 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1966 * Makefile.in: Regenerate.
1967 * configure.tgt: Add entries for aarch64*.
1968 * configure.ac: Likewise.
1969 * configure: Likewise.
1970
7b549045
AM
19712014-06-27 Alan Modra <amodra@gmail.com>
1972
1973 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1974
cb818dbf
CC
19752014-06-24 Cary Coutant <ccoutant@google.com>
1976
1977 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1978 sections.
1979 (Dwo_file::sized_read_unit_index): Likewise.
1980
9810d34d
SS
19812014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1982
1983 * mips.cc: New file.
1984 * Makefile.am (TARGETSOURCES): Add mips.cc
1985 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1986 * configure.tgt: Add entries for mips*.
1987 * configure.ac: Likewise.
1988 * Makefile.in: Regenerate.
1989 * configure: Likewise.
1990
9baa787b
CC
19912014-06-09 Cary Coutant <ccoutant@google.com>
1992
1993 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1994 unit_length is within section bounds.
1995
8f89af0a
CC
19962014-06-09 Cary Coutant <ccoutant@google.com>
1997
1998 PR gold/16980
1999 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2000 map.
2001
a47622ac
AM
20022014-06-07 Alan Modra <amodra@gmail.com>
2003
2004 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2005
4320c691
CC
20062014-06-06 Cary Coutant <ccoutant@google.com>
2007
2008 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2009 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2010 (Dwarf_pubnames_table::read_header): Likewise.
2011 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2012 .debug_gnu_pubtypes.
2013
270c9937
JB
20142014-06-05 Joel Brobecker <brobecker@adacore.com>
2015
2016 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2017 * Makefile.in, configure: Regenerate.
2018
397998fc
AM
20192014-06-03 Alan Modra <amodra@gmail.com>
2020
2021 * powerpc.cc (addis_12_2): Define.
2022 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2023
61f5c66f
AM
20242014-06-03 Alan Modra <amodra@gmail.com>
2025
2026 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2027 st_other output.
2028
f6971787
AM
20292014-06-02 Alan Modra <amodra@gmail.com>
2030
2031 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2032 Only ignore relocs on ELFv1.
2033 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2034
f6fb8322
CC
20352014-05-30 Cary Coutant <ccoutant@google.com>
2036
2037 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2038 * testsuite/Makefile.in: Regenerate.
2039 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2040
c23dd342
L
20412014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2042
2043 PR gold/16945
2044 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2045 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2046
5fe7ffdc
AM
20472014-05-15 Alan Modra <amodra@gmail.com>
2048
2049 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2050 Compare FDE contents with DW_CFA_nop rather than 0.
2051
a82bef93
ST
20522014-05-13 Sriraman Tallam <tmsriram@google.com>
2053
2054 * symtab.h (may_need_copy_reloc): Remove check for position independent
2055 code.
2056 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2057 position independence before pc absolute may_need_copy_reloc call.
2058 Add check for executable output befor pc relative may_need_copy_reloc
2059 call.
2060 * i386.cc: Ditto.
2061 * arm.cc: Ditto.
2062 * sparc.cc: Ditto.
2063 * tilegx.cc: Ditto.
2064 * powerpc.cc: Add check for no position independence before
2065 may_need_copy_reloc calls.
2066 * testsuite/pie_copyrelocs_test.cc: New file.
2067 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2068 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2069 * Makefile.in: Regenerate.
a82bef93 2070
53c66605
ML
20712014-05-08 Martin Liška <mliska@suse.cz>
2072
2073 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2074
57b2284c
CC
20752014-05-06 Cary Coutant <ccoutant@google.com>
2076
2077 PR gold/16900
2078 * i386.cc (Output_data_got_plt_i386): New class.
2079 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2080 parameter. Change all callers.
2081 (Output_data_plt_i386::layout_): Remove.
2082 (Output_data_plt_i386::got_plt_): Change type.
2083 (Target_i386::got_plt_): Change type. Change all references.
2084 (Target_i386::got_section): Create instance of new class.
2085 (Output_data_got_plt_i386::do_write): New function.
2086 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2087 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2088 parameter. Change all callers.
2089 (Output_data_plt_x86_64::layout_): Remove.
2090 (Output_data_plt_x86_64::got_plt_): Change type.
2091 (Target_x86_64::got_plt_): Change type. Change all references.
2092 (Target_x86_64::got_section): Create instance of new class.
2093 (Output_data_got_plt_x86_64::do_write): New function.
2094 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2095 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2096 class.
2097
6b97515d 20982014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2099
6b97515d
CC
2100 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2101 if we have pubnames/pubtypes.
2102
d1bddd3c
CC
21032014-05-02 Cary Coutant <ccoutant@google.com>
2104
5fe7ffdc
AM
2105 * defstd.cc (in_segment): Define __ehdr_start here...
2106 * layout.cc (Layout::finalize): ...Instead of here. Set the
2107 output segment when known.
2108 * resolve.cc (Symbol::override_base_with_special): Remember
2109 the original binding.
2110 * symtab.cc (Symbol::set_output_segment): New function.
2111 (Symbol::set_undefined): New function.
2112 * symtab.h (Symbol::is_weak_undefined): Check original undef
2113 binding.
2114 (Symbol::is_strong_undefined): New function.
2115 (Symbol::set_output_segment): New function.
2116 (Symbol::set_undefined): New function.
2117 * target-reloc.h (is_strong_undefined): Remove.
2118 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2119 Check for hidden undefs.
2120 (relocate_section): Call Symbol::is_strong_undefined.
2121
2122 * testsuite/Makefile.am (ehdr_start_test_1)
2123 (ehdr_start_test_2, ehdr_start_test_3)
2124 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2125 * testsuite/Makefile.in: Regenerate.
2126 * testsuite/ehdr_start_def.cc: New source file.
2127 * testsuite/ehdr_start_test.cc: New source file.
2128 * testsuite/ehdr_start_test.t: New linker script.
2129 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2130
7849f6d8
CC
21312014-04-23 Cary Coutant <ccoutant@google.com>
2132
bf2cc635 2133 PR gold/16870
7849f6d8
CC
2134 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2135
99fd8cff
CC
21362014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2137
2138 * layout.cc (Layout::include_section): Allow a target to decide
2139 whether to include a section.
2140 * target.h (Target::should_include_section): New function.
2141 (Target::do_should_include_section): New function.
2142
91f43acd
CC
21432014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2144
2145 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2146 inline into ...
2147 (Copy_relocs::emit): ... here.
2148 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2149 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2150 (Copy_reloc_entry::entries_): Change from private to protected.
2151
c4eb27e1
ST
21522014-04-02 Sriraman Tallam <tmsriram@google.com>
2153
2154 * icf.cc (get_section_contents): Replace copies of reloc
2155 vectors with const references.
2156
ae447ddd
CC
21572014-04-02 Cary Coutant <ccoutant@google.com>
2158
2159 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2160 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2161 * configure: Regenerate.
2162 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2163 -fno-use-linker-plugin.
2164 (LINK1, CXXLINK1): Add it to the link command.
2165 * testsuite/Makefile.in: Regenerate.
2166
fa47fa92
AM
21672014-03-12 Alan Modra <amodra@gmail.com>
2168
2169 * Makefile.in: Regenerate.
2170
9b12c500
CC
21712014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2172
2173 * symtab.h (Symbol::set_nonvis): New function.
2174
beacaa96
CC
21752014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2176
2177 * symtab.cc (Sized_symbol<32>::init_output_data):
2178 Instantiate the template.
2179 (Sized_symbol<64>::init_output_data): Likewise.
2180
800d9823
CC
21812014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2182
2183 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2184 adjust dynamic symbol value.
2185 * target.h (Target::adjust_dyn_symbol): New function.
2186 (Target::do_adjust_dyn_symbol): New function.
2187
918fc1f8 21882014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2189
918fc1f8
CC
2190 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2191 Get the value of DYNAMIC_CUSTOM dynamic entry.
2192 * output.h (Output_data_dynamic::add_custom): New function.
2193 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2194 dynamic entry.
2195 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2196 * target.h (Target::dynamic_tag_custom_value): New function.
2197 (Target::do_dynamic_tag_custom_value): New function.
2198
98ff9231
CC
21992014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2200
2201 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2202 dynsym indexes.
2203 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2204 (Target::do_has_custom_set_dynsym_indexes): New function.
2205 (Target::set_dynsym_indexes): New function.
2206 (Target::do_set_dynsym_indexes): New function.
2207
b80eed39
AM
22082014-03-07 Alan Modra <amodra@gmail.com>
2209
2210 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2211 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2212 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2213 (Powerpc_relocate_functions::has_overflow_bitfield,
2214 overflowed): Use the above.
2215 (Target_powerpc::Relocate::relocate): Correct overflow checking
2216 for a number of relocations. Modify overflow test for 16-bit
2217 fields in instructions to signed/unsigned according to whether
2218 the field takes a signed or unsigned value.
2219
4b95cf5c
AM
22202014-03-05 Alan Modra <amodra@gmail.com>
2221
2222 Update copyright years.
2223
45965137
AM
22242014-03-05 Alan Modra <amodra@gmail.com>
2225
2226 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2227 R_PPC64_ADDR64_LOCAL.
2228 (Target_powerpc::Relocate::relocate): Likewise.
2229
2c80b753
AM
22302014-03-03 Alan Modra <amodra@gmail.com>
2231
2232 * dwp.cc (print_version): Update copyright year to current.
2233
c1c69e83
AM
22342014-02-10 Alan Modra <amodra@gmail.com>
2235
2236 * po/gold.pot: Regenerate.
2237
dd0c4e70
CC
22382014-02-06 Cary Coutant <ccoutant@google.com>
2239
2240 Fix problem where -u is ignored when a weak undef is seen.
2241
2242 * archive.cc (Library_base::should_include_member): Reorder
2243 code to check for -u option if a weak undef has already been seen.
2244 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2245 * testsuite/Makefile.in: Regenerate.
2246 * testsuite/weak_undef_file3.cc: New file.
2247 * testsuite/weak_undef_file4.cc: New file.
2248 * testsuite/weak_undef_test_2.cc: New file.
2249
1a221d3d
CC
22502014-02-05 Cary Coutant <ccoutant@google.com>
2251
2252 Fix issues with gold undefined symbol diagnostics.
2253
2254 PR binutils/15435
2255 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2256 check to here.
2257 * target-reloc.h (is_strong_undefined): New function.
2258 (relocate_section): Move undef vtable symbol check from here.
2259 Check for is_strong_undefined.
2260
e889f0a4 22612014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2262
e889f0a4
CC
2263 Fix problems with the --dynamic-list option.
2264
2265 PR gold/13577
2266 * options.cc (General_options::parse_dynamic_list):
2267 Set have_dynamic_list_.
2268 (General_options::General_options): Initialize have_dynamic_list_.
2269 (General_options::finalize): Turn off -Bsymbolic and
2270 -Bsymbolic-functions if --dynamic-list provided.
2271 * options.h (General_options::have_dynamic_list): New function.
2272 (General_options::have_dynamic_list_): New data member.
2273 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2274 correctly.
5fe7ffdc 2275
e889f0a4
CC
2276 PR gold/16530
2277 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2278 in --dynamic-list, mark it.
5fe7ffdc 2279
e889f0a4
CC
2280 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2281 (dynamic_list_2): New test case.
2282 * testsuite/Makefile.in: Regenerate.
2283 * testsuite/dynamic_list_2.cc: New file.
2284 * testsuite/dynamic_list_2.t: New file.
2285 * testsuite/dynamic_list_lib1.cc: New file.
2286 * testsuite/dynamic_list_lib2.cc: New file.
2287 * testsuite/gc_dynamic_list_test.c: New file.
2288 * testsuite/gc_dynamic_list_test.sh: New file.
2289 * testsuite/gc_dynamic_list_test.t: New file.
2290
ec673e64
CC
22912014-01-28 Cary Coutant <ccoutant@google.com>
2292
2293 Add .gdb_index version 7 support.
2294
2295 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2296 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2297 debug sections.
2298 (Dwarf_ranges_table::read_ranges_table): Likewise.
2299 (Dwarf_pubnames_table::read_section): Check for GNU-style
2300 sections, and for compressed debug sections.
2301 (Dwarf_pubnames_table::read_header): Compute end address of table.
2302 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2303 for end of list by offset, not by offset == 0.
2304 (Dwarf_info_reader::do_read_string_table): Check for compressed
2305 debug sections.
2306 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2307 Initialize new data members.
2308 (Dwarf_pubnames_table::next_name): return flag_byte.
2309 (Dwarf_pubnames_table::end_of_table_): New data member.
2310 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2311 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2312 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2313 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2314 read skeleton type unit DIEs.
2315 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2316 (Gdb_index::do_write): Write flag_byte.
2317 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2318 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2319 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2320 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2321
221fd5d5
L
23222014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2323
2324 * version.cc (print_version): Update copyright year to 2014.
2325
6c09fb0b
ILT
23262013-12-19 Dimitry Andric <dimitry@andric.com>
2327
2328 * stringpool.cc (Stringpool_template::reserve): Add
2329 HAVE_UNORDERED_MAP case.
2330 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2331
8356f2d0
CC
23322013-12-18 Cary Coutant <ccoutant@google.com>
2333
2334 * configure.ac: Check for <unordered_set> and <unordered_map>.
2335 * config.in: Regenerate.
2336 * configure: Regenerate.
2337 * system.h: Use <unordered_set> and <unordered_map> if available.
2338
f2c7d7ee
RM
23392013-12-10 Roland McGrath <mcgrathr@google.com>
2340
2341 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2342 with $(INSTALL_PROGRAM_ENV).
2343 * Makefile.in: Regenerate.
2344
6632e8cc
CC
23452013-11-22 Cary Coutant <ccoutant@google.com>
2346
2347 * configure.ac: Add check for which library is needed for
2348 dlopen.
2349 * configure: Regenerate.
2350
0c075858
CC
23512013-11-22 Cary Coutant <ccoutant@google.com>
2352
2353 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2354 assembler.
2355 * testsuite/Makefile.in: Regenerate.
2356
f49fe902
L
23572013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2358
2359 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2360 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2361 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2362 (Target_x86_64<size>::Scan::local): Likewise.
2363 (Target_x86_64<size>::Scan::global): Likewise.
2364 (Target_x86_64<size>::Relocate::relocate): Likewise.
2365 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2366 Likewise.
2367 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2368 R_X86_64_PC32_BND.
2369
2370 * testsuite/Makefile.am (check_PROGRAMS): Add
2371 exception_x86_64_bnd_test.
2372 (exception_x86_64_bnd_test_SOURCES): New macro.
2373 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2374 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2375 (exception_x86_64_bnd_test_LDADD): Likewise.
2376 (exception_x86_64_bnd_1.o): New rule.
2377 (exception_x86_64_bnd_2.o): Likewise.
2378 * testsuite/Makefile.in: Regenerated.
2379
9055360d
AM
23802013-11-15 Alan Modra <amodra@gmail.com>
2381
2382 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2383 accessor.
2384 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2385 Only call ppc64_local_entry_offset for 64-bit. Restrict
2386 symval_for_branch lookup to ELFv1.
2387 (Stub_table::add_plt_call_entry): Use unsigned int off.
2388 (Output_data_glink::Address, invalid_address): New.
2389 (Output_data_glink::add_eh_frame): Move out of line. Add
2390 support for ELFv2.
2391 (Output_data_glink::add_global_entry, find_global_entry,
2392 global_entry_address): New functions.
2393 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2394 ge_size): New variables.
2395 (Output_data_glink::set_final_data_size): Add global entry
2396 stub sizing.
2397 (Output_data_glink::do_write): Write global entry stubs.
2398 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2399 parameter. Return true for ELFv2. Adjust callers.
2400 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2401 ELFv1. Similarly for ifunc and dynamic relocation processing
2402 specific to ELFv1. Recognize that symbols are defined on
2403 their plt entries for ELFv2.
2404 (Target_powerpc::symval_for_branch): Assert if called for
2405 ELFv2 or ppc32.
2406 (Target_powerpc::Relocate::relocate): Use global entry plt
2407 stub for symbol value if such exists on ELFv2.
2408 (Target_powerpc::Relocate::relocate): Don't call
2409 symval_for_branch when ELFv2. Do adjust for local entry
2410 offset when ELFv2.
2411 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2412 plt stub for ELFv2.
2413 (Target_powerpc::do_plt_address_for_global): Similarly.
2414
cafdd569
CC
24152013-11-14 Cary Coutant <ccoutant@google.com>
2416
2417 Revert patch -- this did not fix the problem, and there is
2418 no race there.
2419
2420 2013-11-14 Cary Coutant <ccoutant@google.com>
2421
2422 PR gold/14860
2423 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2424 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2425 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2426 updating fde_offsets_.
2427 (Eh_frame_hdr::lock_): New data member.
2428
94e49e16
CC
24292013-11-14 Cary Coutant <ccoutant@google.com>
2430
2431 * dwp.cc (Dwo_file_entry): New type.
2432 (File_list): Use Dwo_file_entry.
2433 (Dwo_file::verify): New function.
2434 (Dwo_file::verify_dwo_list): New function.
2435 (Dwo_file::sized_verify_dwo_list): New function.
2436 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2437 list.
2438 (Dwp_options): New enum type.
2439 (dwp_options): Add --verify-only.
2440 (usage): Likewise.
2441 (main): Likewise.
2442 * dwp.h (gold_info): Add declaration.
2443
7cdd7d57
CC
24442013-11-14 Cary Coutant <ccoutant@google.com>
2445
2446 PR gold/14860
2447 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2448 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2449 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2450 updating fde_offsets_.
2451 (Eh_frame_hdr::lock_): New data member.
2452
1d946cb3
CC
24532013-11-06 Cary Coutant <ccoutant@google.com>
2454
2455 PR gold/15758
2456 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2457 before reloc sections.
2458
4f65b40e
AM
24592013-11-04 Alan Modra <amodra@gmail.com>
2460
2461 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2462 (Symbol::needs_dynamic_reloc): Test new flag.
2463 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2464 (Target_powerpc::Scan::get_reference_flags): Add target param.
2465 Return FUNC_DESC_ABI for 64-bit ELFv1.
2466 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2467 call.
2468 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2469 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2470
908794a9
CC
24712013-10-31 Cary Coutant <ccoutant@google.com>
2472
2473 Restore support for dwp v2 DWARF package file format.
2474
2475 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2476 tu_length parameter. Adjust all callers.
2477 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2478 * dwp.cc: Include dwarf.h.
2479 (Section_bounds): New struct type.
2480 (Unit_set): New struct type.
2481 (Dwo_file::Dwo_file): Initialize new data member.
2482 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2483 Combine and rename to...
2484 (Dwo_file::read_unit_index): ...this.
2485 (Dwo_file::sized_read_compunit_index)
2486 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2487 (Dwo_file::sized_read_unit_index): ...this.
2488 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2489 parameters; add section_id parameter.
2490 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2491 (Dwo_file::add_unit_set): ...this.
2492 (Dwo_file::shndx_map_): Remove.
2493 (Dwo_file::sect_offsets_): New data member.
2494 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2495 (Dwp_output_file::add_section): Rename to...
2496 (Dwp_output_file::add_contribution): ...this.
2497 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2498 (Dwp_output_file::add_tu_set): Likewise.
2499 (Dwp_output_file::Contribution): New type.
2500 (Dwp_output_file::Section::contributions): New data member.
2501 (Dwp_output_file::Cu_or_tu_set): Remove.
2502 (Dwp_output_file::Section::Section): New ctor.
2503 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2504 (Dwp_output_file::Dwp_index::Section_table): New type.
2505 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2506 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2507 parameter.
2508 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2509 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2510 (Dwp_output_file::Dwp_index::section_table): New member function.
2511 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2512 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2513 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2514 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2515 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2516 (Dwp_output_file::Dwp_index::section_table_): New data member.
2517 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2518 (Dwp_output_file::add_output_section): New member function.
2519 (Dwp_output_file::write_new_section): New member function.
2520 (Dwp_output_file::write_contributions): New member function.
2521 (Dwp_output_file::section_id_map_): New data member.
2522 (class Dwo_id_info_reader): Remove.
2523 (class Unit_reader): New class.
2524 (get_dwarf_section_name): New function.
2525 (Dwo_file::read_executable): Adjust initializations of class data.
2526 (Dwo_file::read): Add support for v2 package file format.
2527 (Dwo_file::read_unit_index): Likewise.
2528 (Dwo_file::sized_read_unit_index): Likewise.
2529 (Dwo_file::copy_section): Likewise.
2530 (Dwo_file::add_unit_set): Likewise.
2531 (Dwp_output_file::add_output_section): Likewise.
2532 (Dwp_output_file::add_contribution): Likewise.
2533 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2534 for empty slot.
2535 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2536 file format.
2537 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2538 slot.
2539 (Dwp_output_file::initialize): Remove unused function.
2540 (Dwp_output_file::finalize): Add support for v2 package file format.
2541 (Dwp_output_file::write_index): Likewise.
2542 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2543 function prototype.
2544
2500c017
CC
25452013-10-31 Cary Coutant <ccoutant@google.com>
2546
2547 * configure.ac: Fix check for -fmerge-constants.
2548 * configure.ac: Regenerate.
2549
dd0845d7
RM
25502013-10-30 Roland McGrath <mcgrathr@google.com>
2551
2552 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2553 Correct 9-byte nop sequence to match what the assembler generates.
2554
b4f7960d
AM
25552013-10-30 Alan Modra <amodra@gmail.com>
2556
2557 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2558 ppc64_local_entry_offset, ppc64_local_entry_offset,
2559 do_read_symbols): New functions.
2560 (Powerpc_relobj::e_flags_, st_other_): New vars.
2561 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2562 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2563 (Powerpc_relobj::e_flags_): New var.
2564 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2565 and adjust for ELFv2.
2566 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2567 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2568 (Powerpc_dynobj::do_find_special_sections): Likewise.
2569 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2570 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2571 to ELFv2 local entry.
2572 (Target_powerpc::do_relax): No thread safe barriers needed for
2573 ELFv2.
2574 (Output_data_plt_powerpc::initial_plt_entry_size_,
2575 plt_entry_size): Delete. Replace all uses with
2576 first_plt_entry_offset() and plt_entry_size().
2577 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2578 reserved_size parm. Update callers.
2579 (Output_data_plt_powerpc::entry_count): Update.
2580 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2581 and use Target_powerpc::first_plt_entry_offset().
2582 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2583 rename to plt_entry_size.
2584 (Output_data_plt_powerpc::add_ifunc_entry,
2585 add_local_ifunc_entry): Adjust reloc for ELFv2.
2586 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2587 (glink_eh_frame_fde_64v2): New.
2588 (Stub_table::plt_call_size): Support ELFv2 sizing.
2589 (Output_data_glink::add_eh_frame): Use the new FDE.
2590 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2591 (Stub_table::do_write): Write ELFv2 stubs and glink.
2592 (Target_powerpc::Relocate::relocate): Replaces nop after call
2593 with ld 2,24(1) and adjust local offset destination for ELFv2.
2594
f9c6b907
AM
25952013-10-30 Alan Modra <amodra@gmail.com>
2596
2597 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2598 (Target_powerpc::Scan::global, local): Likewise.
2599 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2600 on all ppc64 @h and @ha relocs.
2601
e84fe78f
AM
26022013-10-14 Alan Modra <amodra@gmail.com>
2603
2604 * output.h (Output_data_got::add_constant): Tidy.
2605 (Output_data_got::add_constant_pair): New function.
2606 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2607 methods used so as to first call reserve_ent().
2608
679e4abf
RM
26092013-10-11 Roland McGrath <mcgrathr@google.com>
2610
44dcb735
RM
2611 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2612 add_got_entry and add_got_entry_pair.
2613
13323c49
RM
2614 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2615 (HAVE_PUBNAMES): Likewise.
2616 * configure: Regenerate.
2617
1496b446
RM
2618 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2619 * testsuite/Makefile.in: Regenerate.
2620
cc84c10b
RM
2621 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2622 Remove const from declaration.
2623 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2624 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2625 * output.h (Output_file_header): Remove const from member target_
2626 and corresponding constructor argument.
2627 * output.cc (Output_file_header::Output_file_header): Update prototype.
2628 (Output_file_header::do_sized_write): Use this->target_ in place
2629 of parameters()->target().
2630
52f66a2c
RM
2631 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2632
2b64b551
RM
2633 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2634 * configure: Regenerate.
2635 * Makefile.in: Regenerate.
2636 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2637 * testsuite/merge_string_literals_2.c: Likewise.
2638 * testsuite/Makefile.am
2639 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2640 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2641 literal -fmerge-constants.
2642 * testsuite/Makefile.in: Regenerate.
2643
43819297
RM
2644 * i386.cc (Target_i386): Remove unused member dynbss_.
2645 * arm.cc (Target_arm): Likewise.
2646 * powerpc.cc (Target_powerpc): Likewise.
2647 * sparc.cc (Target_sparc): Likewise.
2648 * tilegx.cc (Target_tilegx): Likewise.
2649 * x86_64.cc (Target_x86_64): Likewise.
2650 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2651 type_signature_, type_offset_.
2652 * plugin.h (Plugin_hook): Remove unused member layout_.
2653 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2654 mapfile_.
2655 (Read_member): Remove unused members input_objects_, symtab_,
2656 mapfile_, layout_.
2657 (Check_library): Remove unused member symtab_.
2658 * archive.h (Lib_group): Remove unused member lib_.
2659 * archive.cc (Lib_group::Lib_group): Update initializer.
2660 * incremental.h (Incremental_binary): Remove unused member target_.
2661 (Incremental_script_entry): Removed unused member script_.
2662 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2663 * icf.h (Icf): Remove unused member num_tracked_relocs.
2664
39d9ead7
RM
2665 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2666 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2667 its only use.
2668 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2669
679e4abf
RM
2670 * archive.h: Use struct rather than class for forward declaration
2671 of Read_symbols_data.
2672
54de2ea6
CC
26732013-10-07 Cary Coutant <ccoutant@google.com>
2674
2675 PR gold/16010
2676 * testsuite/Makefile.am (icf_test): Fix dependencies.
2677 (icf_safe_test): Likewise.
2678 (icf_safe_so_test): Likewise.
2679 (large_symbol_alignment): Add empty _LDADD rule.
2680 * testsuite/Makefile.in: Regenerate.
2681
b14016f0
L
26822013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2683
2684 PR gold/15927
2685 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2686 relocation for R_X86_64_32 on x32.
2687
eb426534
RM
26882013-08-27 Roland McGrath <mcgrathr@google.com>
2689
2690 * output.cc (Output_segment::set_section_addresses): Take new
2691 Target* argument. If target->isolate_execinstr() and the segment
2692 is executable and starts at a target->abi_pagesize() boundary,
2693 pad its end out to a target->abi_pagesize() boundary with code fill.
2694 * output.h (Output_segment::set_section_addresses): Update decl.
2695 * layout.h (Layout::check_output_data_for_reset_values): Take new
2696 argument RELAX_OUTPUTS.
2697 (Layout): New member relax_output_list_.
2698 (Layout::add_relax_output): New method.
2699 * layout.cc (Layout::Layout): Update constructor.
2700 (Layout::reset_relax_output): New method.
2701 (Layout::clean_up_after_relaxation): Call it.
2702 (Layout::prepare_for_relaxation): Update caller.
2703 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2704 Call reset_relax_output before re-processing segments for
2705 isolate_execinstr case.
2706 (Layout::write_data): Handle relax_output_list_.
2707 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2708 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2709
9aff4b7a
NC
27102013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2711
2712 PR binutils/15834
2713 * object.h: Fix typos.
2714
93f8221c
RM
27152013-08-16 Roland McGrath <mcgrathr@google.com>
2716
2717 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2718 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2719
e44c3715
CC
27202013-08-07 Cary Coutant <ccoutant@google.com>
2721
2722 Revert support for v2 DWP files:
2723
2724 2013-03-01 Cary Coutant <ccoutant@google.com>
2725
2726 Add dwp support for v2 DWARF package file format.
2727 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2728 tu_length parameter. Adjust all callers.
2729 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2730 * dwp.cc: Include dwarf.h.
2731 (Section_bounds): New struct type.
2732 (Unit_set): New struct type.
2733 (Dwo_file::Dwo_file): Initialize new data member.
2734 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2735 Combine and rename to...
2736 (Dwo_file::read_unit_index): ...this.
2737 (Dwo_file::sized_read_compunit_index)
2738 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2739 (Dwo_file::sized_read_unit_index): ...this.
2740 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2741 parameters; add section_id parameter.
2742 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2743 (Dwo_file::add_unit_set): ...this.
2744 (Dwo_file::shndx_map_): Remove.
2745 (Dwo_file::sect_offsets_): New data member.
2746 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2747 (Dwp_output_file::add_section): Rename to...
2748 (Dwp_output_file::add_contribution): ...this.
2749 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2750 (Dwp_output_file::add_tu_set): Likewise.
2751 (Dwp_output_file::Contribution): New type.
2752 (Dwp_output_file::Section::contributions): New data member.
2753 (Dwp_output_file::Cu_or_tu_set): Remove.
2754 (Dwp_output_file::Section::Section): New ctor.
2755 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2756 (Dwp_output_file::Dwp_index::Section_table): New type.
2757 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2758 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2759 parameter.
2760 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2761 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2762 (Dwp_output_file::Dwp_index::section_table): New member function.
2763 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2764 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2765 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2766 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2767 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2768 (Dwp_output_file::Dwp_index::section_table_): New data member.
2769 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2770 (Dwp_output_file::add_output_section): New member function.
2771 (Dwp_output_file::write_new_section): New member function.
2772 (Dwp_output_file::write_contributions): New member function.
2773 (Dwp_output_file::section_id_map_): New data member.
2774 (class Dwo_id_info_reader): Remove.
2775 (class Unit_reader): New class.
2776 (get_dwarf_section_name): New function.
2777 (Dwo_file::read_executable): Adjust initializations of class data.
2778 (Dwo_file::read): Add support for v2 package file format.
2779 (Dwo_file::read_unit_index): Likewise.
2780 (Dwo_file::sized_read_unit_index): Likewise.
2781 (Dwo_file::copy_section): Likewise.
2782 (Dwo_file::add_unit_set): Likewise.
2783 (Dwp_output_file::add_output_section): Likewise.
2784 (Dwp_output_file::add_contribution): Likewise.
2785 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2786 for empty slot.
2787 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2788 file format.
2789 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2790 slot.
2791 (Dwp_output_file::initialize): Remove unused function.
2792 (Dwp_output_file::finalize): Add support for v2 package file format.
2793 (Dwp_output_file::write_index): Likewise.
2794 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2795 function prototype.
2796
c6905c28
CC
27972013-07-31 Cary Coutant <ccoutant@google.com>
2798
2799 * object.cc (Sized_relobj::do_output_section_address): New function.
2800 (Sized_relobj): Instantiate explicitly.
2801 * object.h (Object::output_section_address): New function.
2802 (Object::do_output_section_address): New function.
2803 (Sized_relobj::do_output_section_address): New function.
2804 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2805
28062013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2807 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2808
2809 * parameters.cc (Parameters::entry): Return target-specific entry
2810 symbol name.
2811 * target.h (Target::entry_symbol_name): New function.
2812 (Target_info::entry_symbol_name): New data member.
2813
2814 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2815 * i386.cc (Target_i386::i386_info): Likewise.
2816 (Target_i386_nacl::i386_nacl_info): Likewise.
2817 * sparc.cc (Target_sparc::sparc_info): Likewise.
2818 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2819 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2820 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2821 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2822
234d4ab8
SA
28232013-07-22 Sterling Augustine <saugustine@google.com>
2824
2825 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2826 Convert parameter shndx to local variable. Add parameters symtab
2827 and symtab_size. Scan over section names. Find relocation
2828 section corresponding to current section. Create and initialize
2829 reloc_mapper_ and reloc_type_.
2830 (Dwarf_pubnames_table::read_header): Add assertion. Change
2831 unit_length to off_t. Initialize member unit_length_. Fill in field
2832 cu_offset_.
2833 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2834 Initialize new fields unit_length_ and cu_offset_.
2835 (Dwarf_pubnames_table::read_section): Update prototype.
2836 (Dwarf_pubnames_table::cu_offset): New member function.
2837 (Dwarf_pubnames_table::subsection_size): Likewise.
2838 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2839 New fields.
2840 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2841 member functions public.
2842 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2843 Update comment. Rework logic. Move repeated parts to...
2844 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2845 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2846 pubtypes_table_, and stmt_list_offset.
2847 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2848 Gdb_index::find_pubtype_offset,
2849 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2850 (Gdb_index::pubnames_read): Update prototype and rework logic.
2851 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2852 Forward declare.
2853 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2854 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2855 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2856 Gdb_index::map_pubtable_to_dies):
2857 Declare functions.
2858 (Gdb_index::pubnames_read): Update declaration.
2859 (Gdb_index::Pubname_offset_map): New type.
2860 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2861 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2862 Gdb_index::stmt_list_offset): Declare.
2863 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2864 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2865 Gdb_index::pubtypes_offset_): Remove.
2866
a3ed37d8
RM
28672013-07-19 Roland McGrath <mcgrathr@google.com>
2868
2869 * options.h (General_options): Add -Trodata-segment option.
2870 * parameters.cc (Parameters::check_rodata_segment): New function.
2871 (Parameters::set_target_once): Call it.
2872 * parameters.h (Parameters): Declare it (private member function).
2873 * layout.cc (load_seg_unusable_for_headers): New function, broken
2874 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2875 then validate rodata segment rather than text segment.
2876 (relaxation_loop_body): Call that.
2877 (is_text_segment): New function. Don't admit a non-executable
2878 segment if TARGET->isolate_execinstr().
2879 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2880
eb5b4ded
CC
28812013-07-15 Shawn Landden <shawnlandden@gmail.com>
2882
2883 PR gold/15070
2884 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2885 * nacl.h (Sniff_file::View::View): Request aligned view.
2886
4d5effb9
CC
28872013-07-11 Cary Coutant <ccoutant@google.com>
2888
2889 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2890 correct BRLT entry size.
2891
ba8ca3e7
AM
28922013-07-03 Alan Modra <amodra@gmail.com>
2893
2894 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2895 comment.
2896
267257d2
CC
28972013-07-01 Cary Coutant <ccoutant@google.com>
2898
2899 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2900 reloc_type_.
2901 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2902 (Dwarf_ranges_table::lookup_reloc): New function.
2903 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2904 reloc_type_.
2905 (Dwarf_ranges_table::lookup_reloc): New function.
2906 (Dwarf_ranges_table::reloc_type_): New data member.
2907
06f30c9d
CC
29082013-06-27 Jing Yu <jingyu@google.com>
2909
2910 PR gold/15662
2911 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2912 function.
2913 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2914 (Target_powerpc::do_relax): Call the above.
2915
a2d7bf59
AM
29162013-06-27 Cary Coutant <ccoutant@google.com>
2917
2918 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2919 on garbage collected .opd section.
2920
29212013-06-27 Alan Modra <amodra@gmail.com>
2922
2923 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2924 is non-zero.
2925 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2926 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2927
32364e50
CC
29282013-06-14 Cary Coutant <ccoutant@google.com>
2929
2930 * resolve.cc (Symbol::override_base): Don't override st_type
2931 from plugin placeholder symbols.
2932 (Symbol_table::resolve): Likewise.
2933 (Symbol_table::should_override): Don't complain about TLS mismatch
2934 if the TO symbol is a plugin placeholder.
2935 * testsuite/Makefile.am (plugin_test_tls): New test.
2936 * testsuite/Makefile.in: Regenerate.
2937 * testsuite/plugin_test_tls.sh: New test script.
2938 * testsuite/two_file_test_2_tls.cc: New test source.
2939 * testsuite/two_file_test_tls.cc: New test source.
2940
7fb47cc9
CC
29412013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2942
2943 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2944 the maximum segment alignment is larger than the page size.
2945 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2946 correctly aligns the symbols with large alignemnt.
2947 * testsuite/Makefile.in: Regenerate.
2948 * testsuite/large_symbol_alignment.cc: New file.
2949
6934001a
CC
29502013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2951 Sriraman Tallam <tmsriram@google.com>
2952
2953 * options.h (sort_section): New option.
2954 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2955 Rename from Input_section_sort_section_name_special_ordering_compare.
2956 (Input_section_sort_section_name_compare): New struct.
2957 * output.cc (Output_section::Input_section_sort_section_name_compare::
2958 operator()): New function.
2959 (Output_section::sort_attached_input_sections): Use new sort function
2960 for .text if --sort-section=name is specified.
2961 * layout.cc (Layout::make_output_section):
2962 Add sorting by name when --sort-section=name is specified.
2963 * testsuite/Makefile.am (text_section_grouping): Test option
2964 --sort-section=name.
2965 * testsuite/Makefile.in: Regenerate.
2966 * testsuite/section_sorting_name.cc: New file.
2967 * testsuite/section_sorting_name.sh: New file.
2968
93acabad
CC
29692013-05-21 Cary Coutant <ccoutant@google.com>
2970
2971 * symtab.h (Symbol::is_cxx_vtable): New function.
2972 * target-reloc.h (relocate_section): Check for vtable symbol.
2973 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2974 * testsuite/Makefile.in: Regenerate.
2975 * testsuite/missing_key_func.cc: New test source.
2976 * testsuite/missing_key_func.sh: New test script.
2977
60e8b3fc
CC
29782013-05-21 Cary Coutant <ccoutant@google.com>
2979
2b64b551
RM
2980 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2981 type of enclosing symbol.
2982 (Relocate_info::location): Check symbol type when describing symbol.
2983 * object.h (Symbol_location_info): Remove unused line_number;
2984 add enclosing_symbol_type.
2985 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2986
9df9de2c
CC
29872013-05-13 Cary Coutant <ccoutant@google.com>
2988
2b64b551
RM
2989 * configure.ac: Export DEFAULT_TARGET.
2990 * configure: Regenerate.
2991 * Makefile.in: Regenerate.
2992 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2993 * testsuite/Makefile.in: Regenerate.
2994 * testsuite/debug_msg.sh: Delete duplicate tests.
2995 Don't check undef_int error message match for powerpc where the
2996 source file and line number aren't available.
9df9de2c 2997
bbc5ae17
RM
29982013-05-10 Roland McGrath <mcgrathr@google.com>
2999
3000 * options.h (General_options): Add --rosegment-gap option.
3001 * options.cc (finalize): --rosegment-gap implies --rosegment.
3002 * layout.cc (set_segment_offsets): Let user option override
3003 target->rosegment_gap().
3004
0c6e6c39
RM
30052013-05-10 Roland McGrath <mcgrathr@google.com>
3006
3007 * options.h (General_options): Remove leading space from help
3008 messages for -nostdlib and --rosegment.
3009
cde7cb01
MR
30102013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3011
3012 PR ld/15365
3013 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3014
f31ae5b8
AM
30152013-05-03 Alan Modra <amodra@gmail.com>
3016
3017 * merge.cc (Output_merge_string::do_add_input_section): Correct
3018 scan for number of strings. Rename vars to avoid shadowing.
3019 Include missing terminator in input_size_.
3020
d3a7cd45
L
30212013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3022
3023 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3024 Restore empty string handling.
3025
6ad3daba
CC
30262013-05-01 Cary Coutant <ccoutant@google.com>
3027
3028 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3029 uninitialized warning.
3030
e31908b6
CC
30312013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3032
3033 * output.cc (Output_section::add_merge_input_section): Allow
3034 to merge sections if the alignment is more than character size.
3035 * merge.h (Output_merge_string::Output_merge_string): Remove
3036 assert.
3037 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3038 only not-null strings. Check the alignment of strings.
3039 * stringpool.h
3040 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3041 alignment as the argument.
3042 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3043 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3044 Align non-zero length strings according to the addralign_.
3045 (Stringpool_template<Stringpool_char>::set_string_offsets):
3046 Updating offsets according to the given alignment.
3047 * testsuite/Makefile.am (text_section_grouping): Test if string
3048 literals are getting merged.
3049 * testsuite/Makefile.in: Regenerate.
3050 * testsuite/merge_string_literals_1.c: New file.
3051 * testsuite/merge_string_literals_2.c: Ditto.
3052 * testsuite/merge_string_literals.sh: Ditto.
3053
0e804863
ILT
30542013-04-26 Ian Lance Taylor <iant@google.com>
3055
3056 * target-reloc.h (relocate_section): If the reloc offset is out of
3057 range, pass VIEW as NULL to relocate.relocate.
3058 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3059 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3060 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3061 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3062 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3063 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3064
e7c5ea40
CC
30652013-04-26 Geoff Pike <gpike@chromium.org>
3066
3067 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3068 * layout.cc (Hash_task): New class.
3069 (Layout::queue_build_id_tasks): New function.
3070 (Layout::write_build_id): Handle single-thread portion of build ID
3071 computation. (In some cases, all of it is single-threaded.) Replace
3072 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3073 functionality in fewer lines of code.
3074 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3075 * options.h (General_options): make "--build-id" default to tree
3076 rather than sha1. Add two new options related to --build-id=tree:
3077 --build-id-chunk-size-for-treehash and
3078 --build-id-min-file-size-for-treehash.
3079 * Makefile.am: add testing of --build-id=tree and related new options
3080 (these tests will be invoked by "make check").
3081 * Makefile.in: Regenerate.
3082
49926cd0
AM
30832013-04-25 Alan Modra <amodra@gmail.com>
3084
3085 * configure.tgt: Add powerpcle and powerpc64le.
3086
a4034750
AM
30872013-04-22 Alan Modra <amodra@gmail.com>
3088
3089 PR gold/15355
3090 * layout.cc (Layout::segment_precedes): Allow more than one
3091 segment with the same type and flags.
3092
e79c84aa
CC
30932013-04-15 Cary Coutant <ccoutant@google.com>
3094
3095 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3096 allocate space in file for BSS sections.
3097
2199fbe7
CC
30982013-04-15 Cary Coutant <ccoutant@google.com>
3099
3100 * script-sections.cc (Orphan_output_section): Reset address
3101 to zero after each orphaned section for relocatable links.
3102
502e8a84
CC
31032013-04-15 Cary Coutant <ccoutant@google.com>
3104
a4034750
AM
3105 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3106 section starting address for relocatable link.
3107 * testsuite/Makefile.am (script_test_11): New test.
3108 * testsuite/Makefile.in: Regenerate.
3109 * testsuite/script_test_11.c: New source file.
3110 * testsuite/script_test_11.t: New linker script.
502e8a84 3111
0cfdc767
AM
31122013-04-13 Alan Modra <amodra@gmail.com>
3113
3114 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3115 owner when sections are not adjacent and exceed group size.
3116 (Target_powerpc::group_sections): Handle corner case.
3117 (Target_powerpc::Branch_info::make_stub): Handle case where
3118 stub table doesn't exist due to branches in non-exec sections.
3119 (Target_powerpc::Relocate::relocate): Likewise.
3120
6830ee24
AM
31212013-04-11 Alan Modra <amodra@gmail.com>
3122
3123 PR gold/15354
3124 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3125 .branch_lt to match bfd ld. Adjust comments throughout file.
3126
54a3d865
ILT
31272013-04-04 Ian Lance Taylor <iant@google.com>
3128
3129 GCC PR c++/56840
3130 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3131 sections before checking whether they are included in the link.
3132
9993ba11
ST
31332013-03-29 Sriraman Tallam <tmsriram@google.com>
3134
3135 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3136 object before calling the plugin claim_file handler. Pass the elf
3137 object of the archive to the plugin. Delete the elf object if the
3138 plugin claims the file.
3139
ebacd51e
AM
31402013-03-21 Alan Modra <amodra@gmail.com>
3141
3142 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3143 segment when omagic.
3144
117be58f
AM
31452013-03-21 Alan Modra <amodra@gmail.com>
3146
3147 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3148 comparison warning.
3149 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3150 uninitialized" warning.
3151
32e2b61d
AM
31522013-03-20 Alan Modra <amodra@gmail.com>
3153
3154 * symtab.h (Symbol::clear_version): New function.
3155 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3156 is_needed by weak references. Clear version for symbols defined
3157 in as-needed objects that are not needed.
3158
b3ccdeb5
AM
31592013-03-15 Alan Modra <amodra@gmail.com>
3160
3161 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3162 static and public. Add report_err param. Return false for data refs.
3163 (Target_powerpc::rela_dyn_section): New overloaded function.
3164 (Target_powerpc::plt_, iplt_): Elucidate.
3165 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3166 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3167 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3168 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3169 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3170 push_branch and make_plt_entry for ifunc syms when
3171 reloc_needs_plt_for_ifunc.
3172 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3173 for ifunc unless reloc_needs_plt_for_ifunc.
3174
ad3d8a2f
AM
31752013-03-15 Alan Modra <amodra@gmail.com>
3176
3177 * gc.h (gc_process_relocs): Don't look through function descriptors.
3178 * icf.cc (get_section_contents): Do so here instead.
3179
4d9aa155
AM
31802013-03-13 Alan Modra <amodra@gmail.com>
3181
3182 * powerpc.cc (is_branch_reloc): Forward declare.
3183 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3184 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3185 false for 64-bit, true for 32-bit non-branch relocs.
3186 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3187 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3188 nm output.
3189 (icf_safe_test): Generate linker map file as well as nm output.
3190 (icf_safe_so_test): Likewise.
3191 * testsuite/Makefile.in: Regenerate.
3192 * testsuite/icf_test.sh: Parse linker map file to determine
3193 section folding.
3194 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3195 * testsuite/icf_safe_so_test.sh: Likewise.
3196 (X86_32_or_ARM_specific_safe_fold): Merge into..
3197 (arch_specific_safe_fold): ..this.
3198 (X86_64_specific_safe_fold): Delete unused function.
3199
57420c20
AM
32002013-03-12 Alan Modra <amodra@gmail.com>
3201
3202 * gc.h (gc_process_relocs): Look through function descriptors
3203 to determine shndx, symvalue and addend used by ICF. Tidy
3204 variable duplication.
3205
dc3714f3
AM
32062013-03-11 Alan Modra <amodra@gmail.com>
3207
3208 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3209 * layout.cc (Layout_task_runner::run): ..to here.
3210 * symtab.h (struct Symbol_location): Extract from..
3211 (class Symbol_table): ..here.
3212 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3213 * target.h (class Target): Add function_location and
3214 do_function_location functions.
3215 (class Sized_target): Add do_function_location.
3216 * object.h (class Sized_relobj_file): Move find_shdr..
3217 (class Object): ..to here.
3218 * object.cc: Likewise. Update to suit. Instantiate.
3219 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3220 * powerpc.cc (class Powerpc_dynobj): New.
3221 (Target_powerpc::do_function_location): New function.
3222 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3223 (Powerpc_dynobj::do_read_symbols): New function.
3224 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3225
956b03bb
ILT
32262013-03-08 Ian Lance Taylor <iant@google.com>
3227
3228 * options.cc (General_options::string_to_object_format): Accept
3229 "default".
3230
4bead2d5
AM
32312013-03-08 Alan Modra <amodra@gmail.com>
3232
3233 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3234 pointer to Post_fde.
3235 (struct Post_fde): Move definition to here..
3236 * ehframe.cc (struct Post_fde): ..from here.
3237 (Cie::write): Don't alloc Post_fde.
3238 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3239
02e60bf7
AM
32402013-03-07 Alan Modra <amodra@gmail.com>
3241
3242 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3243 relocation referencing .LC0.
3244 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3245
8343f03a
AM
32462013-03-07 Alan Modra <amodra@gmail.com>
3247
3248 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3249 always_inline. Add assembly for powerpc to avoid GOT.
3250
3366d57c
AM
32512013-03-07 Alan Modra <amodra@gmail.com>
3252
3253 * testsuite/script_test_10.sh: Don't test .bss section
3254 header number.
3255
6c77229c
AM
32562013-03-06 Alan Modra <amodra@gmail.com>
3257
3258 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3259 (Target_powerpc::symval_for_branch): Add symtab param. Update
3260 all callers. Handle folded sections.
3261 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3262 to Powerpc_relobj.
3263 (Global_symbol_visitor_opd::operator()): Likewise.
3264
a39e4af6
AM
32652013-03-04 Alan Modra <amodra@gmail.com>
3266
3267 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3268 * testsuite/Makefile.in: Regenerate.
3269
d5834edb
CC
32702013-03-01 Cary Coutant <ccoutant@google.com>
3271
3272 Add dwp support for v2 DWARF package file format.
3273 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3274 tu_length parameter. Adjust all callers.
3275 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3276 * dwp.cc: Include dwarf.h.
3277 (Section_bounds): New struct type.
3278 (Unit_set): New struct type.
3279 (Dwo_file::Dwo_file): Initialize new data member.
3280 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3281 Combine and rename to...
3282 (Dwo_file::read_unit_index): ...this.
3283 (Dwo_file::sized_read_compunit_index)
3284 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3285 (Dwo_file::sized_read_unit_index): ...this.
3286 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3287 parameters; add section_id parameter.
3288 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3289 (Dwo_file::add_unit_set): ...this.
3290 (Dwo_file::shndx_map_): Remove.
3291 (Dwo_file::sect_offsets_): New data member.
3292 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3293 (Dwp_output_file::add_section): Rename to...
3294 (Dwp_output_file::add_contribution): ...this.
3295 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3296 (Dwp_output_file::add_tu_set): Likewise.
3297 (Dwp_output_file::Contribution): New type.
3298 (Dwp_output_file::Section::contributions): New data member.
3299 (Dwp_output_file::Cu_or_tu_set): Remove.
3300 (Dwp_output_file::Section::Section): New ctor.
3301 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3302 (Dwp_output_file::Dwp_index::Section_table): New type.
3303 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3304 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3305 parameter.
3306 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3307 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3308 (Dwp_output_file::Dwp_index::section_table): New member function.
3309 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3310 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3311 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3312 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3313 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3314 (Dwp_output_file::Dwp_index::section_table_): New data member.
3315 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3316 (Dwp_output_file::add_output_section): New member function.
3317 (Dwp_output_file::write_new_section): New member function.
3318 (Dwp_output_file::write_contributions): New member function.
3319 (Dwp_output_file::section_id_map_): New data member.
3320 (class Dwo_id_info_reader): Remove.
3321 (class Unit_reader): New class.
3322 (get_dwarf_section_name): New function.
3323 (Dwo_file::read_executable): Adjust initializations of class data.
3324 (Dwo_file::read): Add support for v2 package file format.
3325 (Dwo_file::read_unit_index): Likewise.
3326 (Dwo_file::sized_read_unit_index): Likewise.
3327 (Dwo_file::copy_section): Likewise.
3328 (Dwo_file::add_unit_set): Likewise.
3329 (Dwp_output_file::add_output_section): Likewise.
3330 (Dwp_output_file::add_contribution): Likewise.
3331 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3332 for empty slot.
3333 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3334 file format.
3335 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3336 slot.
3337 (Dwp_output_file::initialize): Remove unused function.
3338 (Dwp_output_file::finalize): Add support for v2 package file format.
3339 (Dwp_output_file::write_index): Likewise.
3340 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3341 function prototype.
3342
a68a081d
CC
33432013-03-01 Cary Coutant <ccoutant@google.com>
3344
3345 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3346 function into class definition in header file.
3347 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3348 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3349 New function.
3350 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3351
9d5781f8
AM
33522013-02-28 Alan Modra <amodra@gmail.com>
3353
3354 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3355 * target.cc (Target::do_plt_fde_location): New function.
3356 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3357 accessor function, and constructor param.
3358 (struct Post_fde, Post_fdes): Declare.
3359 (Cie::write): Add post_fdes param.
3360 * ehframe.cc (Fde::write): Use plt_fde_location.
3361 (struct Post_fde): Define.
3362 (Cie::write): Stash FDEs added post merge mapping.
3363 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3364 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3365 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3366 other FDEs.
3367 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3368 (Target_powerpc::has_glink): New function.
3369 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3370 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3371 glink_eh_frame_fde_32, default_fde): New data.
3372 (Stub_table::eh_frame_added_): New var.
3373 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3374 Make const.
3375 (Stub_table::add_eh_frame): New function.
3376 (Output_data_glink::add_eh_frame): New function.
3377 (Target_powerpc::make_glink_section): Call add_eh_frame.
3378
214383dd
ILT
33792013-02-15 Ian Lance Taylor <iant@google.com>
3380
3381 * options.h (DEFINE_uint64_alias): Define.
3382 (class General_options): Add -Ttext-segment as an alias for
3383 -Ttext.
3384
91c2b899
AM
33852013-02-15 Alan Modra <amodra@gmail.com>
3386
3387 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3388 (Stub_table::do_write): ..here, two places.
3389 (Stub_table::plt_call_size): Use it here too.
3390
20e2a8aa
ILT
33912013-02-11 Ian Lance Taylor <iant@google.com>
3392
3393 * descriptors.cc (Descriptors::close_all): New function.
3394 * descriptors.h (class Descriptors): Declare close_all.
3395 (close_all_descriptors): New inline function.
3396 * plugin.cc: Include "descriptors.h".
3397 (Plugin_manager::cleanup): Call close_all_descriptors.
3398
8952bc69
AM
33992013-02-06 Alan Modra <amodra@gmail.com>
3400
3401 * README: Update coding style link.
3402
29bd8b6b
CC
34032013-01-28 Cary Coutant <ccoutant@google.com>
3404
a4034750
AM
3405 * dwp.cc (File_list): New typedef.
3406 (Dwo_name_info_reader): New class.
3407 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3408 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3409 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3410 (Dwo_file::read_executable): New function.
3411 (Dwo_file::read): Move common setup code to ...
3412 (Dwo_file::make_object): ... here.
3413 (dwp_options): Add --exec/-e.
3414 (usage): Likewise.
3415 (main): Likewise.
29bd8b6b 3416
c6ac678d
ST
34172013-01-24 Sriraman Tallam <tmsriram@google.com>
3418
3419 * layout.cc (Layout::layout): Check for option text_reorder.
3420 (Layout::make_output_section): Ditto.
3421 * options.h (text_reorder): New option.
3422 * output.cc (Input_section_sort_compare): Remove special ordering
3423 of section names.
3424 (Output_section::
3425 Input_section_sort_section_name_special_ordering_compare::
3426 operator()): New function.
3427 (Output_section::sort_attached_input_sections): Use new sort function
3428 for .text.
3429 * output.h (Input_section_sort_section_name_special_ordering_compare):
3430 New struct.
3431 * testsuite/Makefile.am (text_section_grouping): Test option
3432 --no-text-reorder
3433 * testsuite/Makefile.in: Regenerate.
3434 * testsuite/text_section_grouping.sh: Check order of functions without
3435 default text reordering.
3436
50701cc1
MF
34372013-01-18 Mike Frysinger <vapier@gentoo.org>
3438
3439 * options.h (General_options): Change default to true for new_dtags.
3440
b1b00fcc
MF
34412013-01-18 Mike Frysinger <vapier@gentoo.org>
3442
3443 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3444 when enable_new_dtags is false. Only add DT_RUNPATH when
3445 enable_new_dtags is true.
3446
ec5b8187
AM
34472013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3448
3449 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3450 used in declaration and definition consistent.
3451 (Target_powerpc::symval_for_branch): Ditto.
3452
a880d4c4
ST
34532013-01-16 Sriraman Tallam <tmsriram@google.com>
3454
3455 * testsuite/plugin_final_layout.cc: Fix comment.
3456
7c381248
ST
34572013-01-16 Sriraman Tallam <tmsriram@google.com>
3458
3459 * layout.cc (Layout::layout): Do not do default sorting for
3460 text sections when section ordering is specified.
3461 (make_output_section): Ditto.
3462 * testsuite/plugin_final_layout.cc: Name the function sections
3463 to catch reordering issues.
3464
e2458743
AM
34652013-01-15 Alan Modra <amodra@gmail.com>
3466
3467 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3468 plt-thread-safe.
3469
431ed302
AM
34702013-01-15 Alan Modra <amodra@gmail.com>
3471
3472 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3473 * testsuite/Makefile.in: Regenerate.
3474
0ec6429b
AM
34752013-01-14 Alan Modra <amodra@gmail.com>
3476
3477 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3478 * testsuite/Makefile.in: Regenerate.
3479
0bf402d5
ILT
34802013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3481
36af3926 3482 PR bfd/14430
0bf402d5
ILT
3483 Fix mingw gold build with plugins enabled
3484 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3485 * configure.ac: Export DLOPEN_LIBS and add headers check.
3486 * plugin.cc: Handle non-dlfcn case.
3487 * Makefile.in: Regenerate.
3488 * config.in: Regenerate.
3489 * configure: Regenerate.
3490 * testsuite/Makefile.in: Regenerate.
3491
9e9143bc
ST
34922013-01-09 Sriraman Tallam <tmsriram@google.com>
3493
3494 * output.h (sort_attached_input_sections): Change to be public.
3495 * script-sections.cc
3496 (Output_section_definition::set_section_addresses): Sort
3497 attached input sections according to section order before linker
3498 script assigns section addresses.
3499 (Orphan_output_section::set_section_addresses): Sort
3500 attached input sections according to section order before linker
3501 script assigns section addresses.
3502 * Makefile.am (final_layout.sh): Use a simple linker script to
3503 check if section ordering still works.
3504 * Makefile.in: Regenerate.
3505
679af368
ILT
35062013-01-09 Ben Cheng <bccheng@google.com>
3507
3508 * arm.cc (Target_arm::attributes_accept_div): New function.
3509 (Target_arm::attributes_forbid_div): New function.
3510 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3511 attribute using the same new functions as what bfd/elf32_arm.c
3512 does.
3513
3136a00e
CC
35142013-01-07 Cary Coutant <ccoutant@google.com>
3515
3516 PR gold/14993
3517 * output.cc (Output_section::add_input_section): For incremental
3518 updates, don't track input sections that are allocated from patch
3519 space.
3520
f2a6224b
L
35212013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3522 Ian Lance Taylor <iant@google.com>
3523
3524 PR gold/14897
3525 * configure.ac (--enable-ld): Removed.
3526 (install_as_default): Set to yes only for --enable-gold=default
3527 or --disable-ld.
3528 * configure: Regenerated.
3529
4f46f626
L
35302013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3531
3532 * options.h (General_options): Add -fuse-ld= for GCC linker
3533 option compatibility.
3534
26e4ef59
CC
35352013-01-04 Cary Coutant <ccoutant@google.com>
3536
3537 * configure.ac: Fix typo restoring CXXFLAGS.
3538 * configure: Regenerate.
3539
3d587466
CC
35402013-01-04 Cary Coutant <ccoutant@google.com>
3541
4f46f626
L
3542 * testsuite/Makefile.am (CXXLINK_S): New macro.
3543 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3544 * testsuite/Makefile.in: Regenerate.
3d587466 3545
44db6695
L
35462013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3547
3548 * version.cc (print_version): Update copyright year to 2013.
3549
edcac0c1
ILT
35502012-12-20 Ian Lance Taylor <iant@google.com>
3551
3552 * layout.cc (Layout::special_ordering_of_input_section): New
3553 function.
3554 (Layout::layout): If input section requires special ordering, must
3555 sort input sections.
3556 (Layout::make_output_section): May sort .text input sections.
3557 (Layout::is_section_name_prefix_grouped): Remove.
3558 * layout.h (class Layout): Declare
3559 special_ordering_of_input_section. Don't declare
3560 is_section_name_prefix_grouped.
3561 * output.cc (Output_section::add_input_section): Revert last
3562 change.
3563 (Output_section::Input_section_sort::match_file_name): Don't crash
3564 if called on output section data.
3565 (Output_section::Input_section_sort_compare): Sort based on
3566 special ordering.
3567 (Output_section::Input_section_sort_section_order_index_compare):
3568 Revert last patch.
3569 (Output_section::sort_attached_input_sections): Likewise.
3570
28f2a4ac
ST
35712012-12-18 Sriraman Tallam <tmsriram@google.com>
3572
edcac0c1 3573 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3574 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3575 * output.cc (Output_section::add_input_section): Check if section
3576 name contains special prefix. Keep input sections to sort such
3577 sections.
3578 (Output_section::Input_section_sort_section_order_index_compare
3579 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3580 (Output_section::sort_attached_input_sections): Add condition to
3581 Input_section_entry constructor call.
28f2a4ac
ST
3582 * testsuite/Makefile.am (text_section_grouping): New test.
3583 * testsuite/Makefile.in: Regenerate.
3584 * testsuite/text_section_grouping.cc: New file.
3585 * testsuite/text_section_grouping.sh: New file.
3586
5bf135a7
NC
35872012-12-17 Nick Clifton <nickc@redhat.com>
3588
3589 * Makefile.am: Add copyright notice.
3590 * NEWS: Likewise.
3591 * README: Likewise.
3592 * configure.ac: Likewise.
3593 * ftruncate.c: Likewise.
3594 * Makefile.in: Regenerate.
3595
59965708
CC
35962012-12-14 Cary Coutant <ccoutant@google.com>
3597
a4034750
AM
3598 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3599 --no-as-needed flag.
3600 (exception_separate_shared_12_test): Likewise.
3601 (incremental_copy_test): Likewise.
3602 * testsuite/Makefile.in: Regenerate.
59965708 3603
2a77e2ab
CC
36042012-12-14 Cary Coutant <ccoutant@google.com>
3605
3606 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3607 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3608
e3deeb9c
AM
36092012-12-12 Alan Modra <amodra@gmail.com>
3610
3611 * powerpc.cc (class Track_tls): New.
3612 (class Relocate, class Scan): Inherit Track_tls.
3613 (Target_powerpc::Scan::local, global): Track tls optimization
3614 and avoid creating plt entry for __tls_get_addr if all uses
3615 are optimized away.
3616 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3617
d8f5a274
AM
36182012-12-12 Alan Modra <amodra@gmail.com>
3619
3620 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3621 Replace no_toc_optimize with toc_optimize.
3622 * output.h (Output_section::input_sections): Provide non-const variant.
3623 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3624 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3625 accessors.
3626 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3627 (class Sort_toc_sections): New.
3628 (Target_powerpc::do_finalize_sections): Sort toc sections.
3629 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3630
4c8a1de1
RM
36312012-12-10 Roland McGrath <mcgrathr@google.com>
3632
3633 * testsuite/binary_unittest.cc (read_all): New function.
3634 (Sized_binary_test): Use it instead of ::read.
3635 * fileread.cc (do_read): Don't assume pread always reads the whole
3636 amount in a single call.
3637
edc27beb
AM
36382012-12-10 Alan Modra <amodra@gmail.com>
3639
3640 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3641 Set EM_PPC64 or EM_PPC here.
3642 (Target_selector_powerpc::do_recognize): Delete.
3643
906b9150
AM
36442012-12-10 Alan Modra <amodra@gmail.com>
3645
3646 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3647 stub_table_.
3648 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3649
418c15ae
RM
36502012-12-07 Roland McGrath <mcgrathr@google.com>
3651
3652 * testsuite/binary_unittest.cc (Sized_binary_test):
3653 Use open_descriptor rather than ::open.
3654
decdd3bc
AM
36552012-12-07 Alan Modra <amodra@gmail.com>
3656
3657 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3658 typedef and invalid_address constant.
3659 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3660 instantiate constants.
3661
db399005
ILT
36622012-12-06 Roland McGrath <mcgrathr@google.com>
3663
3664 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3665 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3666 * aclocal.m4: Regenerate.
3667 * configure: Regenerate.
3668 * Makefile.in: Regenerate.
3669 * testsuite/Makefile.in: Regenerate.
3670
aba6bc71
AM
36712012-12-07 Alan Modra <amodra@gmail.com>
3672
3673 * options.h (General_options): Add no_toc_optimize.
3674 * powerpc.cc (ok_lo_toc_insn): New function.
3675 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3676
9e69ed50
AM
36772012-12-06 Alan Modra <amodra@gmail.com>
3678
3679 * options.h (General_options): Add plt_align, plt_static_chain,
3680 plt_thread_safe. Update stub_group_size help text.
3681 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3682 for new plt_thread_safe_ var.
3683 (use_plt_offset): Correct comments.
3684 (Target_powerpc::do_relax): Look for thread creation symbols to
3685 determine default plt_thread_safe value. Clear plt call stubs
3686 as well as branch stubs each iteration.
3687 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3688 insn constants.
3689 (l, hi, ha, write_insn): Move earlier.
3690 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3691 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3692 plt stubs too.
3693 (Stub_table::update_size): Adjust.
3694 (Stub_table::prev_size, set_prev_size): Delete.
3695 (Stub_table::stub_align): Let --plt-align affect result.
3696 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3697 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3698 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3699 (Stub_table::do_write): Support more stub variants.
3700
f43ba157
AM
37012012-12-04 Alan Modra <amodra@gmail.com>
3702
3703 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3704 (Target_powerpc::do_define_standard_symbols): New function.
3705
34171bc5
AM
37062012-12-03 Alan Modra <amodra@gmail.com>
3707
3708 * output.h: Formatting, whitespace.
3709
dc9589e9 37102012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3711
3712 * layout.h (Layout::get_executable_sections): Declare.
3713 * layout.cc (Layout::get_executable_sections): New function.
3714 * arm.cc (Target_arm::group_sections): Use it.
3715 (Arm_output_section::group_sections): Delete now redundant test.
3716 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3717 param to handle relative relocs.
3718 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3719 (Output_data_reloc::add_absolute): Adjust.
3720 (Output_data_reloc::add_relative): New function.
3721 (Output_data::reset_data_size): New function.
3722 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3723 (Output_section::set_addralign): New function.
3724 (Output_section::checkpoint_set_addralign): New function.
3725 (Output_section::clear_section_offsets_need_adjustment): New function.
3726 (Output_section::input_sections): Make public.
3727 * powerpc.cc (class Output_data_brlt_powerpc): New.
3728 (class Stub_table, class Stub_control): New.
3729 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3730 stub_table_, set_stub_table, stub_table): New vectors and accessor
3731 functions.
3732 (Target_powerpc::do_may_relax, do_relax, push_branch,
3733 new_stub_table, stub_tables, brlt_section, group_sections,
3734 add_branch_lookup_table, find_branch_lookup_table,
3735 write_branch_lookup_table, make_brlt_section): New functions.
3736 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3737 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3738 branch_info_): New vars.
3739 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3740 make call stubs here.
3741 (Output_data_glink): Remove all call stub handling from this class.
3742 (Target_powerpc::Scan::local, global): Save interesting branch
3743 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3744 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3745 functions on final link.
3746 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3747 Handle long branch destinations too.
3748 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3749 do_plt_address_for_local): Adjust lookup of plt call stubs.
3750
627b30b7
AM
37512012-11-30 Alan Modra <amodra@gmail.com>
3752
3753 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3754 relocs against protected symbols when building 32-bit shared libs.
3755
40b469d7
AM
37562012-11-30 Alan Modra <amodra@gmail.com>
3757
3758 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3759 param. Call got_section() to make .got. Update all callers
3760 and their callers and so on.
3761
bb66a627
AM
37622012-11-30 Alan Modra <amodra@gmail.com>
3763
3764 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3765 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3766 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3767 value if it already exists.
3768
d2cf1c6c
L
37692012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3770
3771 PR gold/14858
3772 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3773
edccdf7c
RM
37742012-11-14 Roland McGrath <mcgrathr@google.com>
3775
3776 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3777 than bfc instruction for data sandboxing.
3778
6febeb74
AM
37792012-11-08 Alan Modra <amodra@gmail.com>
3780
3781 * po/POTFILES.in: Regenerate.
3782
0a6f1bf2
AM
37832012-11-05 Alan Modra <amodra@gmail.com>
3784
3785 * configure.ac: Apply 2012-09-10 change to config.in here.
3786 * configure: Regenerate.
3787
26a4e9cb
AM
37882012-11-05 Alan Modra <amodra@gmail.com>
3789
3790 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3791 (struct Opd_ent): Use "Address" rather than "Offset".
3792 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3793 (Target_powerpc::got_section): Make public.
3794 (Target_powerpc::scan_relocs): Move code setting symbols..
3795 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3796 Create _SDA_BASE_ only when referenced.
3797
cc928013
RM
37982012-11-02 Roland McGrath <mcgrathr@google.com>
3799
3800 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3801 from last change.
3802
50ed5eb1
RM
38032012-11-01 Roland McGrath <mcgrathr@google.com>
3804
62fe925a
RM
3805 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3806 for offset_in_output_section parameter.
3807 (Sized_target::relocate_special_relocatable): Likewise.
3808 * arm.cc (Target_arm::relocate_relocs): Likewise.
3809 (Target_arm::relocate_special_relocatable): Likewise.
3810 * i386.cc (Target_i386::relocate_relocs): Likewise.
3811 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3812 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3813 * target-reloc.h (relocate_relocs): Likewise.
3814 * testsuite/testfile.cc (Target_test): Likewise.
3815 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3816 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3817
3818 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3819 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3820
3821 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3822 parameter, which is unused in the [!F_SETFD] case.
3823
50ed5eb1
RM
3824 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3825 SYMNDX to off_t before comparing it to this->data_size().
3826 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3827 * incremental.cc (Output_section_incremental_inputs::do_write):
3828 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3829
2cadc0bf
RM
3830 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3831
3bfcb652
NC
38322012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3833
3834 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3835 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3836 in EABI_VER5.
3837
c1a8d56e
CC
38382012-10-29 Cary Coutant <ccoutant@google.com>
3839
3840 * dwp.cc (usage): Add file and exit status parameters;
3841 add --help and --version options.
3842 (print_version): New function.
3843 (main): Add --help and --version options.
3844
b2490a7b
L
38452012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3846
3847 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3848 final_layout_sequence.txt.
3849 * testsuite/Makefile.in: Regenerated.
3850
aa543512
L
38512012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3852
3853 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3854 COMPILE generated by automake.
3855 (LINK1): Likewise.
3856 (CXXCOMPILE1): Likewise.
3857 (CXXLINK1): Likewise.
3858 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3859 (LINK): Likewise.
3860 (CXXCOMPILE): Likewise.
3861 (CXXLINK): Likewise.
3862 * testsuite/Makefile.in: Regenerated.
3863
d361fafb
L
38642012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3865
3866 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3867 on bad fwrite return.
3868
598c7410
L
38692012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3870
3871 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3872 on val.
3873
35c813e2
CC
38742012-10-23 Cary Coutant <ccoutant@google.com>
3875
3876 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3877 * testsuite/Makefile.in: Regenerate.
3878 * testsuite/dwp_test.h: New source file.
3879 * testsuite/dwp_test_1.cc: New source file.
3880 * testsuite/dwp_test_1.s: New source file.
3881 * testsuite/dwp_test_1.sh: New source file.
3882 * testsuite/dwp_test_1b.cc: New source file.
3883 * testsuite/dwp_test_1b.s: New source file.
3884 * testsuite/dwp_test_2.cc: New source file.
3885 * testsuite/dwp_test_2.s: New source file.
3886 * testsuite/dwp_test_2.sh: New source file.
3887 * testsuite/dwp_test_main.cc: New source file.
3888 * testsuite/dwp_test_main.s: New source file.
3889
77429909
CC
38902012-10-23 Cary Coutant <ccoutant@google.com>
3891
3892 * dwp.h: New header file.
3893 * dwp.cc: New source file.
3894 * gold.h: Move shared declarations to system.h.
3895 * system.h: New header file.
3896 * Makefile.am: Add dwp.
3897 * Makefile.in: Regenerate.
3898
ed5d6712
CC
38992012-10-23 Cary Coutant <ccoutant@google.com>
3900
3901 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3902 Dwarf_info_reader::read_from_pointer.
3903 (Dwarf_pubnames_table::read_header): Likewise.
3904 (Dwarf_pubnames_table::next_name): Likewise.
3905 (Dwarf_die::read_attributes): Likewise.
3906 (Dwarf_die::skip_attributes): Likewise.
3907 (Dwarf_info_reader::read_from_pointer): New function template.
3908 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3909 (Dwarf_pubnames_table): Likewise.
3910 (Dwarf_info_reader::read_from_pointer): New function template.
3911 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3912 Dwarf_pubnames_table ctor.
3913
8787852d
CC
39142012-10-23 Cary Coutant <ccoutant@google.com>
3915
3916 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3917 abbrev_shndx.
3918 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3919 abbrev_shndx_.
3920 (Dwarf_info_reader::set_abbrev_shndx): New method.
3921 (Dwarf_info_reader::abbrev_shndx_): New data member.
3922
9fc236f3
CC
39232012-10-23 Cary Coutant <ccoutant@google.com>
3924
3925 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3926 from object, not parameters.
3927 (Dwarf_info_reader::parse): Likewise.
3928 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3929 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3930 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3931 methods.
3932
effe8365
CC
39332012-10-23 Cary Coutant <ccoutant@google.com>
3934
3935 * fileread.cc (Input_file::Input_file): New constructor.
3936 * fileread.h (class Input_file): Add new constructor.
3937
1698990d
AM
39382012-10-18 Alan Modra <amodra@gmail.com>
3939
3940 PR gold/14727
3941 * object.cc (Relobj::is_section_name_included): Also match
3942 .sdata personality section.
3943
168a4726
AM
39442012-10-18 Alan Modra <amodra@gmail.com>
3945
3946 * target-reloc.h (class Default_comdat_behavior): New, package up..
3947 (get_comdat_behaviour): ..this.
3948 (relocate_section): Add Relocate_comdat_behavior template arg,
3949 adjust code to suit.
3950 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3951 (Target_arm::scan_reloc_section): Likewise.
3952 * i386.cc (Target_i386::relocate_section): Likewise.
3953 * sparc.cc (Target_sparc::relocate_section): Likewise.
3954 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3955 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3956 * powerpc.cc (class Relocate_comdat_behavior): New.
3957 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3958 gold::relocate_section with new template arg.
3959
acc276d8
AM
39602012-10-18 Alan Modra <amodra@gmail.com>
3961
3962 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3963 dynamic relocs for GOT_TPREL got entries, without symbol if
3964 resolving locally.
3965 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3966 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3967 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3968
e10f9870
AM
39692012-10-17 Alan Modra <amodra@gmail.com>
3970
3971 PR gold/14726
3972 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3973
ae034989
ST
39742012-10-16 Sriraman Tallam <tmsriram@google.com>
3975
3976 * layout.cc (Layout::include_section): Keep sections marked
3977 SHF_EXCLUDE when doing relocatable links.
3978
f3a0ed29
AM
39792012-10-16 Alan Modra <amodra@gmail.com>
3980
3981 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3982 (Target_powerpc::do_finalize_sections): Call it.
3983 (Output_data_save_res): New class and supporting functions.
3984 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3985 normal symbols defined in object files.
3986
c6de8ed4
AM
39872012-10-12 Alan Modra <amodra@gmail.com>
3988
3989 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3990 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3991 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3992 section if scan_opd_relocs not yet called.
3993 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3994
03e25981
AM
39952012-10-12 Alan Modra <amodra@gmail.com>
3996
3997 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3998 add_local_ifunc_entry): Revert last change.
3999 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4000
c9824451
AM
40012012-10-05 Alan Modra <amodra@gmail.com>
4002
4003 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4004 do_plt_address_for_global): New functions.
4005 (Output_data_got_powerpc::do_write): Don't segfault when linking
4006 statically.
4007 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4008 add_local_ifunc_entry): Return true on adding entry..
4009 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4010 glink->add_entry call. Remove unused symtab param. Adjust calls.
4011 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4012 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4013 set up symbols here.
4014 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4015 syms here. Do so even when no .iplt. Don't segfault when linking
4016 statically.
4017 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4018 new variants without reloc param.
4019 (Glink_sym_ent::Glink_sym_ent): Likewise.
4020 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4021 reloc when refs will resolve to plt call stub.
4022 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4023 R_PPC_PLTREL24 to resolve locally.
4024 (Target_powerpc::Scan::global): Correct ifunc handling.
4025 (Target_powerpc::Relocate::relocate): Correct local sym glink
4026 lookup. Don't destroy "value" when we have a plt call stub,
4027 and when checking plt call validity.
4028 (Target_powerpc::do_dynsym_value): Simplify.
4029
19fec8c1
AM
40302012-10-05 Alan Modra <amodra@gmail.com>
4031
4032 * i386.cc (Output_data_plt_i386::address_for_global,
4033 address_for_local): Add plt offset to returned value. Adjust uses.
4034 * sparc.cc (Output_data_plt_sparc::address_for_global,
4035 address_for_local): Likewise.
4036 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4037 address_for_local): Likewise.
4038 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4039 address_for_local): Likewise.
4040 * target.h (Target::plt_address_for_global, plt_address_for_local):
4041 Update comment.
4042 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4043 (Output_data_got::Got_entry::write): Nor here.
4044 * output.h: Comment fix.
4045
e867b647
WL
40462012-10-02 Jiong Wang <jiwang@tilera.com>
4047
4048 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4049 global_offset_table_ value for larget got.
4050 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4051
e5d5f5ed
AM
40522012-09-29 Alan Modra <amodra@gmail.com>
4053
4054 * powerpc.cc (Target_powerpc::iplt_): New output section.
4055 (Target_powerpc::iplt_section, make_iplt_section,
4056 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4057 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4058 Target_powerpc::plt_entry_count): Count iplt entries too.
4059 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4060 reloc section in constructor. New params.
4061 (Target_powerpc::make_plt_section): Create reloc section here instead.
4062 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4063 functions.
4064 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4065 (Output_data_glink::add_entry, find_entry): New functions to
4066 deal with local syms.
4067 (Glink_sym_ent): Add support for local syms.
4068 (Output_data_glink::do_write): Handle ifunc plt entries.
4069 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4070 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4071 (Target_powerpc::Relocate::relocate): Likewise.
4072 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4073
ec4dbad3
AM
40742012-09-25 Alan Modra <amodra@gmail.com>
4075
4076 * object.h (Sized_relobj_file::adjust_local_symbol,
4077 do_adjust_local_symbol): New functions.
4078 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4079 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4080 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4081 and irregular opd entry spacing.
4082 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4083 (Global_symbol_visitor_opd): New functor.
4084 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4085 on deleted opd entries.
4086
5c0b3823
WL
40872012-09-15 Jiong Wang <jiwang@tilera.com>
4088
4089 * tilegx.cc: New file.
4090 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4091 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4092 * configure.tgt: Add entries for tilegx*.
4093 * configure.ac: Likewise.
4094 * Makefile.in: Rebuild.
4095 * configure: Likewise.
4096 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4097 tilegx.
4098
bfdfa4cd
AM
40992012-09-13 Alan Modra <amodra@gmail.com>
4100
4101 * target-reloc.h (scan_relocs): Call scan.local for relocs
4102 against symbols in discarded sections. Pass is_discarded
4103 param.
4104 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4105 Add is_discarded param.
4106 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4107 is_discarded to flag opd entry as discarded. Don't emit dyn
4108 relocs on such entries.
4109 (Target_powerpc::Scan::global): Similarly detect and handle
4110 such opd entries.
4111 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4112 opd_ent_. Update all uses.
4113 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4114 (Target_powerpc::relocate_section): Zero out discarded opd
4115 entry relocs.
4116
d77a0555
ILT
41172012-09-12 Ian Lance Taylor <iant@google.com>
4118
4119 PR gold/14570
4120 * output.cc: Rename Output_data_got template parameter from size
4121 to got_size for all functions. Compile all variants of
4122 Output_data_got.
4123 (Output_data_got::Got_entry::write): Correct use of size for
4124 symbol value. Use local_is_tls rather than casting to
4125 Sized_relobj_file.
4126 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4127 (class Sized_relobj_file): Add do_local_is_tls.
4128 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4129
815a1205
AM
41302012-09-11 Alan Modra <amodra@gmail.com>
4131
4132 PR gold/14566
4133 * layout.cc (Layout::set_segment_offsets): When using
4134 common-page-size alignment, ensure we are on a new max-page-size
4135 page.
4136 * output.cc (Output_segment::set_section_addresses): Use
4137 abi_pagesize, not common_pagesize for relro boundary.
4138 (Output_segment::set_offset): Likewise.
4139
bd73a62d
AM
41402012-09-11 Alan Modra <amodra@gmail.com>
4141
4142 * output.h (Output_data_got::add_global_tls, add_local_tls,
4143 add_local_tls_pair): New functions.
4144 (Output_data_got::add_local_pair_with_rel): Remove second
4145 reloc param. Expand comment.
4146 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4147 use_plt_or_tls_offset_, similarly for constructor param.
4148 (Output_data_got::Got_entry::write): Add got_index param.
4149 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4150 add_local_tls_pair): New functions.
4151 (Output_data_got::Got_entry::write): Handle tls symbols
4152 with use_plt_or_tls_offset_ set specially.
4153 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4154 (Output_data_got::do_write): Replace iterator with index, pass
4155 index to entry write function.
4156 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4157 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4158 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4159 call.
4160 * i386.cc (Target_i386::Scan::local): Likewise.
4161 * sparc.cc (Target_sparc::Scan::local): Likewise.
4162 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4163 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4164 do_tls_offset_for_global): New functions.
4165 (Target_powerpc::Scan::local): Correct TLS relocations and got
4166 entry values.
4167 (Target_powerpc::Scan::global): Don't emit unnecessary
4168 dynamic relocations on TLS GOT entries.
4169
00716ab1
AM
41702012-09-10 Matthias Klose <doko@ubuntu.com>
4171
4172 * config.in: Disable sanity check for kfreebsd.
4173
c891b3f9
SA
41742012-09-10 Sterling Augustine <saugustine@google.com>
4175
4176 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4177 (Gdb_index::pubtypes_read): New parameter.
4178 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4179 to calls.
4180 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4181 pubtypes_object_.
4182
e81fea4d
AM
41832012-09-09 Alan Modra <amodra@gmail.com>
4184
4185 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4186 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4187 * gc.h (gc_process_relocs): Call target gc_add_reference.
4188 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4189 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4190 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4191 unnecessary cast.
4192 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4193 to cater for when we don't need code offset. Update use.
4194 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4195 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4196 set_opd_valid): New functions.
4197 (Target_powerpc::do_gc_add_reference): New function.
4198 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4199 stashed refs.
4200 (Target_powerpc::do_gc_mark_symbol): New function.
4201
d2d60eef
CC
42022012-09-06 Cary Coutant <ccoutant@google.com>
4203
4204 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4205 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4206 (Dwarf_die::skip_attributes): Likewise.
4207 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4208 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4209 (main): Call it.
4210 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4211
32ed4573
L
42122012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4213
4214 * testsuite/script_test_3.t: Add .got.plt output section
4215 statement.
4216 * testsuite/script_test_4.t: Likewise.
4217
f4baf0d4
AM
42182012-09-05 Alan Modra <amodra@gmail.com>
4219
4220 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4221 update all uses and lose "enum" when using type.
4222
864a1b56
AM
42232012-09-05 Alan Modra <amodra@gmail.com>
4224
4225 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4226 * configure: Regenerate.
4227 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4228 (plugin_final_layout.stdout): Likewise.
4229 (memory_test): Set page sizes to 0x1000.
4230 * testsuite/Makefile.in: Regenerate.
4231 * testsuite/discard_locals_test.sh: Add FIXME comment.
4232 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4233 * testsuite/pr14265.t: Add .got output section statement.
4234 * testsuite/script_test_2.t: Likewise.
4235 * testsuite/script_test_3.t: Likewise.
4236 * testsuite/script_test_4.t: Likewise.
4237 * testsuite/script_test_5.t: Likewise.
4238 * testsuite/script_test_6.t: Likewise.
4239 * testsuite/script_test_7.t: Likewise.
4240 * testsuite/script_test_9.t: Likewise.
4241
3ea0a085
AM
42422012-09-05 Alan Modra <amodra@gmail.com>
4243
4244 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4245 (Powerpc_relocate_functions::Status): New typedef.
4246 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4247 (Target_powerpc::Scan::local): Handle REL64.
4248 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4249 for REL32 and REL64.
4250 (Target_powerpc::symval_for_branch): New function, extracted from..
4251 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4252 checks. Report overflow errors.
4253
7404fe1b
AM
42542012-09-05 Alan Modra <amodra@gmail.com>
4255
4256 * object.h (Sized_relobj_file::emit_relocs): Delete.
4257 (Sized_relobj_file::emit_relocs_reltype): Delete.
4258 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4259 relocate_relocs for --emit-relocs.
4260 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4261 * output.h: Update comment.
4262 (Output_segment::first_section): New function.
4263 (Output_segment::first_section_load_address): Use first_section.
4264 * output.cc (Output_segment::first_section): New function extracted..
4265 (Output_segment::first_section_load_address): ..from here. Delete.
4266 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4267 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4268 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4269 adjust call to target.h function.
4270 * i386.cc (Target_i386): Likewise.
4271 * sparc.cc (Target_sparc): Likewise.
4272 * x86_64.cc (Target_x86_64): Likewise.
4273 * powerpc.cc (Target_powerpc): Likewise.
4274 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4275 first tls section has section symbol for optimised local dynamic
4276 output relocs.
4277 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4278 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4279 optimised tls code.
4280 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4281 Rename to relocate_relocs. Update error message.
4282
957564c9
AS
42832012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4284
4285 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4286 --just-symbols.
4287
dd93cd0a
AM
42882012-08-31 Alan Modra <amodra@gmail.com>
4289
4290 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4291 (Powerpc_relobj::toc_base_offset): New stub function.
4292 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4293 got_mod_index_offset to tlsld_got_offset. Update all refs.
4294 (Target_powerpc::Relocate::enum skip_tls): New.
4295 (Target_powerpc::call_tls_get_addr_): New var.
4296 (Target_powerpc::is_branch_reloc): Move to file scope.
4297 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4298 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4299 New functions.
4300 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4301 (powerpc_info): Correct common_pagesize for ppc64.
4302 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4303 (Powerpc_relocate_functions): Add overflow check enums and functions.
4304 Add non-shift version of rela, rela_ua. Delete all rel public
4305 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4306 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4307 addr16_ha3, addr14 functions.
4308 (Output_data_got_powerpc::add_constant_pair): New function.
4309 (Output_data_got_powerpc::got_base_offset): Likewise.
4310 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4311 (instruction constants): Sort, add some more.
4312 (Output_data_glink::do_write): Add and use Address typedef. Use
4313 object->toc_base_offset() stub for 64-bit.
4314 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4315 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4316 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4317 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4318 Always treat .opd relocs as against locally defined symbol.
4319 Correct condition for RELATIVE relocs.
4320 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4321 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4322 for 32-bit syms with a plt entry. Correct ppc64 toc base
4323 calculations. Handle TLS relocs, and more. Add overflow
4324 checking and adjust for Powerpc_relocate_functions changes.
4325 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4326 Reinstate --emit-relocs code with FIXME.
4327
a1373b60
AM
43282012-08-30 Alan Modra <amodra@gmail.com>
4329
4330 * layout.cc (Layout::set_segment_offsets): Set p_align to
4331 abi_pagesize, not common_pagesize.
4332 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4333 to determine whether file header can go in segment.
4334
703d02da
AM
43352012-08-30 Alan Modra <amodra@gmail.com>
4336
4337 * output.h (Output_reloc::Output_reloc <output section>): Add
4338 is_relative param. Adjust calls.
4339 (Output_reloc::add_output_section_relative): New functions.
4340 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4341 is_relative.
4342 (Output_reloc::symbol_value): Handle SECTION_CODE.
4343
16164a6b
ST
43442012-08-24 Sriraman Tallam <tmsriram@google.com>
4345
4346 * gold.cc (queue_middle_tasks): Call layout again when unique
4347 segments for sections is desired.
4348 * layout.cc (Layout::Layout): Initialize new members.
4349 (Layout::get_output_section_flags): New function.
4350 (Layout::choose_output_section): Call get_output_section_flags.
4351 (Layout::layout): Make output section for mapping to a unique segment.
4352 (Layout::insert_section_segment_map): New function.
4353 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4354 output sections marked so.
16164a6b
ST
4355 (Layout::segment_precedes): Check for unique segments when sorting.
4356 * layout.h (Layout::Unique_segment_info): New struct.
4357 (Layout::Section_segment_map): New typedef.
4358 (Layout::insert_section_segment_map): New function.
4359 (Layout::get_output_section_flags): New function.
4360 (Layout::is_unique_segment_for_sections_specified): New function.
4361 (Layout::set_unique_segment_for_sections_specified): New function.
4362 (Layout::unique_segment_for_sections_specified_): New member.
4363 (Layout::section_segment_map_): New member.
4364 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4365 Rename is_gc_pass_one to is_pass_one.
4366 Rename is_gc_pass_two to is_pass_two.
4367 Rename is_gc_or_icf to is_two_pass.
4368 Check for which pass based on whether symbols data is present.
4369 Make it two pass when unique segments for sections is desired.
4370 * output.cc (Output_section::Output_section): Initialize new
4371 members.
4372 * output.h (Output_section::is_unique_segment): New function.
4373 (Output_section::set_is_unique_segment): New function.
4374 (Output_section::is_unique_segment_): New member.
4375 (Output_section::extra_segment_flags): New function.
4376 (Output_section::set_extra_segment_flags): New function.
4377 (Output_section::extra_segment_flags_): New member.
4378 (Output_section::segment_alignment): New function.
4379 (Output_section::set_segment_alignment): New function.
4380 (Output_section::segment_alignment_): New member.
4381 (Output_segment::Output_segment): Initialize is_unique_segment_.
4382 (Output_segment::is_unique_segment): New function.
4383 (Output_segment::set_is_unique_segment): New function.
4384 (Output_segment::is_unique_segment_): New member.
4385 * plugin.cc (allow_unique_segment_for_sections): New function.
4386 (unique_segment_for_sections): New function.
4387 (Plugin::load): Add new functions to transfer vector.
4388 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4389 * Makefile.in: Regenerate.
4390 * testsuite/plugin_final_layout.sh: Check if unique segment
4391 functionality works.
4392 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4393 are available.
4394 (allow_unique_segment_for_sections): New global.
4395 (unique_segment_for_sections): New global.
4396 (claim_file_hook): Call allow_unique_segment_for_sections.
4397 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4398
1e2bee4f
CC
43992012-08-22 Cary Coutant <ccoutant@google.com>
4400
4401 * layout.cc (Layout::include_section): Don't assert on GROUP
4402 sections with --emit-relocs.
4403
1d5dfe78
CC
44042012-08-21 Cary Coutant <ccoutant@google.com>
4405
4406 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4407 if --export-dynamic-symbol names an undef symbol.
4408
c9269dff
AM
44092012-08-18 Alan Modra <amodra@gmail.com>
4410
4411 * powerpc.cc: Formatting and white space.
4412 (Powerpc_relobj): Rename got2_section_ to special_.
4413 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4414 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4415 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4416 (Target_powerpc): Add Address typedef and invalid_address. Use
4417 throughout.
4418 (Target_powerpc::is_branch_reloc): New function.
4419 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4420 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4421 for dst_mask, value and addend.
4422 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4423 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4424 (Output_data_glink::do_write): Correct toc base. Don't try to use
4425 uint16_t for 24-bit offset. Use get_output_section_offset and
4426 check return.
4427 (Target_powerpc::Scan::local): Handle more relocs.
4428 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4429 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4430 Plug in toc restoring insn after plt calls. Translate branches
4431 to function descriptor symbols to corresponding entry point.
4432 (Target_powerpc::relocate_for_relocatable): Check return from
4433 get_output_section_offset.
4434 * symtab.h: Comment typo.
4435
b1759dce
ILT
44362012-08-14 Ian Lance Taylor <iant@google.com>
4437
4438 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4439 unsupported_relocal_local to call unsupported_reloc_global.
4440
b9b2ae8b
NC
44412012-08-14 Nick Clifton <nickc@redhat.com>
4442
4443 PR ld/14265
4444 * script-sections.cc (Sections_element::output_section_name): Add
4445 keep return parameter.
4446 (Output_section_element::match_name): Add keep return parameter.
4447 Return the value of the keep_ member.
4448 * script-sections.h (class Output_section): Update
4449 output_section_name prototype.
4450 * layout.cc (Layout::keep_input_section): New public member
4451 function.
4452 (Layout::choose_output_section): Pass keep parameter to
4453 output_section_name.
4454 * layout.h (class Layout): Add keep_input_section.
4455 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4456 sections.
4457 * testsuite/Makefile.am: Add a test.
4458 * testsuite/Makefile.in: Regenerate.
4459 * testsuite/pr14265.c: Source file for the test.
4460 * testsuite/pr14265.t: Linker script for the test.
4461 * testsuite/pr14265.sh: Shell script for the test.
4462
921b5322
AM
44632012-08-14 Alan Modra <amodra@gmail.com>
4464
4465 * target.h (Target::output_section_name): New function.
4466 (Target::do_output_section_name): New function.
4467 * layout.cc (Layout::choose_output_section): Call the above.
4468 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4469
6ce78956
AM
44702012-08-14 Alan Modra <amodra@gmail.com>
4471
4472 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4473 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4474 for replace_constant call.
4475 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4476 (Output_data_glink::do_print_to_mapfile): New function.
4477 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4478 (Target_powerpc::Relocate::relocate): Likewise.
4479
d1a8cabd
AM
44802012-08-14 Alan Modra <amodra@gmail.com>
4481
4482 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4483 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4484 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4485 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4486 all references to shndx_. Handle special case for R_PPC_PLTREL24
4487 here.
4488 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4489 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4490 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4491 here.
4492 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4493 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4494
d83ce4e3
AM
44952012-08-12 Alan Modra <amodra@gmail.com>
4496
4497 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4498 (glink insn constants): Use uint32_t.
4499 (Output_data_glink::add_entry): Use insert, not [] operator.
4500
cf43a2fe
AM
45012012-08-11 Alan Modra <amodra@gmail.com>
4502
4503 * object.h (Sized_relobj_file::find_shdr): New function.
4504 (Sized_relobj_file::find_special_sections): New function.
4505 * object.cc (Sized_relobj_file::find_shdr): New function.
4506 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4507 (Sized_relobj_file::find_special_sections): New function, split out..
4508 (Sized_relobj_file::do_read_symbols): ..from here.
4509 * output.h (Output_data_got::replace_constant): New function.
4510 (Output_data_got::num_entries): New function.
4511 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4512 (Output_data_got::got_offset): Protected rather than private.
4513 (Output_data_got::replace_got_entry): New function.
4514 * output.cc (Output_data_got::replace_got_entry): New function.
4515 * powerpc.cc (class Powerpc_relobj): New.
4516 (class Powerpc_relocate_functions): Delete all psymval variants or
4517 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4518 Implement _ha functions using corresponding _hi function.
4519 (Powerpc_relobj::find_special_sections): New function.
4520 (Target_powerpc::do_make_elf_object): New function.
4521 (class Output_data_got_powerpc): New.
4522 (class Output_data_glink): New.
4523 (class Powerpc_scan_relocatable_reloc): New.
4524 Many more changes througout file.
4525
3c892704
NC
45262012-08-09 Nick Clifton <nickc@redhat.com>
4527
4528 * po/vi.po: Updated Vietnamese translation.
4529
82435b3b
ILT
45302012-08-07 Ian Lance Taylor <iant@google.com>
4531
4532 * layout.cc (Layout::add_target_dynamic_tags): If
4533 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4534 plt_rel.
4535
a6dc81d2
NC
45362012-07-30 Nick Clifton <nickc@redhat.com>
4537
4538 * po/gold.pot: Updated template.
4539 * po/es.po: Updated Spanish translation.
4540
f1415016
CC
45412012-07-18 Cary Coutant <ccoutant@google.com>
4542
4543 PR gold/14344
4544 * configure.ac: Add check for -gpubnames support.
4545 * configure: Regenerate.
4546 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4547 support; force -gno-pubnames.
4548 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4549 support.
4550 (gdb_index_test_4): New test.
4551 * testsuite/Makefile.in: Regenerate.
4552 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4553 * testsuite/gdb_index_test_2.sh: Likewise.
4554 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4555 * testsuite/gdb_index_test_4.sh: New script.
4556 * testsuite/gdb_index_test_comm.sh: New script with common code;
4557 don't look for space after colon.
4558
b7fd7c37
ST
45592012-07-16 Sriraman Tallam <tmsriram@google.com>
4560
4561 * gold.cc (queue_middle_tasks): Update function order only after
4562 deferred objects due to plugins are processed.
4563
1f3212db
ILT
45642012-07-11 Ian Lance Taylor <iant@google.com>
4565
4566 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4567 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4568 (Target_arm::scan_reloc_for_stub): Likewise.
4569 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4570 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4571 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4572 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4573 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4574
81c82a68
ILT
45752012-07-10 Dodji Seketeli <dodji@redhat.com>
4576 Ian Lance Taylor <iant@google.com>
4577
4578 PR gold/14309
4579 * configure.ac: Test whether std::tr1::hash<off_t> works.
4580 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4581 needed.
4582 * output.h (class Output_fill): Add virtual destructor.
4583 * configure, config.in: Rebuild.
4584
eabc84f4
RM
45852012-06-22 Roland McGrath <mcgrathr@google.com>
4586
4587 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4588
370e30b6
RÁE
45892012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4590
4591 * plugin.cc (Plugin::load): Handle position independent executables.
4592
fb1b895d
CC
45932012-06-06 Cary Coutant <ccoutant@google.com>
4594
4595 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4596 add .debug_macro.
4597 (lines_only_debug_sections): Likewise.
4598 (gdb_fast_lookup_sections): New static array.
4599 (is_gdb_debug_section): Rename formal parameter.
4600 (is_lines_only_debug_section): Likewise.
4601 (is_gdb_fast_lookup_section): New function.
4602 (Layout::include_section): Check for ".zdebug_" prefix; pass
4603 section name suffix to is_gdb_debug_section, et al.; check for
4604 fast-lookup sections when building .gdb_index.
4605 * options.h (--strip-debug-gdb): Update GDB version number.
4606
7c0640fa
CC
46072012-06-06 Cary Coutant <ccoutant@google.com>
4608
4609 * configure.ac: Add check for fallocate.
4610 * configure: Regenerate.
4611 * config.in: Regenerate.
4612
4613 * options.h (class General_options): Add --mmap-output-file and
4614 --posix-fallocate options.
4615 * output.cc: (posix_fallocate): Remove; replace with...
4616 (gold_fallocate): New function.
4617 (Output_file::map_no_anonymous): Call gold_fallocate.
4618 (Output_file::map): Check --mmap-output-file option.
4619
2a49eb69
DK
46202012-06-05 Jing Yu <jingyu@google.com>
4621
4622 * gold.h (textdomain): Add do {} to empty while(0).
4623 (bindtextdomain): Likewise.
4624
fad072ac
CC
46252012-06-04 Cary Coutant <ccoutant@google.com>
4626
4627 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4628 has_dynsym_index.
4629
8cc69fb6
ST
46302012-05-25 Sriraman Tallam <tmsriram@google.com>
4631
4632 * symtab.cc (Symbol_table::define_special_symbol):
4633 Initialize *poldsym to prevent uninitialized variable errors.
4634
1be75daa
CC
46352012-05-23 Cary Coutant <ccoutant@google.com>
4636
4637 * layout.cc (Layout::section_name_mapping): Add rules to handle
4638 exact match on .data.rel.ro.local or .data.rel.ro.
4639 (Layout::output_section_name): Check for exact matches.
4640
9b689de0
CC
46412012-05-23 Cary Coutant <ccoutant@google.com>
4642
4643 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4644 more carefully.
4645
b24fdbf5
CC
46462012-05-22 Cary Coutant <ccoutant@google.com>
4647
4648 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4649 object before exporting symbol.
4650
e550e1a2
L
46512012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4652
4653 * testsuite/tls_test.cc: Include "config.h" first.
4654 * testsuite/tls_test_c.c: Likewise.
4655
df7b86aa
NC
46562012-05-17 Daniel Richard G. <skunk@iskunk.org>
4657 Nick Clifton <nickc@redhat.com>
4658
4659 PR 14072
4660 * configure.in: Add check that sysdep.h has been included before
4661 any system header files.
4662 * configure: Regenerate.
4663 * config.in: Regenerate.
4664
1007b503
CC
46652012-05-14 Cary Coutant <ccoutant@google.com>
4666
4667 * layout.cc (Layout::make_output_section): Mark .tdata section
4668 as RELRO.
4669 * testsuite/relro_test.cc: Add a TLS variable.
4670
fd885f3a
L
46712012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4672
4673 PR gold/14091
4674 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4675 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4676 R_X86_64_64.
4677
80f5885c
CC
46782012-05-08 Cary Coutant <ccoutant@google.com>
4679
4680 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4681 (lines_only_debug_sections): Likewise.
4682
2e702c99
RM
46832012-05-02 Roland McGrath <mcgrathr@google.com>
4684
4685 * nacl.cc: New file.
4686 * nacl.h: New file.
4687 * Makefile.am (CCFILES, HFILES): Add them.
4688 * Makefile.in: Regenerate.
4689 * i386.cc (Output_data_plt_i386_nacl): New class.
4690 (Output_data_plt_i386_nacl_exec): New class.
4691 (Output_data_plt_i386_nacl_dyn): New class.
4692 (Target_i386_nacl): New class.
4693 (Target_selector_i386_nacl): New class.
4694 (target_selector_i386): Use it instead of Target_selector_i386.
4695 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4696 (Target_x86_64_nacl): New class.
4697 (Target_selector_x86_64_nacl): New class.
4698 (target_selector_x86_64, target_selector_x32): Use it instead of
4699 Target_selector_x86_64.
4700 * arm.cc (Output_data_plt_arm_nacl): New class.
4701 (Target_arm_nacl): New class.
4702 (Target_selector_arm_nacl): New class.
4703 (target_selector_arm, target_selector_armbe): Use it instead of
4704 Target_selector_arm.
4705
4706 * target-select.cc (select_target): Take new Input_file* and off_t
4707 arguments, pass them on to recognize method of selector.
4708 * object.cc (make_elf_sized_object): Update caller.
4709 * parameters.cc (parameters_force_valid_target): Likewise.
4710 * incremental.cc (make_sized_incremental_binary): Likewise.
4711 * target-select.h: Update decl.
4712 (Target_selector::recognize): Take new Input_file* argument,
4713 pass it on to do_recognize.
4714 (Target_selector::do_recognize): Take new Input_file* argument.
4715 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4716 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4717 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4718 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4719
4720 * target.h (Target::Target_info): New members isolate_execinstr
4721 and rosegment_gap.
4722 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4723 * arm.cc (Target_arm::arm_info): Update initializer.
4724 * i386.cc (Target_i386::i386_info): Likewise.
4725 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4726 * sparc.cc (Target_sparc::sparc_info): Likewise.
4727 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4728 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4729 * layout.cc (Layout::attach_allocated_section_to_segment):
4730 Take new const Target* argument. If target->isolate_execinstr(), act
4731 like --rosegment.
4732 (Layout::find_first_load_seg): Take new const Target* argument;
4733 if target->isolate_execinstr(), reject PF_X segments.
4734 (Layout::relaxation_loop_body): Update caller.
4735 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4736 reset file offset to zero when we hit LOAD_SEG, and then do a second
4737 loop over the segments before LOAD_SEG to reassign offsets after
4738 addresses have been determined. Handle target->rosegment_gap().
4739 (Layout::attach_section_to_segment): Take new const Target* argument;
4740 pass it to attach_allocated_section_to_segment.
4741 (Layout::make_output_section): Update caller.
4742 (Layout::attach_sections_to_segments): Take new const Target* argument;
4743 pass it to attach_section_to_segment.
4744 * gold.cc (queue_middle_tasks): Update caller.
4745 * layout.h (Layout): Update method decls with new arguments.
4746
4747 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4748 Target_info pointer to use.
4749 (Target_arm::do_make_data_plt): New virtual method.
4750 (Target_arm::make_data_plt): New method that calls it.
4751 (Target_arm::make_plt_entry): Use it.
4752 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4753 for the section alignment.
4754 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4755 method.
4756 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4757 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4758 method.
4759 (Output_data_plt_arm::get_plt_entry_size): Call it.
4760 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4761 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4762 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4763 method.
4764 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4765 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4766 method instead of sizeof(plt_entry).
4767 (Output_data_plt_arm::add_entry): Likewise.
4768 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4769 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4770 than static method.
4771 (Target_arm::plt_entry_size): Likewise.
4772 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4773 Move to ...
4774 (Output_data_plt_arm_standard): ... here, new class.
4775 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4776 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4777 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4778
4779 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4780 Take additional argument for the PLT entry size.
4781 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4782 Use get_plt_entry_size method rather than plt_entry_size variable.
4783 (Output_data_plt_x86_64::reserve_slot): Likewise.
4784 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4785 (Output_data_plt_x86_64::add_entry): Likewise.
4786 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4787 (Output_data_plt_x86_64::address_for_global): Likewise.
4788 (Output_data_plt_x86_64::address_for_local): Likewise.
4789 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4790 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4791 Make method non-static.
4792 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4793 method.
4794 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4795 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4796 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4797 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4798 virtual method.
4799 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4800 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4801 virtual method.
4802 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4803 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4804 virtual method.
4805 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4806 (Output_data_plt_x86_64::plt_entry_size)
4807 (Output_data_plt_x86_64::first_plt_entry)
4808 (Output_data_plt_x86_64::plt_entry)
4809 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4810 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4811 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4812 (Output_data_plt_x86_64_standard): ... here, new class.
4813 (Target_x86_64::Target_x86_64): Take optional argument for the
4814 Target_info pointer to use.
4815 (Target_x86_64::do_make_data_plt): New virtual method.
4816 (Target_x86_64::make_data_plt): New method to call it.
4817 (Target_x86_64::init_got_plt_for_update): Use that.
4818 Call this->plt_->add_eh_frame method here.
4819 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4820 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4821 rather than static method.
4822 (Target_x86_64::plt_entry_size): Likewise.
4823 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4824 rather than plt_entry_size variable. Move guts of PLT filling to...
4825 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4826 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4827 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4828
4829 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4830 additional argument for the section alignment.
4831 Don't do add_eh_frame_for_plt here.
4832 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4833 non-static. Use get_plt_entry_size method rather than plt_entry_size
4834 variable.
4835 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4836 method.
4837 (Output_data_plt_i386::get_plt_entry_size): Call it.
4838 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4839 (Output_data_plt_i386::add_eh_frame): New method to call it.
4840 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4841 method.
4842 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4843 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4844 method.
4845 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4846 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4847 method instead of plt_entry_size.
4848 (Output_data_plt_i386::plt_entry_size)
4849 (Output_data_plt_i386::plt_eh_frame_fde_size)
4850 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4851 (Output_data_plt_i386_standard): ... here, new class.
4852 (Output_data_plt_i386_exec): New class.
4853 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4854 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4855 (Output_data_plt_i386::exec_plt_entry): Move to ...
4856 (Output_data_plt_i386_exec::plt_entry): ... here.
4857 (Output_data_plt_i386_dyn): New class.
4858 (Output_data_plt_i386::first_plt_entry): Move to ...
4859 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4860 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4861 (Output_data_plt_i386_dyn::plt_entry): ... here.
4862 (Target_i386::Target_i386): Take optional argument for the Target_info
4863 pointer to use.
4864 (Target_i386::do_make_data_plt): New virtual method.
4865 (Target_i386::make_data_plt): New method to call it.
4866 (Target_i386::make_plt_section): Use that.
4867 Call this->plt_->add_eh_frame method here.
4868 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4869 rather than plt_entry_size variable.
4870 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4871 (Output_data_plt_i386::address_for_local): Likewise.
4872 (Output_data_plt_i386::do_write): Likewise.
4873 Move guts of PLT filling to...
4874 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4875 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4876 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4877 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4878
b9b9f2ee
CC
48792012-05-01 Cary Coutant <ccoutant@google.com>
4880
4881 * dwarf_reader.cc (Dwarf_die::read_attributes)
4882 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4883 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4884 * reduced_debug_output.cc
4885 (Output_reduced_debug_info_section::get_die_end): Remove
4886 DW_FORM_GNU_ref_index. Add default case.
4887
57923f48
MW
48882012-04-26 Mark Wielaard <mjw@redhat.com>
4889
4890 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4891 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4892 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4893 DW_AT_high_pc as offset from DW_AT_low_pc.
4894
4895 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4896 * testsuite/Makefile.in: Regenerate.
4897 * testsuite/gdb_index_test_3.c: New test source file.
4898 * testsuite/gdb_index_test_3.sh: New test source file.
4899
2c54b4f4
ILT
49002012-04-25 Ian Lance Taylor <iant@google.com>
4901
4902 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4903 pointer.
4904 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4905 as a class, not a struct.
4906 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4907 (Target_arm::apply_cortex_a8_workaround): Likewise.
4908 * gc.h: Declare Reloc_types as a struct, not a class.
4909 * object.h: Declare Symbols_data as a struct.
4910 * reloc.h: Declare Read_relocs_data as a struct.
4911 * target.h: Declare Relocate_info as a struct.
4912
a5a5f7a3
DM
49132012-04-24 David S. Miller <davem@davemloft.net>
4914
4915 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4916 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4917 and R_SPARC_WPLT30.
4918
f038d496
CC
49192012-04-24 Cary Coutant <ccoutant@google.com>
4920
4921 * incremental-dump.cc (find_input_containing_global): Replace
4922 magic number with symbolic constant.
4923 (dump_incremental_inputs): Update version number.
4924 * incremental.cc (Output_section_incremental_inputs): Update version
4925 number; import symbolic constants from Incremental_inputs_reader.
4926 (Incremental_inputs::create_data_sections): Align relocations
4927 section correctly for 64-bit targets.
4928 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4929 constants; add padding.
4930 (Output_section_incremental_inputs::write_header): Add assert for
4931 header_size.
4932 (Output_section_incremental_inputs::write_input_files): Add assert
4933 for input_entry_size.
4934 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4935 add assert for object_info_size, input_section_entry_size,
4936 global_sym_entry_size.
4937 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4938 for data structure sizes; use them.
4939 (Incremental_input_entry_reader): Import symbolic constants from
4940 Incremental_inputs_reader; use them.
4941
a4d85145
DM
49422012-04-23 David S. Miller <davem@davemloft.net>
4943
4944 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4945 and elf_flags_set_.
4946 (Target_sparc::Target_sparc): Initialize new fields.
4947 (Target_sparc::do_make_elf_object): New function.
4948 (Target_sparc::do_adjust_elf_header): New function.
4949
1d509098
CC
49502012-04-23 Cary Coutant <ccoutant@google.com>
4951
4952 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4953 CU range table of gdb index.
4954
7ebeff7f
DM
49552012-04-20 David S. Miller <davem@davemloft.net>
4956
4957 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4958 instead of false.
4959
13cf9988
DM
49602012-04-16 David S. Miller <davem@davemloft.net>
4961
2a1079e8
DM
4962 * sparc.cc (Target_sparc::got_address): New function.
4963 (Sparc_relocate_functions::gdop_hix22): New function.
4964 (Sparc_relocate_functions::gdop_lox10): New function.
4965 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4966 relocs.
4967 (Target_sparc::Scan::local): Likewise if the global symbol is not
4968 preemptible and is not IFUNC.
4969 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4970 transformations for local and non-preemptible non-IFUNC global
4971 symbols.
4972
0bc964fc
DM
4973 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4974 writing out 64-bit part of ranges.
4975
661d7a80
DM
4976 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4977 -fpic and -fpie respectively.
4978 * Makefile.in: Regenerate.
4979
8c2bf391
DM
4980 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4981 (Target_sparc::Target_sparc): Initialize new field.
4982 (Target_sparc::do_plt_section_for_global): New function.
4983 (Target_sparc::do_plt_section_for_local): New function.
4984 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4985 (Target_sparc::make_plt_section): New function, broken out of
4986 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4987 (Target_sparc::make_plt_entry): Call make_plt_section.
4988 (Target_sparc::make_local_ifunc_plt_entry): New function.
4989 (Target_sparc::rela_ifunc_section): New function.
4990 (Target_sparc::plt_section): Remove const.
4991 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4992 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4993 and ifunc_count_ fields.
4994 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4995 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4996 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4997 (Output_data_plt_sparc::rela_ifunc): New function.
4998 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4999 (Output_data_plt_sparc::has_ifunc_section): New function.
5000 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5001 (Output_data_plt_sparc::address_for_global): New function.
5002 (Output_data_plt_sparc::address_for_local): New function.
5003 (Output_data_plt_sparc::plt_index_to_offset): New function.
5004 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5005 and entry_count.
5006 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5007 entry_count.
5008 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5009 R_SPARC_JMP_IREL to switch.
5010 (Target_sparc::Scan::check_non_pic): Likewise.
5011 (Target_sparc::Scan::local): Handle IFUNC symbols.
5012 (Target_sparc::Scan::local): Likewise.
5013 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5014 and plt_address_for_local.
5015 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5016 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5017
13cf9988
DM
5018 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5019 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5020 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5021 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5022 global relocs too.
5023 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5024 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5025 calls.
5026 * sparc.cc (Target_sparc::Scan::global): Likewise.
5027 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5028
31821be0
CC
50292012-04-16 Cary Coutant <ccoutant@google.com>
5030
5031 * archive.cc (Library_base::should_include_member): Check for
5032 --export-dynamic-symbol.
5033 * options.h (class General_options): Add --export-dynamic-symbol.
5034 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5035 --export-dynamic-symbol.
5036 (Symbol_table::gc_mark_undef_symbols): Likewise.
5037 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5038
2615994e
DM
50392012-04-12 David S. Miller <davem@davemloft.net>
5040
5041 * sparc.cc (Reloc::wdisp10): New relocation method.
5042 (Reloc::h34): Likewise.
5043 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5044 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5045 R_SPARC_WDISP10.
5046 (Target_sparc::Scan::local): Likewise.
5047 (Target_sparc::Scan::global): Likewise.
5048 (Target_sparc::Relocate::relocate): Likewise.
5049
6782735d
CC
50502012-04-09 Cary Coutant <ccoutant@google.com>
5051
5052 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5053 low_pc == 0.
5054
8c7a0b00
ILT
50552012-04-06 Ian Lance Taylor <iant@google.com>
5056
5057 * timer.cc: #include <unistd.h>.
5058
58797674
RM
50592012-04-06 Roland McGrath <mcgrathr@google.com>
5060
5061 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5062 * config.in: Regenerate.
5063 * configure: Regenerate.
5064
44350750
NC
50652012-04-05 Nick Clifton <nickc@redhat.com>
5066
5067 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5068 (AM_LC_MESSAGES): Add.
5069 * aclocal.m4: Regenerate.
5070 * config.in: Regenerate.
5071 * configure: Regenerate.
5072
c1027032
CC
50732012-03-21 Cary Coutant <ccoutant@google.com>
5074
5075 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5076 * Makefile.in: Regenerate.
5077 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5078 (Sized_elf_reloc_mapper::symbol_section): New function.
5079 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5080 (make_elf_reloc_mapper): New function.
5081 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5082 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5083 (Dwarf_abbrev_table::do_get_abbrev): New function.
5084 (Dwarf_ranges_table::read_ranges_table): New function.
5085 (Dwarf_ranges_table::read_range_list): New function.
5086 (Dwarf_pubnames_table::read_section): New function.
5087 (Dwarf_pubnames_table::read_header): New function.
5088 (Dwarf_pubnames_table::next_name): New function.
5089 (Dwarf_die::Dwarf_die): New function.
5090 (Dwarf_die::read_attributes): New function.
5091 (Dwarf_die::skip_attributes): New function.
5092 (Dwarf_die::set_name): New function.
5093 (Dwarf_die::set_linkage_name): New function.
5094 (Dwarf_die::attribute): New function.
5095 (Dwarf_die::string_attribute): New function.
5096 (Dwarf_die::int_attribute): New function.
5097 (Dwarf_die::uint_attribute): New function.
5098 (Dwarf_die::ref_attribute): New function.
5099 (Dwarf_die::child_offset): New function.
5100 (Dwarf_die::sibling_offset): New function.
5101 (Dwarf_info_reader::check_buffer): New function.
5102 (Dwarf_info_reader::parse): New function.
5103 (Dwarf_info_reader::do_parse): New function.
5104 (Dwarf_info_reader::do_read_string_table): New function.
5105 (Dwarf_info_reader::lookup_reloc): New function.
5106 (Dwarf_info_reader::get_string): New function.
5107 (Dwarf_info_reader::visit_compilation_unit): New function.
5108 (Dwarf_info_reader::visit_type_unit): New function.
5109 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5110 Sized_elf_reloc_mapper.
5111 (Sized_dwarf_line_info::symbol_section): Remove function.
5112 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5113 (Sized_dwarf_line_info::read_line_mappings): Remove object
5114 parameter, adjust callers.
5115 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5116 * dwarf_reader.h: Include <sys/types.h>.
5117 (class Track_relocs): Remove forward declaration.
5118 (class Elf_reloc_mapper): New class.
5119 (class Sized_elf_reloc_mapper): New class.
5120 (class Dwarf_abbrev_table): New class.
5121 (class Dwarf_range_list): New class.
5122 (class Dwarf_ranges_table): New class.
5123 (class Dwarf_pubnames_table): New class.
5124 (class Dwarf_die): New class.
5125 (class Dwarf_info_reader): New class.
5126 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5127 (Sized_dwarf_line_info::symbol_section): Remove member function.
5128 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5129 base class.
5130 * gdb-index.cc: New source file.
5131 * gdb-index.h: New source file.
5132 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5133 and .debug_types sections, call Layout::add_to_gdb_index.
5134 (Sized_relobj_incr::do_section_name): Implement.
5135 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5136 return type; Implement.
5137 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5138 return type.
5139 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5140 parameter list and return type.
5141 (Sized_incr_dynobj::do_section_contents): Likewise.
5142 * layout.cc: Include gdb-index.h.
5143 (Layout::Layout): Initialize gdb_index_data_.
5144 (Layout::init_fixed_output_section): Check for .gdb_index section.
5145 (Layout::add_to_gdb_index): New function. Instantiate.
5146 * layout.h: Add forward declaration for class Gdb_index.
5147 (Layout::add_to_gdb_index): New member function.
5148 (Layout::gdb_index_data_): New data member.
5149 * main.cc: Include gdb-index.h.
5150 (main): Print statistics for gdb index.
5151 * object.cc (Object::section_contents): Move code into
5152 do_section_contents.
5153 (need_decompressed_section): Check for sections needed when building
5154 gdb index.
5155 (build_compressed_section_map): Likewise.
5156 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5157 gdb index.
5158 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5159 sections; call Layout::add_to_gdb_index.
5160 (Sized_relobj_file::do_decompressed_section_contents): Call
5161 do_section_contents directly.
5162 * object.h (Object::do_section_contents): Adjust parameter list and
5163 return type.
5164 (Object::do_decompressed_section_contents): Call do_section_contents
5165 directly.
5166 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5167 return type.
5168 * options.h (class General_options): Add --gdb-index option.
5169 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5170 list and return type.
5171 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5172 * reloc.h (Track_relocs::checkpoint): New function.
5173 (Track_relocs::reset): New function.
5174
5175 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5176 New test cases.
5177 * testsuite/Makefile.in: Regenerate.
5178 * testsuite/gdb_index_test.cc: New test source file.
5179 * testsuite/gdb_index_test_1.sh: New test source file.
5180 * testsuite/gdb_index_test_2.sh: New test source file.
5181
647f1574
DK
51822012-03-19 Doug Kwan <dougkwan@google.com>
5183
5184 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5185 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5186 __exidx_start and __exidx_end. Make symbol table parameter
5187 anonymous as it is not used.
5188 * gold.cc (queue_middle_tasks): Call target hook to define any
5189 target-specific symbols.
5190 * target.h (Target::define_standard_symbols): New method.
5191 (Target::do_define_standard_symbols): Same.
5192 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5193 * testsuite/Makefile.in: Regenerate.
5194 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5195 and __exidx_end.
5196 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5197 relocations are generated for __exidx_start and __exidx_end.
5198
7c6109da
DK
51992012-03-16 Doug Kwan <dougkwan@google.com>
5200
5201 * testsuite/Makefile.am: Disable test initpri3b.
5202 * testsuite/Makefile.in: Regenerate.
5203
7b8957f8
DK
52042012-03-15 Doug Kwan <dougkwan@google.com>
5205
5206 * arm.cc (Target_arm::got_section): Make .got section read-only
5207 if -z now is given.
5208
14dc9ef7
ILT
52092012-03-15 Ian Lance Taylor <iant@google.com>
5210
5211 PR gold/13850
5212 * layout.cc (Layout::make_output_section): Correctly mark
5213 SHT_INIT_ARRAY, et. al., as relro.
5214
fa40b62a
DK
52152012-03-14 Doug Kwan <dougkwan@google.com>
5216
5217 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5218 dynamic relocations for protected symbols in shared objects.
5219
fd325007
ILT
52202012-03-13 Ian Lance Taylor <iant@google.com>
5221
5222 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5223 keep the larger alignment.
5224
e8dd54e1
CC
52252012-03-12 Cary Coutant <ccoutant@google.com>
5226
5227 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5228 handling of DW_LNE_define_file.
5229
feb5f3b0
CC
52302012-03-12 Cary Coutant <ccoutant@google.com>
5231
5232 * reduced_debug_output.cc
5233 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5234 codes to switch.
5235
a1fb4256
CC
52362012-02-29 Cary Coutant <ccoutant@google.com>
5237
5238 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5239
5dd8762a
CC
52402012-02-29 Cary Coutant <ccoutant@google.com>
5241
5242 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5243 Call Object::decompressed_section_contents.
5244 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5245 New dtor.
5246 (Sized_dwarf_line_info::buffer_start_): New data member.
5247 * merge.cc (Output_merge_data::do_add_input_section): Call
5248 Object::decompressed_section_contents.
5249 (Output_merge_string::do_add_input_section): Likewise.
5250 * object.cc (need_decompressed_section): New function.
5251 (build_compressed_section_map): Decompress sections needed later.
5252 (Sized_relobj_file::do_decompressed_section_contents): New function.
5253 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5254 * object.h (Object::decompressed_section_contents): New function.
5255 (Object::discard_decompressed_sections): New function.
5256 (Object::do_decompressed_section_contents): New function.
5257 (Object::do_discard_decompressed_sections): New function.
5258 (Compressed_section_info): New type.
5259 (Compressed_section_map): Include decompressed section contents.
5260 (Sized_relobj_file::do_decompressed_section_contents): New function.
5261 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5262
7b5de7ee
CC
52632012-02-16 Cary Coutant <ccoutant@google.com>
5264
5265 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5266 * testsuite/Makefile.in: Regenerate.
5267
f9fa4a63
CC
52682012-02-14 Cary Coutant <ccoutant@google.com>
5269
5270 * options.cc (General_options::finalize): Disallow -pie and -static.
5271
2c175ebc
DK
52722012-02-03 Doug Kwan <dougkwan@google.com>
5273
5274 * arm.cc (Arm_relocate_functions::abs8,
5275 Arm_relocate_functions::abs16): Use
5276 Bits::has_signed_unsigned_overflow32.
5277 (Arm_relocate_functions::thm_abs8): Correct range of
5278 overflow check.
5279 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5280 in assertions.
5281
90cff06f
DK
52822012-02-02 Doug Kwan <dougkwan@google.com>
5283
5284 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5285 position independent outputs, not just shared objects.
5286
63887f3d
L
52872012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5288
5289 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5290 * configure: Regenerated.
5291
bef2b434
ILT
52922012-01-27 Ian Lance Taylor <iant@google.com>
5293
5294 * reloc.h (Bits): New class with static functions, copied from
5295 namespace utils in arm.cc.
5296 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5297 instead.
5298
c335b55d
L
52992012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5300
5301 * incremental.cc (write_info_blocks): Correct relocation offset.
5302
41194d9f
L
53032012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5304
5305 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5306 (Relocate::tls_gd_to_le): Likewise.
5307
1bae613c
L
53082012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5309
5310 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5311
24482ca0
L
53122012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5313
5314 * configure.ac: Check if -mcmodel=medium works.
5315 * configure: Regenerated.
5316
c2c7840a
CC
53172012-01-24 Cary Coutant <ccoutant@google.com>
5318
5319 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5320 definition and ...
5321 (read_unsigned_LEB_128_x): ... this new function.
5322 (read_signed_LEB_128): Replaced with inline definition and ...
5323 (read_signed_LEB_128_x): ... this new function.
5324 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5325 (read_unsigned_LEB_128): Add inline definition.
5326 (read_signed_LEB_128_x): New function.
5327 (read_signed_LEB_128): Add inline definition.
5328 * testsuite/Makefile.am (leb128_unittest): New unit test.
5329 * testsuite/Makefile.in: Regenerate.
5330 * testsuite/leb128_unittest.cc: New unit test.
5331
833de760 53322012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5333
5334 PR gold/13617
5335 * i386.cc (Target_i386::do_code_fill): When using a jmp
5336 instruction, pad with nop instructions.
5337 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5338
618d6666
L
53392012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5340
5341 * x86_64.cc (gc_process_relocs): Add typename on types used in
5342 template.
5343 (scan_relocs): Likewise.
5344 (relocate_section): Likewise.
5345 (apply_relocation): Likewise.
5346
3660ff06
L
53472012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5348
5349 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5350 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5351 under x32.
5352
fc51264f
L
53532012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5354
5355 * x86_64.cc: Initial support for x32.
5356
dd74ae06
CC
53572012-01-03 Cary Coutant <ccoutant@google.com>
5358
5359 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5360 Use abstract base class for GOT.
5361 * gold/output.h (class Output_data_got_base): New abstract base class.
5362 (class Output_data_got): Derive from new base class, adjust ctors.
5363 (Output_data_got::reserve_slot): Make virtual; rename to
5364 do_reserve_slot; Adjust callers.
5365 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5366 pointer to abstract base class.
5367 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5368
83896202
ILT
53692011-12-18 Ian Lance Taylor <iant@google.com>
5370
5371 * object.h (Relobj::local_symbol_value): New function.
5372 (Relobj::local_plt_offset): New function.
5373 (Relobj::local_has_got_offset): New function.
5374 (Relobj::local_got_offset): New function.
5375 (Relobj::set_local_got_offset): New function.
5376 (Relobj::do_local_symbol_value): New pure virtual function.
5377 (Relobj::do_local_plt_offset): Likewise.
5378 (Relobj::do_local_has_got_offset): Likewise.
5379 (Relobj::do_local_got_offset): Likewise.
5380 (Relobj::do_set_local_got_offset): Likewise.
5381 (Sized_relobj::do_local_has_got_offset): Rename from
5382 local_has_got_offset.
5383 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5384 (Sized_relobj::do_set_local_got_offset): Rename from
5385 set_local_got_offset.
5386 (Sized_relobj_file::do_local_plt_offset): Rename from
5387 local_plt_offset.
5388 (Sized_relobj_file::do_local_symbol_value): New function.
5389 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5390 local_plt_offset.
5391 * output.cc (Output_data_got::Got_entry::write): Change object to
5392 Relobj. Use local_symbol_value.
5393 (Output_data_got::add_global_with_rel): Change rel_dyn to
5394 Output_data_reloc_generic*. Use add_global_generic.
5395 (Output_data_got::add_global_with_rela): Remove. Change all
5396 callers to use add_global_with_rel.
5397 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5398 Output_data_reloc_generic*. Use add_global_generic.
5399 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5400 callers to use add_global_pair_with_rel.
5401 (Output_data_got::add_local): Change object to Relobj*.
5402 (Output_data_got::add_local_plt): Likewise.
5403 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5404 change rel_dyn to Output_data_reloc_generic*. Use
5405 add_local_generic.
5406 (Output_data_got::add_local_with_rela): Remove. Change all
5407 callers to use all_local_with_rel.
5408 (Output_data_got::add_local_pair_with_rel): Change object to
5409 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5410 add_output_section_generic.
5411 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5412 callers to use add_local_pair_with_rel.
5413 (Output_data_got::reserve_local): Change object to Relobj*.
5414 * output.h: (class Output_data_reloc_generic): Add pure virtual
5415 declarations for add_global_generic, add_local_generic,
5416 add_output_section_generic.
5417 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5418 functions for Output_data_reloc_generic. Update declarations for
5419 changes listed in output.cc.
5420 (class Output_data_got): Change template parameter to got_size.
5421 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5422 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5423 function.
5424 (Sized_relobj_incr::do_local_plt_offset): New function.
5425 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5426 add_global_generic.
5427
76677ad0
CC
54282011-12-17 Cary Coutant <ccoutant@google.com>
5429
5430 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5431 * resolve.cc (Symbol_table::resolve): Likewise.
5432 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5433 arrays.
5434 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5435
8b8dd8d5
ILT
54362011-12-16 Ian Lance Taylor <iant@google.com>
5437
5438 * output.h (Output_data_reloc_generic::add): Only call
5439 add_dynamic_reloc if this is a dynamic reloc section.
5440
d55525b9
L
54412011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5442
5443 PR gold/13505
5444 * target-reloc.h (apply_relocation): Replace <64, false> with
5445 <size, big_endian>.
5446
ff81c7c1
NC
54472011-11-25 Nick Clifton <nickc@redhat.com>
5448
5449 * po/it.po: New Italian translation.
5450
628f39be
SA
54512011-11-17 Sterling Augustine <saugustine@google.com>
5452
5453 * script.cc (script_include_directive): Implement.
5454 (read_script_file): New local variables name and search_path. Update
5455 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5456 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5457 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5458
98ef3ea4
SA
54592011-11-11 Sterling Augustine <saugustine@google.com>
5460
5461 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5462 (file_or_sections_cmd): Likewise.
5463
f4a8b6d7
DK
54642011-11-11 Doug Kwan <dougkwan@google.com>
5465
5466 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5467 if --just-symbols is given.
5468
29ab395d
DK
54692011-11-10 Doug Kwan <dougkwan@google.com>
5470
5471 PR gold/13362
5472 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5473 when processing data relocs.
5474 * reloc.h (Relocate_functions::rel_unaligned): New method.
5475 (Relocate_functions::pcrel_unaligned): Ditto.
5476 (Relocate_functions::rel32_unaligned): Ditto.
5477 (Relocate_functions::pcrel32_unaligned): Ditto.
5478
2c339f71
DK
54792011-11-09 Doug Kwan <dougkwan@google.com>
5480
5481 PR gold/13362
5482 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5483 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5484 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5485 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5486 (Relocate_functions::rel_unaligned): New.
5487 (Relocate_functions::rel32_unaligned): New.
5488 * target-reloc.h (relocate_for_relocatable): Add code to handle
5489 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5490 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5491 arm_unaligned_reloc_r): New targets.
5492 * testsuite/Makefile.in: Regenerate.
5493 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5494 linking.
5495
3f3cddf1
ILT
54962011-11-02 Ian Lance Taylor <iant@google.com>
5497
5498 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5499 NATIVE_LINKER.
5500 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5501 * options.cc (General_options::finalize): Use library search path
5502 from configure script if specified. If not native and no sysroot,
5503 only search TOOLLIBDIR.
5504 * options.h (Search_directory::Search_directory): Change name to
5505 const std::string&.
5506 (General_options::add_to_library_path_with_sysroot): Change arg to
5507 const std::string&.
5508 * configure, Makefile.in, config.in: Rebuild.
5509
a8e2273b
ILT
55102011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5511
5512 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5513 we are working around the ARM1176 Erratum.
5514 * options.h (General_options::fix_arm1176): Add option.
5515 * testsuite/Makefile.am: Add testcases, and keep current ones
5516 working.
5517 * testsuite/Makefile.in: Regenerate.
5518 * testsuite/arm_fix_1176.s: New file.
5519 * testsuite/arm_fix_1176.sh: Likewise.
5520
cd6eab1c
ILT
55212011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5522
5523 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5524 may_use_blx_.
5525 (Target_arm::may_use_blx): Remove method.
5526 (Target_arm::set_may_use_blx): Likewise.
5527 (Target_arm::may_use_v4t_interworking): New method.
5528 (Target_arm::may_use_v5t_interworking): Likewise.
5529 (Target_arm::may_use_blx_): Remove member variable.
5530 (Arm_relocate_functions::arm_branch_common): Check for v5T
5531 interworking.
5532 (Arm_relocate_functions::thumb_branch_common): Likewise.
5533 (Reloc_stub::stub_type_for_reloc): Likewise.
5534 (Target_arm::do_finalize_sections): Correct interworking checks.
5535 * testsuite/Makefile.am: Add new tests.
5536 * testsuite/Makefile.in: Regenerate.
5537 * testsuite/arm_farcall_arm_arm.s: New test.
5538 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5539 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5540 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5541 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5542 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5543 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5544 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5545
286adcf4
CC
55462011-10-31 Cary Coutant <ccoutant@google.com>
5547
5548 PR gold/13023
5549 * expression.cc (Expression::eval_with_dot): Add
5550 is_section_dot_assignment parameter.
5551 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5552 absolute and assigning to dot within a section.
5553 * script-sections.cc
5554 (Output_section_element_assignment::set_section_addresses): Pass
5555 dot_section to set_if_absolute.
5556 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5557 as is_section_dot_assignment flag to eval_with_dot.
5558 (Output_section_element_dot_assignment::set_section_addresses):
5559 Likewise.
5560 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5561 parameter. Also set value if relative to dot_section; set the
5562 symbol's output_section.
5563 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5564 parameter. Adjust all callers.
5565 (Expression::eval_maybe_dot): Likewise.
5566 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5567 Adjust all callers.
5568 * testsuite/script_test_2.t: Test assignment of an absolute value
5569 to dot within an output section element.
5570
9634ed06
CC
55712011-10-31 Cary Coutant <ccoutant@google.com>
5572
5573 * options.h (class General_options): Add --[no-]gnu-unique options.
5574 * symtab.cc (Symbol_table::sized_write_globals): Convert
5575 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5576
de4101c7
CC
55772011-10-31 Cary Coutant <ccoutant@google.com>
5578
5579 PR gold/13359
5580 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5581 unnecessary assertion.
5582 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5583
7257cc92
ST
55842011-10-31 Sriraman Tallam <tmsriram@google.com>
5585
5586 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5587 gc_mark_symbol.
5588 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5589 gc_mark_symbol.
5590 Change to just keep the section associated with symbol.
5591 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5592 they are externally visible and --export-dynamic is turned on.
5593 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5594
bfc34b3f
ILT
55952011-10-19 Ian Lance Taylor <iant@google.com>
5596
5597 PR gold/13163
5598 * script-sections.cc
5599 (Output_section_element_dot_assignment::needs_output_section): New
5600 function.
5601
ea0d8c47
ILT
56022011-10-19 Ian Lance Taylor <iant@google.com>
5603
5604 PR gold/13204
5605 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5606 --section-start option was seen.
5607 * options.h (General_options::any_section_start): New function.
5608
abd242a9
DM
56092011-10-18 David S. Miller <davem@davemloft.net>
5610
5611 PR binutils/13301
5612 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5613 member to track relocation locations that have moved during TLS
5614 reloc optimizations.
5615 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5616 (Target_sparc::Relocate::relocate): Adjust view down by 4
5617 bytes if it matches reloc_adjust_addr_.
5618 (Target_sparc::Relocate::relocate_tls): Always move the
5619 __tls_get_addr call delay slot instruction forward 4 bytes when
5620 performing relaxation.
5621
bab9090f
CC
56222011-10-18 Cary Coutant <ccoutant@google.com>
5623
5624 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5625 (Output_file::map_no_anonymous): Check for non-zero
5626 return code from posix_fallocate.
5627
f7c5b166
CC
56282011-10-17 Cary Coutant <ccoutant@google.com>
5629
5630 PR gold/13245
5631 * plugin.cc (is_visible_from_outside): Check for symbols
5632 referenced from dynamic objects.
5633 * resolve.cc (Symbol_table::resolve): Don't count references
5634 from dynamic objects as references from real ELF files.
5635 * testsuite/plugin_test_2.sh: Adjust expected result.
5636
b490c0bb
CC
56372011-10-17 Cary Coutant <ccoutant@google.com>
5638
5639 * gold.cc: Include timer.h.
5640 (queue_middle_tasks): Stamp time.
5641 (queue_final_tasks): Likewise.
5642 * main.cc (main): Store timer in parameters. Print timers
5643 for each pass.
5644 * parameters.cc (Parameters::Parameters): Initialize timer_.
5645 (Parameters::set_timer): New function.
5646 (set_parameters_timer): New function.
5647 * parameters.h (Parameters::set_timer): New function.
5648 (Parameters::timer): New function.
5649 (Parameters::timer_): New data member.
5650 (set_parameters_timer): New function.
5651 * timer.cc (Timer::stamp): New function.
5652 (Timer::get_pass_time): New function.
5653 * timer.h (Timer::stamp): New function.
5654 (Timer::get_pass_time): New function.
5655 (Timer::pass_times_): New data member.
5656
f475cf7b
CC
56572011-10-17 Cary Coutant <ccoutant@google.com>
5658
5659 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5660 task for members of lib groups.
5661
cdd7e244
CC
56622011-10-17 Cary Coutant <ccoutant@google.com>
5663
5664 PR gold/13288
4f95c8b4 5665 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5666 (File_read::make_view): Move bounds check (replace with assert)...
5667 (File_read::find_or_make_view): ... to here.
5668
dfb45471
CC
56692011-10-12 Cary Coutant <ccoutant@google.com>
5670
4f95c8b4 5671 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5672 ::read returns less than requested size.
5673
53bbcc1b
CC
56742011-10-10 Cary Coutant <ccoutant@google.com>
5675
4f95c8b4 5676 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5677 Initialize defined_count_.
5678 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5679 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5680 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5681 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5682 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5683 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5684 member.
5685 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5686 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5687 Return zeroes instead of internal error.
5688
397b129b
CC
56892011-10-10 Cary Coutant <ccoutant@google.com>
5690
5691 PR gold/13249
4f95c8b4 5692 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5693 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5694 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5695 (Output_reloc::type_): Adjust size of bit field.
5696 (Output_reloc::use_plt_offset_): New bit field.
5697 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5698 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5699 flag. Adjust all callers.
4f95c8b4 5700 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5701 creating RELATIVE relocations.
5702
d5698657
NC
57032011-10-10 Nick Clifton <nickc@redhat.com>
5704
5705 * po/es.po: Updated Spanish translation.
5706 * po/fi.po: Updated Finnish translation.
5707
6a59a5c2
DN
57082011-10-03 Diego Novillo <dnovillo@google.com>
5709
5710 * options.cc (parse_uint): Fix dereference of RETVAL.
5711
f0558624
ST
57122011-09-29 Sriraman Tallam <tmsriram@google.com>
5713
5714 * layout.h (section_order_map_): New member.
5715 (get_section_order_map): New member function.
5716 * output.cc (Output_section::add_input_section): Check for patterns
5717 only when --section-ordering-file is specified.
5718 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5719 output_sections have been formed.
5720 * layout.cc (Layout_Layout): Initialize section_order_map_.
5721 * plugin.cc (update_section_order): Store order in order_map. Do not
5722 update the order.
5723 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5724 * testsuite/Makefile.in: Regenerate.
5725 * testsuite/plugin_section_order.c: New file.
5726 * testsuite/plugin_final_layout.cc: New file.
5727 * testsuite/plugin_final_layout.sh: New file.
5728
a7dac153
CC
57292011-09-29 Cary Coutant <ccoutant@google.com>
5730
4f95c8b4 5731 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5732 Check for NULL.
4f95c8b4 5733 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5734 symbols during incremental update.
5735 (Symbol_table::add_from_dynobj): Likewise.
5736
eebd87a5
ILT
57372011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5738 Ian Lance Taylor <iant@google.com>
5739
5740 * symtab.cc (Symbol_table::define_special_symbol): Always
5741 canonicalize version string.
5742
403a3331
CC
57432011-09-26 Cary Coutant <ccoutant@google.com>
5744
4f95c8b4
CC
5745 * gold.cc (queue_initial_tasks): Move option checks ...
5746 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5747 some options; make others fatal.
5748
235061c2
CC
57492011-09-26 Cary Coutant <ccoutant@google.com>
5750
5751 gcc PR lto/47247
5752 * plugin.cc (get_symbols_v2): New function.
5753 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5754 (is_referenced_from_outside): New function.
5755 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5756 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5757 (get_symbols): Pass version parameter.
5758 (get_symbols_v2): New function.
5759 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5760 parameter.
5761 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5762 (onload): Add LDPT_GET_SYMBOLS_V2.
5763 (all_symbols_read_hook): Use get_symbols_v2; check for
5764 LDPR_PREVAILING_DEF_IRONLY_EXP.
5765 * testsuite/plugin_test_3.sh: Update expected results.
5766
dc87f620
ILT
57672011-09-23 Simon Baldwin <simonb@google.com>
5768
5769 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5770 configuration options.
5771 * configure: Regenerate.
5772 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5773 * Makefile.in: Regenerate.
5774 * testsuite/Makefile.in: Regenerate.
5775
a8279f82
ST
57762011-09-19 Sriraman Tallam <tmsriram@google.com>
5777
5778 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5779
0c9350c8
CC
57802011-09-19 Cary Coutant <ccoutant@google.com>
5781
5782 * incremental.cc (can_incremental_update): Fix typo in comment.
5783 * incremental.h (can_incremental_update): Likewise.
5784
aa06ae28
CC
57852011-09-18 Cary Coutant <ccoutant@google.com>
5786
5787 * incremental.cc (can_incremental_update): New function.
5788 * incremental.h (can_incremental_update): New function.
5789 * layout.cc (Layout::init_fixed_output_section): Call it.
5790 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5791 * object.cc (Sized_relobj_file::do_layout): Call
5792 can_incremental_update.
5793
ebb300b2
CC
57942011-09-13 Cary Coutant <ccoutant@google.com>
5795
5796 * configure.ac: Check for glibc support for gnu_indirect_function
5797 support with static linking, setting automake conditional
5798 IFUNC_STATIC.
5799 * Makefile.in: Regenerate.
5800 * configure: Regenerate.
5801
5802 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5803 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5804 for IFUNC_STATIC.
5805 * testsuite/Makefile.in: Regenerate.
5806
1206d0d5
CC
58072011-09-13 Cary Coutant <ccoutant@google.com>
5808
5809 * incremental.cc (Sized_relobj_incr::do_layout): Call
5810 report_comdat_group for kept comdat sections.
5811 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5812 * testsuite/Makefile.in: Regenerate.
5813 * testsuite/incr_comdat_test_1.cc: New source file.
5814 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5815 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5816 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5817
40b29874
ILT
58182011-09-13 Ian Lance Taylor <iant@google.com>
5819
5820 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5821 variable external_symbols_offset.
5822
1b045aac
ILT
58232011-09-12 Ian Lance Taylor <iant@google.com>
5824
5825 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5826 triggered if object has no symbols.
5827
24c6c55a
DM
58282011-09-09 David S. Miller <davem@davemloft.net>
5829
5830 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5831 (Output_fill_debug_line::do_write): Likewise.
5832
66570254
CC
58332011-08-29 Cary Coutant <ccoutant@google.com>
5834
5835 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5836 casts to match formatting specs.
5837 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5838
8ea8cd50
CC
58392011-08-26 Cary Coutant <ccoutant@google.com>
5840
5841 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5842 remaining hole size when allocating.
5843 (Layout::make_output_section): Set fill methods for debug sections.
5844 * layout.h (Free_list::Free_list_node): Move from private to
5845 public.
5846 (Free_list::set_min_hole_size): New function.
5847 (Free_list::begin, Free_list::end): New functions.
5848 (Free_list::min_hole_): New data member.
5849 * output.cc: Include dwarf.h.
5850 (Output_fill_debug_info::do_minimum_hole_size): New function.
5851 (Output_fill_debug_info::do_write): New function.
5852 (Output_fill_debug_line::do_minimum_hole_size): New function.
5853 (Output_fill_debug_line::do_write): New function.
5854 (Output_section::Output_section): Initialize new data member.
5855 (Output_section::set_final_data_size): Ensure patch space is larger
5856 than minimum hole size.
5857 (Output_section::do_write): Fill holes in debug sections.
5858 * output.h (Output_fill): New class.
5859 (Output_fill_debug_info): New class.
5860 (Output_fill_debug_line): New class.
5861 (Output_section::set_free_space_fill): New function.
5862 (Output_section::free_space_fill_): New data member.
5863 * testsuite/Makefile.am (incremental_test_3): Add
5864 --incremental-patch option.
5865 (incremental_test_4): Likewise.
5866 (incremental_test_5): Likewise.
5867 (incremental_test_6): Likewise.
5868 (incremental_copy_test): Likewise.
5869 (incremental_common_test_1): Likewise.
5870 * testsuite/Makefile.in: Regenerate.
5871
7cf80422
NC
58722011-08-26 Nick Clifton <nickc@redhat.com>
5873
5874 * po/es.po: Updated Spanish translation.
5875
c3f7b0e5
CC
58762011-08-01 Cary Coutant <ccoutant@google.com>
5877
5878 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5879 * gold/testsuite/Makefile.in: Regenerate.
5880 * gold/testsuite/justsyms_exec.c: New source file.
5881 * gold/testsuite/justsyms_lib.c: New source file.
5882
9590bf25
CC
58832011-08-01 Cary Coutant <ccoutant@google.com>
5884
5885 * layout.cc (Layout::set_segment_offsets): Don't realign text
5886 segment if -Ttext was specified.
5887 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5888 file type.
5889 * object.h (Sized_relobj_file::e_type): New function.
5890 (Sized_relobj_file::e_type_): New data member.
5891 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5892 base address for ET_EXEC files.
5893 * target.cc (Target::do_make_elf_object_implementation): Allow
5894 ET_EXEC files with --just-symbols option.
5895
dcd8d12e
CC
58962011-07-28 Cary Coutant <ccoutant@google.com>
5897
5898 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5899 Add thread_number parameter.
5900 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5901 * workqueue-threads.cc
5902 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5903 current thread if its thread number is greater than desired thread
5904 count.
5905 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5906 Add thread_number parameter.
5907 (Workqueue::should_cancel_thread): Likewise.
5908 (Workqueue::find_runnable_or_wait): Pass thread_number to
5909 should_cancel_thread.
5910 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5911 parameter.
5912
804eb480
ST
59132011-07-22 Sriraman Tallam <tmsriram@google.com>
5914
5915 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5916 only after checking if it cannot be forced local.
5917 * symtab.h (is_externally_visible): Check if the symbol is not forced
5918 local.
5919
f1ddb600
ILT
59202011-07-15 Ian Lance Taylor <iant@google.com>
5921
5922 * options.h (class General_options): Add --print-output-format.
5923 Move -EL next to -EB, for better --help output.
5924 * target-select.cc: Include <cstdio>, "options.h", and
5925 "parameters.h".
5926 (Target_selector::do_target_bfd_name): New function.
5927 (print_output_format): New function.
5928 * target-select.h (class Target_selector): Update declarations.
5929 (Target_selector::target_bfd_name): New function.
5930 (print_output_format): Declare.
5931 * main.cc: Include "target-select.h".
5932 (main): Handle --print-output-format.
5933 * gold.cc: Include "target-select.h".
5934 (queue_initial_tasks): Handle --print-output-format when there are
5935 no input files.
5936 * parameters.cc (parameters_force_valid_target): Give a better
5937 error message if -EB/-EL does not match target.
5938 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5939 function.
5940
7d172687
ILT
59412011-07-15 Ian Lance Taylor <iant@google.com>
5942
5943 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5944 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5945 (Output_data_plt_i386::do_write): Write address of .dynamic
5946 section to first entry in .got.plt section.
5947 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5948 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5949 Initialize layout_.
5950 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5951 section to first entry in .got.plt section.
5952 * layout.h (Layout::dynamic_section): New function.
5953
e9552f7e
ST
59542011-07-13 Sriraman Tallam <tmsriram@google.com>
5955
5956 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5957 to claim_file call.
5958 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5959 input_section_position_, and input_section_glob_.
5960 (read_layout_from_file): Call function section_ordering_specified.
5961 * layout.h (is_section_ordering_specified): New function.
5962 (section_ordering_specified): New function.
5963 (section_ordering_specified_): New boolean member.
5964 * main.cc(main): Call load_plugins after layout object is defined.
5965 * output.cc (Output_section::add_input_section): Use
5966 function section_ordering_specified to check if section ordering is
5967 needed.
5968 * output.cc (Output_section::add_relaxed_input_section): Use
5969 function section_ordering_specified to check if section ordering is
5970 needed.
5971 (Output_section::update_section_layout): New function.
5972 (Output_section::sort_attached_input_sections): Check if input section
5973 must be reordered.
5974 * output.h (Output_section::update_section_layout): New function.
5975 * plugin.cc (get_section_count): New function.
5976 (get_section_type): New function.
5977 (get_section_name): New function.
5978 (get_section_contents): New function.
5979 (update_section_order): New function.
58797674 5980 (allow_section_ordering): New function.
e9552f7e
ST
5981 (Plugin::load): Add the new interfaces to the transfer vector.
5982 (Plugin_manager::load_plugins): New parameter.
5983 (Plugin_manager::all_symbols_read): New parameter.
5984 (Plugin_manager::claim_file): New parameter. Save the elf object for
5985 unclaimed objects.
5986 (Plugin_manager::get_elf_object): New function.
5987 (Plugin_manager::get_view): Change to directly use the bool to check
5988 if get_view is called from claim_file_hook.
5989 * plugin.h (input_objects): New function
5990 (Plugin__manager::load_plugins): New parameter.
5991 (Plugin_manager::claim_file): New parameter.
5992 (Plugin_manager::get_elf_object): New function.
5993 (Plugin_manager::in_claim_file_handler): New function.
5994 (Plugin_manager::in_claim_file_handler_): New member.
5995 (layout): New function.
5996 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5997 handler with an extra parameter. Make the elf object before calling
5998 claim_file handler.
5999 * testsuite/plugin_test.c (get_section_count): New function pointer.
6000 (get_section_type): New function pointer.
6001 (get_section_name): New function pointer.
6002 (get_section_contents): New function pointer.
6003 (update_section_order): New function pointer.
6004 (allow_section_ordering): New function pointer.
6005 (onload): Check if the new interfaces exist.
6006
9446efde
ILT
60072011-07-13 Ian Lance Taylor <iant@google.com>
6008
6009 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6010 relro section.
6011 * x86_64.cc (Target_x86_64::got_section): Likewise.
6012 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6013 (relro_now_test_SOURCES): New variable.
6014 (relro_now_test_DEPENDENCIES): New variable.
6015 (relro_now_test_LDFLAGS): New variable.
6016 (relro_now_test_LDADD): New variable.
6017 (relro_now_test.so): New target.
6018 * testsuite/Makefile.in: Rebuild.
6019
07aa62f2
ILT
60202011-07-12 Ian Lance Taylor <iant@google.com>
6021
6022 PR gold/12980
6023 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6024 GLOB_DAT relocation rather than a RELATIVE relocation for a
6025 protected symbol when creating a shared library.
6026 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6027 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6028 * testsuite/protected_main_1.cc (main): Test that protected
6029 function has same address.
6030
e2153196
ILT
60312011-07-11 Ian Lance Taylor <iant@google.com>
6032
6033 PR gold/12979
6034 * options.h (class General_options): Add -Bgroup.
6035 * options.cc (General_options::finalize): If -Bgroup is set,
6036 default to --unresolved-symbols=report-all.
6037 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6038 * target-reloc.h (issue_undefined_symbol_error): Handle
6039 --unresolved-symbols=report-all.
6040
6daf5215
ILT
60412011-07-08 Ian Lance Taylor <iant@google.com>
6042
6043 PR gold/11985
6044 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6045 if linker script discards key sections.
6046 (Layout::create_dynamic_symtab): Likewise.
6047 (Layout::assign_local_dynsym_offsets): Likewise.
6048 (Layout::sized_create_version_sections): Likewise.
6049 (Layout::create_interp): Likewise.
6050 (Layout::finish_dynamic_section): Likewise.
6051 (Layout::set_dynamic_symbol_size): Likewise.
6052
beabb2c6
ILT
60532011-07-08 Ian Lance Taylor <iant@google.com>
6054
6055 PR gold/12386
6056 * options.h (class General_options): Add --unresolved-symbols.
6057 * target-reloc.h (issue_undefined_symbol_error): Check
6058 --unresolved-symbols. Add comments.
6059
9c16daf1
ILT
60602011-07-08 Ian Lance Taylor <iant@google.com>
6061
6062 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6063 expression more complex.
6064
191f1a2d
ILT
60652011-07-08 Ian Lance Taylor <iant@google.com>
6066
6067 PR gold/11317
6068 * target-reloc.h (issue_undefined_symbol_error): New inline
6069 function, broken out of relocate_section.
6070 (relocate_section): Call issue_undefined_symbol_error.
6071 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6072 there is no TLS segment if we are about to issue an undefined
6073 symbol error.
6074 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6075
62855347
ILT
60762011-07-08 Ian Lance Taylor <iant@google.com>
6077
6078 PR gold/12279
6079 * resolve.cc (Symbol_table::should_override): Add fromtype
6080 parameter. Change all callers. Give error when linking together
6081 TLS and non-TLS symbol.
6082 (Symbol_table::should_override_with_special): Add fromtype
6083 parameter. Change all callers.
6084 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6085 there is no TLS segment if we have reported some errors.
6086 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6087
67181c72
ILT
60882011-07-08 Ian Lance Taylor <iant@google.com>
6089
6090 PR gold/12372
6091 * target.h (Target::plt_address_for_global): New function.
6092 (Target::plt_address_for_local): New function.
6093 (Target::plt_section_for_global): Remove.
6094 (Target::plt_section_for_local): Remove.
6095 (Target::do_plt_address_for_global): New virtual function.
6096 (Target::do_plt_address_for_local): New virtual function.
6097 (Target::do_plt_section_for_global): Remove.
6098 (Target::do_plt_section_for_local): Remove.
6099 (Target::register_global_plt_entry): Add Symbol_table and Layout
6100 parameters.
6101 * output.cc (Output_data_got::Got_entry::write): Use
6102 plt_address_for_global and plt_address_for_local.
6103 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6104 address of output section.
6105 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6106 got_irelative_, and irelative_count_ fields. Update
6107 declarations.
6108 (Output_data_plt_i386::has_irelative_section): New function.
6109 (Output_data_plt_i386::entry_count): Add irelative_count_.
6110 (Output_data_plt_i386::set_final_data_size): Likewise.
6111 (class Target_i386): Add got_irelative_ and rel_irelative_
6112 fields. Update declarations.
6113 (Target_i386::Target_i386): Initialize new fields.
6114 (Target_i386::do_plt_address_for_global): New function replacing
6115 do_plt_section_for_global.
6116 (Target_i386::do_plt_address_for_local): New function replacing
6117 do_plt_section_for_local.
6118 (Target_i386::got_section): Create got_irelative_.
6119 (Target_i386::rel_irelative_section): New function.
6120 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6121 fields. Don't define __rel_iplt_{start,end}.
6122 (Output_data_plt_i386::add_entry): Add symtab and layout
6123 parameters. Change all callers. Use different PLT and GOT for
6124 IFUNC symbols.
6125 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6126 layout parameters. Change all callers. Use different PLT and
6127 GOT.
6128 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6129 (Output_data_plt_i386::rel_irelative): New function.
6130 (Output_data_plt_i386::address_for_global): New function.
6131 (Output_data_plt_i386::address_for_local): New function.
6132 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6133 IRELATIVE GOT when changing IFUNC GOT entries.
6134 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6135 reloc.
6136 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6137 if we didn't create an IRELATIVE GOT.
6138 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6139 plt_address_for_local.
6140 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6141 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6142 got_irelative_, and irelative_count_ fields. Update
6143 declarations.
6144 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6145 Initialize new fields. Remove symtab parameter. Change all
6146 callers.
6147 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6148 irelative_count_.
6149 (Output_data_plt_x86_64::has_irelative_section): New function.
6150 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6151 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6152 fields. Update declarations.
6153 (Target_x86_64::Target_x86_64): Initialize new fields.
6154 (Target_x86_64::do_plt_address_for_global): New function replacing
6155 do_plt_section_for_global.
6156 (Target_x86_64::do_plt_address_for_local): New function replacing
6157 do_plt_section_for_local.
6158 (Target_x86_64::got_section): Create got_irelative_.
6159 (Target_x86_64::rela_irelative_section): New function.
6160 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6161 all callers. Don't create __rel_iplt_{start,end}.
6162 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6163 parameters. Change all callers. Use different PLT and GOT for
6164 IFUNC symbols.
6165 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6166 layout parameters. Change all callers. Use different PLT and
6167 GOT.
6168 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6169 parameters. Change all callers. Use different PLT and GOT for
6170 IFUNC symbols.
6171 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6172 (Output_data_plt_x86_64::rela_irelative): New function.
6173 (Output_data_plt_x86_64::address_for_global): New function.
6174 (Output_data_plt_x86_64::address_for_local): New function.
6175 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6176 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6177 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6178 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6179 parameters.
6180 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6181 reloc.
6182 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6183 symbols if we didn't create an IRELATIVE GOT.
6184 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6185 plt_address_for_local.
6186 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6187 * testsuite/ifuncvar1.c: New test file.
6188 * testsuite/ifuncvar2.c: New test file.
6189 * testsuite/ifuncvar3.c: New test file.
6190 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6191 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6192 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6193 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6194 * testsuite/Makefile.in: Rebuild.
6195
33c15b45
CC
61962011-07-07 Cary Coutant <ccoutant@google.com>
6197
6198 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6199 (two_file_test_1_ndebug.o): Likewise.
6200 (two_file_test_1b_ndebug.o): Likewise.
6201 (two_file_test_2_ndebug.o): Likewise.
6202 (two_file_test_main_ndebug.o): Likewise.
6203 (incremental_test_2): Link with no-debug versions.
6204
f48b5fb7
CC
62052011-07-06 Cary Coutant <ccoutant@google.com>
6206
6207 * gold/incremental.cc
6208 (Output_section_incremental_inputs::write_info_blocks): Check for
6209 hidden and internal symbols.
6210
221597a5
CC
62112011-07-06 Cary Coutant <ccoutant@google.com>
6212
6213 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6214 Check disposition for startup file.
6215 (Incremental_inputs::report_command_line): Ignore
6216 --incremental-startup-unchanged option.
6217 * options.cc (General_options::parse_incremental_startup_unchanged):
6218 New function.
6219 (General_options::General_options): Initialize new data member.
6220 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6221 (General_options): Add --incremental-startup-unchanged option.
6222 (General_options::incremental_startup_disposition): New function.
6223 (General_options::incremental_startup_disposition_): New data member.
6224
e24719f6
CC
62252011-07-06 Cary Coutant <ccoutant@google.com>
6226
6227 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6228 input file index to Script_info ctor.
6229 (Sized_incremental_binary::do_file_has_changed): Find the
6230 command-line argument for files named in scripts.
6231 * incremental.h (Script_info::Script_info): New ctor
6232 with input file index.
6233 (Script_info::input_file_index): New function.
6234 (Script_info::input_file_index_): New data member.
6235 (Incremental_binary::get_library): Add const.
6236 (Incremental_binary::get_script_info): Add const.
6237 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6238 * testsuite/Makefile.am (incremental_test_5): New test case.
6239 (incremental_test_6): New test case.
6240 * testsuite/Makefile.in: Regenerate.
6241
8f7c81e8
CC
62422011-07-06 Cary Coutant <ccoutant@google.com>
6243
6244 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6245 debug output when command lines differ.
6246
9fbd3822
CC
62472011-07-06 Cary Coutant <ccoutant@google.com>
6248
6249 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6250 --incremental-patch option.
6251 * layout.cc (Free_list::allocate): Extend allocation beyond original
6252 end if enabled.
6253 (Layout::make_output_section): Mark sections that should get
6254 patch space.
6255 * options.cc (parse_percent): New function.
6256 * options.h (parse_percent): New function.
6257 (DEFINE_percent): New macro.
6258 (General_options): Add --incremental-patch option.
6259 * output.cc (Output_section::Output_section): Initialize new data
6260 members.
6261 (Output_section::add_input_section): Print section name when out
6262 of patch space.
6263 (Output_section::add_output_section_data): Likewise.
6264 (Output_section::set_final_data_size): Add patch space when
6265 doing --incremental-full.
6266 (Output_section::do_reset_address_and_file_offset): Remove patch
6267 space.
6268 (Output_segment::set_section_list_addresses): Print debug output
6269 only if --incremental-update.
6270 * output.h (Output_section::set_is_patch_space_allowed): New function.
6271 (Output_section::is_patch_space_allowed_): New data member.
6272 (Output_section::patch_space_): New data member.
6273 * parameters.cc (Parameters::incremental_full): New function.
6274 * parameters.h (Parameters::incremental_full): New function
6275 * testsuite/Makefile.am (incremental_test_2): Add test for
6276 --incremental-patch option.
6277 * testsuite/Makefile.in: Regenerate.
6278 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6279 (t18): Remove function body.
6280
f6cccc2c
DK
62812011-07-05 Doug Kwan <dougkwan@google.com>
6282
6283 PR gold/12771
6284 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6285 Arm_Address type for relocation result.
6286 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6287 overflow check.
6288 (Arm_relocate_functions::abs32): Use unaligned access.
6289 (Arm_relocate_functions::rel32): Ditto.
6290 (Arm_relocate_functions::prel31): Ditto.
6291 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6292 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6293 static data relocations.
6294 * testsuite/Makefile.in: Regnerate.
6295 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6296
28a13fec
ILT
62972011-07-05 Ian Lance Taylor <iant@google.com>
6298
6299 PR gold/12392
6300 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6301 symbols if necessary.
6302 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6303
24d47b34
ILT
63042011-07-05 Ian Lance Taylor <iant@google.com>
6305
6306 PR gold/12952
6307 * resolve.cc (Symbol::override_base_with_special): Simply override
6308 version with special symbol version, ignoring previous version.
6309
41f9cbbe
ILT
63102011-07-05 Ian Lance Taylor <iant@google.com>
6311
6312 * object.cc (Sized_relobj_file::include_section_group): Add
6313 information to comment about signature location.
6314
886288f1
ILT
63152011-07-02 Ian Lance Taylor <iant@google.com>
6316
6317 PR gold/12957
6318 * options.h (class General_options): Add -f and -F.
6319 * options.cc (General_options::finalize): Fatal error if -f/-F
6320 are used without -shared.
6321 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6322
ae3a6d4f
ILT
63232011-07-02 Ian Lance Taylor <iant@google.com>
6324
6325 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6326
21131061
ILT
63272011-07-01 Ian Lance Taylor <iant@google.com>
6328
6329 PR gold/12525
6330 PR gold/12952
6331 * resolve.cc (Symbol::override_base_with_special): Don't override
6332 the version if the overriding symbol has a different name.
6333 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6334 all callers. If we give an error about an undefined version,
6335 define the base version if necessary.
6336 * dynobj.h (class Versions): Update declaration.
6337 * testsuite/weak_alias_test_5.cc: New file.
6338 * testsuite/weak_alias_test.script: New file.
6339 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6340 and versioned_alias have the right value, and call t2.
6341 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6342 weak_alias_test_5.so.
6343 (weak_alias_test_LDADD): Likewise.
6344 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6345 * testsuite/Makefile.in: Rebuild.
6346
611062c0
ILT
63472011-07-01 Ian Lance Taylor <iant@google.com>
6348
6349 PR gold/12525
6350 * options.h (class General_options): Support -z notext.
6351 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6352 -Wl,-z,notext.
6353 (two_file_shared_nonpic.so): Likewise.
6354 (two_file_shared_mixed.so): Likewise.
6355 (two_file_shared_mixed_1.so): Likewise.
6356 (weak_undef_lib_nonpic.so): Likewise.
6357 (alt/weak_undef_lib_nonpic.so): Likewise.
6358 (tls_test_shared_nonpic.so): Likewise.
6359 * testsuite/Makefile.in: Rebuild.
6360
328c7c2f
ILT
63612011-07-01 Ian Lance Taylor <iant@google.com>
6362
6363 PR gold/12525
6364 * configure.ac: Test whether static linking works, setting
6365 the automake conditional HAVE_STATIC.
6366 * testsuite/Makefile.am: Disable tests using -static if
6367 HAVE_STATIC is not true.
6368 * configure, testsuite/Makefile.in: Rebuild.
6369
02d7cd44
ILT
63702011-07-01 Ian Lance Taylor <iant@google.com>
6371
6372 PR gold/12525
6373 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6374 Assert if we see DW_EH_PE_indirect.
6375 * target.h (Target::ehframe_datarel_base): New function.
6376 (Target::do_ehframe_datarel_base): New target function.
6377 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6378 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6379 function.
6380
07a60597
ILT
63812011-07-01 Ian Lance Taylor <iant@google.com>
6382
6383 PR gold/12571
6384 * options.h (class General_options): Add
6385 --ld-generated-unwind-info.
6386 * ehframe.cc (Fde::write): Add address parameter. Change all
6387 callers. If associated with PLT, fill in address and size.
6388 (Cie::set_output_offset): Only add merge mapping if there is an
6389 object.
6390 (Cie::write): Add address parameter. Change all callers.
6391 (Eh_frame::add_ehframe_for_plt): New function.
6392 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6393 input_offset_ fields into union u_, with new plt field.
6394 (Fde::Fde): Adjust for new union field.
6395 (Fde::Fde) [Output_data version]: New constructor.
6396 (Fde::add_mapping): Only add merge mapping if there is an object.
6397 (class Cie): Update declarations.
6398 (class Eh_frame): Declare add_ehframe_for_plt.
6399 * layout.cc (Layout::layout_eh_frame): Break out code into
6400 make_eh_frame_section, and call it.
6401 (Layout::make_eh_frame_section): New function.
6402 (Layout::add_eh_frame_for_plt): New function.
6403 * layout.h (class Layout): Update declarations.
6404 * merge.cc (Merge_map::add_mapping): Add assertion.
6405 * i386.cc: Include "dwarf.h".
6406 (class Output_data_plt_i386): Make first_plt_entry,
6407 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6408 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6409 and plt_eh_frame_fde.
6410 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6411 boundary. Call add_eh_frame_for_plt if appropriate.
6412 * x86_64.cc: Include "dwarf.h".
6413 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6414 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6415 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6416 and plt_eh_frame_fde.
6417 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6418 appropriate.
6419
14788a3f
ILT
64202011-06-29 Ian Lance Taylor <iant@google.com>
6421
6422 PR gold/12629
6423 * object.cc (Sized_relobj_file::layout_section): Change shdr
6424 parameter to be const.
6425 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6426 out of do_layout.
6427 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6428 appropriate. Call layout_eh_frame_section.
6429 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6430 sections.
6431 * object.h (class Sized_relobj_file): Update declarations.
6432
6c21fce1
ILT
64332011-06-29 Ian Lance Taylor <iant@google.com>
6434
37e41b03 6435 PR gold/12652
6c21fce1
ILT
6436 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6437 modifier.
6438 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6439
4d5e4e62
ILT
64402011-06-29 Ian Lance Taylor <iant@google.com>
6441
6442 PR gold/12675
6443 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6444 SHT_X86_64_UNWIND.
6445 * layout.cc (Layout::layout_eh_frame): Likewise.
6446
886f533a
ILT
64472011-06-29 Ian Lance Taylor <iant@google.com>
6448
6449 PR gold/12695
6450 * layout.cc (Layout::symtab_section_shndx): New function.
6451 * layout.h (class Layout): Declare symtab_section_shndx.
6452 * output.cc (Output_section::write_header): Call it.
6453
f3ae1b28
ILT
64542011-06-29 Ian Lance Taylor <iant@google.com>
6455
6456 PR gold/12818
6457 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6458 symbols which are not used in a relocation.
6459
aecf301f
ILT
64602011-06-28 Ian Lance Taylor <iant@google.com>
6461
6462 PR gold/12898
6463 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6464 script create indistinguishable segments.
6465 (Layout::set_segment_offsets): Use stable_sort when sorting
6466 segments. Pass this to Compare_segments constructor.
6467 * layout.h (class Layout): Make segment_precedes non-static.
6468 (class Compare_segments): Change from struct to class. Add
6469 layout_ field. Add constructor.
6470 * script-sections.cc
6471 (Script_sections::attach_sections_using_phdrs_clause): Rename
6472 local orphan to is_orphan. Don't report failure to put empty
6473 section in segment. On attachment failure, report name of
6474 section, and attach to first PT_LOAD segment.
6475
03ef7571
ILT
64762011-06-28 Ian Lance Taylor <iant@google.com>
6477
6478 PR gold/12934
6479 * target-select.cc (Target_selector::Target_selector): Add
6480 emulation parameter. Change all callers.
6481 (select_target_by_bfd_name): Rename from select_target_by_name.
6482 Change all callers.
6483 (select_target_by_emulation): New function.
6484 (supported_emulation_names): New function.
6485 * target-select.h (class Target_selector): Add emulation_ field.
6486 Update declarations.
6487 (Target_selector::recognize_by_bfd_name): Rename from
6488 recognize_by_name. Change all callers.
6489 (Target_selector::supported_bfd_names): Rename from
6490 supported_names. Change all callers.
6491 (Target_selector::recognize_by_emulation): New function.
6492 (Target_selector::supported_emulations): New function.
6493 (Target_selector::emulation): New function.
6494 (Target_selector::do_recognize_by_bfd_name): Rename from
6495 do_recognize_by_name. Change all callers.
6496 (Target_selector::do_supported_bfd_names): Rename from
6497 do_supported_names. Change all callers.
6498 (Target_selector::do_recognize_by_emulation): New function.
6499 (Target_selector::do_supported_emulations): New function.
6500 (select_target_by_bfd_name): Change name in declaration.
6501 (select_target_by_emulation): Declare.
6502 (supported_emulation_names): Declare.
6503 * parameters.cc (parameters_force_valid_target): Try to find
6504 target based on emulation from -m option.
6505 * options.h (class General_options): Change doc string for -m.
6506 * options.cc (help): Print emulations.
6507 (General_options::parse_V): Likewise.
6508 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6509 Add emulation parameter. Change all callers.
6510
200b2bb9
ILT
65112011-06-28 Ian Lance Taylor <iant@google.com>
6512
6513 * target.h (class Target): Add osabi_ field.
6514 (Target::osabi): New function.
6515 (Target::set_osabi): New function.
6516 (Target::Target): Initialize osabi_.
6517 (Target::do_adjust_elf_header): Make pure virtual.
6518 (Sized_target::do_adjust_elf_header): Declare.
6519 * target.cc (Sized_target::do_adjust_elf_header): New function.
6520 (class Sized_target): Instantiate all versions.
6521 * freebsd.h (class Target_freebsd): Remove.
6522 (Target_selector_freebsd::do_recognize): Call set_osabi on
6523 Target.
6524 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6525 (Target_selector_freebsd::set_osabi): Remove.
6526 * i386.cc (class Target_i386): Inherit from Sized_target rather
6527 than Target_freebsd.
6528 * x86_64.cc (class Target_x86_64): Likewise.
6529
b3ce541e
ILT
65302011-06-28 Ian Lance Taylor <iant@google.com>
6531
6532 * target.h (Target::can_check_for_function_pointers): Rewrite.
6533 Make non-virtual.
6534 (Target::can_icf_inline_merge_sections): Likewise.
6535 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6536 (Target::Target_info): Add can_icf_inline_merge_sections field.
6537 (Target::do_can_check_for_function_pointers): New virtual
6538 function.
6539 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6540 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6541 from can_check_for_function_pointers, move in file.
6542 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6543 section_may_have_icf_unsafe_poineters, move in file.
6544 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6545 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6546 Rename from can_check_for_function_pointers, move in file.
6547 (Target_i386::can_icf_inline_merge_sections): Remove.
6548 (Target_i386::i386_info): Initialize
6549 can_icf_inline_merge_sections.
6550 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6551 Initialize can_icf_inline_merge_sections.
6552 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6553 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6554 Rename from can_check_for_function_pointers, move in file.
6555 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6556 (Target_x86_64::x86_64_info): Initialize
6557 can_icf_inline_merge_sections.
6558 * testsuite/testfile.cc (Target_test::test_target_info):
6559 Likewise.
6560 * icf.cc (get_section_contents): Correct formatting.
6561
6d1c4efb
ILT
65622011-06-27 Ian Lance Taylor <iant@google.com>
6563
6564 * symtab.cc (Symbol::versioned_name): New function.
6565 (Symbol_table::add_to_final_symtab): Use versioned_name when
6566 appropriate.
6567 (Symbol_table::sized_write_symbol): Likewise.
6568 * symtab.h (class Symbol): Declare versioned_name.
6569 * stringpool.h (class Stringpool_template): Add variant of add
6570 which takes a std::basic_string.
6571 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6572 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6573 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6574 (ver_test_12.o): New target.
6575 * testsuite/Makefile.in: Rebuild.
6576
57eb9b50
DK
65772011-06-27 Doug Kwan <dougkwan@google.com>
6578
6579 * arm.cc (Arm_relocate_functions::thm_jump8,
6580 Arm_relocate_functions::thm_jump11): Use a wider signed
6581 type to compute offset.
6582 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6583 arm_thm_jump8.
6584 * testsuite/Makefile.in: Regenerate.
6585 * testsuite/arm_branch_in_range.sh: Check test results of
6586 arm_thm_jump11 and arm_thm_jump8.
6587 * testsuite/arm_thm_jump11.s: New test source file.
6588 * testsuite/arm_thm_jump11.t: New linker script.
6589 * testsuite/arm_thm_jump8.s: New test source file.
6590 * testsuite/arm_thm_jump8.t: New linker script.
6591
487b39df
ILT
65922011-06-24 Ian Lance Taylor <iant@google.com>
6593
6594 * layout.cc: Include "object.h".
6595 (ctors_sections_in_init_array): New static variable.
6596 (Layout::is_ctors_in_init_array): New function.
6597 (Layout::layout): Add entry to ctors_sections_in_init_array if
6598 appropriate.
6599 * layout.h (class Layout): Declare is_ctors_in_init_array.
6600 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6601 is_ctors_reverse_view is set.
6602 (Sized_relobj_file::write_sections): Add layout parameter. Change
6603 all callers. Set is_ctors_reverse_view field of View_size.
6604 (Sized_relobj_file::reverse_words): New function.
6605 * object.h (Sized_relobj_file::View_size): Add
6606 is_ctors_reverse_view field.
6607 (class Sized_relobj_file): Update declarations.
6608 * testsuite/initpri3.c: New test.
6609 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6610 initpri3b.
6611 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6612 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6613 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6614 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6615 * testsuite/Makefile.in: Rebuild.
6616
472076e4
CC
66172011-06-24 Cary Coutant <ccoutant@google.com>
6618
6619 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6620 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6621 (debug_msg_cdebug.err): New targets.
6622 * testsuite/Makefile.in: Regenerate.
6623 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6624 Fix checks for link with shared library.
6625
a60af0db
DK
66262011-06-24 Doug Kwan <dougkwan@google.com>
6627
6628 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6629 skip empty text sections.
6630 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6631
5393d741
ILT
66322011-06-22 Ian Lance Taylor <iant@google.com>
6633
6634 PR gold/12910
6635 * options.h (class General_options): Add --ctors-in-init-array.
6636 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6637 friends as SHT_PROGBITS for merging sections.
6638 (Layout::layout): Remove special handling of .init_array and
6639 friends. Don't sort if doing relocatable link. Sort for .ctors
6640 and .dtors if ctors_in_init_array.
6641 (Layout::make_output_section): Force correct section types for
6642 .init_array and friends. Don't sort if doing relocatable link,
6643 Don't sort .ctors and .dtors if ctors_in_init_array.
6644 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6645 (Layout::output_section_name): Add relobj parameter. Change all
6646 callers. Handle .ctors. and .dtors. in code rather than table.
6647 Handle .ctors and .dtors if ctors_in_init_array.
6648 (Layout::match_file_name): New function, moved from output.cc.
6649 * layout.h (class Layout): Update declarations.
6650 * output.cc: Include "layout.h".
6651 (Input_section_sort_entry::get_priority): New function.
6652 (Input_section_sort_entry::match_file_name): Just call
6653 Layout::match_file_name.
6654 (Output_section::Input_section_sort_init_fini_compare::operator()):
6655 Handle .ctors and .dtors. Sort by explicit priority rather than
6656 by name.
6657 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6658 * testsuite/initpri2.c: New test.
6659 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6660 (check_PROGRAMS): Add initpri2.
6661 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6662 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6663 * configure, testsuite/Makefile.in: Rebuild.
6664
e1f74f98
ILT
66652011-06-19 Ian Lance Taylor <iant@google.com>
6666
6667 PR gold/12880
6668 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6669 .interp section to a PT_INTERP segment even if we have seen a
6670 --dynamic-linker option. Don't do it if we have seen a PHDRS
6671 clause in a linker script.
6672 (Layout::finalize): Don't create a .interp section if we've
6673 already create a PT_INTERP segment.
6674 (Layout::create_interp): Always call choose_output_section (revert
6675 patch of 2011-06-17). Don't create PT_INTERP segment.
6676 * script-sections.cc
6677 (Script_sections::create_note_and_tls_segments): Add a .interp
6678 section to a PT_INTERP segment even if we have seen a
6679 --dynamic-linker option.
6680
766f91bb
ILT
66812011-06-18 Ian Lance Taylor <iant@google.com>
6682
6683 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6684 merely because a non-PT_LOAD segment has a dynamic reloc.
6685
0d212c3a
ILT
66862011-06-18 Ian Lance Taylor <iant@google.com>
6687
6688 * layout.cc (Layout::finish_dynamic_section): Don't create
6689 DT_FLAGS entry if not needed.
6690
911a5072
ILT
66912011-06-18 Ian Lance Taylor <iant@google.com>
6692
6693 PR gold/12745
6694 * layout.cc (Layout::layout_eh_frame): Correct handling of
6695 writable .eh_frame section.
6696
534b4e5f
ILT
66972011-06-17 Ian Lance Taylor <iant@google.com>
6698
6699 PR gold/12893
6700 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6701 symbol is redefined with the exact same object and value.
6702
10b4f102
ILT
67032011-06-17 Ian Lance Taylor <iant@google.com>
6704
6705 PR gold/12880
6706 * layout.h (class Layout): Add interp_segment_ field.
6707 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6708 (Layout::attach_allocated_section_to_segment): If making shared
6709 library, put .interp section in PT_INTERP segment.
6710 (Layout::finalize): Also call create_interp if -dynamic-linker
6711 option was used.
6712 (Layout::create_interp): Assert that there is no PT_INTERP
6713 segment. If not using a SECTIONS clause, use make_output_section.
6714 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6715 * script-sections.cc
6716 (Script_sections::create_note_and_tls_segments): If making shared
6717 library, put .interp section in PT_INTERP segment.
6718
a29b0dad
ILT
67192011-06-17 Ian Lance Taylor <iant@google.com>
6720
e588ea8d
ILT
6721 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6722 when making a shared library.
6723
67242011-06-17 Ian Lance Taylor <iant@google.com>
6725
6726 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6727 parameter. Change all callers. Don't issue warning about PC32
6728 against locally defined symbol.
a29b0dad 6729
9d3b0698
ILT
67302011-06-16 Ian Lance Taylor <iant@google.com>
6731
6732 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6733 occurs in same object.
6734
85b0f90c
AM
67352011-06-14 Alan Modra <amodra@gmail.com>
6736
6737 * po/POTFILES.in: Regenerate.
6738
a94907d9
ILT
67392011-06-09 Ian Lance Taylor <iant@google.com>
6740
6741 * script-sections.cc
6742 (Orphan_output_section::set_section_addresses): For a relocatable
6743 link set address to 0.
6744
4fb3a1c3
CC
67452011-06-09 Cary Coutant <ccoutant@google.com>
6746
6747 PR gold/12804
6748 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6749 used with --compress-debug-sections.
6750 * gold/object.cc (Sized_relobj_file::do_layout): Report
6751 uncompressed size of compressed input sections.
6752
61220854
CC
67532011-06-08 Cary Coutant <ccoutant@google.com>
6754
6755 PR gold/12804
6756 * testsuite/two_file_test_2_v1.cc: Change initialization of
6757 v2 to keep it in .data.
6758
e6455dfb
CC
67592011-06-07 Cary Coutant <ccoutant@google.com>
6760
6761 * common.cc (Symbol_table::do_allocate_commons_list): Call
6762 gold_fallback.
6763 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6764 (Errors::fallback): New function.
6765 (gold_fallback): New function.
6766 * errors.h (Errors::fallback): New function.
6767 * gold.cc (gold_exit): Change status parameter to enum; adjust
6768 all callers.
6769 (queue_initial_tasks): Call gold_fallback.
6770 * gold.h: Include cstdlib.
6771 (Exit_status): New enum type.
6772 (gold_exit): Change status parameter to enum.
6773 (gold_fallback): New function.
6774 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6775 (Layout::create_symtab_sections): Likewise.
6776 (Layout::create_shdrs): Likewise.
6777 * main.cc (main): Adjust call to gold_exit.
6778 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6779 (Output_data_got::add_got_entry_pair): Likewise.
6780 (Output_section::add_input_section): Likewise.
6781 (Output_section::add_output_section_data): Likewise.
6782 (Output_segment::set_section_list_addresses): Likewise.
6783 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6784
fb0e076f
CC
67852011-06-07 Cary Coutant <ccoutant@google.com>
6786
6787 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6788 for incremental links.
6789 * output.cc (Output_segment::set_section_list_addresses): Remove
6790 FIXME and test for TLS or BSS.
6791
a5ee4d5d
CC
67922011-06-07 Cary Coutant <ccoutant@google.com>
6793
6794 * testsuite/Makefile.am: Add incremental_copy_test,
6795 incremental_common_test_1.
6796 * testsuite/Makefile.in: Regenerate.
6797 * testsuite/common_test_1_v1.c: New source file.
6798 * testsuite/common_test_1_v2.c: New source file.
6799 * testsuite/copy_test_v1.cc: New source file.
6800
5146f448
CC
68012011-06-07 Cary Coutant <ccoutant@google.com>
6802
6803 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6804 update, allocate common from bss section's free list.
6805 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6806 linker-defined symbols.
6807 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6808 Skip GOT and PLT entries that are no longer referenced.
6809 (Output_section_incremental_inputs::write_info_blocks): Mark
6810 linker-defined symbols.
6811 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6812 * output.cc (Output_section::allocate): New function.
6813 * output.h (Output_section::allocate): New function.
6814 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6815 linker-defined symbols.
6816 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6817 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6818 (Symbol::init_base_output_data): Likewise.
6819 (Symbol::init_base_output_segment): Likewise.
6820 (Symbol::init_base_constant): Likewise.
6821 (Sized_symbol::init_output_data): Likewise.
6822 (Sized_symbol::init_output_segment): Likewise.
6823 (Sized_symbol::init_constant): Likewise.
6824 (Symbol_table::do_define_in_output_data): Likewise.
6825 (Symbol_table::do_define_in_output_segment): Likewise.
6826 (Symbol_table::do_define_as_constant): Likewise.
6827 * symtab.h (Symbol::is_predefined): New function.
6828 (Symbol::init_base_output_data): Add is_predefined parameter.
6829 (Symbol::init_base_output_segment): Likewise.
6830 (Symbol::init_base_constant): Likewise.
6831 (Symbol::is_predefined_): New data member.
6832 (Sized_symbol::init_output_data): Add is_predefined parameter.
6833 (Sized_symbol::init_output_segment): Likewise.
6834 (Sized_symbol::init_constant): Likewise.
6835 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6836
26d3c67d
CC
68372011-06-07 Cary Coutant <ccoutant@google.com>
6838
6839 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6840 instead of emit_copy_reloc.
6841 (Copy_relocs::emit_copy_reloc): Refactor.
6842 (Copy_relocs::make_copy_reloc): New function.
6843 (Copy_relocs::add_copy_reloc): Remove.
6844 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6845 section.
6846 (Copy_relocs::make_copy_reloc): New function.
6847 (Copy_relocs::add_copy_reloc): Remove.
6848 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6849 unchanged input files.
6850 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6851 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6852 Reserve BSS space for COPY relocations.
6853 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6854 (Output_section_incremental_inputs::write_info_blocks): Record
6855 whether a symbol is copied from a shared object.
6856 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6857 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6858 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6859 (Incremental_input_entry_reader::get_output_symbol_index): Add
6860 is_copy parameter.
6861 (Incremental_binary::emit_copy_relocs): New function.
6862 (Incremental_binary::do_emit_copy_relocs): New function.
6863 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6864 new data member.
6865 (Sized_incremental_binary::add_copy_reloc): New function.
6866 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6867 (Sized_incremental_binary::Copy_reloc): New struct.
6868 (Sized_incremental_binary::Copy_relocs): New typedef.
6869 (Sized_incremental_binary::copy_relocs_): New data member.
6870 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6871 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6872 * target.h (Sized_target::emit_copy_reloc): New function.
6873 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6874
7cdb37d9
CC
68752011-06-02 Cary Coutant <ccoutant@google.com>
6876
6877 PR gold/12163
6878 * gold/archive.cc (Archive::Archive): Initialize new data member.
6879 (Archive::include_all_members): Return if archive has already been
6880 included.
6881 * gold/archive.h (Archive::include_all_members_): New data member.
6882
cc643b88
NC
68832011-06-02 Nick Clifton <nickc@redhat.com>
6884
6885 * dynobj.h: Fix spelling mistake in comment.
6886 * output.cc: Likewise.
6887
f62a3ca7 68882011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6889 Asier Llano
f62a3ca7
DK
6890
6891 PR gold/12826
cc643b88 6892 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6893 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6894 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6895 redundant arm_exidx_test.so.
6896 * testsuite/Makefile.in: Regenerate.
6897 (check_SCRIPTS): Add pr12826.sh
6898 (check_DATA): Add pr12826.stdout
6899 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6900 * testsuite/pr12826.sh: New file.
6901 * testsuite/pr12826_1.s: Ditto.
6902 * testsuite/pr12826_1.s: Ditto.
6903
8dbe1edc
ILT
69042011-05-30 Ian Lance Taylor <iant@google.com>
6905
6906 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6907 sections.
6908
c49875be
ILT
69092011-05-29 Ian Lance Taylor <iant@google.com>
6910
6911 PR gold/12804
6912 * testsuite/Makefile.am: Use different file name for two_file_test
6913 temporary file for each incremental test.
6914 * testsuite/Makefile.in: Rebuild.
6915
69d53f7a
ILT
69162011-05-29 Ian Lance Taylor <iant@google.com>
6917
6918 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6919 binary input file is empty.
6920
41d0ab5f
ILT
69212011-05-27 Ian Lance Taylor <iant@google.com>
6922
6923 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6924 (ver_test_9.so): Likewise.
6925 * testsuite/Makefile.in: Rebuild.
6926
89d8a36b
CC
69272011-05-26 Cary Coutant <ccoutant@google.com>
6928
6929 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6930 * incremental.cc (Incremental_inputs::report_input_section): Fix
6931 comment, indentation.
6932 (Incremental_inputs::report_comdat_group): New function.
6933 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6934 of data for incremental input file entry.
6935 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6936 group count, COMDAT group signatures.
6937 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6938 an unchanged input file.
6939 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6940 Initialize new data member.
6941 (Incremental_object_entry::add_comdat_group): New function.
6942 (Incremental_object_entry::get_comdat_group_count): New function.
6943 (Incremental_object_entry::get_comdat_signature_key): New function.
6944 (Incremental_object_entry::groups_): New data member.
6945 (Incremental_inputs::report_comdat_group): New function.
6946 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6947 data for incremental input file entry.
6948 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6949 (Incremental_input_entry_reader::get_input_section): Adjust size of
6950 data for incremental input file entry.
6951 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6952 (Incremental_input_entry_reader::get_comdat_group_signature): New
6953 function.
6954 * object.cc (Sized_relobj::include_section_group): Report kept
6955 COMDAT groups for incremental links.
6956
1706a06f
ILT
69572011-05-24 David Meyer <pdox@google.com>
6958
6959 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6960 with name parameter. Add found_name parameter.
6961 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6962 * dirsearch.h (class Dirsearch): Update declaration.
6963
a10ae760
ILT
69642011-05-24 Ian Lance Taylor <iant@google.com>
6965
6966 * archive.cc (Library_base::should_include_member): Pull in object
6967 from archive if it defines the entry symbol.
6968 * parameters.cc (Parameters::entry): New function.
6969 * parameters.h (class Parameters): Declare entry.
6970 * output.h (class Output_file_header): Remove entry_ field.
6971 * output.cc (Output_file_header::Output_file_header): Remove entry
6972 parameter. Change all callers.
6973 (Output_file_header::entry): Use parameters->entry.
6974 * gold.cc (queue_middle_tasks): Likewise.
6975 * plugin.cc (Plugin_hook::run): Likewise.
6976
aa92d6ed
CC
69772011-05-24 Cary Coutant <ccoutant@google.com>
6978
6979 * gold.cc (queue_initial_tasks): Pass incremental base filename
6980 to Output_file::open_base_file; don't print error message.
6981 * incremental-dump.cc (main): Adjust call to
6982 Output_file::open_for_modification.
6983 * incremental-dump.cc (main): Likewise.
6984 * incremental.cc (Incremental_inputs::report_command_line):
6985 Ignore --incremental-base option when comparing command lines.
6986 Ignore parameter when given as separate argument.
6987 * options.h (class General_options): Add --incremental-base.
6988 * output.cc (Output_file::Output_file):
6989 (Output_file::open_base_file): Add base_name and writable parameters;
6990 read base file into new file; print error message here.
6991 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6992 callers.
6993 * output.h (Output_file::open_for_modification): Rename to...
6994 (Output_file::open_base_file): ...this; add base_name and
6995 writable parameters; adjust all callers.
6996 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6997 callers.
6998 * testsuite/Makefile.am (incremental_test_4): Test
6999 --incremental-base.
7000 * testsuite/Makefile.in: Regenerate.
7001
2eedd706
CC
70022011-05-24 Cary Coutant <ccoutant@google.com>
7003
7004 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7005 incremental_test_4.
7006 * testsuite/Makefile.in: Regenerate.
7007 * testsuite/two_file_test_1_v1.cc: New test source file.
7008 * testsuite/two_file_test_1b_v1.cc: New test source file.
7009 * testsuite/two_file_test_2_v1.cc: New test source file.
7010
0f1c85a6
CC
70112011-05-24 Cary Coutant <ccoutant@google.com>
7012
7013 * dynobj.h (Dynobj::do_dynobj): New function.
7014 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7015 flag and soname for shared objects.
7016 * incremental.cc (Incremental_inputs::report_object): Make
7017 either Incremental_object_entry or Incremental_dynobj_entry; add
7018 soname to string table.
7019 (Incremental_inputs::report_input_section): Add assertion.
7020 (Output_section_incremental_inputs::set_final_data_size): Adjust
7021 type of input file entry for shared libraries; adjust size of
7022 shared library info entry.
7023 (Output_section_incremental_inputs::write_input_files): Write
7024 as_needed flag for shared libraries.
7025 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7026 of input file entry for shared libraries; write soname.
7027 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7028 soname from incremental info.
7029 * incremental.h (enum Incremental_input_flags): Add
7030 INCREMENTAL_INPUT_AS_NEEDED.
7031 (Incremental_input_entry::Incremental_input_entry): Initialize new
7032 data member.
7033 (Incremental_input_entry::set_as_needed): New function.
7034 (Incremental_input_entry::as_needed): New function.
7035 (Incremental_input_entry::do_dynobj_entry): New function.
7036 (Incremental_input_entry::as_needed_): New data member.
7037 (Incremental_object_entry::Incremental_object_entry): Don't check
7038 for shared library.
7039 (Incremental_object_entry::do_type): Likewise.
7040 (class Incremental_dynobj_entry): New class.
7041 (Incremental_input_entry_reader::as_needed): New function.
7042 (Incremental_input_entry_reader::get_soname): New function.
7043 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7044 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7045 size of shared library info entry.
58797674 7046 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7047 incremental link when adding DT_NEEDED entries.
7048 * object.h (Object::Object): Initialize new data member.
7049 (Object::dynobj): New function.
7050 (Object::set_as_needed): New function.
7051 (Object::as_needed): New function.
7052 (Object::do_dynobj): New function.
7053 (Object::as_needed_): New data member.
7054
6fa2a40b
CC
70552011-05-24 Cary Coutant <ccoutant@google.com>
7056
7057 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7058 info; adjust display of GOT entries.
7059 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7060 vector of input objects; remove file_status_.
7061 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7062 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7063 got_plt reader; call target hooks to reserve GOT entries.
7064 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7065 of input file info header and GOT info entry.
7066 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7067 relocation info.
7068 (Got_plt_view_info::got_descriptor): Remove.
7069 (Got_plt_view_info::sym_index): New data member.
7070 (Got_plt_view_info::input_index): New data member.
7071 (Local_got_offset_visitor::visit): Write input file index.
7072 (Global_got_offset_visitor::visit): Write 0 for input file index.
7073 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7074 with sym_index and input_index.
7075 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7076 incremental info GOT entry; replace got_descriptor with input_index.
7077 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7078 map from input file index to object.
7079 (Sized_relobj_incr::do_layout): Replace direct data member reference
7080 with accessor function.
7081 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7082 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7083 Adjust size of input file info header.
7084 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7085 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7086 (Incremental_input_entry_reader::get_input_section): Adjust size of
7087 input file info header.
7088 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7089 of incremental info GOT entry.
7090 (Incremental_got_plt_reader::get_got_desc): Remove.
7091 (Incremental_got_plt_reader::get_got_symndx): New function.
7092 (Incremental_got_plt_reader::get_got_input_index): New function.
7093 (Sized_incremental_binary::Sized_incremental_binary): Remove
7094 file_status_; add input_objects_.
7095 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7096 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7097 (Sized_incremental_binary::file_is_unchanged): Remove.
7098 (Sized_incremental_binary::set_input_object): New function.
7099 (Sized_incremental_binary::input_object): New function.
7100 (Sized_incremental_binary::file_status_): Remove.
7101 (Sized_incremental_binary::input_objects_): New data member.
7102 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7103 references.
7104 (Sized_relobj_incr::invalid_address): Move to base class.
7105 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7106 class.
7107 (Sized_relobj_incr::do_output_section_offset): Likewise.
7108 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7109 (Sized_relobj_incr::section_offsets_): Likewise.
7110 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7111 function.
7112 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7113 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7114 with accessor function.
7115 (Sized_relobj_file::do_layout): Likewise.
7116 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7117 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7118 (Sized_relobj_file::compute_final_local_value): Replace refs to
7119 section_offsets_ with accessor function.
7120 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7121 * object.h (Relobj::Relobj): Initialize new data members.
7122 (Relobj::add_dyn_reloc): New function.
7123 (Relobj::first_dyn_reloc): New function.
7124 (Relobj::dyn_reloc_count): New function.
7125 (Relobj::first_dyn_reloc_): New data member.
7126 (Relobj::dyn_reloc_count_): New data member.
7127 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7128 references.
7129 (Sized_relobj::Address): New typedef.
7130 (Sized_relobj::invalid_address): Move here from child class.
7131 (Sized_relobj::Sized_relobj): Initialize new data members.
7132 (Sized_relobj::sized_relobj): New function.
7133 (Sized_relobj::is_output_section_offset_invalid): Move here from
7134 child class.
7135 (Sized_relobj::get_output_section_offset): Likewise.
7136 (Sized_relobj::local_has_got_offset): Likewise.
7137 (Sized_relobj::local_got_offset): Likewise.
7138 (Sized_relobj::set_local_got_offset): Likewise.
7139 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7140 (Sized_relobj::clear_got_offsets): New function.
7141 (Sized_relobj::section_offsets): Move here from child class.
7142 (Sized_relobj::do_output_section_offset): Likewise.
7143 (Sized_relobj::do_set_section_offset): Likewise.
7144 (Sized_relobj::Local_got_offsets): Likewise.
7145 (Sized_relobj::local_got_offsets_): Likewise.
7146 (Sized_relobj::section_offsets_): Likewise.
7147 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7148 references.
7149 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7150 class.
7151 (Sized_relobj_file::sized_relobj): New function
7152 (Sized_relobj_file::local_has_got_offset): Move to base class.
7153 (Sized_relobj_file::local_got_offset): Likewise.
7154 (Sized_relobj_file::set_local_got_offset): Likewise.
7155 (Sized_relobj_file::get_output_section_offset): Likewise.
7156 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7157 (Sized_relobj_file::do_output_section_offset): Likewise.
7158 (Sized_relobj_file::do_set_section_offset): Likewise.
7159 (Sized_relobj_file::Local_got_offsets): Likewise.
7160 (Sized_relobj_file::local_got_offsets_): Likewise.
7161 (Sized_relobj_file::section_offsets_): Likewise.
7162 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7163 (all constructors).
7164 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7165 (Output_reloc::get_symbol_index): Likewise.
7166 (Output_reloc::local_section_offset): Likewise.
7167 (Output_reloc::get_address): Likewise.
7168 (Output_reloc::symbol_value): Likewise.
7169 (Output_data_got::reserve_slot): Move to class definition.
7170 (Output_data_got::reserve_local): New function.
7171 (Output_data_got::reserve_slot_for_global): Remove.
7172 (Output_data_got::reserve_global): New function.
7173 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7174 (all constructors, two instantiations).
7175 (Output_reloc::get_relobj): New function (two instantiations).
7176 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7177 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7178 (Output_data_reloc::add_global): Adjust type of relobj.
7179 (Output_data_reloc::add_global_relative): Likewise.
7180 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7181 (Output_data_reloc::add_local): Likewise.
7182 (Output_data_reloc::add_local_relative): Likewise.
7183 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7184 (Output_data_reloc::add_local_section): Likewise.
7185 (Output_data_reloc::add_output_section): Likewise.
7186 (Output_data_reloc::add_absolute): Likewise.
7187 (Output_data_reloc::add_target_specific): Likewise.
7188 (Output_data_got::reserve_slot): Move definition here.
7189 (Output_data_got::reserve_local): New function.
7190 (Output_data_got::reserve_global): New function.
7191 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7192 section_offsets_ with accessor function.
7193 (Sized_relobj_file::write_sections): Likewise.
7194 (Sized_relobj_file::do_relocate_sections): Likewise.
7195 * target.h (Sized_target::reserve_local_got_entry): New function.
7196 (Sized_target::reserve_global_got_entry): New function.
7197 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7198 (Target_x86_64::reserve_global_got_entry): New function.
7199 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7200
4829d394
CC
72012011-05-23 Cary Coutant <ccoutant@google.com>
7202
7203 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7204 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7205 bit when checking got_type.
7206 * incremental.cc (Sized_incremental_binary::setup_readers):
7207 Store symbol table and string table locations; initialize bit vector
7208 of file status flags.
7209 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7210 unchanged files.
7211 (Sized_incremental_binary::do_process_got_plt): New function.
7212 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7213 (Output_section_incremental_inputs::set_final_data_size): Record
7214 file index for each input file.
7215 (Output_section_incremental_inputs::write_got_plt): Store file index
7216 instead of input entry offset for each GOT entry.
7217 * incremental.h
7218 (Incremental_input_entry::Incremental_input_entry): Initialize new
7219 data member.
7220 (Incremental_input_entry::set_offset): Store file index.
7221 (Incremental_input_entry::get_file_index): New function.
7222 (Incremental_input_entry::file_index_): New data member.
7223 (Incremental_binary::process_got_plt): New function.
7224 (Incremental_binary::do_process_got_plt): New function.
7225 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7226 data members.
7227 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7228 (Sized_incremental_binary::set_file_is_unchanged): New function.
7229 (Sized_incremental_binary::file_is_unchanged): New function.
7230 (Sized_incremental_binary::do_process_got_plt): New function.
7231 (Sized_incremental_binary::file_status_): New data member.
7232 (Sized_incremental_binary::main_symtab_loc_): New data member.
7233 (Sized_incremental_binary::main_strtab_loc_): New data member.
7234 * output.cc (Output_data_got::Got_entry::write): Add case
7235 RESERVED_CODE.
7236 (Output_data_got::add_global): Call add_got_entry.
7237 (Output_data_got::add_global_plt): Likewise.
7238 (Output_data_got::add_global_with_rel): Likewise.
7239 (Output_data_got::add_global_with_rela): Likewise.
7240 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7241 (Output_data_got::add_global_pair_with_rela): Likewise.
7242 (Output_data_got::add_local): Call add_got_entry.
7243 (Output_data_got::add_local_plt): Likewise.
7244 (Output_data_got::add_local_with_rel): Likewise.
7245 (Output_data_got::add_local_with_rela): Likewise.
7246 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7247 (Output_data_got::add_local_pair_with_rela): Likewise.
7248 (Output_data_got::reserve_slot): New function.
7249 (Output_data_got::reserve_slot_for_global): New function.
7250 (Output_data_got::add_got_entry): New function.
7251 (Output_data_got::add_got_entry_pair): New function.
7252 (Output_section::add_output_section_data): Edit FIXME.
7253 * output.h
7254 (Output_section_data_build::Output_section_data_build): New
7255 constructor with size parameter.
7256 (Output_data_space::Output_data_space): Likewise.
7257 (Output_data_got::Output_data_got): Initialize new data member; new
7258 constructor with size parameter.
7259 (Output_data_got::add_constant): Call add_got_entry.
7260 (Output_data_got::reserve_slot): New function.
7261 (Output_data_got::reserve_slot_for_global): New function.
7262 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7263 (Output_data_got::add_got_entry): New function.
7264 (Output_data_got::add_got_entry_pair): New function.
7265 (Output_data_got::free_list_): New data member.
7266 * target.h (Sized_target::init_got_plt_for_update): New function.
7267 (Sized_target::register_global_plt_entry): New function.
7268 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7269 Initialize new data member; call init; add constructor with PLT count.
7270 (Output_data_plt_x86_64::init): New function.
7271 (Output_data_plt_x86_64::add_relocation): New function.
7272 (Output_data_plt_x86_64::reserve_slot): New function.
7273 (Output_data_plt_x86_64::free_list_): New data member.
7274 (Target_x86_64::init_got_plt_for_update): New function.
7275 (Target_x86_64::register_global_plt_entry): New function.
7276 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7277 incremental updates.
7278 (Output_data_plt_x86_64::add_relocation): New function.
7279 * testsuite/object_unittest.cc (Object_test): Set default options.
7280
ec69d6da
ILT
72812011-05-16 Ian Lance Taylor <iant@google.com>
7282
7283 * options.h (class General_options): Make -i a synonym for -r.
7284
732e31de
ILT
72852011-05-16 Ian Lance Taylor <iant@google.com>
7286
7287 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7288
403676b5
CC
72892011-05-10 Cary Coutant <ccoutant@google.com>
7290
7291 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7292 strip_all (-s).
7293
5b7b7d6e
ILT
72942011-05-06 Ian Lance Taylor <iant@google.com>
7295
7296 * layout.cc (Layout::layout): If the output section flags change,
7297 update the ordering.
7298
f0f9babf
CC
72992011-04-25 Cary Coutant <ccoutant@google.com>
7300
7301 * incremental-dump.cc (dump_incremental_inputs): Print local
7302 symbol info for each input file.
7303 * incremental.cc
7304 (Output_section_incremental_inputs::set_final_data_size): Add local
7305 symbol info to input file entries in incremental info.
7306 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7307 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7308 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7309 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7310 implementation.
7311 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7312 (Sized_incr_relobj::do_relocate): Write the local symbols.
7313 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7314 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7315 Adjust size of input file header.
7316 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7317 (Incremental_inputs_reader::get_local_symbol_count): New function.
7318 (Incremental_inputs_reader::get_input_section): Adjust size of input
7319 file header.
7320 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7321 (Sized_incr_relobj::This): New typedef.
7322 (Sized_incr_relobj::sym_size): New const data member.
7323 (Sized_incr_relobj::Local_symbol): New struct.
7324 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7325 (Sized_incr_relobj::do_local_symbol_offset): New function.
7326 (Sized_incr_relobj::local_symbol_count_): New data member.
7327 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7328 (Sized_incr_relobj::local_symbol_index_): New data member.
7329 (Sized_incr_relobj::local_symbol_offset_): New data member.
7330 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7331 (Sized_incr_relobj::local_symbols_): New data member.
7332 * object.h (Relobj::output_local_symbol_count): New function.
7333 (Relobj::local_symbol_offset): New function.
7334 (Relobj::do_output_local_symbol_count): New function.
7335 (Relobj::do_local_symbol_offset): New function.
7336 (Sized_relobj::do_output_local_symbol_count): New function.
7337 (Sized_relobj::do_local_symbol_offset): New function.
7338
d0a9ace3
ILT
73392011-04-22 Vladimir Simonov <sv@sw.ru>
7340
7341 * descriptors.cc (set_close_on_exec): New function.
7342 (Descriptors::open): Use set_close_on_exec.
7343 * output.cc (S_ISLNK): Define if not defined.
7344
94a3fc8b
CC
73452011-04-22 Cary Coutant <ccoutant@google.com>
7346
7347 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7348 global symbol map.
7349 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7350 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7351 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7352 relocations.
7353 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7354 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7355 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7356 * incremental.h
7357 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7358 function.
7359 (Incremental_binary::apply_incremental_relocs): New function.
7360 (Incremental_binary::do_apply_incremental_relocs): New function.
7361 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7362 data member.
7363 (Sized_incremental_binary::add_global_symbol): New function.
7364 (Sized_incremental_binary::global_symbol): New function.
7365 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7366 (Sized_incremental_binary::symbol_map_): New data member.
7367 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7368 * target.h (Sized_target::apply_relocation): New function.
7369 * target-reloc.h (apply_relocation): New function.
7370 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7371
c87e4302
DK
73722011-04-22 Doug Kwan <dougkwan@google.com>
7373
7374 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7375 flag of a SHT_ARM_EXIDX section.
2e702c99 7376 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7377 * testsuite/Makefile.in: Regenerate.
7378 * testsuite/arm_exidx_test.s: New file.
7379 * testsuite/arm_exidx_test.sh: Same.
7380
e7782cf6
CC
73812011-04-20 Cary Coutant <ccoutant@google.com>
7382
7383 PR gold/12689
7384 * archive.h (Incremental_archive_entry::Archive_member):
7385 Initialize arg_serial_ (second constructor).
7386
308ecdc7
ILT
73872011-04-17 Ian Lance Taylor <iant@google.com>
7388
7389 * object.cc (Relocate_info::location): Simplify location string.
7390 * errors.cc (Errors::error_at_location): Don't print program
7391 name.
7392 (Errors::warning_at_location): Likewise.
7393 (Errors::undefined_symbol): Likewise.
7394 * testsuite/debug_msg.sh: Update accordingly.
7395
bec5b579
CC
73962011-04-14 Cary Coutant <ccoutant@google.com>
7397
7398 * gold/layout.cc (Layout::symtab_section_offset): New function.
7399 * gold/layout.h (Layout::symtab_section_offset): New function.
7400 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7401
88597d34
ILT
74022011-04-12 Ian Lance Taylor <iant@google.com>
7403
7404 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7405 with MREMAP_MAYMOVE.
7406 * output.h (class Output_file): Add map_is_allocated_ field.
7407 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7408 not available, provide stubs. If mremap is not available, #define
7409 it to gold_mremap.
7410 (MREMAP_MAYMOVE): Define if not defined.
7411 (Output_file::Output_file): Initialize map_is_allocated_.
7412 (Output_file::resize): Check map_is_allocated_.
7413 (Output_file::map_anonymous): If mmap fails, use malloc.
7414 (Output_file::unmap): Don't do anything for an anonymous map.
7415 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7416 is not available, provide stubs.
7417 (File_read::View::~View): Use free rather than delete[].
7418 (File_read::make_view): Use malloc rather than new[]. If mmap
7419 fails, use malloc.
7420 (File_read::find_or_make_view): Use malloc rather than new[].
7421 * gold.h: Remove HAVE_REMAP code.
7422 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7423 exists. Rename mremap to gold_mremap. If mmap is not available
7424 don't do anything.
7425 * configure, config.in: Rebuild.
7426
11e361bc
ILT
74272011-04-11 Ian Lance Taylor <iant@google.com>
7428
7429 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7430 initialize local variable v.
7431
cdc29364
CC
74322011-04-11 Cary Coutant <ccoutant@google.com>
7433
7434 * archive.cc (Archive::include_member): Adjust call to
7435 report_object.
7436 (Add_archive_symbols::run): Track argument serial numbers.
7437 (Lib_group::include_member): Likewise.
7438 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7439 * archive.h (Incremental_archive_entry::Archive_member):
7440 Initialize arg_serial_.
7441 (Archive_member::arg_serial_): New data member.
7442 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7443 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7444 incremental link.
7445 (Sized_dynobj::do_for_all_local_got_entries): New function.
7446 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7447 function.
7448 * fileread.cc (get_mtime): New function.
7449 * fileread.h (get_mtime): New function.
7450 * gold.cc (queue_initial_tasks): Check for incremental update.
7451 (process_incremental_input): New function.
7452 (queue_middle_tasks): Don't force valid target for incremental
7453 update.
7454 * incremental-dump.cc (find_input_containing_global): Adjust
7455 size of symbol info entry.
7456 (dump_incremental_inputs): Dump argument serial number and
7457 in_system_directory flag; bias shndx by 1; print symbol names
7458 when dumping per-file symbol lists; use new symbol info readers.
7459 * incremental.cc
7460 (Output_section_incremental_inputs:update_data_size): New function.
7461 (Sized_incremental_binary::setup_readers): Setup input readers
7462 for each input file; build maps for files added from libraries
7463 and scripts.
7464 (Sized_incremental_binary::check_input_args): New function.
7465 (Sized_incremental_binary::do_check_inputs): Build map of argument
7466 serial numbers to input arguments.
7467 (Sized_incremental_binary::do_file_has_changed): Rename
7468 do_file_is_unchanged to this; compare file modification times.
7469 (Sized_incremental_binary::do_init_layout): New function.
7470 (Sized_incremental_binary::do_reserve_layout): New function.
7471 (Sized_incremental_binary::do_get_input_reader): Remove.
7472 (Sized_incremental_binary::get_symtab_view): New function.
7473 (Incremental_checker::can_incrementally_link_output_file): Remove.
7474 (Incremental_inputs::report_command_line): Exclude --debug options.
7475 (Incremental_inputs::report_archive_begin): Add parameter; track
7476 argument serial numbers; don't put input file entry for archive
7477 before archive members.
7478 (Incremental_inputs::report_archive_end): Put input file entry
7479 for archive after archive members.
7480 (Incremental_inputs::report_object): Add parameter; track argument
7481 serial numbers and in_system_directory flag.
7482 (Incremental_inputs::report_script): Add parameter; track argument
7483 serial numbers.
7484 (Output_section_incremental_inputs::set_final_data_size): Adjust
7485 size of symbol info entry; check for forwarding symbols.
7486 (Output_section_incremental_inputs::write_input_files): Write
7487 in_system_directory flag and argument serial number.
7488 (Output_section_incremental_inputs::write_info_blocks): Map section
7489 indices between incremental info and original input file; store
7490 input section index for each symbol.
7491 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7492 change operator() to visit().
7493 (class Global_got_offset_visitor): Likewise.
7494 (class Global_symbol_visitor_got_plt):
7495 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7496 classes.
7497 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7498 (Sized_incr_relobj::do_read_symbols): New function.
7499 (Sized_incr_relobj::do_layout): New function.
7500 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7501 (Sized_incr_relobj::do_add_symbols): New function.
7502 (Sized_incr_relobj::do_should_include_member): New function.
7503 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7504 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7505 (Sized_incr_relobj::do_section_size): New function.
7506 (Sized_incr_relobj::do_section_name): New function.
7507 (Sized_incr_relobj::do_section_contents): New function.
7508 (Sized_incr_relobj::do_section_flags): New function.
7509 (Sized_incr_relobj::do_section_entsize): New function.
7510 (Sized_incr_relobj::do_section_address): New function.
7511 (Sized_incr_relobj::do_section_type): New function.
7512 (Sized_incr_relobj::do_section_link): New function.
7513 (Sized_incr_relobj::do_section_info): New function.
7514 (Sized_incr_relobj::do_section_addralign): New function.
7515 (Sized_incr_relobj::do_initialize_xindex): New function.
7516 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7517 (Sized_incr_relobj::do_read_relocs): New function.
7518 (Sized_incr_relobj::do_gc_process_relocs): New function.
7519 (Sized_incr_relobj::do_scan_relocs): New function.
7520 (Sized_incr_relobj::do_count_local_symbols): New function.
7521 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7522 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7523 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7524 (Sized_incr_relobj::do_relocate): New function.
7525 (Sized_incr_relobj::do_set_section_offset): New function.
7526 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7527 (Sized_incr_dynobj::do_read_symbols): New function.
7528 (Sized_incr_dynobj::do_layout): New function.
7529 (Sized_incr_dynobj::do_add_symbols): New function.
7530 (Sized_incr_dynobj::do_should_include_member): New function.
7531 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7532 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7533 (Sized_incr_dynobj::do_section_size): New function.
7534 (Sized_incr_dynobj::do_section_name): New function.
7535 (Sized_incr_dynobj::do_section_contents): New function.
7536 (Sized_incr_dynobj::do_section_flags): New function.
7537 (Sized_incr_dynobj::do_section_entsize): New function.
7538 (Sized_incr_dynobj::do_section_address): New function.
7539 (Sized_incr_dynobj::do_section_type): New function.
7540 (Sized_incr_dynobj::do_section_link): New function.
7541 (Sized_incr_dynobj::do_section_info): New function.
7542 (Sized_incr_dynobj::do_section_addralign): New function.
7543 (Sized_incr_dynobj::do_initialize_xindex): New function.
7544 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7545 (make_sized_incremental_object): New function.
7546 (Incremental_library::copy_unused_symbols): New function.
7547 (Incremental_library::do_for_all_unused_symbols): New function.
7548 * incremental.h (enum Incremental_input_flags): New type.
7549 (class Incremental_checker): Remove.
7550 (Incremental_input_entry::Incremental_input_entry): Add argument
7551 serial number.
7552 (Incremental_input_entry::arg_serial): New function.
7553 (Incremental_input_entry::set_is_in_system_directory): New function.
7554 (Incremental_input_entry::is_in_system_directory): New function.
7555 (Incremental_input_entry::arg_serial_): New data member.
7556 (Incremental_input_entry::is_in_system_directory_): New data member.
7557 (class Script_info): Move here from script.h.
7558 (Script_info::Script_info): Add filename parameter.
7559 (Script_info::filename): New function.
7560 (Script_info::filename_): New data member.
7561 (Incremental_script_entry::Incremental_script_entry): Add argument
7562 serial number.
7563 (Incremental_object_entry::Incremental_object_entry): Likewise.
7564 (Incremental_object_entry::add_input_section): Build list of input
7565 sections with map to original shndx.
7566 (Incremental_object_entry::get_input_section_index): New function.
7567 (Incremental_object_entry::shndx_): New data member.
7568 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7569 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7570 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7571 serial number.
7572 (Incremental_inputs::report_archive_begin): Likewise.
7573 (Incremental_inputs::report_object): Likewise.
7574 (Incremental_inputs::report_script): Likewise.
7575 (class Incremental_global_symbol_reader): New class.
7576 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7577 and store flags and input file type.
7578 (Incremental_input_entry_reader::arg_serial): New function.
7579 (Incremental_input_entry_reader::type): Extract type from flags.
7580 (Incremental_input_entry_reader::is_in_system_directory): New function.
7581 (Incremental_input_entry_reader::get_input_section_count): Call
7582 accessor function for type.
7583 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7584 function for type; adjust size of global symbol entry.
7585 (Incremental_input_entry_reader::get_global_symbol_count): Call
7586 accessor function for type.
7587 (Incremental_input_entry_reader::get_object_count): Likewise.
7588 (Incremental_input_entry_reader::get_object_offset): Likewise.
7589 (Incremental_input_entry_reader::get_member_count): Likewise.
7590 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7591 (Incremental_input_entry_reader::get_member_offset): Likewise.
7592 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7593 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7594 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7595 (Incremental_input_entry_reader::get_global_symbol_reader): New
7596 function.
7597 (Incremental_input_entry_reader::get_output_symbol_index): New
7598 function.
7599 (Incremental_input_entry_reader::type_): Remove.
7600 (Incremental_input_entry_reader::flags_): New data member.
7601 (Incremental_inputs_reader::input_file_offset): New function.
7602 (Incremental_inputs_reader::input_file_index): New function.
7603 (Incremental_inputs_reader::input_file): Call input_file_offset.
7604 (Incremental_inputs_reader::input_file_at_offset): New function.
7605 (Incremental_relocs_reader::get_r_type): Reformat.
7606 (Incremental_relocs_reader::get_r_shndx): Reformat.
7607 (Incremental_relocs_reader::get_r_offset): Reformat.
7608 (Incremental_relocs_reader::data): New function.
7609 (Incremental_binary::Incremental_binary): Initialize new data members.
7610 (Incremental_binary::check_inputs): Add cmdline parameter.
7611 (Incremental_binary::file_is_unchanged): Remove.
7612 (Input_reader::arg_serial): New function.
7613 (Input_reader::get_unused_symbol_count): New function.
7614 (Input_reader::get_unused_symbol): New function.
7615 (Input_reader::do_arg_serial): New function.
7616 (Input_reader::do_get_unused_symbol_count): New function.
7617 (Input_reader::do_get_unused_symbol): New function.
7618 (Incremental_binary::input_file_count): New function.
7619 (Incremental_binary::get_input_reader): Change signature to use
7620 index instead of filename.
7621 (Incremental_binary::file_has_changed): New function.
7622 (Incremental_binary::get_input_argument): New function.
7623 (Incremental_binary::get_library): New function.
7624 (Incremental_binary::get_script_info): New function.
7625 (Incremental_binary::init_layout): New function.
7626 (Incremental_binary::reserve_layout): New function.
7627 (Incremental_binary::output_file): New function.
7628 (Incremental_binary::do_check_inputs): New function.
7629 (Incremental_binary::do_file_is_unchanged): Remove.
7630 (Incremental_binary::do_file_has_changed): New function.
7631 (Incremental_binary::do_init_layout): New function.
7632 (Incremental_binary::do_reserve_layout): New function.
7633 (Incremental_binary::do_input_file_count): New function.
7634 (Incremental_binary::do_get_input_reader): Change signature.
7635 (Incremental_binary::input_args_map_): New data member.
7636 (Incremental_binary::library_map_): New data member.
7637 (Incremental_binary::script_map_): New data member.
7638 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7639 new data members.
7640 (Sized_incremental_binary::output_section): New function.
7641 (Sized_incremental_binary::inputs_reader): Add const.
7642 (Sized_incremental_binary::symtab_reader): Add const.
7643 (Sized_incremental_binary::relocs_reader): Add const.
7644 (Sized_incremental_binary::got_plt_reader): Add const.
7645 (Sized_incremental_binary::get_symtab_view): New function.
7646 (Sized_incremental_binary::Inputs_reader): New typedef.
7647 (Sized_incremental_binary::Input_entry_reader): New typedef.
7648 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7649 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7650 (Sized_incremental_binary::do_file_has_changed): New function.
7651 (Sized_incremental_binary::do_init_layout): New function.
7652 (Sized_incremental_binary::do_reserve_layout): New function.
7653 (Sized_input_reader::Inputs_reader): Remove.
7654 (Sized_input_reader::Input_entry_reader): Remove.
7655 (Sized_input_reader::do_arg_serial): New function.
7656 (Sized_input_reader::do_get_unused_symbol_count): New function.
7657 (Sized_input_reader::do_get_unused_symbol): New function.
7658 (Sized_incremental_binary::do_input_file_count): New function.
7659 (Sized_incremental_binary::do_get_input_reader): Change signature;
7660 use index instead of filename.
7661 (Sized_incremental_binary::section_map_): New data member.
7662 (Sized_incremental_binary::input_entry_readers_): New data member.
7663 (class Sized_incr_relobj): New class.
7664 (class Sized_incr_dynobj): New class.
7665 (make_sized_incremental_object): New function.
7666 (class Incremental_library): New class.
7667 * layout.cc (Free_list::num_lists): New static data member.
7668 (Free_list::num_nodes): New static data member.
7669 (Free_list::num_removes): New static data member.
7670 (Free_list::num_remove_visits): New static data member.
7671 (Free_list::num_allocates): New static data member.
7672 (Free_list::num_allocate_visits): New static data member.
7673 (Free_list::init): New function.
7674 (Free_list::remove): New function.
7675 (Free_list::allocate): New function.
7676 (Free_list::dump): New function.
7677 (Free_list::print_stats): New function.
7678 (Layout_task_runner::run): Resize output file for incremental updates.
7679 (Layout::Layout): Initialize new data members.
7680 (Layout::set_incremental_base): New function.
7681 (Layout::init_fixed_output_section): New function.
7682 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7683 incremental updates.
7684 (Layout::create_gold_note): Do not create gold note section for
7685 incremental updates.
7686 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7687 for incremental updates.
7688 (Layout::set_section_offsets): For incremental updates, allocate space
7689 from free list.
7690 (Layout::create_symtab_sections): Layout with offsets relative to
7691 start of section; for incremental updates, allocate space from free
7692 list.
7693 (Layout::create_shdrs): For incremental updates, allocate space from
7694 free list.
7695 (Layout::finish_dynamic_section): For incremental updates, do not
7696 check --as-needed (fixed in subsequent patch).
7697 * layout.h (class Free_list): New class.
7698 (Layout::set_incremental_base): New function.
7699 (Layout::incremental_base): New function.
7700 (Layout::init_fixed_output_section): New function.
7701 (Layout::allocate): New function.
7702 (Layout::incremental_base_): New data member.
7703 (Layout::free_list_): New data member.
7704 * main.cc (main): Print Free_list statistics.
7705 * object.cc (Relobj::finalize_incremental_relocs): Add
7706 clear_counts parameter; clear counts only when clear_counts is set.
7707 (Sized_relobj::Sized_relobj): Initialize new base class.
7708 (Sized_relobj::do_layout): Don't report special sections.
7709 (Sized_relobj::do_for_all_local_got_entries): New function.
7710 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7711 symtab_off to all symbol table offsets.
7712 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7713 * object.h (class Got_offset_list): Move to top of file.
7714 (Object::Object): Allow case where input_file == NULL.
7715 (Object::~Object): Likewise.
7716 (Object::input_file): Assert that input_file != NULL.
7717 (Object::lock): Allow case where input_file == NULL.
7718 (Object::unlock): Likewise.
7719 (Object::is_locked): Likewise.
7720 (Object::token): Likewise.
7721 (Object::release): Likewise.
7722 (Object::is_incremental): New function.
7723 (Object::get_mtime): New function.
7724 (Object::for_all_local_got_entries): New function.
7725 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7726 (Object::set_is_in_system_directory): New function.
7727 (Object::is_in_system_directory): New function.
7728 (Object::do_is_incremental): New function.
7729 (Object::do_get_mtime): New function.
7730 (Object::do_for_all_local_got_entries): New function.
7731 (Object::is_in_system_directory_): New data member.
7732 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7733 (class Sized_relobj_base): New class.
7734 (class Sized_relobj): Derive from Sized_relobj_base.
7735 (class Sized_relobj::Symbols): Redeclare from base class.
7736 (class Sized_relobj::local_got_offset_list): Remove.
7737 (class Sized_relobj::Output_sections): Redeclare from base class.
7738 (class Sized_relobj::do_for_all_local_got_entries): New function.
7739 (class Sized_relobj::write_local_symbols): Add offset parameter.
7740 (class Sized_relobj::local_symbol_offset_): Update comment.
7741 (class Sized_relobj::local_dynsym_offset_): Update comment.
7742 * options.cc (Input_arguments::add_file): Remove const.
7743 * options.h (Input_file_argument::Input_file_argument):
7744 Initialize arg_serial_ (all constructors).
7745 (Input_file_argument::set_arg_serial): New function.
7746 (Input_file_argument::arg_serial): New function.
7747 (Input_file_argument::arg_serial_): New data member.
7748 (Input_arguments::Input_arguments): Initialize file_count_.
7749 (Input_arguments::add_file): Remove const.
7750 (Input_arguments::number_of_input_files): New function.
7751 (Input_arguments::file_count_): New data member.
7752 (Command_line::number_of_input_files): Call
7753 Input_arguments::number_of_input_files.
7754 * output.cc (Output_segment_headers::Output_segment_headers):
7755 Set current size.
7756 (Output_section::Input_section::current_data_size): New function.
7757 (Output_section::Output_section): Initialize new data members.
7758 (Output_section::add_input_section): Don't do merge sections for
7759 an incremental link; allocate space from free list for an
7760 incremental update.
7761 (Output_section::add_output_section_data): Allocate space from
7762 free list for an incremental update.
7763 (Output_section::update_data_size): New function.
7764 (Output_section::set_fixed_layout): New function.
7765 (Output_section::reserve): New function.
7766 (Output_segment::set_section_addresses): Remove const.
7767 (Output_segment::set_section_list_addresses): Remove const; allocate
7768 space from free list for an incremental update.
7769 (Output_segment::set_offset): Adjust size of RELRO segment for an
7770 incremental update.
7771 * output.h (Output_data::current_data_size): Move here from
7772 child classes.
7773 (Output_data::pre_finalize_data_size): New function.
7774 (Output_data::update_data_size): New function.
7775 (Output_section_headers::update_data_size): new function.
7776 (Output_section_data_build::current_data_size): Move to Output_data.
7777 (Output_data_strtab::update_data_size): New function.
7778 (Output_section::current_data_size): Move to Output_data.
7779 (Output_section::set_fixed_layout): New function.
7780 (Output_section::has_fixed_layout): New function.
7781 (Output_section::reserve): New function.
7782 (Output_section::update_data_size): New function.
7783 (Output_section::has_fixed_layout_): New data member.
7784 (Output_section::free_list_): New data member.
7785 (Output_segment::set_section_addresses): Remove const.
7786 (Output_segment::set_section_list_addresses): Remove const.
7787 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7788 New function.
7789 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7790 New function.
7791 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7792 parameter when calling Add_symbols constructor; store argument
7793 serial number for members of a lib group.
7794 (Add_symbols::locks): Allow case where token == NULL.
7795 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7796 (Read_member::~Read_member): New function.
7797 (Read_member::is_runnable): New function.
7798 (Read_member::locks): New function.
7799 (Read_member::run): New function.
7800 (Check_script::~Check_script): New function.
7801 (Check_script::is_runnable): New function.
7802 (Check_script::locks): New function.
7803 (Check_script::run): New function.
7804 (Check_library::~Check_library): New function.
7805 (Check_library::is_runnable): New function.
7806 (Check_library::locks): New function.
7807 (Check_library::run): New function.
7808 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7809 (Add_symbols::library_): New data member.
7810 (class Read_member): New class.
7811 (class Check_script): New class.
7812 (class Check_library): New class.
7813 * reloc.cc (Read_relocs::is_runnable): Allow case where
7814 token == NULL.
7815 (Read_relocs::locks): Likewise.
7816 (Scan_relocs::locks): Likewise.
7817 (Relocate_task::locks): Likewise.
7818 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7819 to clear counters.
7820 (Sized_relobj::incremental_relocs_scan): Fix comment.
7821 (Sized_relobj::do_relocate): Pass output file offset to
7822 write_local_symbols.
7823 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7824 from class declaration.
7825 * script.cc (read_input_script): Allocate Script_info; pass
7826 argument serial number to report_script.
7827 * script.h (class Script_info): Move to incremental.h.
7828 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7829 * symtab.h (Symbol_table::add_from_incrobj): New function.
7830 (Symbol_table::set_file_offset): New function.
7831
b961d0d7
CC
78322011-04-05 Cary Coutant <ccoutant@google.com>
7833
7834 * incremental-dump.cc (dump_incremental_inputs): Change signature
7835 to take a Sized_incremental_binary; change caller. Use readers
7836 in Sized_incremental_binary.
7837 * incremental.cc
7838 (Sized_incremental_binary::find_incremental_inputs_sections):
7839 Rename do_find_incremental_inputs_sections to this.
7840 (Sized_incremental_binary::setup_readers): New function.
7841 (Sized_incremental_binary::do_check_inputs): Check
7842 has_incremental_info_ flag; move setup code to setup_readers;
7843 use input readers.
7844 (Sized_incremental_binary::do_file_is_unchanged): New function.
7845 (Sized_incremental_binary::do_get_input_reader): New function.
7846 * incremental.h (class Incremental_binary): Move to end of file.
7847 (Incremental_binary::file_is_unchanged): New function.
7848 (Incremental_binary::do_file_is_unchanged): New function.
7849 (Incremental_binary::Input_reader): New class.
7850 (Incremental_binary::get_input_reader): New function.
7851 (class Sized_incremental_binary): Move to end of file.
7852 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7853 input section reader classes.
7854 (Sized_incremental_binary::has_incremental_info): New function.
7855 (Sized_incremental_binary::inputs_reader): New function.
7856 (Sized_incremental_binary::symtab_reader): New function.
7857 (Sized_incremental_binary::relocs_reader): New function.
7858 (Sized_incremental_binary::got_plt_reader): New function.
7859 (Sized_incremental_binary::do_file_is_unchanged): New function.
7860 (Sized_incremental_binary::Sized_input_reader): New class.
7861 (Sized_incremental_binary::get_input_reader): New function.
7862 (Sized_incremental_binary::find_incremental_inputs_sections):
7863 Rename do_find_incremental_inputs_sections to this.
7864 (Sized_incremental_binary::setup_readers): New function.
7865 (Sized_incremental_binary::has_incremental_info_): New data member.
7866 (Sized_incremental_binary::inputs_reader_): New data member.
7867 (Sized_incremental_binary::symtab_reader_): New data member.
7868 (Sized_incremental_binary::relocs_reader_): New data member.
7869 (Sized_incremental_binary::got_plt_reader_): New data member.
7870 (Sized_incremental_binary::current_input_file_): New data member.
7871
a869183f
PP
78722011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7873
7874 PR gold/12640
7875 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7876 violation.
7877
78782011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7879
7880 * archive.cc (Archive::include_member): Adjust call to report_object.
7881 (Add_archive_symbols::run): Add script_info to call to
7882 report_archive_begin.
7883 (Lib_group::include_member): Adjust call to report_object.
7884 (Add_lib_group_symbols::run): Adjust call to report_object.
7885 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7886 blocks. Add object count for script input files.
7887 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7888 script_info parameter; change all callers.
7889 (Incremental_inputs::report_object): Add script_info parameter;
7890 change all callers.
7891 (Incremental_inputs::report_script): Store backpointer to
7892 incremental info entry.
7893 (Output_section_incremental_inputs::set_final_data_size): Record
7894 additional information for scripts.
7895 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7896 * incremental.h (Incremental_script_entry::add_object): New function.
7897 (Incremental_script_entry::get_object_count): New function.
7898 (Incremental_script_entry::get_object): New function.
7899 (Incremental_script_entry::objects_): New data member; adjust
7900 constructor.
7901 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7902 (Incremental_inputs::report_object): Add script_info parameter.
7903 (Incremental_inputs_reader::get_object_count): New function.
7904 (Incremental_inputs_reader::get_object_offset): New function.
7905 * options.cc (Input_arguments::add_file): Return reference to
7906 new input argument.
7907 * options.h (Input_argument::set_script_info): New function.
7908 (Input_argument::script_info): New function.
7909 (Input_argument::script_info_): New data member; adjust all
7910 constructors.
7911 (Input_file_group::add_file): Return reference to new input argument.
7912 (Input_file_lib::add_file): Likewise.
7913 (Input_arguments::add_file): Likewise.
7914 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7915 * script.cc (Parser_closure::Parser_closure): Add script_info
7916 parameter; adjust all callers.
7917 (Parser_closure::script_info): New function.
7918 (Parser_closure::script_info_): New data member.
7919 (read_input_script): Report scripts earlier to incremental info.
7920 (script_add_file): Set script_info in Input_argument.
7921 (script_add_library): Likewise.
7922 * script.h (Script_options::Script_info): Rewrite class.
7923
a869183f 79242011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7925
7926 * archive.cc (Library_base::should_include_member): Move
7927 method here from class Archive.
7928 (Archive::Archive): Initialize base class.
7929 (Archive::should_include_member): Move to base class.
7930 (Archive::do_for_all_unused_symbols): New function.
7931 (Add_archive_symbols::run): Remove redundant access to
7932 incremental_inputs.
7933 (Lib_group::Lib_group): Initialize base class.
7934 (Lib_group::do_filename): New function.
7935 (Lib_group::include_member): Pass pointer to Lib_group to
7936 report_object.
7937 (Lib_group::do_for_all_unused_symbols): New function.
7938 (Add_lib_group_symbols::run): Report archive information for
7939 incremental links.
7940 * archive.h (class Library_base): New base class.
7941 (class Archive): Derive from Library_base.
7942 (Archive::filename): Move to base class.
7943 (Archive::set_incremental_info): Likewise.
7944 (Archive::incremental_info): Likewise.
7945 (Archive::Should_include): Likewise.
7946 (Archive::should_include_member): Likewise.
7947 (Archive::Armap_entry): Remove.
7948 (Archive::Unused_symbol_iterator): Remove.
7949 (Archive::unused_symbols_begin): Remove.
7950 (Archive::unused_symbols_end): Remove.
7951 (Archive::do_filename): New function.
7952 (Archive::do_get_mtime): New function.
7953 (Archive::do_for_all_unused_symbols): New function.
7954 (Archive::task_): Move to base class.
7955 (Archive::incremental_info_): Likewise.
7956 (class Lib_group): Derive from Library_base.
7957 (Lib_group::do_filename): New function.
7958 (Lib_group::do_get_mtime): New function.
7959 (Lib_group::do_for_all_unused_symbols): New function.
7960 (Lib_group::task_): Move to base class.
7961 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7962 function.
7963 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7964 function.
7965 * incremental.cc (Incremental_inputs::report_archive_begin):
7966 Use Library_base; call library's get_mtime; add incremental inputs
7967 entry before members.
7968 (class Unused_symbol_visitor): New class.
7969 (Incremental_inputs::report_archive_end): Use Library_base; use
7970 visitor class to record unused symbols; don't add incremental inputs
7971 entry after members.
7972 (Incremental_inputs::report_object): Use Library_base.
7973 * incremental.h
7974 (Incremental_archive_entry::Incremental_archive_entry): Remove
7975 unused Archive parameter.
7976 (Incremental_inputs::report_archive_begin): Use Library_base.
7977 (Incremental_inputs::report_archive_end): Likewise.
7978 (Incremental_inputs::report_object): Likewise.
7979 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7980 function.
7981 * object.h (Object::for_all_global_symbols): New function.
7982 (Object::do_for_all_global_symbols): New function.
7983 (Sized_relobj::do_for_all_global_symbols): New function.
7984 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7985 function.
7986 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7987 function.
7988
61ab3e40
ILT
79892011-03-27 Ian Lance Taylor <iant@google.com>
7990
7991 * archive.cc (Archive::interpret_header): Return -1 if something
7992 goes wrong. Change callers accordingly.
7993
30e1f9e6
CC
79942011-03-25 Cary Coutant <ccoutant@google.com>
7995
7996 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7997 * testsuite/Makefile.in: Regenerate.
7998
9370ce59 79992011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
8000
8001 * plugin.cc (get_view): New.
8002 (Plugin::load): Pass get_view to the plugin.
8003 (Plugin_manager::get_view): New.
8004
9312bb0a
ILT
80052011-03-21 Ian Lance Taylor <iant@google.com>
8006
8007 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 8008 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 8009
7e12ba9e
ST
80102011-03-21 Sriraman Tallam <tmsriram@google.com>
8011
8012 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8013 Change == to -eq.
8014 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8015 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8016 Change == to -eq.
8017 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8018 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8019
fd7a005d
ILT
80202011-03-14 Ian Lance Taylor <iant@google.com>
8021
8022 * script-sections.cc (Sort_output_sections::script_compare):
8023 Rename from is_before, change return type.
8024 (Sort_output_sections::operator()): Adjust accordingly.
8025
ed16fd1b
ILT
80262011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8027
8028 PR gold/12572
8029 * testsuite/odr_violation2.cc: Add comment to make all error line
8030 numbers double digits.
8031 * testsuite/debug_msg.sh: Adjust expected errors.
8032
71ff8986
ILT
80332011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8034
8035 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8036 but mark earlier ones as non-canonical
8037 (offset_to_iterator): Update search target and example
8038 (do_addr2line): Return extra lines in a vector*
8039 (format_file_lineno): Extract from do_addr2line
8040 (one_addr2line): Add vector* out-param
8041 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8042 when a lineno entry appeared last for its instruction
8043 (Dwarf_line_info): Add vector* out-param
8044 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8045 * symtab.cc (Odr_violation_compare): Include the lineno in the
8046 comparison again.
8047 (linenos_from_loc): New. Combine the canonical line for an
8048 address with its other lines.
8049 (True_if_intersect): New. Helper functor to make
8050 std::set_intersection a query.
8051 (detect_odr_violations): Compare sets of lines instead of just
8052 one line for each function. This became less deterministic, but
8053 has fewer false positives.
8054 * symtab.h: Declarations.
8055 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8056 mix an optimized and non-optimized object in the same binary
8057 (odr_violation2.so): Same.
8058 * testsuite/Makefile.in: Regenerate from Makefile.am.
8059 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8060 * testsuite/debug_msg.sh: Update line numbers and add
8061 assertions.
8062 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8063 non-optimized context.
8064 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8065 isn't inlined, and use OdrDerived in an optimized context.
8066 * testsuite/odr_header1.h: Defines OdrDerived, where
8067 optimization will change the
8068 first-instruction-in-the-destructor's file and line number.
8069 * testsuite/odr_header2.h: Defines OdrBase.
8070
a19fefdc
ILT
80712011-03-09 Ian Lance Taylor <iant@google.com>
8072
8073 * fileread.cc (File_read::clear_views): Don't delete the whole
8074 file view.
8075
ecb351e9
ILT
80762011-03-08 Ian Lance Taylor <iant@google.com>
8077
8078 PR gold/12525
8079 * fileread.cc: #include <climits>.
8080 (GOLD_IOV_MAX): Define.
8081 (File_read::read_multiple): Limit number of entries by iov_max.
8082 * fileread.h (class File_read): Always set max_readv_entries to
8083 128.
8084
b821d13c
ILT
80852011-03-07 Ian Lance Taylor <iant@google.com>
8086
8087 PR gold/12525
8088 * options.h (class General_options): Add -dy and -dn.
8089
89243142
CC
80902011-03-02 Cary Coutant <ccoutant@google.com>
8091
8092 * testsuite/script_test_9.t: Add TLS segment.
8093
d0773f31
ILT
80942011-03-02 Simon Baldwin <simonb@google.com>
8095
8096 * configure.ac: Add check for gnu_indirect_function support in
8097 the toolchain building binutils.
8098 * configure: Rebuild.
8099
9370ce59 81002011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8101
8102 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8103 plugin only symbols.
8104 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8105 in plugin files as not needed in the symbol table.
8106
4cf7a849
ST
81072011-02-11 Sriraman Tallam <tmsriram@google.com>
8108
8109 * output.cc (Output_section::add_input_section): Delay fill
8110 generation for section ordering.
8111
b578bd7d
ILT
81122011-02-09 Ian Lance Taylor <iant@google.com>
8113
8114 PR gold/12316
8115 * object.h (class Sized_relobj): Remove clear_local_symbols.
8116 * reloc.cc (Sized_relobj::do_relocate): Don't call
8117 clear_local_symbols.
8118
9370ce59 81192011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8120
8121 * plugin.cc (is_visible_from_outside): Return true for symbols
8122 in the -u option.
8123
55382fb7
ILT
81242011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8125
8126 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8127 filename.
8128
4e271fff
ST
81292011-02-02 Sriraman Tallam <tmsriram@google.com>
8130
8131 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8132 to std::string.
4e271fff 8133 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8134 section_name to be std::string.
4e271fff
ST
8135 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8136
d433c3ac
ILT
81372011-01-25 Ian Lance Taylor <iant@google.com>
8138
8139 * script.cc (script_add_extern): Rewrite to use
8140 add_symbol_reference.
8141
880473a6
DK
81422011-01-25 Doug Kwan <dougkwan@google.com>
8143
d433c3ac 8144 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8145
f30f86fa
ILT
81462011-01-24 Ian Lance Taylor <iant@google.com>
8147
8148 * options.h (class General_options): Accept
8149 --no-detect-odr-violations.
8150
8e51a0b9
ILT
81512011-01-24 Ian Lance Taylor <iant@google.com>
8152
8153 * version.cc (version_string): Bump to 1.11.
8154
0f3b89d8
ILT
81552011-01-24 Ian Lance Taylor <iant@google.com>
8156
8157 * plugin.cc (class Plugin_rescan): Define new class.
8158 (Plugin_manager::claim_file): Set any_claimed_.
8159 (Plugin_manager::save_archive): New function.
8160 (Plugin_manager::save_input_group): New function.
8161 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8162 necessary.
8163 (Plugin_manager::new_undefined_symbol): New function.
8164 (Plugin_manager::rescan): New function.
8165 (Plugin_manager::rescannable_defines): New function.
8166 (Plugin_manager::add_input_file): Set any_added_.
8167 * plugin.h (class Plugin_manager): define new fields rescannable_,
8168 undefined_symbols_, any_claimed_, and any_added_. Declare
8169 Plugin_rescan as friend. Declare new functions.
8170 (Plugin_manager::Rescannable): Define type.
8171 (Plugin_manager::Rescannable_list): Define type.
8172 (Plugin_manager::Undefined_symbol_list): Define type.
8173 (Plugin_manager::Plugin_manager): Initialize new fields.
8174 * archive.cc (Archive::defines_symbol): New function.
8175 (Add_archive_symbols::run): Pass archive to plugins if any.
8176 * archive.h (class Archive): Declare defines_symbol.
8177 * readsyms.cc (Input_group::~Input_group): New function.
8178 (Finish_group::run): Pass input_group to plugins if any.
8179 * readsyms.h (class Input_group): Declare destructor.
8180 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8181 any.
8182
3bb951e5
ILT
81832011-01-10 Ian Lance Taylor <iant@google.com>
8184
8185 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8186 section as relro.
8187 (Layout::set_segment_offsets): Reset increase_relro before calling
8188 set_section_addresses a second time.
8189
0aa45fac
CC
81902011-01-04 Cary Coutant <ccoutant@google.com>
8191
8192 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8193 sections before NOBITS sections.
8194
0db46eb4
L
81952011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8196
8197 * version.cc (print_version): Update copyright to 2011.
8198
829c9745
CC
81992010-12-23 Cary Coutant <ccoutant@google.com>
8200
8201 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8202 of OS to this->add. Add OD parameter to second form of the function.
8203
7500420b
ILT
82042010-12-20 Ian Lance Taylor <iant@google.com>
8205
8206 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8207 second of two consecutive entries with same offset.
8208
f8e9a930
RW
82092010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8210
8211 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8212 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8213 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8214 to avoid unneeded links against $(LDADD).
8215 * testsuite/Makefile.in: Regenerate.
8216
2fbb4320
ILT
82172010-12-15 Ian Lance Taylor <iant@google.com>
8218
8219 PR gold/12324
8220 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8221 for R_X86_64_32 and R_X86_64_PC32.
8222 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8223 ver_matching_def_pic.o.
8224 (ver_matching_def_pic.o): New target.
8225
fedb228d
RW
82262010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8227
8228 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8229 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8230 Move definition before File_read::View member definitions.
8231 (File_read::View::~View): Initialize and hold lock before
8232 updating current_mapped_bytes.
8233
9b547ce6
RW
82342010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8235
8236 * dwarf_reader.cc: Remove outdated comment.
8237 * gold-threads.cc: Fix typo in error message.
8238 * archive.cc: Fix typos in comments.
8239 * archive.h: Likewise.
8240 * arm-reloc-property.cc: Likewise.
8241 * arm-reloc-property.h: Likewise.
8242 * arm-reloc.def: Likewise.
8243 * arm.cc: Likewise.
8244 * attributes.h: Likewise.
8245 * cref.cc: Likewise.
8246 * ehframe.cc: Likewise.
8247 * fileread.h: Likewise.
8248 * gold.h: Likewise.
8249 * i386.cc: Likewise.
8250 * icf.cc: Likewise.
8251 * incremental.h: Likewise.
8252 * int_encoding.cc: Likewise.
8253 * layout.h: Likewise.
8254 * main.cc: Likewise.
8255 * merge.h: Likewise.
8256 * object.cc: Likewise.
8257 * object.h: Likewise.
8258 * options.cc: Likewise.
8259 * readsyms.cc: Likewise.
8260 * reduced_debug_output.cc: Likewise.
8261 * reloc.cc: Likewise.
8262 * script-sections.cc: Likewise.
8263 * sparc.cc: Likewise.
8264 * symtab.h: Likewise.
8265 * target-reloc.h: Likewise.
8266 * target.cc: Likewise.
8267 * target.h: Likewise.
8268 * timer.cc: Likewise.
8269 * timer.h: Likewise.
8270 * x86_64.cc: Likewise.
8271
83e17bd5
CC
82722010-12-09 Cary Coutant <ccoutant@google.com>
8273
8274 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8275 stack.
8276 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8277 parameter; change all callers.
8278 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8279 * options.h (warn_execstack): New option.
8280
017257f8
DK
82812010-12-07 Doug Kwan <dougkwan@google.com>
8282
8283 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8284 like function call relocations.
8285
c20cbc06
ILT
82862010-12-07 Ian Lance Taylor <iant@google.com>
8287
8288 * archive.cc (Archive::get_elf_object_for_member): Permit
8289 punconfigured to be NULL.
8290 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8291 (Archive::include_member): Pass NULL to get_elf_object_for_member
8292 if we searched for the archive and this is the first included
8293 object.
8294
4dbfafcc
ILT
82952010-12-01 Ian Lance Taylor <iant@google.com>
8296
8297 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8298 track_relocs_type_ field.
8299 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8300 Set track_relocs_type_.
8301 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8302 contents when using RELA relocs.
8303 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8304 reloc_map_.
8305 * reloc.cc (Track_relocs::next_addend): New function.
8306 * reloc.h (class Track_relocs): Declare next_addend.
8307
e5e19edd
ILT
83082010-12-01 Ian Lance Taylor <iant@google.com>
8309
8310 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8311 virtual destructor.
8312
9a5ce24c
ILT
83132010-12-01 Ian Lance Taylor <iant@google.com>
8314
8315 * README: Update compilers known to work and fail.
8316
c7791212
NC
83172010-11-23 Matthias Klose <doko@ubuntu.com>
8318
8319 * configure.in: For --enable-gold, handle value `default' instead of
8320 `both*'. Always install ld as ld.bfd, install as ld if gold is
8321 not the default.
8322 * configure: Regenerate.
8323
0ad220c9
DK
83242010-11-18 Doug Kwan <dougkwan@google.com>
8325
8326 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8327 and right_alignment to be zero. Store result alignment only if it is
8328 greater than existing alignment.
8329
ab8056e0
CC
83302010-11-16 Cary Coutant <ccoutant@google.com>
8331
8332 PR gold/12220
8333 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8334 Check for ".zdebug_line".
8335
fd064a5b
CC
83362010-11-16 Doug Kwan <dougkwan@google.com>
8337 Cary Coutant <ccoutant@google.com>
8338
8339 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8340 by reference; adjust all callers.
8341 * output.cc (Output_segment::set_section_addresses): Adjust references
8342 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8343 list is empty.
8344 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8345 end at page boundary.
8346
6fc6ea19
CC
83472010-11-16 Cary Coutant <ccoutant@google.com>
8348
8349 PR gold/12220
8350 * layout.cc (Layout::choose_output_section): Transform names of
8351 compressed sections even when using a script with a SECTIONS clause.
8352 (Layout::output_section_name): Remove code to transform
8353 compressed debug section names.
8354 * output.cc (Output_section::add_input_section): Use uncompressed
8355 section size when tracking input sections.
8356
95a2c8d6
RS
83572010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8358
8359 * symtab.h (Symbol::NON_PIC_REF): Remove.
8360 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8361 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8362 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8363 (Symbol::use_plt_offset): Take a flags argument and pass it
8364 directly to needs_dynamic_reloc. Restrict check for undefined
8365 weak symbols to function calls.
8366 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8367 (Target_arm::Scan::global): Use it.
8368 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8369 (Target_arm::Relocate::relocate): Likewise.
8370 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8371 parameter with an r_type parameter. Use get_reference_flags
8372 to get the flags.
8373 (Target_arm::Relocate::relocate): Update accordingly.
8374 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8375 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8376 (Target_i386::Scan::global): Likewise.
8377 (Target_i386::Relocate::relocate): Likewise.
8378 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8379 parameter with an r_type parameter. Use get_reference_flags
8380 to get the flags.
8381 (Target_i386::Relocate::relocate): Update accordingly.
8382 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8383 (Target_powerpc::Scan::global): Use it.
8384 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8385 (Target_powerpc::Relocate::relocate): Likewise.
8386 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8387 (Target_sparc::Scan::global): Use it.
8388 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8389 (Target_sparc::Relocate::relocate): Likewise.
8390 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8391 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8392 (Target_x86_64::Scan::global): Likewise.
8393 (Target_x86_64::Relocate::relocate): Likewise.
8394
f625ae50
DK
83952010-11-08 Doug Kwan <dougkwan@google.com>
8396 Cary Coutant <ccoutant@google.com>
8397
8398 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8399 (Arm_exidx_merge_section::section_contents_): New data member.
8400 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8401 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8402 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8403 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8404 in parameters instead of calling Object::section_contents without
8405 locking.
8406 (Arm_output_section::group_section): New parameter TASK. Pass it
8407 to callees that need locking objects.
8408 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8409 to lock EXIDX input sections. Fix a formatting issue. Call
8410 Arm_exidx_merged_section::build_contents to create merged section
8411 contents.
8412 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8413 to lock object of stub table owner.
8414 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8415 TEXT_SIZE to initialize data member TEXT_SIZE_.
8416 (Arm_exidx_input_section::addralign): Fix typo in comment.
8417 (Arm_exidx_input_section::text_size): New method.
8418 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8419 that require locking objects. Lock objects before scanning for stubs
8420 and updating local symbols.
8421 (Arm_input_section<big_endian>::init): Copy contents of original
8422 input section.
2e702c99 8423 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8424 original input section instead of calling Object::section_contents
8425 without locking.
8426 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8427 size without calling Object::section_size().
8428 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8429 for size. Allocate a buffer for merged EXIDX entries.
8430 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8431 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8432 building code to Arm_exidx_merged_section::build_contetns. Write
8433 out contetns in buffer instead of building it on the fly.
8434 (Arm_relobj::make_exidx_input_section): Also pass text section size
8435 to Arm_exidx_input_section constructor.
8436 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8437 (Arm_dynobj::do_read_symbols): Fix memory leak.
8438 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8439 * target.h: (class Task): Add forward declaration.
8440 (Target::relax): Add new parameter TASK and pass it to
8441 Target::do_relax().
8442 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8443
5f9bcf58
CC
84442010-11-05 Cary Coutant <ccoutant@google.com>
8445
8446 PR gold/10708
8447 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8448 object when reading from the file.
8449 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8450 second layout pass.
8451 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8452 when reading section contents.
8453 (get_section_contents): Likewise.
8454 (icf::find_identical_sections): Likewise.
8455 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8456 object when reading from the file.
8457 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8458 the object when doing deferred section layout.
8459
e597fa08
NC
84602010-11-03 Nick Clifton <nickc@redhat.com>
8461
8462 PR gold/12001
8463 * script.h (class Symbol_assignment: name): New member. Returns
8464 the name of the symbol.
8465 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8466 Returns true if the given symbol name is on the list of
8467 assignments wating to be processed.
8468 * archive.cc (should_incldue_member): If the symbol is undefined,
8469 check to see if it is on the list of symbols pending assignment.
8470
3f9a3278
ILT
84712010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8472
8473 * script-sections.cc (Script_sections::find_memory_region): Check
8474 for a NULL output section pointer.
8475
d06fb4d1
DK
84762010-10-29 Doug Kwan <dougkwan@google.com>
8477
8478 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8479 Output_section::add_relaxed_input_section.
8480 * output.cc (Output_section::add_relaxed_input_section): Add new
8481 arguments LAYOUT and NAME. Set section order index.
8482 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8483 Copy section order index.
8484 * output.h (Output_section::add_relaxed_input_section): Add new
8485 arguments LAYOUT and NAME.
8486
90e24de5
ILT
84872010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8488
8489 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8490 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8491 * testsuite/Makefile.in: Regenerate.
8492
c9484ea5
DK
84932010-10-20 Doug Kwan <dougkwan@google.com>
8494
8495 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8496 without SHF_LINK_ORDER flags.
8497 * layout.cc (Layout::choose_output_section): Do not filter
8498 SHF_LINK_ORDER flag in a relocatable link.
8499
5bc2f5be
CC
85002010-10-17 Cary Coutant <ccoutant@google.com>
8501
8502 * output.h (Output_segment::set_section_addresses): Change function
8503 signature. Update all callers.
8504 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8505 sections.
8506 (Output_segment::set_section_addresses): Align after last TLS
8507 section. Add padding before last relro section instead of after.
8508
0c91cf04
DK
85092010-10-17 Doug Kwan <dougkwan@google.com>
8510
8511 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8512 GOT output section to be writable.
8513
8c21d9d3
CC
85142010-10-14 Cary Coutant <ccoutant@google.com>
8515
8516 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8517 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8518 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8519 mode.
8520 * incremental.cc (report_command_line): Ignore all forms of
8521 --incremental.
8522 * layout.cc (Layout::Layout): Check parameters for incremental link
8523 mode.
8524 * options.cc (General_options::parse_incremental): New function.
8525 (General_options::parse_no_incremental): New function.
8526 (General_options::parse_incremental_full): New function.
8527 (General_options::parse_incremental_update): New function.
8528 (General_options::incremental_mode_): New data member.
8529 (General_options::finalize): Check incremental_mode_.
8530 * options.h (General_options): Update help text for --incremental.
8531 Add --no-incremental, --incremental-full, --incremental-update.
8532 (General_options::Incremental_mode): New enum type.
8533 (General_options::incremental_mode): New function.
8534 (General_options::incremental_mode_): New data member.
8535 * parameters.cc (Parameters::incremental_mode_): New data member.
8536 (Parameters::set_options): Set incremental_mode_.
8537 (Parameters::set_incremental_full): New function.
8538 (Parameters::incremental): New function.
8539 (Parameters::incremental_update): New function.
8540 (set_parameters_incremental_full): New function.
8541 * parameters.h (Parameters::set_incremental_full): New function.
8542 (Parameters::incremental): New function.
8543 (Parameters::incremental_update): New function.
8544 (Parameters::incremental_mode_): New data member.
8545 (set_parameters_incremental_full): New function.
8546 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8547 incremental link mode.
8548 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8549 (Sized_relobj::do_relocate_sections): Likewise.
8550 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8551 option.
8552 * testsuite/Makefile.in: Regenerate.
8553 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8554
bb32aa18 85552010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8556
8557 * script-sections.h (class Script_sections): Make
8558 Sections_elements typedef public.
8559 * script-sections.cc (class Sort_output_sections): Add elements_
8560 field. Add constructor which sets it; change all callers.
8561 (Sort_output_sections::is_before): New function.
8562 (Sort_output_sections::operator()): Call is_before.
8563 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8564 conditional.
8565 * testsuite/script_test_10.sh: New test. Test script section
8566 order.
8567 * testsuite/script_test_10.t: Likewise.
8568 * testsuite/script_test_10.s: Likewise.
8569 * testsuite/Makefile.am: Wrap the cross linker tests and the
8570 common tests into NATIVE_OR_CROSS_LINKER.
8571 (check_SCRIPTS): Add script_test_10.sh.
8572 (check_DATA): Add script_test_10.stdout.
8573 (script_test_10.o, script_test_10): New targets.
8574 (script_test_10.stdout): New target.
8575 * configure, testsuite/Makefile.in: Regenerate.
8576
3cef7179
ILT
85772010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8578
8579 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8580 error for the deprecated relocations.
8581 (Target_arm::Scan::global): Likewise.
8582 (Target_arm::Relocate::relocate): Likewise.
8583
7411e9a8
RS
85842010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8585
8586 * fileread.cc (Input_file::find_file): Initialize *found_name
8587 and *namep when using the fallback search for case 4.
8588
6a9da32a
CC
85892010-10-11 Cary Coutant <ccoutant@google.com>
8590
8591 * options.h (class General_options): Redefine -z lazy as an alias for
8592 the negation of -z now.
8593
ac897c20
ILT
85942010-10-11 Ian Lance Taylor <iant@google.com>
8595
8596 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8597 binding.
8598
ea5cae92
NC
85992010-10-06 Nick Clifton <nickc@redhat.com>
8600
8601 * script-sections.cc(class Memory_region): Remove
8602 current_lma_offset_ field. Rename current_vma_offset_ to
8603 current_offset_. Add last_section_ field.
8604 (Memory_region::get_current_vma_address): Rename to
8605 get_current_address.
8606 (Memory_region::get_current_lma_address): Delete.
8607 (Memory_region::increment_vma_offset): Rename to
8608 increment_offset.
8609 (Memory_region::increment_lma_offset): Delete.
8610 (Memory_region::attributes_compatible): New method. Returns
8611 true if the provided section is compatible with the region.
8612 (Memory_region::get_last_section): New method. Returns the last
8613 section to use the region.
8614 (Memory_region::set_last_section): New method. Stores the last
8615 section to use the region.
8616 (Script_sections::block_in_region): New method. Returns true if
8617 a block of memory is contained within a region.
8618 (Script_sections::find_memory_region): New method. Locates a
8619 memory region to be used to set a VMA or LMA address.
8620 (Output_section_definition::set_section_addresses): Add code to
8621 check for addresses set by memory regions.
8622 (Output_segment::set_section_addresses): Remove memory region
8623 walking code.
8624 (Script_sections::create_segment): Add a warning if a header
8625 segment is created outside of any region.
8626 * script-sections.h (class Script_sections): Add prototypes for
8627 find_memory_region and block_in_region methods.
8628 * testsuite/memory_test.s: Use .long instead of .word.
8629 * testsuite/memory_test.t: Add some more output sections.
8630 * testsuite/memory_test.sh: Update expected output.
8631
a9bfd952
DK
86322010-10-02 Doug Kwan <dougkwan@google.com>
8633
8634 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8635 defintion to symtab.h
8636 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8637 declaration to defintion.
8638
bacff3ab
NC
86392010-10-01 Nick Clifton <nickc@redhat.com>
8640
8641 * expression.cc (eval): Replace dummy argument with NULL.
8642 (eval_maybe_dot): Check for a NULL result section pointer.
8643 (Symbol_expression::value): Likewise.
8644 (Dot_expression::value): Likewise.
8645 (BINARY_EXPRESSION): Likewise.
8646 (Max_expression::value): Likewise.
8647 (Min_expression::value): Likewise.
8648 (Absolute_expression::value): Likewise.
8649 (Addr_expression::value_from_output_section): Likewise.
8650 (Loaddddr_expression::value_from_output_section): Likewise.
8651 (Segment_start_expression::value): Likewise.
8652 * script-sections.cc
8653 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8654 argument with NULL.
8655 (Sections_elememt_dot_assignment::set_section_addresses):
8656 Likewise.
8657 (Output_data_expression::do_write_to_buffer): Likewise.
8658 (Output_section_definition::finalize_symbols): Likewise.
8659 (Output_section_definition::set_section_addresses): Likewise.
8660
f81bc8b5
DK
86612010-09-30 Doug Kwan <dougkwan@google.com>
8662
8663 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8664
c95e9f27
ST
86652010-09-28 Sriraman Tallam <tmsriram@google.com>
8666
8667 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8668 function.
c95e9f27
ST
8669 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8670 virtual function.
8671 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8672 virtual function.
8673 * icf.cc (get_section_contents): Inline merge sections only when
8674 target allows it.
8675
3cac54d2
RW
86762010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8677
8678 * configure: Regenerate.
8679
2904037a
ILT
86802010-09-17 Ian Lance Taylor <iant@google.com>
8681
8682 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8683 * testsuite/Makefile.am (memory_test.o): New target.
8684 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8685 memory_test.t.
8686 * testsuite/Makefile.in: Rebuild.
2904037a 8687
bca7fb63
DK
86882010-09-17 Doug Kwan <dougkwan@google.com>
8689
8690 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8691 defintion if relocation uses GOT entries of the symbol.
8692 * testsuite/icf_safe_test.sh: Fix test.
8693 * testsuite/icf_safe_so_test.sh: Fix test.
8694
4ef28648
CC
86952010-09-16 Cary Coutant <ccoutant@google.com>
8696
8697 * script_sections.cc (class Memory_region): Remove "NULL" from
8698 vector initializations.
8699
793990de
CC
87002010-09-15 Cary Coutant <ccoutant@google.com>
8701
8702 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8703 Resolve forwarding symbols.
8704
81e015e2
DK
87052010-09-15 Doug Kwan <dougkwan@google.com>
8706
8707 * gold/testsuite/script_test_3.t: Add ARM special sections.
8708 * gold/testsuite/script_test_4.t: Same.
8709 * gold/testsuite/script_test_5.t: Same.
8710 * gold/testsuite/script_test_6.t: Same.
8711 * gold/testsuite/script_test_7.t: Same.
8712 * gold/testsuite/script_test_7.t: Same.
8713 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8714
36171d64
CC
87152010-09-14 Cary Coutant <ccoutant@google.com>
8716
8717 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8718 (Target_x86_64::Relocate::relocate_tls): Replace check for
8719 saw_tls_block_reloc_ with test for executable section.
8720
d89051bd
CC
87212010-09-12 Cary Coutant <ccoutant@google.com>
8722
8723 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8724 position-independent executables to shared libraries need dynamic
8725 relocations.
8726 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8727 position-independent executables.
8728 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8729 * testsuite/Makefile.in: Regenerate.
8730
fca41f0f
NC
87312010-09-10 Nick Clifton <nickc@redhat.com>
8732
8733 PR gold/11997
8734 * testsuite/memory_test.t: Discard any sections that are not
8735 needed.
8736
6695e4b3
L
87372010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8738
8739 PR gold/11996
8740 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8741 "This::" to work around a bug in gcc 4.2.
8742
8743 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8744
0f72bf6f
RÁE
87452010-09-09 Rafael Espindola <espindola@google.com>
8746
8747 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8748 sections with different PF_X flags in the same segment.
8749 (Layout::find_first_load_seg): Search all segments to find the first
8750 one.
8751 * options.h (rosegment): New.
8752
87532010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8754
05a79166 8755 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8756
aa98ff75
DK
87572010-09-08 Doug Kwan <dougkwan@google.com>
8758
8759 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8760 (Arm_relobj::do_relocate_sections): Add new parameter for output
8761 file to match the parent.
8762 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8763 of local symbols instead of input values. Update code to track
8764 changes in gold::relocate_section.
8765 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8766 (Sized_relobj::compute_final_local_value_internal): New methods.
8767 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8768 body into private version of Sized_relobj::compute_final_local_value.
8769 Call the inline method.
8770 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8771 merged symbol value if there is one.
8772 (Symbol_value::has_output_value): New method defintiion.
8773 (Sized_relobj::Compute_final_local_value_status): New enum type.
8774 (Sized_relobj::compute_final_local_value): New methods.
8775 (Sized_relobj::compute_final_local_value_internal): New methods.
8776 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8777 and arm_cortex_a8.sh.
8778 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8779 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8780 New tests.
8781 * Makefile.in: Regenerate.
8782 * testsuite/arm_bl_out_of_range.s: Update test.
8783 * testsuite/thumb_bl_out_of_range.s: Ditto.
8784 * testsuite/thumb_blx_out_of_range.s: Ditto.
8785 * testsuite/arm_branch_out_of_range.sh: New file.
8786 * testsuite/arm_cortex_a8.sh: Ditto.
8787 * testsuite/arm_cortex_a8_b.s: Ditto.
8788 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8789 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8790 * testsuite/arm_cortex_a8_bl.s: Ditto.
8791 * testsuite/arm_cortex_a8_blx.s: Ditto.
8792 * testsuite/arm_cortex_a8_local.s: Ditto.
8793 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8794 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8795
05a79166
L
87962010-09-08 Rafael Espindola <espindola@google.com>
8797
8798 * Makefile.am (memory_test.stdout): Run readelf with -W.
8799 * Makefile.in: Regenerate.
8800 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8801 64 bit output.
8802
33dbc701
RÁE
88032010-09-08 Rafael Espindola <espindola@google.com>
8804
8805 * script-sections.cc (Script_sections::add_memory_region): Convert
8806 field precision to int.
8807 * script.cc (script_set_section_region, script_set_section_region):
8808 Convert field precision to int.
8809
731ca54a
RÁE
88102010-09-08 Rafael Espindola <espindola@google.com>
8811
8812 * arm.cc (do_finalize_sections): Create the __exidx_start and
8813 __exdix_end symbols even when the section is missing.
8814
7f8cd844
NC
88152010-09-08 Nick Clifton <nickc@redhat.com>
8816
8817 * README: Remove claim that MEMORY is not supported.
8818 * expression.cc (script_exp_function_origin)
8819 (script_exp_function_length): Move from here to ...
8820 * script.cc: ... here.
8821 (script_set_section_region, script_add_memory)
8822 (script_parse_memory_attr, script_include_directive): New
8823 functions.
8824 * script-sections.cc
8825 (class Memory_region): New class.
8826 (class Output_section_definition): Add set_memory_region,
8827 set_section_vma, set_section_lma and get_section_name methods.
8828 (class Script_Sections): Add add_memory_region,
8829 find_memory_region, find_memory_region_origin,
8830 find_memory_region_length and set_memory_region methods.
8831 Have set_section_addresses method walk the list of set memory
8832 regions.
8833 Extend the print methos to display memory regions.
8834 * script-sections.h: Add prototypes for new methods.
8835 Add enum for MEMORY region attributes.
8836 * yyscript.y: Add support for parsing MEMORY regions.
8837 * script-c.h: Add prototypes for new functions.
8838 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8839 * testsuite/Makefile.in: Regenerate.
8840 * testsuite/memory_test.sh: New script.
8841 * testsuite/memory_test.s: New assembler source file.
8842 * testsuite/memory_test.t: New linker script.
8843
a4649286
DK
88442010-08-27 Doug Kwan <dougkwan@google.com>
8845
8846 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8847 reference override an existing dynamic weak reference.
8848 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8849 * testsuite/Makefile.in: Regenerate.
8850 * testsuite/dyn_weak_ref.sh: New file.
8851 * testsuite/dyn_weak_ref_1.c: Ditto.
8852 * testsuite/dyn_weak_ref_2.c: Ditto.
8853
b56648ad
ILT
88542010-08-27 Ian Lance Taylor <iant@google.com>
8855
8856 * incremental.h (class Incremental_input_entry): Add virtual
8857 destructor.
8858
809313cb
ILT
88592010-08-27 Ian Lance Taylor <iant@google.com>
8860
8861 * testsuite/start_lib_test_3.c: Mark t3 as used.
8862
11e32464
NC
88632010-08-27 Nick Clifton <nickc@redhat.com>
8864
8865 * options.cc (version_script): Fix small typo in previous
8866 whitespace tidyup.
8867
ca09d69a
NC
88682010-08-25 Nick Clifton <nickc@redhat.com>
8869
8870 * archive.cc: Formatting fixes: Remove whitespace between
8871 typename and following asterisk. Remove whitespace between
8872 function name and opening parenthesis.
8873 * archive.h: Likewise.
8874 * arm.cc: Likewise.
8875 * attributes.cc: Likewise.
8876 * attributes.h: Likewise.
8877 * common.cc: Likewise.
8878 * copy-relocs.cc: Likewise.
8879 * dirsearch.h: Likewise.
8880 * dynobj.cc: Likewise.
8881 * ehframe.cc: Likewise.
8882 * ehframe.h: Likewise.
8883 * expression.cc: Likewise.
8884 * fileread.cc: Likewise.
8885 * fileread.h: Likewise.
8886 * gc.h: Likewise.
8887 * gold-threads.cc: Likewise.
8888 * gold.cc: Likewise.
8889 * i386.cc: Likewise.
8890 * icf.h: Likewise.
8891 * incremental-dump.cc: Likewise.
8892 * incremental.cc: Likewise.
8893 * layout.cc: Likewise.
8894 * layout.h: Likewise.
8895 * main.cc: Likewise.
8896 * merge.cc: Likewise.
8897 * merge.h: Likewise.
8898 * object.cc: Likewise.
8899 * object.h: Likewise.
8900 * options.cc: Likewise.
8901 * options.h: Likewise.
8902 * output.cc: Likewise.
8903 * output.h: Likewise.
8904 * plugin.cc: Likewise.
8905 * plugin.h: Likewise.
8906 * powerpc.cc: Likewise.
8907 * reloc.cc: Likewise.
8908 * script-c.h: Likewise.
8909 * script-sections.cc: Likewise.
8910 * script.cc: Likewise.
8911 * stringpool.cc: Likewise.
8912 * symtab.cc: Likewise.
8913 * symtab.h: Likewise.
8914 * target.cc: Likewise.
8915 * timer.cc: Likewise.
8916 * timer.h: Likewise.
8917 * version.cc: Likewise.
8918 * x86_64.cc: Likewise.
8919
b8fa8750
NC
89202010-08-24 Nick Clifton <nickc@redhat.com>
8921
8922 PR 11899
8923 * layout.cc (segment_precedes): Sort segments by their physical
8924 addresses, if they have been set.
8925
9919d93b
CC
89262010-08-23 Cary Coutant <ccoutant@google.com>
8927
8928 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8929 symbols data.
8930 (Lib_group::include_member): Unlock object after deleting its
8931 symbols data.
8932 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8933 the bug fixed here.
8934
97b4be1c
CC
89352010-08-19 Neil Vachharajani <nvachhar@google.com>
8936 Cary Coutant <ccoutant@google.com>
8937
8938 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8939 constructor, and set_blocker.
8940 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8941 readsyms_blocker_.
8942 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8943 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8944 * testsuite/Makefile.am (start_lib_test): New test case.
8945 * testsuite/Makefile.in: Regenerate.
8946 * testsuite/start_lib_test_main.c: New file.
8947 * testsuite/start_lib_test_1.c: New file.
8948 * testsuite/start_lib_test_2.c: New file.
8949 * testsuite/start_lib_test_3.c: New file.
8950
dd0b1884
ILT
89512010-08-19 Ian Lance Taylor <iant@google.com>
8952
8953 * Makefile.in: Rebuild with automake 1.11.1.
8954 * aclocal.m4: Likewise.
8955 * testsuite/Makefile.in: Likewise.
8956
7223e9ca
ILT
89572010-08-19 Ian Lance Taylor <iant@google.com>
8958
8959 PR 10893
8960 * i386.cc (class Output_data_plt_i386): Update declarations.
8961 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8962 local_ifuncs_ fields.
8963 (Target_i386::do_plt_section_for_global): New function.
8964 (Target_i386::do_plt_section_for_local): New function.
8965 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8966 parameter; change all callers. Initialize global_ifuncs_ and
8967 local_ifuncs_. If doing a static link define __rel_iplt_start and
8968 __rel_iplt_end.
8969 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8970 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8971 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8972 symbols.
8973 (Target_i386::make_plt_section): New function, broken out of
8974 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8975 (Target_i386::make_plt_entry): Call make_plt_section.
8976 (Target_i386::make_local_ifunc_plt_entry): New function.
8977 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8978 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8979 R_386_IRELATIVE to switch.
8980 (Target_i386::Scan::global): Likewise.
8981 (Target_i386::Relocate::relocate): Likewise.
8982 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8983 switch.
8984 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8985 (Target_x86_64::do_plt_section_for_global): New function.
8986 (Target_x86_64::do_plt_section_for_local): New function.
8987 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8988 parameter; change all callers. If doing a static link define
8989 __rela_iplt_start and __rela_iplt_end.
8990 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8991 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8992 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8993 to point to .plt.
8994 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8995 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8996 switch.
8997 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8998 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8999 R_X86_64_IRELATIVE to switch.
9000 (Target_x86_64::Scan::global): Likewise.
9001 (Target_x86_64::Relocate::relocate): Likewise.
9002 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9003 switch.
9004 * target.h (class Target): Add plt_section_for_global and
9005 plt_section_for_local functions. Add do_plt_section_for_global
9006 and do_plt_section_for_local virtual functions.
9007 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9008 clarifying comments.
9009 (Symbol::use_plt_offset): Handle IFUNC symbol.
9010 * object.cc (Sized_relobj::Sized_relobj): Initialize
9011 local_plt_offsets_.
9012 (Sized_relobj::local_has_plt_offset): New function.
9013 (Sized_relobj::local_plt_offset): New function.
9014 (Sized_relobj::set_local_plt_offset): New function.
9015 (Sized_relobj::do_count): Handle IFUNC symbol.
9016 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9017 a bit away from input_shndx_ field. Add set_is_func_symbol and
9018 is_ifunc_symbol functions.
9019 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9020 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9021 local_plt_offsets_ field.
9022 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9023 * output.h (class Output_section_data): Add non-const
9024 output_section function.
9025 (class Output_data_got): Update declarations.
9026 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9027 Add use_plt_offset parameter to global and local constructors.
9028 Change all callers. Change local_sym_index_ field to 31 bits.
9029 Change GSYM_CODE and CONSTANT_CODE accordingly.
9030 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9031 doing a static link don't set sh_link field.
9032 (Output_data_got::Got_entry::write): Use PLT offset if
9033 appropriate.
9034 (Output_data_got::add_global_plt): New function.
9035 (Output_data_got::add_local_plt): New function.
9036 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9037 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9038 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9039 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9040 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9041 IFUNC conditional.
9042 * testsuite/ifunc-sel.h: New file.
9043 * testsuite/ifuncmain1.c: New file.
9044 * testsuite/ifuncmain1vis.c: New file.
9045 * testsuite/ifuncmod1.c: New file.
9046 * testsuite/ifuncdep2.c: New file.
9047 * testsuite/ifuncmain2.c: New file.
9048 * testsuite/ifuncmain3.c: New file.
9049 * testsuite/ifuncmod3.c: New file.
9050 * testsuite/ifuncmain4.c: New file.
9051 * testsuite/ifuncmain5.c: New file.
9052 * testsuite/ifuncmod5.c: New file.
9053 * testsuite/ifuncmain6pie.c: New file.
9054 * testsuite/ifuncmod6.c: New file.
9055 * testsuite/ifuncmain7.c: New file.
9056 * configure, testsuite/Makefile.in: Rebuild.
9057
56f75c03
ILT
90582010-08-18 Ian Lance Taylor <iant@google.com>
9059
9060 * incremental.cc
9061 (Output_section_incremental_inputs::write_input_files): Add cast
9062 to avoid signed/unsigned comparison warning.
9063 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9064
55455f89
CC
90652010-08-12 Cary Coutant <ccoutant@google.com>
9066
9067 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9068
e2054bcb
ILT
90692010-08-13 Ian Lance Taylor <iant@google.com>
9070
9071 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9072
74f67560
DK
90732010-08-12 Cary Coutant <ccoutant@google.com>
9074 Doug Kwan <dougkwan@google.com>
9075
9076 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9077 defintion overrides non-weak undef, remember that the original undef
9078 is not weak.
9079 * symtab.cc (Symbol_table::sized_write_global): For undef without
9080 an original weak binding, set binding to global in output.
9081 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9082 * testsuite/Makefile.in: Regenerate.
9083 * testsuite/strong_ref_weak_def.sh: New file.
9084 * testsuite/strong_ref_weak_def_1.c: Ditto.
9085 * testsuite/strong_ref_weak_def_2.c: Ditto.
9086
d1238d12
CC
90872010-08-12 Cary Coutant <ccoutant@google.com>
9088
9089 * testsuite/incremental_test.sh: Rewrite.
9090 * testsuite/incremental_test_1.c: Rewrite.
9091 * testsuite/incremental_test_2.c: Rewrite.
9092
0e70b911
CC
90932010-08-12 Cary Coutant <ccoutant@google.com>
9094
9095 * arm.cc (Target_arm::got_size): Add const.
9096 (Target_arm::got_entry_count): New function.
9097 (Target_arm::plt_entry_count): New function.
9098 (Target_arm::first_plt_entry_offset): New function.
9099 (Target_arm::plt_entry_size): New function.
9100 (Output_data_plt_arm::entry_count): New function.
9101 (Output_data_plt_arm::first_plt_entry_offset): New function.
9102 (Output_data_plt_arm::get_plt_entry_size): New function.
9103 * i386.cc (Target_i386::got_size): Add const.
9104 (Target_i386::got_entry_count): New function.
9105 (Target_i386::plt_entry_count): New function.
9106 (Target_i386::first_plt_entry_offset): New function.
9107 (Target_i386::plt_entry_size): New function.
9108 (Output_data_plt_i386::entry_count): New function.
9109 (Output_data_plt_i386::first_plt_entry_offset): New function.
9110 (Output_data_plt_i386::get_plt_entry_size): New function.
9111 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9112 find_incremental_inputs_sections. Dump incremental_got_plt section.
9113 * incremental.cc: Include target.h.
9114 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9115 parameter. Adjust all callers. Find incremental_got_plt section.
9116 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9117 section.
9118 (Output_section_incremental_inputs::set_final_data_size): Calculate
9119 size of incremental_got_plt section.
9120 (Output_section_incremental_inputs::do_write): Write the
9121 incremental_got_plt section.
9122 (Got_plt_view_info): New struct.
9123 (Local_got_offset_visitor): New class.
9124 (Global_got_offset_visitor): New class.
9125 (Global_symbol_visitor_got_plt): New class.
9126 (Output_section_incremental_inputs::write_got_plt): New function.
9127 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9128 Add parameter. Adjust all callers.
9129 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9130 (Incremental_inputs::got_plt_section): New function.
9131 (Incremental_inputs::got_plt_section_): New data member.
9132 (Incremental_got_plt_reader): New class.
9133 * layout.cc (Layout::create_incremental_info_sections): Add the
9134 incremental_got_plt section.
9135 * object.h (Got_offset_list::get_list): New function.
9136 (Got offset_list::for_all_got_offsets): New function.
9137 (Sized_relobj::local_got_offset_list): New function.
9138 * powerpc.cc (Target_powerpc::got_size): Add const.
9139 (Target_powerpc::got_entry_count): New function.
9140 (Target_powerpc::plt_entry_count): New function.
9141 (Target_powerpc::first_plt_entry_offset): New function.
9142 (Target_powerpc::plt_entry_size): New function.
9143 (Output_data_plt_powerpc::entry_count): New function.
9144 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9145 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9146 * sparc.cc (Target_sparc::got_size): Add const.
9147 (Target_sparc::got_entry_count): New function.
9148 (Target_sparc::plt_entry_count): New function.
9149 (Target_sparc::first_plt_entry_offset): New function.
9150 (Target_sparc::plt_entry_size): New function.
9151 (Output_data_plt_sparc::entry_count): New function.
9152 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9153 (Output_data_plt_sparc::get_plt_entry_size): New function.
9154 * symtab.h (Symbol::got_offset_list): New function.
9155 (Symbol_table::for_all_symbols): New function.
9156 * target.h (Sized_target::got_entry_count): New function.
9157 (Sized_target::plt_entry_count): New function.
9158 (Sized_target::plt_entry_size): New function.
9159 * x86_64.cc (Target_x86_64::got_size): Add const.
9160 (Target_x86_64::got_entry_count): New function.
9161 (Target_x86_64::plt_entry_count): New function.
9162 (Target_x86_64::first_plt_entry_offset): New function.
9163 (Target_x86_64::plt_entry_size): New function.
9164 (Output_data_plt_x86_64::entry_count): New function.
9165 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9166 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9167
09ec0418
CC
91682010-08-12 Cary Coutant <ccoutant@google.com>
9169
9170 * archive.cc: Include incremental.h.
9171 (Archive::Archive): Initialize incremental_info_.
9172 (Archive::include_member): Record archive members in incremental info.
9173 (Add_archive_symbols::run): Record begin and end of an archive in
9174 incremental info.
9175 (Lib_group::include_member): Record objects in incremental info.
9176 * archive.h (Incremental_archive_entry): Forward declaration.
9177 (Archive::set_incremental_info): New member function.
9178 (Archive::incremental_info): New member function.
9179 (Archive::Unused_symbol_iterator): New class.
9180 (Archive::unused_symbols_begin): New member function.
9181 (Archive::unused_symbols_end): New member function.
9182 (Archive::incremental_info_): New data member.
9183 * incremental-dump.cc (find_input_containing_global): New function.
9184 (dump_incremental_inputs): Dump new incremental info sections.
9185 * incremental.cc: Include symtab.h.
9186 (Output_section_incremental_inputs): New class.
9187 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9188 new incremental info sections.
9189 (Sized_incremental_binary::do_check_inputs): Likewise.
9190 (Incremental_inputs::report_archive): Remove.
9191 (Incremental_inputs::report_archive_begin): New function.
9192 (Incremental_inputs::report_archive_end): New function.
9193 (Incremental_inputs::report_object): New function.
9194 (Incremental_inputs::finalize_inputs): Remove.
9195 (Incremental_inputs::report_input_section): New function.
9196 (Incremental_inputs::report_script): Rewrite.
9197 (Incremental_inputs::finalize): Do nothing but finalize string table.
9198 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9199 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9200 (Incremental_inputs::create_data_sections): New function.
9201 (Incremental_inputs::relocs_entsize): New function.
9202 (Output_section_incremental_inputs::set_final_data_size): New function.
9203 (Output_section_incremental_inputs::do_write): New function.
9204 (Output_section_incremental_inputs::write_header): New function.
9205 (Output_section_incremental_inputs::write_input_files): New function.
9206 (Output_section_incremental_inputs::write_info_blocks): New function.
9207 (Output_section_incremental_inputs::write_symtab): New function.
9208 * incremental.h (Incremental_script_entry): Forward declaration.
9209 (Incremental_object_entry): Forward declaration.
9210 (Incremental_archive_entry): Forward declaration.
9211 (Incremental_inputs): Forward declaration.
9212 (Incremental_inputs_header_data): Remove.
9213 (Incremental_inputs_header): Remove.
9214 (Incremental_inputs_header_write): Remove.
9215 (Incremental_inputs_entry_data): Remove.
9216 (Incremental_inputs_entry): Remove.
9217 (Incremental_inputs_entry_write): Remove.
9218 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9219 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9220 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9221 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9222 Likewise.
9223 (Incremental_input_entry): New class.
9224 (Incremental_script_entry): New class.
9225 (Incremental_object_entry): New class.
9226 (Incremental_archive_entry): New class.
9227 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9228 (Incremental_inputs::report_inputs): Remove.
9229 (Incremental_inputs::report_archive): Remove.
9230 (Incremental_inputs::report_archive_begin): New function.
9231 (Incremental_inputs::report_archive_end): New function.
9232 (Incremental_inputs::report_object): Change prototype.
9233 (Incremental_inputs::report_input_section): New function.
9234 (Incremental_inputs::report_script): Change prototype.
9235 (Incremental_inputs::get_reloc_count): New function.
9236 (Incremental_inputs::set_reloc_count): New function.
9237 (Incremental_inputs::create_data_sections): New function.
9238 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9239 (Incremental_inputs::inputs_section): New function.
9240 (Incremental_inputs::symtab_section): New function.
9241 (Incremental_inputs::relocs_section): New function.
9242 (Incremental_inputs::get_stringpool): Add const.
9243 (Incremental_inputs::command_line): Add const.
9244 (Incremental_inputs::inputs): Remove.
9245 (Incremental_inputs::command_line_key): New function.
9246 (Incremental_inputs::input_file_count): New function.
9247 (Incremental_inputs::input_files): New function.
9248 (Incremental_inputs::relocs_entsize): New function.
9249 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9250 (Incremental_inputs::finalize_inputs): Remove.
9251 (Incremental_inputs::Input_info): Remove.
9252 (Incremental_inputs::lock_): Remove.
9253 (Incremental_inputs::inputs_): Change type.
9254 (Incremental_inputs::inputs_map_): Remove.
9255 (Incremental_inputs::current_object_entry_): New data member.
9256 (Incremental_inputs::inputs_section_): New data member.
9257 (Incremental_inputs::symtab_section_): New data member.
9258 (Incremental_inputs::relocs_section_): New data member.
9259 (Incremental_inputs::reloc_count_): New data member.
9260 (Incremental_inputs_reader): New class.
9261 (Incremental_symtab_reader): New class.
9262 (Incremental_relocs_reader): New class.
9263 * layout.cc (Layout::finalize): Move finalization of incremental info
9264 and creation of incremental info sections to follow finalization of
9265 symbol table. Set offsets for postprocessing sections.
9266 (Layout::create_incremental_info_sections): Call
9267 Incremental_inputs::create_data_sections. Add incremental symtab
9268 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9269 sections to layout after input sections.
9270 * layout.h (struct Timespec): Forward declaration.
9271 (Layout::incremental_inputs): Add const.
9272 (Layout::create_incremental_info_sections): Add parameter.
9273 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9274 * object.cc: Include incremental.h.
9275 (Relobj::finalize_incremental_relocs): New function.
9276 (Sized_relobj::do_layout): Record input sections in incremental info.
9277 * object.h (Object::output_section): New function.
9278 (Object::output_section_offset): Moved from Relobj.
9279 (Object::get_incremental_reloc_base): New function.
9280 (Object::get_incremental_reloc_count): New function.
9281 (Object::do_output_section): New function.
9282 (Object::do_output_section_offset): Moved from Relobj.
9283 (Object::do_get_incremental_reloc_base): New function.
9284 (Object::do_get_incremental_reloc_count): New function.
9285 (Object::Object): Initialize new data members.
9286 (Relobj::output_section): Renamed do_output_section and moved to
9287 protected.
9288 (Relobj::output_section_offset): Moved to Object.
9289 (Relobj::do_get_incremental_reloc_base): New function.
9290 (Relobj::do_get_incremental_reloc_count): New function.
9291 (Relobj::allocate_incremental_reloc_counts): New function.
9292 (Relobj::count_incremental_reloc): New function.
9293 (Relobj::finalize_incremental_relocs): New function.
9294 (Relobj::next_incremental_reloc_index): New function.
9295 (Relobj::reloc_counts_): New data member.
9296 (Relobj::reloc_bases_): New data member.
9297 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9298 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9299 (Sized_relobj::incremental_relocs_scan): New function.
9300 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9301 (Sized_relobj::incremental_relocs_write): New function.
9302 (Sized_relobj::incremental_relocs_write_reltype): New function.
9303 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9304 incremental link.
9305 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9306 archives and object files elsewhere.
9307 (Add_symbols::run): Report object files here.
9308 (Finish_group::run): Report end of archive at end of group.
9309 * reloc.cc: Include layout.h, incremental.h.
9310 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9311 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9312 (Sized_relobj::incremental_relocs_scan): New function.
9313 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9314 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9315 (Sized_relobj::incremental_relocs_write): New function.
9316 (Sized_relobj::incremental_relocs_write_reltype): New function.
9317 * script.cc (read_input_script): Rewrite test for incremental link.
9318 Change call to Incremental_inputs::report_script.
9319 * symtab.h (Symbol_table::first_global_index): New function.
9320 (Symbol_table::output_count): New function.
9321
ce0d1972
DK
93222010-08-12 Doug Kwan <dougkwan@google.com>
9323
9324 * arm.cc (Target_arm::merge_object_attributes): Check command line
9325 options --no-wchar-size-warning and --no-enum-size-warning.
9326 * options.h (General_options): Add ld-compatible options
9327 --no-enum-size-warning and --no-wchar-size-warning.
9328
6e5710ce
ILT
93292010-08-04 Ian Lance Taylor <iant@google.com>
9330
9331 * x86_64.cc (Target_x86_64::Scan::local): Use
9332 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9333 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9334 (Target_x86_64::Scan::global): Likewise.
9335 (Target_x86_64::Relocate::relocate): Likewise.
9336 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9337 Likewise.
9338
fef830db
CC
93392010-08-03 Cary Coutant <ccoutant@google.com>
9340
9341 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9342 to reserve space in merged_strings vector. Keep total input size
9343 for stats.
9344 (Output_merge_string::do_print_merge_stats): Print total input size.
9345 * merge.h (Output_merge_string): Add input_size_ field.
9346 * stringpool.cc (Stringpool_template::string_length): Move
9347 implementations out of Stringpool_template class and place in
9348 stringpool.h.
9349 * stringpool.h (string_length): Move out of Stringpool_template.
9350
1e3811b0
ILT
93512010-08-03 Ian Lance Taylor <iant@google.com>
9352
9353 PR 11712
9354 * layout.cc (relaxation_loop_body): If address of load segment is
9355 set, adjust address to include headers if possible.
9356
7af0c620
ILT
93572010-08-03 Ian Lance Taylor <iant@google.com>
9358
9359 * version.cc (version_string): Bump to 1.10.
9360
22f0da72
ILT
93612010-08-03 Ian Lance Taylor <iant@google.com>
9362
9363 PR 11805
9364 * layout.h (enum Output_section_order): Define.
9365 (class Layout): Update declarations.
9366 * layout.cc (Layout::get_output_section): Add order parameter.
9367 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9368 is_first_non_relro parameters. Change all callers.
9369 (Layout::choose_output_section): Likewise.
9370 (Layout::add_output_section_data): Likewise.
9371 (Layout::make_output_section): Likewise. Set order.
9372 (Layout::default_section_order): New function.
9373 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9374 * output.cc (Output_section::Output_section): Initialize order_.
9375 Don't initialize deleted fields.
9376 (Output_segment::Output_segment): Don't initialize deleted
9377 fields.
9378 (Output_segment::add_output_section_to_load): New function
9379 replacing add_output_section. Change all callers to call this or
9380 add_output_section_to_nonload.
9381 (Output_segment::add_output_section_to_nonload): New function.
9382 (Output_segment::remove_output_section): Rewrite.
9383 (Output_segment::add_initial_output_data): Likewise.
9384 (Output_segment::has_any_data_sections): Likewise.
9385 (Output_segment::is_first_section_relro): Likewise.
9386 (Output_segment::maximum_alignment): Likewise.
9387 (Output_segment::has_dynamic_reloc): New function replacing
9388 dynamic_reloc_count. Change all callers.
9389 (Output_segment::has_dynamic_reloc_list): New function replacing
9390 dynamic_reloc_count_list. Change all callers.
9391 (Output_segment::set_section_addresses): Rewrite.
9392 (Output_segment::set_offset): Rewrite.
9393 (Output_segment::find_first_and_last_list): Remove.
9394 (Output_segment::set_tls_offsets): Rewrite.
9395 (Output_segment::first_section_load_address): Likewise.
9396 (Output_segment::output_section_count): Likewise.
9397 (Output_segment::section_with_lowest_load_address): Likewise.
9398 (Output_segment::write_section_headers): Likewise.
9399 (Output_segment::print_sections_to_map): Likewise.
9400 * output.h (class Output_data): Remove dynamic_reloc_count_
9401 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9402 (Output_data::add_dynamic_reloc): Rewrite.
9403 (Output_data::has_dynamic_reloc): New function.
9404 (Output_data::dynamic_reloc_count): Remove.
9405 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9406 is_last_relro_, is_first_non_relro_, is_interp_,
9407 is_dynamic_linker_section_ fields. Add order and set_order
9408 functions. Remove is_relro_local, set_is_relro_local,
9409 is_last_relro, set_is_last_relro, is_first_non_relro,
9410 set_is_first_non_relro functions, is_interp, set_is_interp,
9411 is_dynamic_linker_section, and set_is_dynamic_linker_section
9412 functions.
9413 (class Output_segment): Change Output_data_list from std::list to
9414 std:;vector. Add output_lists_ field. Remove output_data_ and
9415 output_bss_ fields. Update declarations.
9416
3ff2ccb0
ILT
94172010-08-02 Ian Lance Taylor <iant@google.com>
9418
9419 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9420 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9421 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9422
88a4108b
ILT
94232010-08-02 Ian Lance Taylor <iant@google.com>
9424
9425 PR 11855
9426 * script.cc (Script_options::Script_options): Initialize
9427 symbol_definitions_ and symbol_references_.
9428 (Script_options::add_symbol_assignment): Update
9429 symbol_definitions_ and symbol_references_.
9430 (Script_options::add_symbol_reference): New function.
9431 (script_symbol): New function.
9432 * script.h (class Script_options): Add symbol_definitions_ and
9433 symbol_references_ fields.
9434 (Script_options::referenced_const_iterator): New type.
9435 (Script_options::referenced_begin): New function.
9436 (Script_options::referenced_end): New function.
9437 (Script_options::is_referenced): New function.
9438 (Script_options::any_unreferenced): New function.
9439 * script-c.h (script_symbol): Declare.
9440 * yyscript.y (exp): Call script_symbol.
9441 * symtab.cc: Include "script.h".
9442 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9443 Change all callers. Check symbols referenced by scripts.
9444 (Symbol_table::add_undefined_symbols_from_command_line): Add
9445 layout parameter. Change all callers.
9446 (Symbol_table::do_add_undefined_symbols_from_command_line):
9447 Likewise. Break out loop body. Check symbols referenced by
9448 scripts.
9449 (Symbol_table::add_undefined_symbol_from_command_line): New
9450 function broken out of
9451 do_add_undefined_symbols_from_command_line.
9452 * symtab.h (class Symbol_table): Update declarations.
9453 * archive.cc: Include "layout.h".
9454 (Archive::should_include_member): Add layout parameter. Change
9455 all callers. Check for symbol mentioned in expression.
9456 * archive.h (class Archive): Update declaration.
9457 * object.cc (Sized_relobj::do_should_include_member): Add layout
9458 parameter.
9459 * object.h (Object::should_include_member): Add layout parameter.
9460 Change all callers.
9461 (Object::do_should_include_member): Add layout parameter.
9462 (class Sized_relobj): Update declaration.
9463 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9464 parameter.
9465 * dynobj.h (class Sized_dynobj): Update declaration.
9466 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9467 layout parameter.
9468 * plugin.h (class Sized_pluginobj): Update declaration.
9469
5f1ab67a
ILT
94702010-08-02 Ian Lance Taylor <iant@google.com>
9471
9472 PR 11866
9473 * output.cc (Output_segment::set_offset): Search for the first and
9474 last sections rather than assuming that the list is in order.
9475 (Output_segment::find_first_and_last_list): New function.
9476 * output.h (class Output_segment): Update declarations.
9477 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9478 (relro_strip_test_SOURCES): New variable.
9479 (relro_strip_test_DEPENDENCIES): New variable.
9480 (relro_strip_test_LDFLAGS): New variable.
9481 (relro_strip_test_LDADD): New variable.
9482 (relro_strip_test.so): New target.
9483
a8df5856
ILT
94842010-08-02 Ian Lance Taylor <iant@google.com>
9485
9486 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9487 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9488 (Target_i386::got_tlsdesc_section): New function.
9489 (Target_i386::got_section): Create space for GOT entries for
9490 TLSDESC relocations.
9491 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9492 R_386_TLS_GOTDESC.
9493 (Target_i386::Scan::global): Likewise.
9494 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9495 using TLSDESC GOT.
9496 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9497 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9498 (Target_x86_64::got_tlsdesc_section): New function.
9499 (Target_x86_64::got_section): Create space for GOT entries for
9500 TLSDESC relocations.
9501 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9502 R_386_TLS_GOTDESC.
9503 (Target_x86_64::Scan::global): Likewise.
9504 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9505 using TLSDESC GOT.
9506
0c10a0a6
ILT
95072010-08-02 Ian Lance Taylor <iant@google.com>
9508
9509 * testsuite/final_layout.sh: Use dc to convert from hex to
9510 decimal.
9511
41cbeecc
ST
95122010-07-29 Sriraman Tallam <tmsriram@google.com>
9513
9514 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9515 paramter to the call to gold::gc_process_relocs.
9516 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9517 paramter to the call to gold::gc_process_relocs.
9518 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9519 parameter to the call to gold::gc_process_relocs.
9520 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9521 template parameter to the call to gold::gc_process_relocs.
9522 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9523 paramter to the call to gold::gc_process_relocs.
9524 * gc.h (get_embedded_addend_size): New function.
9525 (gc_process_relocs): Save the size of the reloc for use by ICF.
9526 * icf.cc (get_section_contents): Get the addend from the text section
9527 for SHT_REL relocation sections.
9528 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9529 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9530 * int_encoding.h (read_from_pointer): New overloaded function.
9531 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9532 * testsuite/icf_sht_rel_addend_test.sh: New file.
9533 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9534 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9535
6ea55b82
RW
95362010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9537
9538 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9539 * Makefile.in: Regenerate.
9540 * testsuite/Makefile.in: Regenerate.
9541
9691462b
ILT
95422010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9543
9544 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9545 * gold/testsuite/debug_msg.cc: Likewise.
9546 * gold/testsuite/odr_violation1.cc
9547 * gold/testsuite/odr_violation2.cc
9548
76897331
CC
95492010-07-21 Cary Coutant <ccoutant@google.com>
9550
9551 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9552 string, and length fields.
9553 (Output_merge_string::Merged_strings_list): New type.
9554 (Output_merge_string::Merged_strings_lists): New typedef.
9555 (Output_merge_string): Replace merged_strings_ with
9556 merged_strings_lists_.
9557 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9558 Merged_strings_list per input object and section. Don't store pointer
9559 to the string. Don't store length with each merged string entry.
9560 (Output_merge_string::finalize_merged_data): Loop over list of merged
9561 strings lists. Recompute length of each merged string.
9562
78384e8f
CC
95632010-07-15 Cary Coutant <ccoutant@google.com>
9564
9565 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9566 here.
9567
783659f9
ILT
95682010-07-14 Ian Lance Taylor <iant@google.com>
9569
9570 * descriptors.cc (Descriptors::open): Report correct name in error
9571 message.
9572
131687b4
DK
95732010-07-13 Doug Kwan <dougkwan@google.com>
9574
9575 * arm.cc (Arm_input_section::Arm_input_section): For a
9576 SHT_ARM_EXIDX section, always keeps the input sections.
9577 (Arm_input_section::set_exidx_section_link): New method.
9578 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9579 has_errors_ to false.
9580 (Arm_exidx_input_section::has_errors,
9581 Arm_exidx_input_section::set_has_errors): New methods.
9582 (Arm_exidx_input_section::has_errors_): New data member.
9583 (Arm_relobj::get_exidx_shndx_list): New method.
9584 (Arm_output_section::append_text_sections_to_list): Do not skip
9585 section without SHF_EXECINSTR.
9586 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9587 errors.
2e702c99 9588 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9589 section header. Make error messages more verbose. Check for
9590 a non-executable section linked to an EXIDX section.
9591 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9592 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9593 check that there is no deferred EXIDX section if we exit early.
9594 Instead of not making an EXIDX section in case of an error, make one
9595 and set the has_errors flag of it.
9596 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9597 in a relocatable link.
9598 (Target_arm::do_relax): Look for the EXIDX output section instead of
9599 assuming that it is called .ARM.exidx.
2e702c99 9600 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9601 section list. Do not check for SHF_EXECINSTR section flags but
9602 skip any input section with errors.
9603 * output.cc (Output_section::Output_section): Initialize
9604 always_keeps_input_sections_ to false.
9605 (Output_section::add_input_section): Check for
9606 always_keeps_input_sections_.
9607 * output.h (Output_section::always_keeps_input_sections,
9608 Output_section::set_always_keeps_input_sections): New methods.
9609 (Output_section::always_keeps_input_sections): New data member.
9610
69517287
RÁE
96112010-07-13 Rafael Espindola <espindola@google.com>
9612
9613 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9614 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9615
82742395
ILT
96162010-07-13 Philip Herron <herron.philip@googlemail.com>
9617 Ian Lance Taylor <iant@google.com>
9618
9619 * output.h (Output_section_lookup_maps::add_merge_section):
9620 Correct check of whether value was inserted.
9621 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9622 (Output_section_lookup_maps::add_relaxed_input_section):
9623 Likewise.
9624 * arm.cc (Target_arm::got_section): Remove used local os.
9625 * i386.cc (Target_i386::got_section): Likewise.
9626 * x86_64.cc (Target_x86_64::got_section): Likewise.
9627 * sparc.cc (Target_sparc::got_section): Likewise.
9628 (Target_sparc::relocate): Remove unused local have_got_offset.
9629 * powerpc.cc (Target_powerpc::relocate): Likewise.
9630
f2d707b5
ILT
96312010-07-13 Ian Lance Taylor <iant@google.com>
9632
241531d6
ILT
9633 * compressed_output.cc (zlib_decompress): Fix signature in
9634 !HAVE_ZLIB_H case.
9635
f2d707b5
ILT
9636 * archive.cc (Archive::include_member): Unlock an external member
9637 of a thin archive. Don't bother to delete an object we know is
9638 NULL.
9639
a2e47362
CC
96402010-07-12 Cary Coutant <ccoutant@google.com>
9641
9642 * compressed_output.cc (zlib_decompress): New function.
9643 (get_uncompressed_size): New function.
9644 (decompress_input_section): New function.
9645 * compressed_output.h (get_uncompressed_size): New function.
9646 (decompress_input_section): New function.
9647 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9648 Handle compressed debug sections.
9649 * layout.cc (is_compressed_debug_section): New function.
9650 (Layout::output_section_name): Map compressed section names to
9651 canonical names.
9652 * layout.h (is_compressed_debug_section): New function.
9653 (is_debug_info_section): Recognize compressed debug sections.
9654 * merge.cc: Include compressed_output.h.
9655 (Output_merge_data::do_add_input_section): Handle compressed
9656 debug sections.
9657 (Output_merge_string::do_add_input_section): Handle compressed
9658 debug sections.
9659 * object.cc: Include compressed_output.h.
9660 (Sized_relobj::Sized_relobj): Initialize new data members.
9661 (build_compressed_section_map): New function.
9662 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9663 * object.h (Object::section_is_compressed): New method.
9664 (Object::do_section_is_compressed): New method.
9665 (Sized_relobj::Compressed_section_map): New type.
9666 (Sized_relobj::do_section_is_compressed): New method.
9667 (Sized_relobj::compressed_sections_): New data member.
9668 * output.cc (Output_section::add_input_section): Handle compressed
9669 debug sections.
9670 * reloc.cc: Include compressed_output.h.
9671 (Sized_relobj::write_sections): Handle compressed debug sections.
9672
ce279a62
CC
96732010-07-08 Cary Coutant <ccoutant@google.com>
9674
9675 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9676 weak when resolving to a dynamic def.
9677 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9678 for weak undef/dynamic def cases. Adjust callers.
9679 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9680 undef_binding_weak_.
9681 (Symbol_table::sized_write_globals): Adjust symbol binding.
9682 (Symbol_table::sized_write_symbol): Add binding parameter.
9683 * symtab.h (Symbol::set_undef_binding): New method.
9684 (Symbol::is_undef_binding_weak): New method.
9685 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9686 (Symbol_table::should_override): Add new parameter.
9687 (Symbol_table::sized_write_symbol): Add new parameter.
9688
9689 * testsuite/weak_undef_file1.cc: Add new test case.
9690 * testsuite/weak_undef_file2.cc: Fix header comment.
9691 * testsuite/weak_undef_test.cc: Add new test case.
9692
b2286c10
DK
96932010-06-29 Doug Kwan <dougkwan@google.com>
9694
9695 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9696 Initialize USE_SYMBOL_.
9697 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9698 definition.
9699 (Arm_reloc_property::uses_symbol_): New data member declaration.
9700 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9701 uses symbol value and symbol is undefined but not weakly undefined.
9702
4802450a
RÁE
97032010-06-28 Rafael Espindola <espindola@google.com>
9704
9705 * plugin.cc (Plugin::load): Use dlerror.
9706
e5ca47ba
ILT
97072010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9708
9709 * symtab.cc (detect_odr_violations): When reporting an ODR
9710 violation, report an object where the symbol is defined.
9711
8a75a161
DK
97122010-06-25 Doug Kwan <dougkwan@google.com>
9713
9714 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9715 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9716 definition.
9717 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9718 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9719 target hook to detect function points.
9720 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9721 * icf.h (Icf::check_section_for_function_pointers): Change type of
9722 parameter SECTION_NAME to const reference to std::string. Use
9723 target hook to determine if section may have unsafe pointers.
9724 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9725 method definition.
9726
42218b9f
RÁE
97272010-06-21 Rafael Espindola <espindola@google.com>
9728
9729 * fileread.cc (Input_file::find_fie): New
9730 (Input_file::open): Use Input_file::find_fie.
9731 * fileread.h (Input_file::find_fie): New
9732 * plugin.cc (set_extra_library_path): New.
9733 (Plugin::load): Add set_extra_library_path to the transfer vector.
9734 (Plugin_manager::set_extra_library_path): New.
9735 (Plugin_manager::add_input_file): Use the extra search path if set.
9736 (set_extra_library_path(): New.
9737 * plugin.h (Plugin_manager): Add set_extra_library_path and
9738 extra_search_path_.
9739
a0506cca
CC
97402010-06-19 Cary Coutant <ccoutant@google.com>
9741
9742 * layout.cc (gdb_sections): Add .debug_types.
9743 (lines_only_debug_sections): Likewise.
9744
6508b958
RÁE
97452010-06-18 Rafael Espindola <espindola@google.com>
9746
9747 * plugin.cc (add_input_file,add_input_library)
9748 (Plugin_manager::add_input_file): Make filename arguments const.
9749 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9750 const.
9751
3e235302
DK
97522010-06-16 Doug Kwan <dougkwan@google.com>
9753
9754 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9755 .ARM.attributes section if we have not merged any input
9756 attributes sections.
9757
106e8a6c
DK
97582010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9759
9760 * arm.cc: Allow combining objects with no EABI version
9761 information.
9762
91ff43fe
RÁE
97632010-06-15 Rafael Espindola <espindola@google.com>
9764
9765 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9766
68ed838c
ILT
97672010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9768
9769 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9770 (struct iovec): Correct !HAVE_READV definition.
9771
f3a2388f
CC
97722010-06-10 Cary Coutant <ccoutant@google.com>
9773
9774 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9775 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9776 reloc sections.
9777 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9778
9779 PR 11683
9780 * symtab.h (Symbol::is_placeholder): New member function.
9781 * target-reloc.h (relocate_section): Check for placeholder symbols.
9782
9783 * testsuite/Makefile.am (plugin_test_8): New test.
9784 (plugin_test_9): New test.
9785 * testsuite/Makefile.in: Regenerate.
9786
e1df38aa
NC
97872010-06-09 Nick Clifton <nickc@redhat.com>
9788
9789 * yyscript.y (input_list_element): Allow strings prefixed with
9790 the '-' character. Treat these as libraries.
9791 * script.cc (script_add_library): New function. Adds a library
9792 specified by "-l<name>" found in an input script.
9793 * script-c.h: Add prototype for script_add_library.
9794
25bbe950
DK
97952010-06-07 Doug Kwan <dougkwan@google.com>
9796
9797 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9798 Restrict stub-group size to be within long conditional branch
9799 range when working around cortex-A8 erratum.
9800
0f32ea4c
ILT
98012010-06-07 Damien Diederen <dd@crosstwine.com>
9802
9803 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9804 #ifdef typo.
9805
8fe2a369
ST
98062010-06-03 Sriraman Tallam <tmsriram@google.com>
9807
9808 PR gold/11658
9809 * output.cc
9810 (Output_section::Input_section_sort_entry::compare_section_ordering):
9811 Change to return non-zero correctly.
9812 (Output_section::Input_section_sort_section_order_index_compare
9813 ::operator()): Change to fix ambiguity in comparisons.
9814
6e9ba2ca
ST
98152010-06-01 Sriraman Tallam <tmsriram@google.com>
9816
9817 * gold.h (is_wildcard_string): New function.
9818 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9819 (Layout::layout_eh_frame): Ditto.
9820 (Layout::find_section_order_index): New method.
9821 (Layout::read_layout_from_file): New method.
9822 * layout.h (Layout::find_section_order_index): New method.
9823 (Layout::read_layout_from_file): New method.
9824 (Layout::input_section_position_): New private member.
9825 (Layout::input_section_glob_): New private member.
9826 * main.cc (main): Call read_layout_from_file here.
9827 * options.h (--section-ordering-file): New option.
9828 * output.cc (Output_section::input_section_order_specified_): New
9829 member.
9830 (Output_section::Output_section): Initialize new member.
9831 (Output_section::add_input_section): Add new parameter.
9832 Keep input sections when --section-ordering-file is used.
9833 (Output_section::set_final_data_size): Sort input sections when
9834 section ordering file is specified.
9835 (Output_section::Input_section_sort_entry): Add new parameter.
9836 Check sorting type.
9837 (Output_section::Input_section_sort_entry::compare_section_ordering):
9838 New method.
9839 (Output_section::Input_section_sort_compare::operator()): Change to
9840 consider section_order_index.
9841 (Output_section::Input_section_sort_init_fini_compare::operator()):
9842 Change to consider section_order_index.
9843 (Output_section::Input_section_sort_section_order_index_compare
9844 ::operator()): New method.
9845 (Output_section::sort_attached_input_sections): Change to sort
9846 according to section order when specified.
e1df38aa
NC
9847 (Output_section::add_input_section<32, true>): Add new parameter.
9848 (Output_section::add_input_section<64, true>): Add new parameter.
9849 (Output_section::add_input_section<32, false>): Add new parameter.
9850 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9851 * output.h (Output_section::add_input_section): Add new parameter.
9852 (Output_section::input_section_order_specified): New
9853 method.
9854 (Output_section::set_input_section_order_specified): New method.
9855 (Input_section::Input_section): Initialize section_order_index_.
9856 (Input_section::section_order_index): New method.
9857 (Input_section::set_section_order_index): New method.
9858 (Input_section::section_order_index_): New member.
9859 (Input_section::Input_section_sort_section_order_index_compare): New
9860 struct.
9861 (Output_section::input_section_order_specified_): New member.
9862 * script-sections.cc (is_wildcard_string): Delete and move modified
9863 method to gold.h.
9864 (Output_section_element_input::Output_section_element_input): Modify
9865 call to is_wildcard_string.
9866 (Output_section_element_input::Input_section_pattern
9867 ::Input_section_pattern): Ditto.
9868 (Output_section_element_input::Output_section_element_input): Ditto.
9869 * testsuite/Makefile.am (final_layout): New test case.
9870 * testsuite/Makefile.in: Regenerate.
9871 * testsuite/final_layout.cc: New file.
9872 * testsuite/final_layout.sh: New file.
9873
3537c84b
RÁE
98742010-06-01 Rafael Espindola <espindola@google.com>
9875
9876 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9877
105b6afd
RÁE
98782010-06-01 Rafael Espindola <espindola@google.com>
9879
9880 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9881 visibility of symbols.
9882
29e11421
DK
98832010-05-27 Doug Kwan <dougkwan@google.com>
9884
9885 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9886 from start of output section instead of address for a local symbol
9887 in a merged or relaxed section when doing a relocatable link.
9888
5e0f337e
RÁE
98892010-05-26 Rafael Espindola <espindola@google.com>
9890
703d02da 9891 PR 11604
5e0f337e
RÁE
9892 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9893 adding sections the garbage collector removed.
9894 * gold/testsuite/Makefile.am: Add test.
9895 * gold/testsuite/Makefile.in: Regenerate.
9896 * gold/testsuite/plugin_test_7.sh: New.
9897 * gold/testsuite/plugin_test_7_1.c: New.
9898 * gold/testsuite/plugin_test_7_2.c: New.
9899
f4187277
RÁE
99002010-05-26 Rafael Espindola <espindola@google.com>
9901
9902 * script-sections.cc (Output_section_definition::set_section_addresses):
9903 Check for --section-start.
9904
5c388529
DK
99052010-05-26 Doug Kwan <dougkwan@google.com>
9906
9907 * arm.cc (Arm_scan_relocatable_relocs): New class.
9908 (Target_arm::relocate_special_relocatable): New method.
9909 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9910 (Arm_relocate_functions::thumb_branch_common): Same.
9911 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9912 instead of Default_scan_relocatable_relocs.
9913 * target-reloc.h (relocate_for_relocatable): Let target handle
9914 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9915 * target.h (Sized_target::relocate_special_relocatable): New method.
9916
bca1c3ae
ILT
99172010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9918
9919 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9920
0439c796
DK
99212010-05-23 Doug Kwan <dougkwan@google.com>
9922
9923 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9924 instead of a cast.
9925 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9926 with a direct branch, not a conditional branch, to a stub.
9927 * merge.cc (Output_merge_base::record_input_section): New method
9928 defintion.
9929 (Output_merge_data::do_add_input_section): Record input section if
9930 keeps-input-sections flag is set.
9931 (Output_merge_string::do_add_input_section): Ditto.
9932 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9933 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9934 INPUT_SECTIONS_.
9935 (Output_merge_base::keeps_input_sections,
9936 Output_merge_base::set_keeps_input_sections,
9937 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9938 method definitions.
9939 (Output_merge_base::Input_sections): New type declaration.
9940 (Output_merge_base::input_sections_begin,
9941 Output_merge_base::input_sections_end,
9942 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9943 (Output_merge_base::bool keeps_input_sections_,
9944 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9945 Output_merge_base::input_sections_): New data members.
9946 (Output_merge_data::do_set_keeps_input_sections): New method
9947 defintion.
9948 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9949 * output.cc (Output_section::Input_section::relobj): Move method
9950 defintion from class declaration to here and handle merge sections.
9951 (Output_section::Input_section::shndx): Ditto.
9952 (Output_section::Output_section): Remove initializations of removed
9953 data members and initialize new data member LOOKUP_MAPS_.
9954 (Output_section::add_input_section): Set keeps-input-sections flag
9955 for a newly created merge output section as appropriate. Adjust code
9956 to use Output_section_lookup_maps class.
9957 (Output_section::add_relaxed_input_section): Adjst code for lookup
9958 maps code refactoring.
2e702c99 9959 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9960 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9961 class. If adding input section to a newly created merge output
9962 section fails, remove the new merge section.
9963 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9964 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9965 (Output_section::find_merge_section): Ditto.
0439c796 9966 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9967 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9968 Output_section_lookup_maps class.
9969 (Output_section::get_input_sections): Export merge sections. Adjust
9970 code to use Output_section_lookup_maps class.
9971 (Output_section:::add_script_input_section): Adjust code to use
9972 Output_section_lookup_maps class. Update lookup maps for merge
9973 sections also.
9974 (Output_section::discard_states): Use Output_section_lookup_maps.
9975 (Output_section::restore_states): Same.
9976 * output.h (Merge_section_properties): Move class defintion out of
9977 Output_section.
9978 (Output_section_lookup_maps): New class.
9979 (Output_section::Input_section::is_merge_section): New method
9980 defintion.
9981 (Output_section::Input_section::relobj): Move defintion out of class
9982 defintion. Declare method only.
9983 (Output_section::Input_section::shndx): Ditto.
9984 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9985 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9986 (Output_section::Merge_section_by_properties_map,
9987 Output_section::Output_section_data_by_input_section_map,
9988 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9989 Remove types.
2e702c99 9990 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9991 KEEPS_INPUT_SECTIONS.
9992 (Output_section::build_lookup_maps): New method declaration.
9993 (Output_section::merge_section_map_,
9994 Output_section::merge_section_by_properties_map_,
9995 Output_section::relaxed_input_section_map_,
9996 Output_section::is_relaxed_input_section_map_valid_): Remove data
9997 members.
9998 (Output_section::lookup_maps_): New data member.
9999
76295588
L
100002010-05-21 Doug Kwan <dougkwan@google.com>
10001
10002 PR gold/11619
10003 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10004 avoid a compilation error.
10005
d103a984
RÁE
100062010-05-19 Rafael Espindola <espindola@google.com>
10007
10008 * script-sections.cc (Output_section_definition::allocate_to_segment):
10009 Update the phdrs_list even when the output section is NULL.
10010 * testsuite/Makefile.am: Add test.
10011 * testsuite/Makefile.in: Regenerate.
10012 * testsuite/script_test_9.cc: New.
10013 * testsuite/script_test_9.sh: New.
10014 * testsuite/script_test_9.t: New.
10015
6625d24e
DK
100162010-05-19 Doug Kwan <dougkwan@google.com>
10017
10018 * arm.cc (Arm_input_section::original_size): New method.
10019 (Arm_input_section::do_addralign): Add a cast.
10020 (Arm_input_section::do_output_offset): Remove static cast.
10021 (Arm_input_section::original_addralign,
10022 Arm_input_section::original_size_): Change type to uint32_t.
10023 (Arm_input_section::init): Add safe casts for section alignment
10024 and size.
10025 (Arm_input_section::set_final_data_size): Do not set address and
10026 offset of stub table.
10027 (Arm_output_section::fix_exidx_coverage): Change use of of
10028 Output_section::Simple_input_section to that of
10029 Output_section::Input_section.
10030 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10031 except for the first pass.
10032 * output.cc (Output_section::get_input_sections): Change type of
10033 input_sections to std::list<Input_section>.
10034 (Output_section::add_script_input_section): Rename from
10035 Output_section::add_simple_input_section. Change type of SIS
10036 parameter from Simple_input_section to Input_section.
10037 * output.h (Output_section::Simple_input_section): Remove class.
10038 (Output_section::Input_section): Change class visibility to public.
10039 (Output_section::Input_section::addralign): Use stored alignments
10040 for special input sections if set.
10041 (Output_section::Input_section::set_addralign): New method.
10042 (Output_section::get_input_sections): Change parameter type from
10043 list of Simple_input_section to list of Input_section.
10044 (Output_section::add_script_input_section): Rename from
10045 Output_section::add_simple_input_section. Change first parameter's
10046 type from Simple_input_section to Input_section and remove the
10047 second and third parameters.
10048 * script-sections.cc (Input_section::Input_section_list): Change
10049 type to list of Output_section::Input_section/
10050 (Input_section_info::Input_section_info): Change parameter type of
10051 INPUT_SECTION to Output_section::Input_section.
10052 (Input_section_info::input_section): Change return type.
10053 (Input_section_info::input_section_): Change type to
10054 Output_section::Input_section.
10055 (Output_section_element_input::set_section_addresses): Adjust code
10056 to use Output_section::Input_section instead of
10057 Output_section::Simple_input_section. Adjust code for renaming
10058 of Output_section::add_simple_input_section.
10059 (Orphan_output_section::set_section_addresses): Ditto.
10060
e1e82ea4
RW
100612010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10062
10063 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10064 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10065
91e75c8a
RÁE
100662010-05-18 Rafael Espindola <espindola@google.com>
10067
10068 * options.cc (General_options::finalize): Handle -nostdlib.
10069 * options.h (nostdlib): New option.
10070 * script.cc (script_add_search_dir): Handle -nostdlib.
10071
da59ad79
DK
100722010-05-12 Doug Kwan <dougkwan@google.com>
10073
10074 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10075 attributes section only if there no attributes section after merging.
10076 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10077 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10078 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10079 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10080 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10081 and arm_attr_merge_7.stdout.
10082 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10083 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10084 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10085 arm_attr_merge_7b.o): New rules.
10086 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10087 arm_attr_merge_7
10088 * testsuite/Makefile.in: Regenerate.
10089 * testsuite/arm_attr_merge.sh: New file.
10090 * testsuite/arm_attr_merge_[67][ab].s: Same.
10091
3e01a7fd
NC
100922010-05-05 Nick Clifton <nickc@redhat.com>
10093
10094 * po/es.po: Updated Spanish translation.
10095
7ad2014a
L
100962010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10097
10098 * Makefile.am (install-exec-local): Properly install gold as
10099 default cross linker.
10100 * Makefile.in: Regenerated.
10101
4fda8867
NC
101022010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10103 Nick Clifton <nickc@redhat.com>
10104
10105 * configure.ac (install_as_default): Define and set to false
10106 unless --enable-gold or --enable-gold=both/gold has been
10107 specified.
10108 * configure: Regenerate.
10109
10110 * Makefile.am (install-exec-local): Install the executable as
10111 'ld.gold'. If install_as_default is true then also install it as
10112 'ld'.
10113 * Makefile.in: Regenerated.
10114
bd288ea2
ILT
101152010-04-24 Ian Lance Taylor <iant@google.com>
10116
10117 * layout.cc (Layout::layout_reloc): In relocatable link don't
10118 combine reloc sections for grouped sections.
10119
ef38fd8a
ST
101202010-04-23 Sriraman Tallam <tmsriram@google.com>
10121
10122 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10123 sections that are not ordinary to icf.
10124 * icf.cc (get_section_contents): Handle relocation pointing to section
10125 with no object or shndx information.
10126 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10127 * testsuite/Makefile.in: Regenerate.
10128 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10129 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10130
f6973bdc
ILT
101312010-04-22 Ian Lance Taylor <iant@google.com>
10132
10133 * expression.cc (Expression::Expression_eval_info): Add
10134 result_alignment_pointer field.
10135 (Expression::eval_with_dot): Add result_alignment_pointer
10136 parameter. Change all callers.
10137 (Expression::eval_maybe_dot): Likewise.
10138 (class Binary_expression): Add alignment_pointer parameter to
10139 left_value and right_value. Change all callers.
10140 (BINARY_EXPRESSION): Set result alignment.
10141 (class Trinary_expression): Add alignment_pointer parameter to
10142 arg2_value and arg3_value. Change all callers.
10143 (Trinary_cond::value): Set result alignment.
10144 (Max_expression::value, Min_expression::value): Likewise.
10145 (Align_expression::value): Likewise.
10146 * script-sections.cc (class Sections_element): Add dot_alignment
10147 parameter to set_section_addresses virtual function. Update
10148 instantiations.
10149 (class Output_section_element): Likewise.
10150 (Script_sections::create_segments): Add dot_alignment parameter.
10151 Change all callers.
10152 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10153 (Script_sections::set_phdrs_clause_addresses): Likewise.
10154 * script-sections.h: Update declarations.
10155 * script.h: Update declarations.
10156 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10157 min_p_align.
10158 * testsuite/script_test_3.t: Set large alignment.
10159 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10160 segment has expected alignment.
10161
9c9c98a5
NC
101622010-04-22 Nick Clifton <nickc@redhat.com>
10163
10164 * po/gold.pot: Updated by the Translation project.
10165 * po/vi.po: Updated Vietnamese translation.
10166
2253bfba
L
101672010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10168
10169 * testsuite/Makefile.am (check_PROGRAMS): Add
10170 icf_virtual_function_folding_test.
10171 * testsuite/Makefile.in: Regenerated.
10172
85fdf906
AH
101732010-04-15 Andrew Haley <aph@redhat.com>
10174
10175 * options.h (merge_exidx_entries): New option.
10176 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10177 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10178 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10179 (Target_arm::merge_exidx_entries): New function.
10180 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10181 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10182 to Arm_exidx_fixup constructor.
10183 Add new arg, merge_exidx_entries.
10184 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10185 Arm_output_section::fix_exidx_coverage.
10186
ce97fa81
ST
101872010-04-18 Sriraman Tallam <tmsriram@google.com>
10188
10189 * icf.cc (get_section_contents): Check for preemptible functions.
10190 Ignore addend when appropriate.
10191 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10192 section folded.
10193 (add_from_relobj): Check for section folded.
10194 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10195 * symtab.h (should_add_dynsym_entry): Add new parameter.
10196 * target-reloc.h (scan_relocs): Check for section folded.
10197 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10198 Check reloc types for function pointers in shared objects.
10199 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10200 case.
10201 (icf_preemptible_functions_test): New test case.
10202 (icf_string_merge_test): New test case.
10203 * testsuite.Makefile.in: Regenerate.
10204 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10205 bar_glob. Refactor code.
10206 * testsuite/icf_preemptible_functions_test.cc: New file.
10207 * testsuite/icf_preemptible_functions_test.sh: New file.
10208 * testsuite/icf_string_merge_test.cc: New file.
10209 * testsuite/icf_string_merge_test.sh: New file.
10210 * testsuite/icf_virtual_function_folding_test.cc: New file.
10211 * testsuite/icf_virtual_function_folding_test.sh: New file.
10212
04ceb17c
DK
102132010-04-14 Doug Kwan <dougkwan@google.com>
10214
10215 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10216 for local symbol recounting if we remove a section due to ICF.
10217 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10218 there are no regular objects in input.
10219
153e7da4
DK
102202010-04-13 Doug Kwan <dougkwan@google.com>
10221
10222 * arm.cc (Arm_input_section::set_final_data_size): Compute
10223 accurate final data size instead of using current data size.
10224
4dbd9faf
DK
102252010-04-09 Doug Kwan <dougkwan@google.com>
10226
10227 * layout.cc (Layout::choose_output_section): Handle script section
10228 types.
10229 (Layout::make_output_section_for_script): Add section type parameter.
10230 Handle script section types.
10231 * layout.h (Layout::make_output_section_for_script): Add section
10232 type parameter.
10233 * output.cc (Output_section::Output_section): Initialize data member
10234 is_noload_.
10235 (Output_section::do_reset_address_and_file_offset): Do not set address
10236 to 0 if section is a NOLOAD section.
10237 * output.h (Output_section::is_noload): New method.
10238 (Output_section::set_is_noload): Ditto.
10239 (Output_section::is_noload_): New data member.
10240 * script-c.h (Script_section_type): New enum type.
10241 (struct Parser_output_section_header): Add new file section_type.
10242 * script-sections.cc (Sections_element::output_section_name): Add
10243 parameter for returning script section type.
10244 (Output_section_definition::output_section_name): Ditto.
10245 (Output_section_definition::section_type)P; New method.
10246 (Output_section_definiton::script_section_type_name): Ditto.
10247 (Output_section_definition::script_section_type_): New data member.
10248 (Output_section_definition::Output_section_definition): Initialize
10249 data member Output_section_definition::script_section_type_.
10250 (Output_section_definition::create_sections): Pass script section type
10251 to Layout::make_output_section_for_script.
10252 (Output_section_definition::output_section_name): Return script
10253 section type to caller.
10254 (Output_section_definition::set_section_address): Do not advance
10255 dot value and load address if section type is NOLOAD. Set address
10256 of NOLOAD sections regardless of section flags.
10257 (Output_section_definition::print): Print section type if it is
10258 not SCRIPT_SECTION_TYPE_NONE.
10259 (Output_section_definition::section_type): New method.
10260 (Output_section_definition::script_section_type_name): Ditto.
10261 (Script_sections::output_section_name): Add new parameter
10262 PSECTION_TYPE for returning script section type. Pass it to
10263 section elements. Handle discard sections.
10264 (Sort_output_sections::operator()): Handle NOLOAD sections.
10265 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10266 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10267 returning script section type.
10268 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10269 INFO and NOLOAD.
10270 * yyscript.y (union): Add new field SECTION_TYPE.
10271 (COPY, DSECT, INFO, NOLOAD): New tokens.
10272 (opt_address_and_section_type): Change type to output_section_header.
10273 (section_type): New non-terminal
10274 (section_header): Handle section type.
2253bfba 10275 (opt_address_and_section_type): Return section type value.
4dbd9faf 10276
721ea635
L
102772010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10278
10279 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10280 * testsuite/plugin_common_test_2.c (foo): Likewise.
10281
6bf924b0
DK
102822010-04-08 Doug Kwan <dougkwan@google.com>
10283
10284 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10285 Output_merge_data.
10286 * output.cc (Output_section::add_merge_input_section): Simplify
10287 code and return status of Output_merge_base::add_input_section.
e1df38aa 10288 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10289 returns true.
10290
24af6f92
DK
102912010-04-07 Doug Kwan <dougkwan@google.com>
10292
10293 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10294 if section is marked as containing instructions but has no mapping
10295 symbols.
10296 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10297 correct section index.
10298 (Arm_relobj::find_linked_text_section): Ditto.
10299
00698fc5
CC
103002010-04-07 Cary Coutant <ccoutant@google.com>
10301
10302 * archive.cc (include_member): Destroy Read_symbols_data object before
10303 releasing file.
10304 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10305 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10306 (Read_symbols_data::~Read_symbols_data) New destructor.
10307 (Section_relocs::Section_relocs) New constructor.
10308 (Section_relocs::~Section_relocs) New destructor.
10309 (Read_relocs_data::Read_relocs_data) New constructor.
10310 (Read_relocs_data::~Read_relocs_data) New destructor.
10311 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10312 pointers to NULL after deleting.
10313
7296d933
DK
103142010-04-07 Doug Kwan <dougkwan@google.com>
10315
10316 * arm.cc: Replace "endianity" with "endianness" in comments.
10317 (Arm_exidx_cantunwind): Ditto.
10318 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10319 (Arm_relobj::merge_flags_and_attributes): New method.
10320 (Arm_relobj::merge_flags_and_attributes_): New data member.
10321 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10322 (Arm_relobj::scan_sections_for_stubs): Ditto.
10323 (Arm_relobj::do_read_symbols): Check to see if we really want to
10324 merge processor-specific flags and attributes. Exit early if
10325 an object is empty except for section names and the undefined symbol.
10326 (Target_arm::do_finalize_sections): Move check for ELF format to
10327 Arm_relobj::do_read_symbols. Merge processor specific flags and
10328 attributes from a regular object only when we have determined that
10329 it is aapropriate. Do not create an .ARM.attributes section in
10330 output if there is no regular input object.
10331 (Target_arm::merge_processor_specific_flags): Check
10332 --warn-mismatch before printing any error.
10333 (Target_arm::merge_object_attributes): Ditto.
10334 * gold.cc (queue_middle_tasks): Handle the case in which there is
10335 no regular object in input.
10336 * options.cc (General_options::parse_EB): New method.
10337 (General_options::parse_EL): Same.
10338 (General_options::General_options): Initialize endianness_.
10339 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10340 New options.
10341 (General_options::Endianness): New enum.
10342 (General_options::endianness): New method.
10343 (General_options::endianness_): New data member.
10344 * parameters.cc (Parameters::set_options): Check target endianness.
10345 (Parameters::set_target_once): Ditto.
10346 (Parameters::check_target_endianness): New method.
10347 (parameters_force_valid_target): If either -EL or -EB is specified,
10348 use it to define endianness of default target.
10349 * parameters.h (Parameters::check_target_endianness): New method
10350 declaration.
10351 * target.h (class Target): Change "endianity" to "endianness"
10352 in comments.
10353
efc8d4f2
RW
103542010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10355
10356 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10357 * configure: Regenerate.
10358 * Makefile.in: Regenerate.
10359 * testsuite/Makefile.in: Regenerate.
10360
be234d88
CC
103612010-04-06 Cary Coutant <ccoutant@google.com>
10362
10363 gcc PR lto/42757
10364 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10365 prevailing definitions of common symbols.
10366 * testsuite/plugin_test_6.sh: New test case.
10367 * testsuite/plugin_common_test_1.c: New test case.
10368 * testsuite/plugin_common_test_2.c: New test case.
10369 * testsuite/Makefile.am (plugin_test_6): New test case.
10370 * testsuite/Makefile.in: Regenerate.
10371
bd32c6bd
NC
103722010-04-06 Nick Clifton <nickc@redhat.com>
10373
10374 * po/vi.po: New Vietnamese translation.
10375
323c532f
DK
103762010-03-30 Doug Kwan <dougkwan@google.com>
10377
10378 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10379
4fcd97eb
DK
103802010-03-25 Doug Kwan <dougkwan@google.com>
10381
10382 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10383 to avoid a conversion warning on a 32-bit host.
10384
4ebf39db
ILT
103852010-03-24 Ian Lance Taylor <iant@google.com>
10386
10387 * testsuite/script_test_3.t: Add a TLS segment.
10388 * testsuite/Makefile.am (check_PROGRAMS): Add
10389 tls_phdrs_script_test.
10390 (tls_phdrs_script_test_SOURCES): Define.
10391 (tls_phdrs_script_test_DEPENDENCIES): Define.
10392 (tls_phdrs_script_test_LDFLAGS): Define.
10393 (tls_phdrs_script_test_LDADD): Define.
10394 * testsuite/Makefile.in: Rebuild.
10395
4a599bdd
CC
103962010-03-23 Cary Coutant <ccoutant@google.com>
10397
10398 * fileread.cc (find_or_make_view): Fix comment.
10399
6c93b22c
ILT
104002010-03-23 Ian Lance Taylor <iant@google.com>
10401
10402 * script-sections.cc (class Orphan_section_placement): Define
10403 PLACE_TLS and PLACE_TLS_BSS.
10404 (Orphan_section_placement::Orphan_section_placement): Initialize
10405 new places.
10406 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10407 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10408 (tls_script_test_SOURCES): Define.
10409 (tls_script_test_DEPENDENCIES): Define.
10410 (tls_script_test_LDFLAGS): Define.
10411 (tls_script_test_LDADD): Define.
10412 * testsuite/Makefile.in: Rebuild.
10413
a2c7281b
DK
104142010-03-22 Doug Kwan <dougkwan@google.com>
10415
10416 * arm.cc (Arm_relocate_functions::abs8,
10417 Arm_relocate_functions::abs16): Use correct check for overflow
10418 specified in the ARM ELF specs.
10419 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10420 target of a BLX instruction specially.
10421 (Reloc_stub::stub_type_for_reloc): Ditto.
10422 (Relocate::relocate): Use symbolic names instead of numeric relocation
10423 codes to report error.
10424 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10425 workaround.
10426 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10427 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10428 thumb2_blx_out_of_range.stdout
10429 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10430 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10431 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10432 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10433 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10434 thumb2_blx_in_range, thumb2_blx_in_range.o,
10435 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10436 thumb2_blx_out_of_range.o): New rules.
2e702c99 10437 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10438 thumb2_blx_in_range and thumb2_blx_out_of_range.
10439 * testsuite/Makefile.in: Regenerate.
10440 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10441 * testsuite/thumb_blx_in_range.s: New file.
10442 * testsuite/thumb_blx_out_of_range.s: New file.
10443
b0193076
RÁE
104442010-03-22 Rafael Espindola <espindola@google.com>
10445
10446 * archive.cc (Should_include): Move to archive.h.
10447 (should_include_member): Make it a member of Archive.
10448 (Lib_group): New.
10449 (Add_lib_group_symbols): New.
10450 * archive.h: Include options.h.
10451 (Archive_member): Moved from Archive.
10452 (Should_include): Moved from archive.cc.
10453 (Lib_group): New.
10454 (Add_lib_group_symbols): New.
10455 * dynobj.cc (do_should_include_member): New.
10456 * dynobj.h (do_should_include_member): New.
10457 * gold.cc (queue_initial_tasks): Update call to queue.
10458 * main.cc (main): Print lib group stats.
10459 * object.cc (do_should_include_member): New.
10460 * object.h: Include archive.h.
10461 (Object::should_include_member): New.
10462 (Object::do_should_include_member): New.
10463 (Sized_relobj::do_should_include_member): New.
10464 * options.cc (General_options::parse_start_lib): New.
10465 (General_options::parse_end_lib): New.
10466 (Input_arguments::add_file): Handle lib groups.
10467 (Input_arguments::start_group): Check we are not in a lib.
10468 (Input_arguments::start_lib): New.
10469 (Input_arguments::end_lib): New.
10470 * options.h (General_options): Add start_lib and end_lib.
10471 (Input_argument::lib_): New.
10472 (Input_argument::lib): New.
10473 (Input_argument::is_lib): New.
10474 (Input_file_lib): New.
10475 (Input_arguments::in_lib_): New.
10476 (Input_arguments::in_lib): New.
10477 (Input_arguments::start_lib): New.
10478 (Input_arguments::end_lib_): New.
10479 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10480 in unused members as preempted.
10481 (Sized_pluginobj::do_should_include_member): New.
10482 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10483 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10484 return the blocker.
10485 (Read_symbols::do_whole_lib_group): New.
10486 (Read_symbols::do_lib_group): New.
10487 (Read_symbols::do_read_symbols): Handle lib groups.
10488 (Read_symbols::get_name): Handle lib groups.
10489 * readsyms.h (Read_symbols): Add an archive member pointer.
10490 (Read_symbols::do_whole_lib_group): New.
10491 (Read_symbols::do_lib_group): New.
10492 (Read_symbols::member_): New.
10493 * script.cc (read_input_script): Update call to queue_soon.
10494
d099120c
DK
104952010-03-19 Doug Kwan <dougkwan@google.com>
10496
10497 * arm.cc (Stub_table::Stub_table): Initialize new data members
10498 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10499 (Stub_table::add_reloc_stub): Assign stub offset and update
10500 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10501 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10502 New data members.
2e702c99 10503 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10504 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10505 instead of going over all reloc stubs.
2e702c99 10506 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10507 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10508 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10509 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10510 Stringpool_template::offset_.
10511 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10512 Stringpool_template::offset_ to zero.
10513
1aa37384
DK
105142010-03-15 Doug Kwan <dougkwan@google.com>
10515
10516 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10517 offset_.
10518 (Stringpool_template::new_key_offset): New method.
10519 (Stringpool_template::add_string): Assign offsets when adding new
10520 strings.
10521 (Stringpool_template::set_string_offsets): Do not set string offsets
10522 when not optimizing.
10523 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10524 member size_.
2e702c99
RM
10525 (Chunked_vector::clear): Clear size_.
10526 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10527 (Chunked_vector::size): Return size_.
10528 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10529 (Chunked_vector::size_): New data member.
1aa37384
DK
10530 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10531 (Stringpool_template::new_key_offset): New method declaration.
10532 (Stringpool_template::offset_): New data member.
10533
b672b057
RÁE
105342010-03-15 Rafael Espindola <espindola@google.com>
10535
10536 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10537 Add_symbols' constructor.
10538 * readsyms.h (Add_symbols): Remove the input_group member.
10539
b6848d3c
ILT
105402010-03-10 Ian Lance Taylor <iant@google.com>
10541
10542 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10543 target to ask whether a reference to a symbol requires a stack
10544 split.
10545 * target.h (Target::is_call_to_non_split): New function.
10546 (Target::do_is_call_to_non_split): Declare virtual function.
10547 * target.cc: Include "symtab.h".
10548 (Target::do_is_call_to_non_split): New function.
10549 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10550
a2a5469e
CC
105512010-03-10 Cary Coutant <ccoutant@google.com>
10552
10553 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10554 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10555 (File_read::open[2]): Add whole_file_view_ to list of views.
10556 (File_read::make_view): Remove test of whole_file_view_.
10557 (File_read::find_or_make_view): Create whole_file_view_ if
10558 necessary.
10559 (File_read::clear_views): Replace bool parameter with enum;
10560 adjust all callers. Don't delete views with permanent data;
10561 do delete cached views and views from archives if
10562 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10563 if clearing the corresponding view.
10564 * fileread.h (File_read::Clear_views_mode): New enum.
10565 (File_read::View::is_permanent_view): New method.
10566 (File_read::clear_views): Replace bool parameter
10567 with enum; adjust all callers.
10568 * options.h (General_options): Change keep_files_mapped option;
10569 add map_whole_files.
10570 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10571 releasing the file.
10572 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10573 the file.
10574
8861f32b
DM
105752010-03-10 David S. Miller <davem@davemloft.net>
10576
10577 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10578
d62d0f5f
ST
105792010-03-09 Sriraman Tallam <tmsriram@google.com>
10580
10581 * icf.cc (get_section_contents): Add '@' marker after processing the
10582 merge reloc.
10583
9177756d
DK
105842010-03-08 Doug Kwan <dougkwan@google.com>
10585
10586 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10587 due to a conversion warning.
10588 (Arm_relobj::update_output_local_symbol_count): Check for local
10589 symbol with unset output index.
10590
9e9e071b
ILT
105912010-03-05 Ian Lance Taylor <iant@google.com>
10592
10593 * options.h (class General_options): Add --spare-dynamic-tags.
10594 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10595 --spare-dynamic-tags.
10596
a81ee015
ILT
105972010-03-05 Ian Lance Taylor <iant@google.com>
10598
10599 * incremental.cc: Include "libiberty.h".
10600
44ec90b9
RO
106012010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10602
10603 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10604 function, is_info_ member.
10605 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10606 (Versions::Versions): Update caller.
10607 (Versions::define_base_version): Likewise.
10608 (Versions::add_def): Likewise.
10609
0897ed3b
ST
106102010-03-03 Sriraman Tallam <tmsriram@google.com>
10611
10612 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10613 (Scan::possible_function_pointer_reloc): New function.
10614 (Scan::local_reloc_may_be_function_pointer): Change to call
10615 possible_function_pointer_reloc.
10616 (Scan::global_reloc_may_be_function_pointer): Ditto.
10617 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10618 relocations in ".data.rel.ro._ZTV" section.
10619 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10620 * testsuite/icf_safe_so_test.cc: Ditto.
10621 * testsuite/icf_safe_test.cc: Ditto.
10622 * testsuite/icf_safe_test.sh: Ditto.
10623
d3bbad62
ILT
106242010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10625 Ian Lance Taylor <iant@google.com>
10626
10627 * target-reloc.h (relocate_section): Check the symbol table index
10628 for -1U before setting the local symbol index.
10629 (scan_relocatable_relocs): If copying the relocation, record that
10630 the local symbol is required.
10631 * object.h (Symbol_value::is_output_symtab_index_set): New
10632 function.
10633 (Symbol_value::may_be_discarded_from_output_symtab): New
10634 function.
10635 (Symbol_value::has_output_symtab_entry): New function.
10636 (Symbol_value::needs_output_symtab_entry): Remove.
10637 (Symbol_value::output_symtab_index): Make sure the symbol index is
10638 set.
10639 (Symbol_value::set_output_symtab_index): Make sure the symbol
10640 index is not set. Make sure the new index is valid.
10641 (Symbol_value::set_must_have_output_symtab_entry): New function.
10642 (Symbol_value::has_output_dynsym_entry): New function.
10643 (Symbol_value::set_output_dynsym_index): Make sure the new index
10644 is valid.
10645 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10646 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10647 local symbol if permitted.
10648 (Sized_relobj::do_finalize_local_symbols): Call
10649 is_output_symtab_index_set rather than needs_output_symtab_entry.
10650 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10651 rather than needs_output_symtab_entry. Call
10652 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10653 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10654 is_output_symtab_index_set rather than needs_output_symtab_entry.
10655 * testsuite/discard_locals_relocatable_test.c: New file.
10656 * testsuite/discard_locals_test.sh: Test -r.
10657 * testsuite/Makefile.am (check_DATA): Add
10658 discard_locals_relocatable_test1.syms,
10659 discard_local_relocatable_test2.syms.
10660 (MOSTLYCLEANFILES): Likewise. Also add
10661 discard_locals_relocatable_test1.lout and
10662 discard_locals_relocatable_test2.out.
10663 (discard_locals_relocatable_test1.syms): New target.
10664 (discard_locals_relocatable_test.o): New target.
10665 (discard_locals_relocatable_test1.out): New target.
10666 (discard_locals_relocatable_test2.syms): New target.
10667 (discard_locals_relocatable_test2.out): New target.
10668 (various): Add missing ../ld-new dependencies.
10669 * testsuite/Makefile.in: Rebuild.
10670
7e8ccf26
NC
106712010-03-03 Nick Clifton <nickc@redhat.com>
10672
10673 * po/fi.po: New Finnish translation.
10674
2a0ff005
DK
106752010-03-01 Doug Kwan <dougkwan@google.com>
10676
10677 * layout.cc (Layout::Layout): Force section types of .init_array*,
10678 .preinit_array* and .fini_array* sections.
10679 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10680 Fix check of return value of std::string::find.().
10681 (Output_section::Input_section_sort_compare::operator()): Remove
10682 comment about .init_array.
10683 (Output_section::Input_section_sort_init_fini_compare::operator()):
10684 New method.
10685 (Output_section::sort_attached_input_sections): Handle .init_array
10686 and .fini_array specially.
10687 * output.h (Output_section::Inut_section_sort_compare): Update
10688 comment.
10689 (Output_section::Input_section_sort_init_fini_compare): New struct.
10690
c3e4ae29
DK
106912010-02-26 Doug Kwan <dougkwan@google.com>
10692
10693 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10694 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10695 * testsuite/debug_msg.sh: Avoid matching source line number for
10696 use of global variable undef_int.
10697
2fd9ae7a
DK
106982010-02-26 Doug Kwan <dougkwan@google.com>
10699
10700 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10701 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10702 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10703 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10704 * options.cc (General_options::General_options): Initialize member
10705 fix_v4bx_.
10706 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10707 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10708 and rm_no_fix_v4bx.stdout
10709 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10710 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10711 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10712 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10713 and arm_no_fix_v4bx.
10714 * Makefile.in: Regenerate.
10715 * testsuite/arm_fix_v4bx.s: New file.
10716 * testsuite/arm_fix_v4bx.sh: Ditto.
10717
67ec7d0b
DK
107182010-02-24 Doug Kwan <dougkwan@google.com>
10719
10720 * arm.cc (Target_arm::got_section): Make the .got section the first
10721 non RELRO section in the data segment.
10722 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10723 suffixes of section names.
10724
10165461
DK
107252010-02-24 Doug Kwan <dougkwan@google.com>
10726
10727 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10728 flags and attributes merging if an input file is a binary file.
10729 * fileread.cc (Input_file::open): Record format of original file.
10730 * fileread.h (Input_file::Format): New enum type.
2e702c99 10731 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10732 (Input_file::format): New method definition.
10733 (Input_file::format_):: New data member.
10734
4a54abbb
DK
107352010-02-24 Doug Kwan <dougkwan@google.com>
10736
10737 * arm.cc (Arm_output_data_got): New class.
10738 (ARM_TCB_SIZE): New constant
10739 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10740 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10741 If user uses a script with a SECTIONS clause, issue only a warning
10742 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10743 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10744 garbage collection.
10745 (Target_arm::got_mode_index_entry): Handle static linking.
10746 (Target_arm::Scan::local): Ditto.
10747 (Target_arm::Scan::global): Ditto.
10748 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10749 all incorrectly implemented relocations.
e1df38aa 10750 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10751 Arm_output_section::fix_exidx_coverage.
10752 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10753 from ".ARM.exidx." and ".ARM.extab.".
10754
ca419a6f
ILT
107552010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10756
10757 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10758 section if it does not already exist.
10759 * attributes.cc (Attributes_section_data::Attributes_section_data):
10760 Don't crash if size is zero.
10761
135b9c78
ILT
107622010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10763 Ian Lance Taylor <iant@google.com>
10764
10765 * gold.cc (queue_middle_tasks): If no input files were opened,
10766 exit.
10767 * workqueue.h (Task_function::Task_function): Assert that there is
10768 a blocker.
10769
bb0bfe4f
DK
107702010-02-22 Doug Kwan <dougkwan@google.com>
10771
10772 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10773 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10774 types to avoid warnings due to different uint64_t implementations
10775 on different hosts.
10776
2a2b6d42
DK
107772010-02-21 Doug Kwan <dougkwan@google.com>
10778
10779 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10780 handling of the maximum backward branch offset.
2e702c99 10781 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10782 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10783 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10784 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10785 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10786 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10787 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10788 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10789 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10790 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10791 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10792 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10793 thumb2_bl_out_of_range.o): New rules.
10794 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10795 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10796 thumb2_bl_out_of_range
10797 * testsuite/Makefile.in: Regenerate.
10798 * testsuite/arm_bl_in_range.s: New file.
10799 * testsuite/arm_bl_out_of_range.s: Ditto.
10800 * testsuite/arm_branch_in_range.sh: Ditto.
10801 * testsuite/arm_branch_range.t: Ditto.
10802 * testsuite/thumb2_branch_range.t: Ditto.
10803 * testsuite/thumb_bl_in_range.s: Ditto.
10804 * testsuite/thumb_bl_out_of_range.s: Ditto.
10805 * testsuite/thumb_branch_range.t: Ditto.
10806
b487ad64
ST
108072010-02-20 Sriraman Tallam <tmsriram@google.com>
10808
10809 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10810 Add reloc offset information.
10811 * icf.cc (get_section_contents): Change iterators to point to the new
10812 vectors. Add reloc offset information to the contents.
10813 * icf.h (Icf::Sections_reachable_info): New typedef.
10814 (Icf::Sections_reachable_list): New typedef.
10815 (Icf::Offset_info): New typedef.
10816 (Icf::Reloc_info): New struct typedef.
10817 (Icf::Reloc_info_list): New typedef.
10818 (Icf::symbol_reloc_list): Delete method.
10819 (Icf::addend_reloc_list): Delete method.
10820 (Icf::section_reloc_list): Delete method.
10821 (Icf::reloc_info_list): New method.
10822 (Icf::reloc_info_list_): New member.
10823
f96accdf
DK
108242010-02-19 Doug Kwan <dougkwan@google.com>
10825
10826 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10827 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10828 * arm.cc (Arm_relocation_functions): New forward declaration.
10829 (Target_arm::Target_arm): Initialize new data members
10830 got_mod_index_offset_ and tls_base_symbol_defined_.
10831 (Target_arm::Relocate::relocate_tls): New method.
10832 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10833 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10834 New methods.
2e702c99 10835 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10836 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10837 (Target_arm::got_mod_index_offset_,
10838 Target_arm::tls_base_symbol_defined_): New data members.
10839 (Target_arm::Scan::local, Target::Scan::global,
10840 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10841 relocations.
10842
c8761b9a
DK
108432010-02-18 Doug Kwan <dougkwan@google.com>
10844
10845 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10846 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10847 text section as a parameter becuase some broken tools may not set
10848 the link in section header.
10849 (Target_arm::has_got_section): New method.
10850 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10851 without any mapping symbol as data only. Remove warning.
10852 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10853 link in its section header, try to discover the link by inspecting the
10854 REL31 relocation at the beginning of the section.
10855 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10856 in error message.
10857 (Target_arm::Scan::global): Treat any reference to the symbol
10858 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10859
21bb3914
ST
108602010-02-12 Sriraman Tallam <tmsriram@google.com>
10861
10862 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10863 (Scan::global_reloc_may_be_function_pointer): New function.
10864 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10865 (Scan::global_reloc_may_be_function_pointer): New function.
10866 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10867 (Scan::global_reloc_may_be_function_pointer): New function.
10868 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10869 (Scan::global_reloc_may_be_function_pointer): New function.
10870 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10871 (Scan::global_reloc_may_be_function_pointer): New function.
10872 (Scan::possible_function_pointer_reloc): New function.
10873 (Target_x86_64::can_check_for_function_pointers): New function.
10874 * gc.h (gc_process_relocs): Scan relocation types to determine if
10875 function pointers were taken for targets that support it.
10876 * icf.cc (Icf::find_identical_sections): Include functions for
10877 folding in safe ICF whose pointer is not taken.
10878 * icf.h (Secn_fptr_taken_set): New typedef.
10879 (fptr_section_id_): New member.
10880 (section_has_function_pointers): New function.
10881 (set_section_has_function_pointers): New function.
10882 (check_section_for_function_pointers): New function.
10883 * options.h: Fix comment for safe ICF option.
10884 * target.h (can_check_for_function_pointers): New function.
10885 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10886 Modify icf_safe_test for X86-64.
10887 * testsuite/Makefile.in: Regenerate.
10888 * testsuite/icf_safe_so_test.cc: New file.
10889 * testsuite/icf_safe_so_test.sh: New file.
10890 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10891 (main): Change to take pointer to function kept_func_3.
10892 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10893 folding is done correctly for X86-64.
10894
0da6fa6c
DM
108952010-02-12 David S. Miller <davem@davemloft.net>
10896
10897 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10898 is_symbolless parameter.
10899 (Output_reloc<SHT_REL>::is_symbolless): New.
10900 (Output_reloc<SHT_REL>::is_symbolless_): New.
10901 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10902 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10903 (Output_reloc<SHT_RELA>::is_symbolless): New.
10904 (Output_data_reloc::add_global): Handle is_symbolless.
10905 (Output_data_reloc::add_global_relative): Likewise.
10906 (Output_data_reloc::add_local): Likewise.
10907 (Output_data_reloc::add_local_relative): Likewise.
10908 (Output_data_reloc::add_symbolless_global_addend): New.
10909 (Output_data_reloc::add_symbolless_local_addend): New.
10910 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10911 is_symbolless.
10912 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10913 instead of ->is_relative_
10914 (Output_reloc::write): Likewise.
10915 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10916 (Output_reloc::write_rel): Simplify.
10917
10918 * sparc.cc (Target_sparc::Scan::local): Use
10919 ->add_symbolless_local_addend as needed.
10920 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10921 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10922 based upon relocation offset.
10923
e4782e83
DK
109242010-02-11 Doug Kwan <dougkwan@google.com>
10925
10926 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10927 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10928 beginning of function.
10929 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10930 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10931 parameter is_32bit in calls to should_apply_static_reloc.
10932 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10933 (check_DATA): Add arm_abs_global.stdout.
10934 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10935 arm_abs_global.stdout): New rules.
10936 (MOSTLLYCLEANFILES): Add arm_abs_global
10937 * Makefile.in: Regenerate.
10938 * testsuite/arm_abs_global.s: New file.
10939 * testsuite/arm_abs_global.sh: Ditto.
10940 * testsuite/arm_abs_lib.s: Ditto.
10941
93ceb764
ILT
109422010-02-11 Ian Lance Taylor <iant@google.com>
10943
10944 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10945 Read_relocs task.
10946 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10947 Allocate_commons_task first.
10948 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10949 task, rather than symtab_lock_.
10950 (Gc_process_relocs::~Gc_process_relocs): New function.
10951 (Gc_process_relocs::is_runnable): Check this_blocker_.
10952 (Gc_process_relocs::locks): Use next_blocker_ rather than
10953 blocker_.
10954 (Scan_relocs::~Scan_relocs): New function.
10955 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10956 symtab_lock_.
10957 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10958 next_blocker_.
10959 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10960 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10961 constructor accordingly.
10962 (class Gc_process_relocs): Likewise.
10963 (class Scan_relocs): Likewise.
10964 * common.h (class Allocate_commons_task): Remove symtab_lock_
10965 field, and corresponding constructor parameter.
10966 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10967 symtab_lock_.
10968 (Allocate_commons_task::locks): Likewise.
10969
114dfbe1
ILT
109702010-02-11 Ian Lance Taylor <iant@google.com>
10971
10972 * gold-threads.h (class Once): Define.
10973 (class Initialize_lock): Rewrite as child of Once.
10974 * gold-threads.cc (class Once_initialize): Define.
10975 (once_pointer_control): New static variable.
10976 (once_pointer, once_arg): New static variables.
10977 (c_run_once): New static function.
10978 (Once::Once, Once::run_once, Once::internal_run): New functions.
10979 (class Initialize_lock_once): Remove.
10980 (initialize_lock_control): Remove.
10981 (initialize_lock_pointer): Remove.
10982 (initialize_lock_once): Remove.
10983 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10984 (Initialize_lock::initialize): Rewrite.
10985 (Initialize_lock::do_run_once): New function.
10986 * archive.cc (Archive::interpret_header): Only clear name if it is
10987 not already empty.
10988 * fileread.cc: Include "gold-threads.h"
10989 (file_counts_lock): New static variable.
10990 (file_counts_initialize_lock): Likewise.
10991 (File_read::release): Only increment counts when using --stats.
10992 Use a lock around the increment.
10993 * parameters.cc (class Set_parameters_target_once): Define.
10994 (set_parameters_target_once): New static variable.
10995 (Parameters::Parameters): Move here from parameters.h.
10996 (Parameters::set_target): Rewrite.
10997 (Parameters::set_target_once): New function.
10998 (Parameters::clear_target): Move here and rewrite.
10999 * parameters.h (class Parameters): Update declarations. Add
11000 set_parameters_target_once_ field.
11001 (Parameters::Parameters): Move to parameters.cc.
11002 (Parameters::clear_target): Likewise.
11003 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11004 task.
11005 (Start_group::~Start_group): New function.
11006 (Start_group::is_runnable): New function.
11007 (Start_group::locks, Start_group::run): New functions.
11008 (Finish_group::run): Change saw_undefined to size_t.
11009 * readsyms.h (class Start_group): Define.
11010 (class Finish_group): Change saw_undefined_ field to size_t.
11011 (Finish_group::Finish_group): Remove saw_undefined and
11012 this_blocker parameters. Change all callers.
11013 (Finish_group::set_saw_undefined): New function.
11014 (Finish_group::set_blocker): New function.
11015 * symtab.h (class Symbol_table): Change saw_undefined to return
11016 size_t. Change saw_undefined_ field to size_t.
11017 * target-select.cc (Set_target_once::do_run_once): New function.
11018 (Target_selector::Target_selector): Initialize set_target_once_
11019 field. Don't initialize lock_ and initialize_lock_ fields.
11020 (Target_selector::instantiate_target): Rewrite.
11021 (Target_selector::set_target): New function.
11022 * target-select.h (class Set_target_once): Define.
11023 (class Target_selector): Update declarations. Make
11024 Set_target_once a friend. Remove lock_ and initialize_lock_
11025 fields. Add set_target_once_ field.
11026
fa17a3f4
ILT
110272010-02-10 Ian Lance Taylor <iant@google.com>
11028
11029 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11030 queueing any tasks.
11031 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11032 (queue_middle_tasks): Add all blockers before queueing any tasks.
11033 (queue_final_tasks): Likewise.
11034 * token.h (Task_token::add_blockers): New function.
11035 * object.h (Input_objects::number_of_relobjs): New function.
11036
c7177d31
ILT
110372010-02-10 Ian Lance Taylor <iant@google.com>
11038
5de0e392
ILT
11039 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11040 shared, not if not position independent.
11041 * x86_64.cc (Relocate::relocate_tls): Likewise.
11042 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11043 (tls_pie_pic_test): New target.
11044 * testsuite/Makefile.in: Rebuild.
11045
c7177d31
ILT
11046 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11047 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11048 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11049 * testsuite/Makefile.in: Rebuild.
11050
684b268a
DM
110512010-02-09 David S. Miller <davem@davemloft.net>
11052
11053 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11054 R_SPARC_RELATIVE using ->add_local_relative().
11055 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11056
612a8d3d
DM
11057 * output.h (Output_data_dynamic::add_section_size): New method
11058 that takes two Output_data objects.
11059 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11060 entry param. Handle it in initializers.
11061 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11062 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11063 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11064 arg.
11065 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11066 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11067 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11068 for dynrel_includes_plt.
11069 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11070 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11071 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11072 before .rela.plt
11073 (Target_sparc::do_finalize_sections): Update to pass true for
11074 dynrel_includes_plt.
11075 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11076 output before .rela.plt
11077 (Target_powerpc::do_finalize_sections): Update to pass true for
11078 dynrel_includes_plt when 32-bit.
11079
cb1be87e
DK
110802010-02-08 Doug Kwan <dougkwan@google.com>
11081
11082 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11083 method.
11084 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11085 Arm_relobj::scan_section_for_cortex_a8_stubs,
11086 Arm_relobj::do_relocation_section): Instead of calling
11087 Output_section::output_address, use faster
11088 Arm_relobj::simple_input_section_output_address.
11089
705b5121
DM
110902010-02-08 David S. Miller <davem@davemloft.net>
11091
11092 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11093 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11094 relocation helper function.
11095
024c4466
DM
11096 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11097 just like R_SPARC_GOT{10,13,22}.
11098 (Target_sparc::Scan::local): Likewise.
11099 (Target_sparc::Relocate:relocate): Likewise.
11100
9109c078
ILT
111012010-02-06 Ian Lance Taylor <iant@google.com>
11102
11103 * configure.ac: Rewrite targetobjs duplicate removal code to use
11104 only shell constructs.
11105 * configure: Rebuild.
11106
cf846138
DK
111072010-02-05 Doug Kwan <dougkwan@google.com>
11108
11109 PR 11247
11110 * arm.cc (Arm_relobj::section_is_scannable): New method.
11111 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11112 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11113
6cfaf60b
DK
111142010-02-04 Doug Kwan <dougkwan@google.com>
11115
11116 PR 11247
11117 * arm-reloc-property.cc (cstdio): Include.
11118 * configure.ac (targetobjs): Remove duplicates.
11119 * configure: Regenerate.
11120 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11121 big and little endian version for a given address size.
11122
5c57f1be
DK
111232010-02-03 Doug Kwan <dougkwan@google.com>
11124
11125 * arm-reloc-property.cc
11126 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11127 definition.
11128 * arm-reloc-property.h
11129 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11130 New method definition.
11131 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11132 declaration.
11133 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11134 overflow to N.
11135 (GOT_PREL): Change implemented to Y.
11136 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11137 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11138 (Arm_relocate_functions::movw_abs_nc): Remove method.
11139 (Arm_relocate_functions::movt_abs): Ditto.
11140 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11141 (Arm_relocate_functions::thm_movt_abs): Ditto.
11142 (Arm_relocate_functions::movw_rel_nc): Ditto.
11143 (Arm_relocate_functions::movw_rel): Ditto.
11144 (Arm_relocate_functions::movt_rel): Ditto.
11145 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11146 (Arm_relocate_functions:thm_movw_rel): Ditto.
11147 (Arm_relocate_functions:thm_movt_rel): Ditto.
11148 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11149 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11150 New method definitions.
11151 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11152 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11153 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11154 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11155 (Target_arm::Relocate::relocate): Check for non-static or
11156 unimplemented relocation code and exit early. Change calls to
11157 Target_arm::reloc_uses_thumb_bit and
11158 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11159 instead. Refactor code to handle similar relocations to increase
11160 code sharing. Remove check for unsupported relocation code in switch
11161 statement.
11162 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11163 relocation property table to find out size. Change error message to
11164 print out the name of a relocation code instead of the numeric value.
11165 (Target_arm::scan_reloc_for_stub): Use relocation property table
11166 instead of calling Target_arm::reloc_uses_thumb_bit().
11167
218c5831
DK
111682010-02-02 Doug Kwan <dougkwan@google.com>
11169
11170 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11171 types of relaxed input section.
11172
0d31c79d
DK
111732010-02-02 Doug Kwan <dougkwan@google.com>
11174
11175 * Makefile.am (HFILES): Add arm-reloc-property.h.
11176 (DEFFILES): New.
2e702c99
RM
11177 (TARGETSOURCES): Add arm-reloc-property.cc
11178 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11179 (libgold_a_SOURCES): $(DEFFILES)
11180 * Makefile.in: Regenerate.
11181 * arm-reloc-property.cc: New file.
11182 * arm-reloc-property.h: New file.
11183 * arm-reloc.def: New file.
11184 * arm.cc: Update comments.
11185 (arm-reloc-property.h): New included header.
11186 (arm_reloc_property_table): New global variable.
11187 (Target_arm::do_select_as_default_target): New method definition.
11188 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11189 arm-reloc-property to targ_extra_obj.
11190 * parameters.cc (set_parameters_target): Call
11191 Target::select_as_default_target().
11192 * target.h (Target::select_as_default_target): New method definition.
11193 (Target::do_select_as_default_target): Same.
11194
546c7457
DK
111952010-02-01 Doug Kwan <dougkwan@google.com>
11196
11197 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11198 first_output_text_section_.
11199 (Arm_exidx_fixup::first_output_text_section): New method definition.
11200 (Arm_exidx_fixup::first_output_text_section_): New data member.
11201 (Arm_exidx_fixup::process_exidx_section): Record the first text
11202 output section seen.
11203 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11204 and entsize in output section header.
11205
11b861d5
DK
112062010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11207
11208 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11209 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11210 (Arm_relocate_functions::thm_alu11): New Method.
11211 (Arm_relocate_functions::thm_pc8): New Method.
11212 (Arm_relocate_functions::thm_pc12): New Method.
11213 (Target_arm::Scan::local): Handle the relocations.
11214 (Target_arm::Scan::global): Likewise.
11215 (Target_arm::Relocate::relocate): Likewise.
11216 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11217
c9a2c125
DK
112182010-01-29 Doug Kwan <dougkwan@google.com>
11219
11220 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11221 of relocation types as ld.
11222
1521477a
DK
112232010-01-29 Doug Kwan <dougkwan@google.com>
11224
11225 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11226 to public.
11227 (Arm_relocate_functions::thumb_branch_common): Ditto.
11228 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11229 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11230 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11231 Arm_relocate_functions::jump24): Remove.
11232 (Target_arm::Relocate::relocate): Adjust code to call
11233 Arm_relocation_functions::arm_branch_common and
11234 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11235 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11236
e7eca48c
DK
112372010-01-29 Doug Kwan <dougkwan@google.com>
11238
11239 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11240 output_local_symbol_count_needs_update_.
11241 (Arm_relobj::output_local_symbol_count_needs_update,
11242 Arm_relobj::set_output_local_symbol_count_needs_update,
11243 Arm_relobj::update_output_local_symbol_count): New methods.
11244 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11245 member.
11246 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11247 of pointed function as in a R_ARM_PREL31 relocation.
11248 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11249 for output local symbol count updating.
11250 (Target_arm::do_relax): Update output local symbol counts in objects
11251 if necessary.
11252 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11253
02961d7e
ILT
112542010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11255
11256 * arm.cc: Added support for the ARM relocations:
11257 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11258 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11259 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11260 movw_prel_nc).
11261 (Arm_relocate_functions::movw_rel): New method.
11262 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11263 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11264 thm_movw_prel_nc).
11265 (Arm_relocate_functions::thm_movw_rel): New method.
11266 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11267 thm_movt_prel).
11268 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11269 relocations.
11270 (Target_arm::Scan::global): Likewise.
11271 (Target_arm::Relocate::relocate): Likewise.
11272 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11273 Likewise.
11274
b10d2873
ILT
112752010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11276
11277 * arm.cc: Added support for ARM group relocations.
11278 (Target_arm::reloc_needs_sym_origin): New method.
11279 (Arm_relocate_functions::calc_grp_kn): New method.
11280 (Arm_relocate_functions::calc_grp_residual): New method.
11281 (Arm_relocate_functions::calc_grp_gn): New method.
11282 (Arm_relocate_functions::arm_grp_alu): New Method.
11283 (Arm_relocate_functions::arm_grp_ldr): New Method.
11284 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11285 (Arm_relocate_functions::arm_grp_ldc): New Method.
11286 (Target_arm::Scan::local): Handle the ARM group relocations.
11287 (Target_arm::Scan::global): Likewise.
11288 (Target_arm::Relocate::relocate): Likewise.
11289 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11290 Likewise.
11291
2b328d4e
DK
112922010-01-26 Doug Kwan <dougkwan@google.com>
11293
11294 * arm.cc (set): Include.
11295 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11296 pointer type.
2e702c99 11297 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11298 (Arm_output_section::append_text_sections_to_list): New method.
11299 (Arm_output_section::fix_exidx_coverage): Ditto.
11300 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11301 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11302 Relobj::set_section_offset() instead of
11303 Sized_relobj::invalidate_section_offset().
2e702c99 11304 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11305 parameter for section headers. Ignore relocation sections for
11306 unallocated sections and EXIDX sections.
11307 (Target_arm::fix_exidx_coverage): New method.
11308 (Target_arm::output_section_address_less_than): New type.
11309 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11310 linked text section instead of the EXIDX section.
11311 (Arm_output_section::create_stub_group): Add an assertion to check
11312 that this is not an EXIDX output section.
11313 (Arm_output_section::append_text_sections_to_list): New method.
11314 (Arm_output_section::fix_exidx_coverage): Ditto.
11315 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11316 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11317 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11318 first pass.
11319 (Target_arm::fix_exidx_coverage): New method.
11320 * object.h (Relobj::set_output_section): New method.
11321 (Sized_relobj::invalidate_section_offset): Remove method.
11322 (Sized_relobj::do_invalidate_section_offset): Remove method.
11323 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11324
c7f3c371
DK
113252010-01-25 Doug Kwan <dougkwan@google.com>
11326
11327 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11328 Fix warning due to signed and unsigned comparison on a 32-bit host.
11329
8923b24c
DK
113302010-01-22 Doug Kwan <dougkwan@google.com>
11331
11332 * arm.cc (Target_arm::do_relax): Record an output section for section
11333 offset adjustment it contains any stub table that has changed.
11334 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11335 offsets in an output section if necessary.
11336 * output.cc (Output_section::Output_section): Initialize
11337 section_offsets_need_adjustments_.
11338 (Output_section::add_input_section_for_script): Renamed to
11339 Output_section::add_simple_input_section.
11340 (Output_section::save_states): Add a comment.
11341 (Output_section::discard_states): New method defintion.
11342 (Output_section::adjust_section_offsets): Same.
11343 * output.h (Output_section::add_input_section_for_script): Renamed to
11344 Output_section::add_simple_input_section.
11345 (Output_section::discard_states): New method declaration.
11346 (Output_section::adjust_section_offsets): Same.
11347 (Output_section::section_offsets_need_adjustment,
11348 Output_section::set_section_offsets_need_adjustment): New method
11349 definitions.
11350 (Output_section::section_offsets_need_adjustment_): New data member.
11351 * script-sections.cc
11352 (Output_section_element_input::set_section_address): Adjust code for
11353 renaming of Output_section::add_input_section_for_script.
11354 (Orphan_output_section::set_section_address): Same.
11355
9b2fd367
DK
113562010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11357
11358 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11359 Fix_v4bx enum values .
11360 * gold/options.h (General_options): New option definitions.
11361 (General_options::fix_v4bx): New method.
11362 (General_options::Fix_v4bx): New enum.
11363 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11364 (General_options::parse_fix_v4bx_interworking): New method.
11365
80d0d023
DK
113662010-01-22 Doug Kwan <dougkwan@google.com>
11367
11368 * arm.cc (Arm_exidx_fixup): New class.
11369
af2cdeae
DK
113702010-01-21 Doug Kwan <dougkwan@google.com>
11371
11372 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11373 classes.
11374 (Arm_exidx_section_offset_map): New type.
11375
993d07c1
DK
113762010-01-21 Doug Kwan <dougkwan@google.com>
11377
11378 * arm.cc (Arm_exidx_input_section): New class.
11379 (Arm_relobj::exidx_input_section_by_link,
11380 Arm_relobj::exidx_input_section_by_shndx,
11381 Arm_relobj::make_exidx_input_section): New methods.
11382 (read_arm_attributes_section): Remove.
11383 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11384 information about them.
11385 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11386 to here.
11387
5ac169d4
DK
113882010-01-20 Doug Kwan <dougkwan@google.com>
11389
11390 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11391 Input_section_specifier to Section_id.
11392 (Target_arm::new_arm_input_section: Adjust code for change of key
11393 type.
11394 (Target_arm::find_arm_input_section): Ditto.
11395 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11396 (Section_id): Remove.
11397 (Garbage_collection::Section_id_hash): Remove.
11398 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11399 (Section_id): Remove.
11400 (Icf::Section_id_hash): Remove.
11401 * object.h (Section_id, Const_section_id, Section_id_hash,
11402 Const_section_id_hash): New type definitions.
11403 * output.cc (Output_section::add_relaxed_input_section): Change to
11404 use Const_section_id instead of Input_section_specifier as key type.
11405 (Output_section::add_merge_input_section): Ditto.
11406 (Output_section::build_relaxation_map): Change to use Section_id
11407 instead of Input_section_specifier as key type.
2e702c99 11408 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11409 Ditto.
11410 (Output_section::convert_input_sections_to_relaxed_sections): Change
11411 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11412 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11413 (Output_section::find_relaxed_input_section): Ditto.
11414 * output.h (Input_section_specifier): Remove class.
11415 (Output_section::Output_section_data_by_input_section_map): Change
11416 key type to Const_section_id.
11417 (Output_section::Output_relaxed_input_section_by_input_section_map):
11418 Ditto.
11419 (Output_section::Relaxation_map): Change key type to Section_id.
11420
a2162063
ILT
114212010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11422
11423 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11424 (class Arm_v4bx_stub): New class.
11425 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11426 (Stub_factory::make_arm_v4bx_stub): New method.
11427 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11428 (Stub_table::empty): Handle v4bx stubs.
11429 (Stub_table::add_arm_v4bx_stub): New method.
11430 (Stub_table::find_arm_v4bx_stub): New method.
11431 (Arm_relocate_functions::v4bx): New method.
11432 (Target_arm::fix_v4bx): New method.
11433 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11434 (Stub_table::relocate_stubs): Likewise.
11435 (Stub_table::do_write): Likewise.
11436 (Stub_table::update_data_size_and_addralign): Likewise.
11437 (Stub_table::finalize_stubs): Likewise.
11438 (Target_arm::Scan::local): Likewise.
11439 (Target_arm::Scan::global): Likewise.
11440 (Target_arm::do_finalize_sections): Likewise.
11441 (Target_arm::Relocate::relocate): Likewise.
11442 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11443 Likewise.
11444 (Target_arm::scan_reloc_for_stub): Likewise.
11445 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11446
5696ab0b
ILT
114472010-01-19 Ian Lance Taylor <iant@google.com>
11448
11449 * output.cc (Output_section_headers::do_sized_write): Write large
11450 segment count to sh_info field.
11451 (Output_file_header::do_sized_write): For large segment count,
11452 write PN_XNUM to e_phnum field.
11453
800d0f56
ILT
114542010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11455
11456 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11457 (Arm_relocate_functions::thm_jump8): New function.
11458 (Arm_relocate_functions::thm_jump11): New function.
11459 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11460 R_ARM_THM_JUMP11.
11461 (Target_arm::Scan::global): Likewise.
11462 (Target_arm::Relocate::relocate): Likewise.
11463 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11464 Likewise.
11465
41263c05
DK
114662010-01-14 Doug Kwan <dougkwan@google.com>
11467
11468 * arm.cc (map, utility): Include headers.
11469 (Target_arm::apply_cortex_a8_workaround): New method.
11470 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11471 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11472 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11473 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11474 the --[no-]fix-cortex-a8 command line options.
11475 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11476 (Target_arm::relocate_stub): Use addend in instruction template.
11477 * options.h (DEFINE_bool): Set the user-set flag.
11478 (General_options): Add --[no-]-fix-cortex options.
11479 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11480 : Update fast look-up map after conversion.
41263c05 11481
459e9b03
ST
114822010-01-14 Sriraman Tallam <tmsriram@google.com>
11483
11484 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11485 in the first pass of do_layout.
11486
b521dfe4
DK
114872010-01-13 Doug Kwan <dougkwan@google.com>
11488
11489 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11490 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11491 apparent compiler problem of not folding static constant integral
11492 data members of elfcpp::Elf_sizes<32>.
11493
44272192
DK
114942010-01-13 Doug Kwan <dougkwan@google.com>
11495
11496 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11497 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11498 Arm_relobj::scan_section_for_cortex_a8_erratum,
11499 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11500 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11501 sections to scan for relocation stubs into a new method
11502 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11503 relocation and Cortex-A8 stub scanning.
11504 (Target_arm::do_relax): Force stubs to be after stubbed sections
11505 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11506 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11507 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11508
44b71ece
ILT
115092010-01-12 Ian Lance Taylor <iant@google.com>
11510
11511 * target-reloc.h (visibility_error): New inline function.
11512 (relocate_section): Call visibility_error.
11513 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11514 (MOSTLYCLEANFILES): Likewise.
11515 (protected_4_pic.o, protected_3.err): New targets.
11516 * testsuite/protected_4.cc: New file.
11517
a120bc7f
DK
115182010-01-12 Doug Kwan <dougkwan@google.com>
11519
11520 * arm.cc (Cortex_a8_reloc): New class.
11521 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11522 and cortex_a8_relocs_info_.
11523 (Target_arm::fix_cortex_a8): New method definition.
11524 (Target_arm::Cortex_a8_relocs_info): New type.
11525 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11526 New data member declarations.
11527 (Target_arm::scan_reloc_for_stub): Record information about
11528 relocations for THUMB branches that might be exempted from the
11529 Cortex-A8 workaround.
11530 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11531 at the beginning of a relaxation pass.
11532
20138696
DK
115332010-01-12 Doug Kwan <dougkwan@google.com>
11534
11535 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11536 (Arm_relobj::Mapping_symbol_position,
11537 Arm_reloj::Mapping_symbol_position_less,
11538 Arm_relobj::Mapping_symbols_info): New types.
11539 (Target_arm::is_mapping_symbol_name): New method definition.
11540 (Arm_relobj::do_count_local_symbols): Save information about mapping
11541 symbols.
11542
089d69dc
DK
115432010-01-11 Doug Kwan <dougkwan@google.com>
11544
11545 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11546 Arm_relocate_functions::thumb32_branch_upper,
11547 Arm_relocate_functions::thumb32_branch_lower,
11548 Arm_relocate_functions::thumb32_cond_branch_offset,
11549 Arm_relocate_functions::thumb32_cond_branch_upper,
11550 Arm_relocate_functions::thumb32_cond_branch_lower,
11551 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11552 branch offset encoding.
11553 (Arm_relocate_functions::thumb_branch_common): Use new branch
11554 offset encoding methods to avoid code duplication.
11555 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11556 (Stub_addend_reader::operator()): Use new branch encoding method
11557 to avoid code duplication.
11558
99e5bff2
DK
115592010-01-11 Doug Kwan <dougkwan@google.com>
11560
11561 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11562 (Target_arm::do_finalize_sections): Define special EXIDX section
11563 symbols only if referenced.
11564 * gc.h (Garbage_collection::add_reference): New method.
11565 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11566 code duplication.
11567
98e090bd
ILT
115682010-01-11 Ian Lance Taylor <iant@google.com>
11569
d0a91bd8
ILT
11570 * script.cc (Version_script_info::build_expression_list_lookup):
11571 Change complaing about duplicate wildcard match from error to
11572 warning.
11573
98e090bd
ILT
11574 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11575 of 2009-12-30.
11576 (Version_script_info::Version_script_info): Initialize globs_,
11577 default_version_, default_is_global_, and exact_. Don't
11578 initialize globals_ or locals_.
11579 (Version_script_info::build_lookup_tables): Build local symbols
11580 first.
11581 (Version_script_info::unquote): New function.
11582 (Version_script_info::add_exact_match): New function.
11583 (Version_script_info::build_expression_list_lookup): Remove lookup
11584 parameter. Add is_global parameter. Change all callers. Handle
11585 wildcard pattern specially. Unquote pattern. Call
11586 add_exact_match.
11587 (Version_script_info::get_name_to_match): New function.
11588 (Version_script_info::get_symbol_version): New function.
11589 (Version_script_info::get_symbol_version_helper): Remove.
11590 (Version_script_info::check_unmatched_names): Call unquote.
11591 * script.h (class Version_script_info): Change get_symbol_version
11592 to be non-inline and add is_global parameter; change all callers.
11593 Rewrite symbol_is_local. Update declarations. Define struct
11594 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11595 Remove globals_ and locals_ members. Add exact_, globs_,
11596 default_version_, is_global_.
11597 (Version_script_info::Glob): Remove pattern, add expression and
11598 is_global. Update constructor. Change all callers.
11599 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11600 default version.
11601 (Versions::symbol_section_contents): If a symbol is undefined, or
11602 defined in a dynamic object, set the version index to
11603 VER_NDX_LOCAL.
11604 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11605 symbol_is_local.
11606 (Symbol_table::add_from_pluginobj): Likewise.
11607 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11608
d56962d3
DK
116092010-01-11 Doug Kwan <dougkwan@google.com>
11610
11611 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11612 (incremental_dump_LDADD): Add linking option for libintl.
11613 * Makefile.in: Regenerate.
11614
94e6ee91
L
116152010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11616
11617 PR gold/11144
11618 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11619 instead of -Ds.
11620 * testsuite/Makefile.in: Regenerated.
11621
e96c574b
DK
116222010-01-10 Doug Kwan <dougkwan@google.com>
11623
11624 * options.h (DEFINE_var): Use parentheses around argument varname__
11625 in macro body to avoid any unintended subsequent substitutions.
11626
7198066b
ILT
116272010-01-10 Ian Lance Taylor <iant@google.com>
11628
ba4d53bf
ILT
11629 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11630 candidates before doing symbol resolution.
11631
7198066b
ILT
11632 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11633 ODR candidates if only one is weak.
11634
a2beed37
ILT
116352010-01-08 Ian Lance Taylor <iant@google.com>
11636
11637 * script.cc (Version_script_info::build_expression_list_lookup):
11638 Don't warn about ambiguous version, just record the ambiguity.
11639 (Version_script_info::get_symbol_version_helper): Give error if
11640 version is ambiguous.
11641
2fb7225c
DK
116422010-01-08 Doug Kwan <dougkwan@google.com>
11643
11644 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11645 prev_data_size_ and prev_addralign_. Remove initializer for
11646 deleted data member has_been_changed_.
11647 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11648 to determine if the table is empty.
11649 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11650 Remove.
11651 (Stub_table::add_reloc_stub): Define method in class definition
11652 instead of just declaring it there.
11653 (Stub_table::add_cortex_a8_stub): New method definition.
11654 (Stub_table::update_data_size_and_addralign): Ditto.
11655 (Stub_table::finalize_stubs): Ditto.
11656 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11657 (Stub_table::do_addralign_): Return address alignment in the
11658 (Stub_table::do_reset_address_and_file_offset): Define method in
11659 class definition instead of declaring it there. Set current data
11660 size to be the data size of the previous pass.
11661 (Stub_table::set_final_data_size): Use current data size as the
11662 final data size.
11663 (Stub_table::relocate_stub): Change parameter type of stub from
11664 Reloc_stub pointer to Stub pointer.
11665 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11666 (Stub_table::Cortex_a8_stub_list): New typedef.
11667 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11668 Stub_table::prev_addralign_): New data member.
11669 (Arm_relobj::Arm_relobj): Initialize data member
11670 section_has_cortex_a8_workaround_.
11671 (Arm_relobj::section_has_cortex_a8_workaround,
11672 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11673 definitions.
11674 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11675 declarations.
11676 (Target_arm::relocate_stub): Change parameter type of stub from
11677 Reloc_stub pointer to Stub pointer.
11678 (Insn_template::size, Insn_template::alignment): Handle
11679 THUMB16_SPECIAL_TYPE.
11680 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11681 Stub_table::update_data_size_and_addralign,
11682 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11683 definitions.
11684 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11685 (Stub_table::do_write): Ditto.
11686 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11687
880cd20d
ILT
116882010-01-08 Ian Lance Taylor <iant@google.com>
11689
11690 PR 11108
11691 * symtab.h (class Symbol): Remove fields is_target_special_ and
11692 has_plt_offset_. Add field is_defined_in_discarded_section_.
11693 (Symbol::is_defined_in_discarded_section): New function.
11694 (Symbol::set_is_defined_in_discarded_section): New function.
11695 (Symbol::has_plt_offset): Rewrite.
11696 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11697 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11698 Don't initialize is_target_special_ or has_plt_offset_.
11699 Initialize is_defined_in_discarded_section_.
11700 (Symbol_table::add_from_relobj): If appropriate, set
11701 is_defined_in_discarded_section.
11702 * resolve.cc (Symbol::override_base_with_special): Don't test
11703 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11704 * target-reloc.h (relocate_section): Do special handling for
11705 symbols defined in discarded sections for global symbols as well
11706 as local symbols.
11707
2703e3eb
ILT
117082010-01-08 Ian Lance Taylor <iant@google.com>
11709
11710 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11711 the SHT_SYMTAB case.
11712
339d40a3
ILT
117132010-01-08 Ian Lance Taylor <iant@google.com>
11714
11715 * object.cc (Sized_relobj::do_layout): Don't get confused if
11716 layout_eh_frame returns NULL.
11717
abecea76
ILT
117182010-01-08 Ian Lance Taylor <iant@google.com>
11719
11720 PR 11084
11721 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11722 dynamic symbol table, use the normal symbol table.
11723 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11724 symbol table.
11725
6b7dd3f3
ILT
117262010-01-08 Ian Lance Taylor <iant@google.com>
11727
11728 PR 11072
11729 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11730 sections.
11731
36c50e63
L
117322010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11733
11734 * version.cc (print_version): Change to "Copyright 2010".
11735
e291e7b9
ILT
117362010-01-08 Ian Lance Taylor <iant@google.com>
11737
11738 PR 10287
11739 PR 11063
11740 * i386.cc (class Target_i386): Change return type of plt_section
11741 to be non-const.
11742 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11743 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11744 tls_desc_rel_ field.
11745 (Output_data_plt_i386::rel_tls_desc): New function.
11746 (Target_i386::rel_tls_desc_section): New function.
11747 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11748 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11749 R_386_TLS_DESC reloc in rel_tls_desc_section.
11750 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11751 Define struct Tlsdesc_info.
11752 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11753 (Target_x86_64::do_reloc_symbol_index): New function.
11754 (Target_x86_64::add_tlsdesc_info): New function.
11755 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11756 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11757 tlsdesc_rel_ field.
11758 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11759 all callers.
11760 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11761 (Target_x86_64::rela_tlsdesc_section): New function.
11762 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11763 handling.
11764 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11765 (Target_x86_64::do_reloc_addend): New function.
11766 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11767 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11768 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11769 (Output_reloc::type): New function.
11770 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11771 (Output_reloc::is_target_specific): New function.
11772 (Output_reloc::target_arg): New function.
11773 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11774 absolute relocs and target specific relocs.
11775 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11776 add_target_specific.
11777 (class Output_data_reloc) [SHT_RELA]: Likewise.
11778 * output.cc (Output_reloc::Output_reloc): Add four new versions
11779 for absolute relocs and target specific relocs.
11780 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11781 (Output_reloc::get_symbol_index): Likewise.
11782 (Output_reloc::local_section_offset): Check that local_sym_index_
11783 is not TARGET_CODE or 0.
11784 (Output_reloc::symbol_value): Likewise.
11785 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11786 reloc.
11787 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11788 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11789 functions.
11790 * layout.cc (add_target_dynamic_tags): Use output section for
11791 DT_PLTRELSZ and DT_JMPREL.
11792
3a44184e
ILT
117932010-01-07 Ian Lance Taylor <iant@google.com>
11794
11795 PR 11061
11796 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11797 function.
11798 (class Output_data_reloc_generic): Define.
11799 (class Output_data_reloc_base): Change base class to
11800 Output_data_reloc_generic. Change add() method to call
11801 bump_relative_reloc_count for a relative reloc. Remove
11802 sort_relocs_ field.
11803 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11804 to sort_relocs().
11805 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11806 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11807 appropriate.
11808 * layout.h (class Layout): Update declaration.
11809
ea715a34
ILT
118102010-01-07 Ian Lance Taylor <iant@google.com>
11811
11812 * output.h (class Output_data): Add const version of
11813 output_section and do_output_section.
11814 (class Output_section_data): Add const version of
11815 do_output_section.
11816 (class Output_section): Likewise.
11817 * layout.cc (Layout::add_target_dynamic_tags): New function.
11818 * layout.h (class Layout): Update declarations.
11819 * arm.cc (Target_arm::do_finalize_sections): Use
11820 add_target_dynamic_tags.
11821 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11822 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11823 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11824 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11825
659948a4
ILT
118262010-01-07 Ian Lance Taylor <iant@google.com>
11827
11828 PR 11042
11829 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11830 object as needed.
11831
9d3b86f6
ILT
118322010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11833 Ian Lance Taylor <iant@google.com>
11834
11835 PR 11019
11836 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11837 Xindex::read_symtab_xindex.
11838
bb0d3eb0
DK
118392010-01-07 Doug Kwan <dougkwan@google.com>
11840
11841 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11842 (Insn_template::thumb16_bcond_insn): New method declaration.
11843 (Insn_template): Fix spelling.
11844 (Stub::thumb16_special): New method declaration.
11845 (Stub::do_write): Define virtual method which was previously pure
11846 virtual.
11847 (Stub::do_thumb16_special): New method declaration.
11848 (Stub::do_fixed_endian_write): New template member.
11849 (Reloc_stub::do_write): Remove.
11850 (Reloc_stub::do_fixed_endian_write): Remove.
11851 (Cortex_a8_stub): New class definition.
11852 (Stub_factory::make_cortex_a8_stub): New method definition.
11853 (Stub_factory::Stub_factory): Add missing static storage class
11854 qualifier for elf32_arm_stub_a8_veneer_blx.
11855
ffeef7df
ILT
118562010-01-07 Ian Lance Taylor <iant@google.com>
11857
dc3f80fe
ILT
11858 PR 10980
11859 * options.h (class General_options): Add --warn-unresolved-symbols
11860 and --error-unresolved-symbols.
11861 * errors.cc (Errors::undefined_symbol): Implement
11862 --warn-unresolved-symbols.
11863
ffeef7df
ILT
11864 * options.h (class General_options): Add -z text and -z textoff.
11865 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11866
f1ec9ded
ST
118672010-01-06 Sriraman Tallam <tmsriram@google.com>
11868
11869 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11870 (Garbage_collection::cident_sections): New function.
11871 (Garbage_collection::add_cident_section): New function.
11872 (Garbage_collection::cident_sections_): New member.
11873 (gc_process_relocs): Add references to sections whose names are C
11874 identifiers.
11875 * gold.h (cident_section_start_prefix): New constant.
11876 (cident_section_stop_prefix): New constant.
11877 (is_cident): New function.
11878 * layout.cc (Layout::define_section_symbols): Replace string constants
11879 with the newly defined constants.
11880 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11881 C identifiers.
11882 * testsuite/Makefile.am: Add gc_orphan_section_test.
11883 * testsuite/Makefile.in: Regenerate.
11884 * testsuite/gc_orphan_section_test.cc: New file.
11885 * testsuite/gc_orphan_section_test.sh: New file.
11886
6eda8c29
ILT
118872010-01-06 Ian Lance Taylor <iant@google.com>
11888
b9674e17
ILT
11889 PR 10980
11890 * options.h (class General_options): Add --warn-shared-textrel.
11891 * layout.cc (Layout::finish_dynamic_section): Implement
11892 --warn-shared-textrel.
11893
6eda8c29
ILT
11894 PR 10980
11895 * options.h (class General_options): Add --warn-multiple-gp.
11896
32dcd44e
ILT
118972010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11898
11899 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11900 $(THREADSLIB) and $(LIBDL).
11901 * Makefile.in: Rebuild.
11902
a192ba05
ILT
119032010-01-06 Ian Lance Taylor <iant@google.com>
11904
11905 PR 10980
11906 * options.cc (General_options::parse_section_start): New function.
11907 (General_options::section_start): New function.
11908 (General_options::General_options): Initialize all members.
11909 * options.h: Include <map>
11910 (class General_options): Add --section-start. Add section_starts_
11911 member.
11912 * layout.cc (Layout::attach_allocated_section_to_segment): If
11913 --section-start was used, set the address of the segment. Remove
11914 local sort_sections.
11915 (Layout::relaxation_loop_body): If the address of the load segment
11916 has been set by --section-start, don't use it.
11917 * output.h (Output_segment::update_flags_for_output_section): New
11918 function.
11919 * output.cc (Output_segment::add_output_section): Call
11920 update_flags_for_output_section.
11921
dde3f402
ILT
119222010-01-05 Ian Lance Taylor <iant@google.com>
11923
62dfdd4d
ILT
11924 PR 10980
11925 * options.h (class General_options): Add --undefined-version.
11926 * script.cc (struct Version_expression): Add was_matched_by_symbol
11927 field.
11928 (Version_script_info::matched_symbol): New function.
11929 (Version_script_info::get_symbol_version_helper): Call
11930 matched_symbol.
11931 (Version_script_info::check_unmatched_names): New function.
11932 * script.h (class Version_script_info): Update declarations.
11933 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11934
9c4ae156
ILT
11935 * options.h (class General_options): Use DEFINE_bool_alias for
11936 allow_multiple_definition.
11937 * resolve.cc (Symbol_table::should_override): Don't test
11938 allow_multiple_definition.
11939
dde3f402
ILT
11940 PR 10980
11941 * options.h (class General_options): Add --cref.
11942 * main.cc (main): Print cref table if --cref. Don't close mapfile
11943 until after printing cref table.
11944 * cref.cc: Include "symtab.h".
11945 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11946 (Cref_table_compare::operator()): New function.
11947 (Cref_inputs::gather_cref): New function.
11948 (filecol): New static const.
11949 (Cref_inputs::print_cref): New function.
11950 (Cref::print_cref): New function.
11951 * cref.h: Include <cstdio>.
11952 (class Cref): Update declarations.
11953 * mapfile.h (Mapfile::file): New function.
11954 * object.h (class Object): Define Symbols. Declare virtual
11955 do_get_global_symbols.
11956 (Object::get_global_symbols): New function.
11957 * object.cc (Input_objects::add_object): Pass object to cref_ if
11958 --cref.
11959 (Input_objects::archive_start): Likewise.
11960 (Input_objects::archive_stop): Likewise.
11961 (Input_objects::print_cref): New function.
11962 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11963 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11964 --cref.
11965 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11966 function.
11967 * plugin.h (class Sized_pluginobj): Update declarations.
11968
8781f709
ILT
119692010-01-05 Ian Lance Taylor <iant@google.com>
11970
11971 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11972 to is_default_version. Rename insdef to insdefault.
11973 (Symbol_table::add_from_relobj): Rename def to is_default_version
11974 and local to is_forced_local.
11975 (Symbol_table::add_from_pluginobj): Likewise.
11976 (Symbol_table::add_from_dynobj): Likewise.
11977 (Symbol_table::define_special_symbol): Rename insdef to
11978 insdefault.
11979
fe35d28d
ILT
119802010-01-04 Ian Lance Taylor <iant@google.com>
11981
30bc8c46
ILT
11982 PR 10980
11983 * options.h (class General_options): Add
11984 --allow-multiple-definition and -z muldefs.
11985 * resolve.cc (Symbol_table::should_override): Don't warn about a
11986 multiple symbol definition if --allow-multiple-definition or -z
11987 muldefs.
11988
7eaea549
ILT
11989 PR 10980
11990 * options.h (class General_options): Add --add-needed and
11991 --copy-dt-needed-entries. Tweak --as-needed help entry.
11992 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11993 error if --copy-dt-needed-entries aka --add-needed is used and
11994 would cause a change in behaviour.
11995
fe35d28d
ILT
11996 PR 10980
11997 * options.h (class General_options): Add -G as a short version of
11998 --shared. Add no-op options -assert, -g, and -i.
11999
55a2bb35
ST
120002010-01-04 Sriraman Tallam <tmsriram@google.com>
12001
12002 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12003 check for .text or .gnu.linkonce.t sections.
12004 * icf.cc (Icf::find_identical_sections): Ditto.
12005 Change the detection for mangled function name within the section
12006 name.
12007 * icf.h (is_section_foldable_candidate): New function.
12008
719328e1
ILT
120092009-12-30 Ian Lance Taylor <iant@google.com>
12010
12011 PR 10980
12012 * options.h (class General_options): Permit two dashes with
12013 --retain-symbols-file.
12014
d7bb5745
ILT
120152009-12-30 Ian Lance Taylor <iant@google.com>
12016
403a15dd
ILT
12017 PR 10979
12018 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12019 don't put the file header and segment headers in the text
12020 segment.
12021
eda294df
ILT
12022 PR 10979
12023 * common.cc (Sort_commons::operator()): Stabilize sort when both
12024 entries are NULL.
12025 (Symbol_table::do_allocate_commons_list): When allocating common
12026 symbols, skip a symbol which is no longer common.
12027 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12028 an object before checking its type.
12029 * testsuite/common_test_2.c: New file.
12030 * testsuite/common_test_3.c: New file.
12031 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12032 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12033 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12034 (common_test_2_pic.o, common_test_2.so): New targets.
12035 (common_test_3_pic.o, common_test_3.so): New targets.
12036 * testsuite/Makefile.in: Rebuild.
12037
d7bb5745
ILT
12038 PR 10979
12039 * script.cc (read_input_script): If we see a new SECTIONS clause,
12040 and we have added an input section, give an error.
12041 * layout.h (class Layout): Add have_added_input_section function.
12042 Add have_added_input_section_ field.
12043 * layout.cc (Layout::Layout): Initialize
12044 have_added_input_section_.
12045 (Layout::layout): Set have_added_input_section_.
12046 (Layout::layout_eh_frame): Likewise.
12047
fc59c572
ILT
120482009-12-30 Ian Lance Taylor <iant@google.com>
12049
12050 PR 10931
12051 * options.h (class General_options): Add --sort-common option.
12052 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12053 * common.cc (Sort_common): Add sort_order parameter to
12054 constructor. Add sort_order_ field.
12055 (Sort_commons::operator): Check sort_order_.
12056 (Symbol_table::allocate_commons): Determine the sort order.
12057 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12058 Change all callers.
12059 (Symbol_table::do_allocate_commons_list): Likewise.
12060
1c74fab0
ILT
120612009-12-30 Ian Lance Taylor <iant@google.com>
12062
12063 PR 10916
12064 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12065 symbols from this object, don't change the visibility of an
12066 undefined symbol.
12067 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12068
6affe781
ILT
120692009-12-30 Ian Lance Taylor <iant@google.com>
12070
12071 PR 10861
12072 * script.h (class Version_script_info): Define Language enum.
12073 Update declarations. Define Glob, Exact, and Lookup types. Add
12074 new fields globals_, locals_, and is_finalized_.
12075 * script.cc: Various formatting fixes.
12076 (class Parser_closure): Change language_stack_ from a vector of
12077 std::string to one of Version_script_info::Language. Adjust all
12078 uses accordingly.
12079 (class Lazy_demangler): Remove.
12080 (struct Version_expression): Change language from std::string to
12081 Version_script_info::Language.
12082 (Version_script_info::Version_script_info): New function.
12083 (Version_script_info::~Version_script_info): Don't call clear.
12084 (Version_script_info::finalize): New function.
12085 (Version_script_info::build_lookup_tables): New function.
12086 (Version_script_info::build_expression_list_lookup): New
12087 function.
12088 (Version_script_info::get_symbol_version_helper): Rewrite to use
12089 lookup tables.
12090 (Version_script_info::print_expression_list): Adjust to use
12091 Version_script_info::Language.
12092 (script_push_lex_into_version_mode): Check that the version script
12093 has not been finalized.
12094 (version_script_push_lang): Change language string to
12095 Version_script_info::Language.
12096 * options.cc (Command_line::version_script): New function.
12097 * options.h (class General_options): Add finalize_dynamic_list
12098 function. Change version_script from declaration to definition.
12099 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12100 * testsuite/version_script.map: Remove duplicate def of foo.
12101 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12102 version_script.map.
12103 * testsuite/Makefile.in: Rebuild.
12104
818bf354
ILT
121052009-12-30 Ian Lance Taylor <iant@google.com>
12106
12107 PR 10843
12108 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12109 if the input symbol index is 0, make the output symbol index 0.
12110
ebcc8304
ILT
121112009-12-30 Ian Lance Taylor <iant@google.com>
12112
12113 PR 10670
12114 * options.h (class General_options): Add -x/--discard-all.
12115 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12116 --discard-all. If the local symbol needs a dynamic entry, check
12117 that before handling --discard-locals.
12118
176fe33f
ILT
121192009-12-30 Ian Lance Taylor <iant@google.com>
12120
bb321bb1
ILT
12121 PR 10450
12122 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12123 flags to PF_R.
12124 (Output_segment::add_output_section): Don't change the flags if
12125 the type is PT_TLS.
12126
176fe33f
ILT
12127 PR 10450
12128 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12129 GNU hash table if they need a dynamic value. Otherwise, don't add
12130 them if they are defined in a dynamic object or are forced local.
12131
e8cd95c7
ILT
121322009-12-29 Ian Lance Taylor <iant@google.com>
12133
1b81fb71
ILT
12134 PR 10450
12135 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12136 .gnu.hash table for a 32-bit target.
12137
8d6d383d
ILT
12138 PR 10450
12139 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12140 regular and a dynamic object only needs a dynamic symbol table
12141 entry if it is externally visible.
12142
e785ec03
ILT
12143 PR 10450
12144 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12145 constructor. Add global_offset_table_ field.
12146 (Target_i386::got_section): Set global_offset_table_.
12147 (Target_i386::do_finalize_sections): Set global_offset_table_
12148 size.
12149 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12150 in constructor. Add global_offset_table_ field.
12151 (Target_x86_64::got_section): Set global_offset_table_.
12152 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12153 size.
12154
1a2dff53
ILT
12155 * layout.cc (Layout::Layout): Initialize increase_relro_.
12156 (Layout::get_output_section): Add is_relro, is_last_relro, and
12157 is_first_non_relro parameters. Change all callers.
12158 (Layout::choose_output_section): Likewise.
12159 (Layout::add_output_section_data): Likewise.
12160 (Layout::make_output_section): Likewise.
12161 (Layout::set_segment_offsets): Clear increase_relro when using a
12162 linker script.
12163 * layout.h (class Layout): Add increase_relro method. Add
12164 increase_relro_ field. Update declarations.
12165 * output.cc (Output_section::Output_section): Initialize
12166 is_last_relro_ and is_first_non_relro_.
12167 (Output_segment::add_output_section): Group relro sections is
12168 do_sort is true. Handle is_last_relro and is_first_non_relro.
12169 (Output_segment::maximum_alignment): Remove relro handling.
12170 (Output_segment::set_section_addresses): Add increase_relro
12171 parameter. Change all callers. Add initial alignment to align
12172 relro sections on separate page. Remove old relro handling.
12173 (Output_segment::set_section_list_addresses): Remove in_relro
12174 parameter. Change all callers.
12175 (Output_segment::set_offset): Add increase parameter. Change all
12176 callers. Remove old relro handling.
12177 * output.h (class Output_section): Add new methods: is_last_relro,
12178 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12179 Add is_last_relro_ and is_first_non_relro_ fields.
12180 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12181 Create separate .got.plt section. Call increase_relro.
12182 * x86_64.cc (Target_x86_64::got_section): Likewise.
12183 * testsuite/relro_script_test.t: Add .got.plt.
12184
f0ba79e2
ILT
12185 PR 10450
12186 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12187 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12188 (Layout::finalize): Call set_dynamic_symbol_size.
12189 (Layout::set_dynamic_symbol_size): New function.
12190 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12191 set_dynamic_symbol_size.
12192
e8cd95c7
ILT
12193 PR 10450
12194 * output.h (class Output_section): Add is_entsize_zero_ field.
12195 * output.cc (Output_section::Output_section): Initialize
12196 is_entsize_zero_.
12197 (Output_section::set_entsize): If two different entsizes are
12198 requested, force it to zero.
12199 (Output_section::add_input_section): Set flags for .debug_str
12200 before updating section flags. Set entsize.
12201 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12202 and SHF_STRING if all input sections have those flags.
12203
3e1b9a8a
RÁE
122042009-12-29 Rafael Espindola <espindola@google.com>
12205
12206 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12207 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12208 reporting.
3e1b9a8a 12209
3dcad376
ST
122102009-12-29 Sriraman Tallam <tmsriram@google.com>
12211
12212 * options.cc (General_options::parse_version): Allow -v to exit
12213 without an error if there is nothing to link.
12214
084e2665
ILT
122152009-12-29 Ian Lance Taylor <iant@google.com>
12216
12217 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12218 using a version of gcc before 4.1.
12219 * configure: Rebuild.
12220
250acde3
CD
122212009-12-28 Chris Demetriou <cgd@google.com>
12222
12223 * attributes.cc (Output_attributes_section_data::do_write): Use
12224 std::vector::front rather than std::vector::data.
12225
99fff23b
ILT
122262009-12-28 Ian Lance Taylor <iant@google.com>
12227
12228 * symtab.h (class Symbol_table): Add enum Defined.
12229 * resolve.cc (Symbol_table::should_override): Add defined
12230 parameter. Change all callers. Test whether object is NULL
12231 before calling a method on it.
12232 (Symbol_table::report_resolve_problem): Add defined parameter.
12233 Change all callers.
12234 (Symbol_table::should_override_with_special): Likewise.
12235 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12236 parameter. Change all callers.
12237 (Symbol_table::do_define_in_output_data): Likewise.
12238 (Symbol_table::define_in_output_segment): Likewise.
12239 (Symbol_table::do_define_in_output_segment): Likewise.
12240 (Symbol_table::define_as_constant): Likewise.
12241 (Symbol_table::do_define_as_constant): Likewise.
12242 * script.h (class Symbol_assignment): Add is_defsym parameter to
12243 constructor; change all callers.
12244 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12245 parameter. Change all callers. Add is_defsym_ field.
12246 (class Parser_closure): Add parsing_defsym parameter to
12247 constructor; change all callers. Add parsing_defsym accessor
12248 function. Add parsing_defsym_ field.
12249
556bd683
ILT
122502009-12-28 Ian Lance Taylor <iant@google.com>
12251
12252 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12253 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12254
1782c879
ILT
122552009-12-23 Ian Lance Taylor <iant@google.com>
12256
12257 * i386.cc (Target_i386::do_calls_non_split): Recognize
12258 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12259 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12260 -fsplit-stack prologue when using %r11.
1782c879 12261
329ca2b1
ST
122622009-12-21 Sriraman Tallam <tmsriram@google.com>
12263
12264 * options.cc (General_options::parse_version): Make -v continue and do
12265 the link like GNU ld does.
12266
d675ff46
RÁE
122672009-12-17 Rafael Avila de Espindola <espindola@google.com>
12268
12269 * Makefile.am (CCFILES): Add timer.cc.
12270 (HFILES): Add timer.h.
12271 * configure.ac: Check for sysconf and times.
12272 * main.cc: include timer.h.
12273 (main): Use Timer instead of get_run_time.
12274 * timer.cc: New.
12275 * timer.h: New.
12276 * workqueue.cc: include timer.h.
12277 (Workqueue::find_and_run_task):
12278 Report user, sys and wall time.
12279 * Makefile.in: Regenerate.
12280 * config.in: Regenerate.
12281 * configure: Regenerate.
12282
d6344fb5
DK
122832009-12-16 Doug Kwan <dougkwan@google.com>
12284
12285 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12286 sections.
12287 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12288 relaxed input sections.
12289 * output.cc (Output_section::find_relaxed_input_section): Change
12290 return type to Output_relaxed_input_section pointer. Adjust code
12291 for new type of relaxed_input_section_map_.
12292 * output.h (Output_section::find_relaxed_input_section): Change
12293 return type to Output_relaxed_input_section pointer.
12294 (Output_section::Output_relaxed_input_section_by_input_section_map):
12295 New type.
12296 (Output_section::relaxed_input_section_map_): Change type to
12297 Output_section::Output_relaxed_input_section_by_input_section_map.
12298 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12299 input section.
12300
0e0d5469
ILT
123012009-12-15 Ian Lance Taylor <iant@google.com>
12302
12303 * layout.cc (Layout::create_shstrtab): Only write out after input
12304 sections if we are compressing debug sections.
12305
0649a889
ILT
123062009-12-15 Ian Lance Taylor <iant@google.com>
12307
12308 * archive.cc (Archive::add_symbols): Only look up a symbol without
12309 a version if there is, in fact, a version.
12310
2ea97941
ILT
123112009-12-14 Ian Lance Taylor <iant@google.com>
12312
12313 Revert -Wshadow changes, all changes from:
12314 2009-12-11 Doug Kwan <dougkwan@google.com>
12315 2009-12-11 Nick Clifton <nickc@redhat.com>
12316 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12317
b0eec2cc
DK
123182009-12-11 Doug Kwan <dougkwan@google.com>
12319
12320 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12321 due to -Wshadow.
12322 * attributes.cc (Object_attribute::size): Ditto.
12323 (Attributes_section_data::size): Ditto.
12324 (Attributes_section_data::Attributes_section_data): Ditto.
12325 (Output_attributes_section_data::do_write): Ditto.
12326 * attributes.h (Object_attribute::set_type): Ditto.
12327 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12328
91d6fa6a
NC
123292009-12-11 Nick Clifton <nickc@redhat.com>
12330
12331 * archive.cc: Fix shadowed variable warnings.
12332 * arm.cc: Likewise.
12333 * compressed_output.cc: Likewise.
12334 * compressed_output.h: Likewise.
12335 * configure: Likewise.
12336 * dwarf_reader.cc: Likewise.
12337 * dynobj.cc: Likewise.
12338 * dynobj.h: Likewise.
12339 * ehframe.cc: Likewise.
12340 * ehframe.h: Likewise.
12341 * errors.cc: Likewise.
12342 * expression.cc: Likewise.
12343 * fileread.cc: Likewise.
12344 * fileread.h: Likewise.
12345 * freebsd.h: Likewise.
12346 * i386.cc: Likewise.
12347 * icf.cc: Likewise.
12348 * incremental.h: Likewise.
12349 * layout.cc: Likewise.
12350 * layout.h: Likewise.
12351 * mapfile.cc: Likewise.
12352 * merge.cc: Likewise.
12353 * merge.h: Likewise.
12354 * object.cc: Likewise.
12355 * object.h: Likewise.
12356 * options.h: Likewise.
12357 * output.cc: Likewise.
12358 * output.h: Likewise.
12359 * parameters.cc: Likewise.
12360 * plugin.cc: Likewise.
12361 * powerpc.cc: Likewise.
12362 * reduced_debug_output.cc: Likewise.
12363 * reduced_debug_output.h: Likewise.
12364 * reloc.cc: Likewise.
12365 * reloc.h: Likewise.
12366 * resolve.cc: Likewise.
12367 * script-sections.cc: Likewise.
12368 * script.cc: Likewise.
12369 * script.h: Likewise.
12370 * sparc.cc: Likewise.
12371 * symtab.cc: Likewise.
12372 * symtab.h: Likewise.
12373 * target-select.cc: Likewise.
12374 * target-select.h: Likewise.
12375 * token.h: Likewise.
12376 * workqueue.cc: Likewise.
12377 * workqueue.h: Likewise.
12378 * x86_64.cc: Likewise.
12379
a0351a69
DK
123802009-12-10 Doug Kwan <dougkwan@google.com>
12381
12382 * arm.cc (attributes.h): New include.
12383 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12384 (Arm_relobj::~Arm_relobj): Delete object pointed by
12385 attributes_section_data_.
12386 (Arm_relobj::attributes_section_data): New method definition.
12387 (Arm_relobj::attributes_section_data_): New data member declaration.
12388 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12389 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12390 attributes_section_data_.
12391 (Arm_dynobj::attributes_section_data): New method definition.
12392 (Arm_dynobj::attributes_section_data_): New data member declaration.
12393 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12394 initialization value of may_use_blx_ to false.
2e702c99 12395 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12396 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12397 object attributes to compute results instead of hard-coding.
12398 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12399 Target_arm::get_secondary_compatible_arch,
12400 Target_arm::set_secondary_compatible_arch
12401 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12402 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12403 New method declarations.
12404 (Target_arm::get_aeabi_object_attribute): New method definition.
12405 (Target_arm::attributes_section_data_): New data member declaration.
12406 (read_arm_attributes_section): New template definition.
12407 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12408 (Arm_dynobj::do_read_symbols): Ditto.
12409 (Target_arm::do_finalize_sections): Merge attributes sections from
12410 input. Check for BLX use after attributes section merging.
12411 Fix __exidx_start and __exidx_end visibility. Create an
12412 .ARM.attributes section if necessary.
12413 (Target_arm::get_secondary_compatible_arch,
12414 Target_arm::set_secondary_compatible_arch,
12415 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12416 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12417 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12418 New method definitions.
12419
b59befec
ILT
124202009-12-09 Ian Lance Taylor <iant@google.com>
12421
12422 * plugin.cc (Plugin::load): Don't cast from void* to a function
12423 pointer.
12424
1276bc89
ILT
124252009-12-09 Ian Lance Taylor <iant@google.com>
12426
12427 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12428 information fields.
12429
2f2de248
L
124302009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12431
12432 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12433 Replace two_file_shared_1.so with two_file_shared_2.so.
12434 * testsuite/Makefile.in: Regenerated.
12435
4f787271
DK
124362009-12-08 Doug Kwan <dougkwan@google.com>
12437
12438 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12439 (HFILES): Add attributes.h and int_encoding.h.
12440 * Makefile.in: Regenerate.
12441 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12442 function definitions to int_encoding.cc
12443 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12444 prototypes to int_encoding.h
12445 * reduced_debug_output.cc (int_encoding.h): New include.
12446 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12447 function definitions to int_encoding.cc
12448 (insert_into_vector, read_from_pointer): Move template definitions to
12449 int_encoding.h
12450 * attributes.cc: New file.
12451 * attributes.h: New file.
12452 * int_encoding.cc: New file.
12453 * int_encoding.h: New file.
12454
20b52f1a
RÁE
124552009-12-07 Rafael Avila de Espindola <espindola@google.com>
12456
12457 PR gold/11055
12458 * incremental-dump.cc (dump_incremental_inputs): New.
12459 (main): Use dump_incremental_inputs.
12460
53d7974c
L
124612009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12462
12463 PR gold/10893
12464 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12465 checking elfcpp::STT_FUNC.
12466 (Target_i386::Relocate::relocate): Likewise.
12467 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12468
12469 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12470 symbols from shared libraries into normal FUNC symbols.
12471
12472 * symtab.h (Symbol): Add is_func and use it.
12473
05a352e6
DK
124742009-12-05 Doug Kwan <dougkwan@google.com>
12475
12476 * arm.cc (Target_arm::arm_info): Initialize new fields
12477 attributes_section and attributes_vendor.
12478 * i386.cc (Target_i386::i386_info): Same.
12479 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12480 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12481 fields attributes_section and attributes_vendor.
53d7974c 12482 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12483 * target.h (Target::attributes_section, Target::attributes_vendor,
12484 Target::is_attributes_section, Target::attribute_arg_type,
12485 Target::attributes_order): New method definitions.
12486 (Target::Target_info::attributes_section,
12487 Target::Target_info::attributes_vendor): New fields.
12488 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12489 virtual method definitions.
12490 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12491 attributes_section and attributes_vendor.
12492 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12493
f4e5969c
DK
124942009-12-05 Doug Kwan <dougkwan@google.com>
12495
12496 * arm.cc: Update comments about interworking and stub generation.
12497 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12498 considered as non-PIC.
12499 (Arm_relocate_functions::base_abs): Fix formatting.
12500 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12501 of function to use GOT entry address instead of offset.
12502 (Target_arm::Scan::global): Issue an error if a symbol would need a
12503 PLT does not get one because it is untyped. Remove code to create
12504 dynamic symbols for relative branches.
12505 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12506 takes unsigned integer instead of boolean.
12507
1abce4a6
L
125082009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12509
12510 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12511 (two_file_test_LDADD): Likewise.
12512 (common_test_1_LDADD): Likewise.
12513 (exception_test_LDADD) Likewise.
12514 (weak_test_LDADD): Likewise.
12515 (many_sections_test_LDADD): Likewise.
12516 (initpri1_LDADD): Likewise.
12517 (script_test_1_LDADD): Likewise.
12518 (script_test_2_LDADD): Likewise.
12519 (justsyms_LDADD): Likewise.
12520 (binary_test_LDADD): Likewise.
12521 (large_LDADD): Likewise.
12522 * testsuite/Makefile.in: Regenerated.
12523
adcf2816 125242009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12525
adcf2816
L
12526 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12527 (Symbol_table::override_with_special): Likewise.
12528 (Symbol_table::add_from_object): Likewise.
12529
28e67f5d
RÁE
125302009-12-04 Rafael Avila de Espindola <espindola@google.com>
12531
12532 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12533 Don't set the data_offset twice.
12534
ae10a101
RÁE
125352009-12-04 Rafael Avila de Espindola <espindola@google.com>
12536
12537 * testsuite/Makefile.in: Regenerate.
12538
f59f41f3
DK
125392009-12-03 Doug Kwan <dougkwan@google.com>
12540
12541 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12542 (Target_arm::do_finalize_sections): Add parameter for symbol table
12543 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12544 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12545 parameter for symbol table pointer.
12546 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12547 an additional parameter for a pointer to symbol table.
12548 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12549 parameter for a symbol table pointer.
12550 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12551 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12552 Ditto.
12553 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12554 parameter for a symbol table pointer.
12555
ca55d848
RÁE
125562009-12-03 Rafael Avila de Espindola <espindola@google.com>
12557
12558 * incremental.cc (Incremental_inputs_header)
12559 (Incremental_inputs_header_write, Incremental_inputs_entry)
12560 (Incremental_inputs_entry_write): Move ...
12561 * incremental.h (Incremental_inputs_header)
12562 (Incremental_inputs_header_write, Incremental_inputs_entry)
12563 (Incremental_inputs_entry_write): here.
12564
3aec4f9c
RÁE
125652009-12-02 Rafael Avila de Espindola <espindola@google.com>
12566
12567 * incremental.cc (make_sized_incremental_binary): Set the target.
12568 Error if it is incompatible.
12569 * output.h (Output_file): Add filename method.
12570
9c0ae74d
RÁE
125712009-12-02 Rafael Avila de Espindola <espindola@google.com>
12572
12573 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12574 from the get_* methods.
12575
a45500ae
RÁE
125762009-12-02 Rafael Avila de Espindola <espindola@google.com>
12577
12578 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12579 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12580 Write 0 for the data_offset of scripts.
12581
325e6408
RÁE
125822009-12-02 Rafael Avila de Espindola <espindola@google.com>
12583
12584 * testsuite/Makefile.am: Add the incremental_test.sh test.
12585 * testsuite/incremental_test.sh: New.
12586 * testsuite/incremental_test_1.c: New.
12587 * testsuite/incremental_test_2.c: New.
12588
954c3e2e
RÁE
125892009-12-01 Rafael Avila de Espindola <espindola@google.com>
12590
703d02da 12591 * incremental-dump.cc (main): Fix typos.
954c3e2e 12592
f8086623
RÁE
125932009-11-27 Rafael Avila de Espindola <espindola@google.com>
12594
12595 PR gold/11025
12596 * incremental-dump.cc (main): Use llu to print 64 bit values.
12597
3b0dd6ac
L
125982009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12599 H.J. Lu <hongjiu.lu@intel.com>
12600
12601 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12602 $(LIBDL).
12603 (incremental_dump_LDADD): Likewise.
12604 * Makefile.in: Regenerated.
12605
a6d1ef57 126062009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12607
a6d1ef57
DK
12608 Revert:
12609
12610 2009-11-25 Doug Kwan <dougkwan@google.com>
12611
12612 * arm.cc (Target_arm::Target_arm): Move method definition
12613 outside of class definition. Add code to handle
12614 --target1-rel, --target1-abs and --target2= options.
12615 (Target_arm::get_reloc_reloc_type): Change method to be
12616 non-static and const.
12617 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12618 New data member declaration.
12619 (Target_arm::Scan::local, Target_arm::Scan::global,
12620 Target_arm::Relocate::relocate,
12621 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12622 Adjust call to Target_arm::get_real_reloc_type.
12623 (Target_arm::get_real_reloc_type): Use command line options
12624 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12625 * options.h (--target1-rel, --target1-abs, --target2): New
12626 ARM-only options.
12627
50aeb7d4
DK
126282009-11-25 Doug Kwan <dougkwan@google.com>
12629
12630 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12631 class definition. Add code to handle --target1-rel, --target1-abs
12632 and --target2= options.
12633 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12634 and const.
12635 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12636 member declaration.
12637 (Target_arm::Scan::local, Target_arm::Scan::global,
12638 Target_arm::Relocate::relocate,
12639 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12640 call to Target_arm::get_real_reloc_type.
12641 (Target_arm::get_real_reloc_type): Use command line options to
12642 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12643 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12644 options.
12645
51938283
DK
126462009-11-25 Doug Kwan <dougkwan@google.com>
12647
12648 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12649 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12650 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12651 formatting.
12652 (Arm_relocate_functions::thm_call): Replace body with a call to
12653 Arm_relocate_functions::thumb_branch_common.
12654 (Arm_relocate_functions::thm_jump24,
12655 Arm_relocate_functions::thm_xpc22): New method definitions.
12656 (Arm_relocate_functions::thumb_branch_common): New method definition.
12657 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12658 operator.
12659 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12660 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12661
e2b8f3c4
RÁE
126622009-11-24 Rafael Avila de Espindola <espindola@google.com>
12663
12664 * Makefile.am: Build incremental-dump
12665 * Makefile.in: Regenerate.
12666 * incremental-dump.cc: New.
12667 * incremental.cc (Incremental_inputs_header_data,
12668 Incremental_inputs_entry_data): Move to incremental.h
12669 * incremental.h: (Incremental_inputs_header_data,
12670 Incremental_inputs_entry_data): Move from incremental.cc
12671
bcba9aec
RÁE
126722009-11-24 Rafael Avila de Espindola <espindola@google.com>
12673
12674 * incremental.cc (Incremental_inputs_header,
12675 Incremental_inputs_header_write, Incremental_inputs_entry,
12676 Incremental_inputs_entry_write): Add a typedef with the data type.
12677
7c3afe08
RÁE
126782009-11-24 Rafael Avila de Espindola <espindola@google.com>
12679
12680 * incremental.cc (Incremental_inputs_header,
12681 Incremental_inputs_header_write, Incremental_inputs_entry,
12682 Incremental_inputs_entry_write): Update comment about which
12683 type has the filed descriptions.
12684
d204b6e9
DK
126852009-11-15 Doug Kwan <dougkwan@google.com>
12686
12687 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12688 (Arm_relocate_functions::arm_branch_common): Change method defintion
12689 in class definition to a method declaration and update list of formal
12690 parameters.
12691 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12692 Arm_relocation_functions::jump24): Adjust call to
12693 Arm_relocate_functions::arm_branch_common. Update list of formal
12694 parameters.
12695 (Arm_relocate_functions::xpc25): New method definition.
12696 (Arm_relocate_functions::arm_branch_common): Move method defintion
12697 out from class definition. Use stubs for mode-switching and extending
12698 branch ranges.
12699 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12700 specially. Change code to enable use of stubs in ARM branches.
12701
43d12afe
DK
127022009-11-10 Doug Kwan <dougkwan@google.com>
12703
12704 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12705 in method declaration.
12706 (Target_arm::relocate_stub): New method declaration.
12707 (Target_arm::default_target): Change to return a pointer instead of
12708 a const reference.
12709 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12710 Target_arm::default_target.
12711 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12712 method definition.
12713 (Target_arm::relocate_section): Adjust view.
12714 (Target_arm::relocate_stub): New method definition.
12715
ac33a407
DK
127162009-11-10 Doug Kwan <dougkwan@google.com>
12717
12718 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12719 a format warning.
12720 * incremental.cc (open_incremental_binary): Initialized local
12721 variables to avoid warnings.
12722 * object.cc (make_elf_object): Ditto.
12723 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12724 a format warning.
e1df38aa 12725
88ee28e9
L
12726009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12727
12728 PR gold/10930
12729 * testsuite/plugin_test.c: Include "config.h".
12730
2daedcd6
DK
127312009-11-09 Doug Kwan <dougkwan@google.com>
12732
12733 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12734 (arm_symbol_value): Remove.
12735 (Arm_relocate_functions::arm_branch_common,
12736 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12737 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12738 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12739 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12740 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12741 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12742 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12743 Arm_relocate_functions::thm_mobw_abs_nc,
12744 Arm_relocate_functions::thm_mov_abs,
12745 Arm_relocate_functions::movw_prel_nc,
12746 Arm_relocate_functions::thm_movt_abs,
12747 Arm_relocate_functions::movt_prel,
12748 Arm_relocate_functions::thm_movw_prel_nc,
12749 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12750 (Target_arm::Relocate::relocate): Only decompose address into two
12751 parts if relocation type uses the thumb-bit and pass the actual
12752 bit instead of a flag indicating that the thumb-bit is used. Adjust
12753 calls to methods in Arm_relocate_functions for this change.
12754
1276bc89 127552009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12756
12757 PR 10925
12758 * reloc.cc: Instantiate
12759 Sized_relobj::initialize_input_to_output_maps and
12760 Sized_relobj:free_input_to_output_maps.
12761
e53ad1b5
ILT
127622009-11-06 Ian Lance Taylor <iant@google.com>
12763
12764 PR 10876
12765 * defstd.cc (in_segment): Set only_if_ref true for "end".
12766
eb44217c
DK
127672009-11-06 Doug Kwan <dougkwan@google.com>
12768
12769 * arm.cc (class Reloc_stub): Correct a comment.
12770 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12771 (Target_arm::scan_section_for_stubs): New method declaration.
12772 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12773 Change methods from private to protected.
12774 (Target_arm::do_may_relax): New method definition.
12775 (Target_arm::do_relax, Target_arm::group_sections,
12776 Target_arm::scan_reloc_for_stub,
12777 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12778 (Target_arm::arm_input_section_map_): New data member declaration.
12779 (Target_arm::scan_reloc_for_stub,
12780 Target_arm::scan_reloc_section_for_stubs,
12781 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12782 Target_arm::do_relax): New method definitions.
12783
5d329b7d
ILT
127842009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12785
12786 * configure.ac: Check for (struct stat)::st_mtim
12787 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12788 * config.in: Regenerate.
12789 * configure: Regenerate.
12790
96a0d71b
ILT
127912009-11-05 Ian Lance Taylor <iant@google.com>
12792
12793 PR 10910
12794 * output.cc (Output_segment::add_output_section): Add missing
12795 return statement.
12796
594c8e5e
ILT
127972009-11-04 Ian Lance Taylor <iant@google.com>
12798
12799 PR 10880
12800 * object.h (class Object): Add is_needed and set_is_needed
12801 methods. Add is_needed_ field. Make bool fields into bitfields.
12802 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12803 defined in a dynamic object and referenced by a regular object,
12804 set is_needed for the dynamic object.
12805 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12806 if the file is marked with as_needed and it is not needed.
12807
22b127cc
ILT
128082009-11-04 Ian Lance Taylor <iant@google.com>
12809
12810 PR 10887
12811 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12812 tags if data is discarded by linker script.
12813 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12814 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12815 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12816 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12817
f5c870d2
ILT
128182009-11-04 Ian Lance Taylor <iant@google.com>
12819
12820 * layout.cc (Layout::get_output_section): Add is_interp and
12821 is_dynamic_linker_section parameters. Change all callers.
12822 (Layout::choose_output_section): Likewise.
12823 (Layout::make_output_section): Likewise.
12824 (Layout::add_output_section_data): Add is_dynamic_linker_section
12825 parameter. Change all callers.
12826 * layout.h (class Layout): Update declarations.
12827 * output.h (class Output_section): Add is_interp, set_is_interp,
12828 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12829 Add is_interp_, is_dynamic_linker_section_ fields. Change
12830 generate_code_fills_at_write_ to a bitfield.
12831 * output.cc (Output_section::Output_sections): Initialize new
12832 fields.
12833 (Output_segment::add_output_section): Add do_sort parameter.
12834 Change all callers.
12835
1ae4d23b
ILT
128362009-11-03 Ian Lance Taylor <iant@google.com>
12837
12838 PR 10860
12839 * options.h (class General_options): Add --warn-common.
12840 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12841 merging two common symbols.
12842 (Symbol_table::should_override): Handle --warn-common when merging
12843 a common symbol with a defined symbol. Use report_resolve_problem
12844 for multiple definitions.
12845 (Symbol_table::report_resolve_problem): New function.
12846 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12847
55da9579
DK
128482009-11-03 Doug Kwan <dougkwan@google.com>
12849
12850 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12851 stub_factory_.
12852 (Target_arm::stub_factory): New method definition.
12853 (Target_arm::new_arm_input_section,
12854 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12855 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12856 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12857 New type definitions.
12858 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12859 member declarations.
12860 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12861 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12862 New method definitions.
12863
37a9ac43
ILT
128642009-11-03 Ian Lance Taylor <iant@google.com>
12865
12866 * options.h (class General_options): Add --warn_constructors.
12867
b3d6a3d4
ILT
128682009-11-03 Ian Lance Taylor <iant@google.com>
12869
12870 PR 10893
12871 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12872 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12873
934b01dd
ILT
128742009-11-03 Ian Lance Taylor <iant@google.com>
12875
12876 PR 10895
12877 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12878 --msgid-bugs-address.
12879 (install-pdf): New target.
12880 (install-data_yes): Look up one directory to find mkinstalldirs.
12881
03c1939b
L
128822009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12883
12884 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12885 tree.
12886
ebd95253
DK
128872009-10-30 Doug Kwan <dougkwan@google.com>
12888
12889 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12890
e9bbb538
DK
128912009-10-30 Doug Kwan <dougkwan@google.com>
12892
12893 * arm.cc (Stub_addend_reader): New struct template definition
12894 and partial specializations.
12895 (Stub_addend_reader::operator()): New method definition for a
12896 partially specialized template.
12897
d5b40221
DK
128982009-10-30 Doug Kwan <dougkwan@google.com>
12899
12900 * arm.cc (Arm_relobj::processor_specific_flags): New method
12901 definition.
12902 (Arm_relobj::do_read_symbols): New method declaration.
12903 (Arm_relobj::processor_specific_flags_): New data member declaration.
12904 (Arm_dynobj): New class definition.
12905 (Target_arm::do_finalize_sections): Add input_objects parameter.
12906 (Target_arm::do_adjust_elf_header): New method declaration.
12907 (Target_arm::are_eabi_versions_compatible,
12908 (Target_arm::merge_processor_specific_flags): New method declaration.
12909 (Target_arm::do_make_elf_object): New overloaded method definitions
12910 and declaration.
12911 (Arm_relobj::do_read_symbols): New method definition.
12912 (Arm_dynobj::do_read_symbols): Ditto.
12913 (Target_arm::do_finalize_sections): Add input_objects parameters.
12914 Merge processor-specific flags from all input objects.
12915 (Target_arm::are_eabi_versions_compatible,
12916 Target_arm::merge_processor_specific_flags,
12917 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12918 New method definitions.
12919 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12920 Input_objects pointer type parameter.
12921 * layout.cc (Layout::finalize): Pass input objects to target's.
12922 finalize_sections function.
12923 * output.cc (Output_file_header::do_sized_write): Set ELF file
12924 header's processor-specific flags.
12925 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12926 Input_objects pointer type parameter.
12927 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12928 * target.h (Input_objects): New forward class declaration.
12929 (Target::processor_specific_flags,
12930 Target::are_processor_specific_flags_sect): New method definitions.
12931 (Target::finalize_sections): Add input_objects parameter.
12932 (Target::Target): Initialize processor_specific_flags_ and
12933 are_processor_specific_flags_set_.
12934 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12935 parameter.
12936 (Target::set_processor_specific_flags): New method definition.
12937 (Target::processor_specific_flags_,
12938 Target::are_processor_specific_flags_set_): New data member
12939 declarations.
12940 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12941 Input_objects pointer type parameter.
12942
ebabffbd
DK
129432009-10-30 Doug Kwan <dougkwan@google.com>
12944
12945 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12946
ad0f2072
ILT
129472009-10-28 Ian Lance Taylor <iant@google.com>
12948
12949 * object.h (class Relobj): Drop options parameter from
12950 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12951 do_scan_relocs, do_relocate. Change all callers.
12952 (class Sized_relobj): Drop options parameters from
12953 do_gc_process_relocs, do_scan_relocs, do_relocate,
12954 do_relocate_sections, relocate_sections, emit_relocs_scan,
12955 emit_relocs_scan_reltype. Change all callers.
12956 (struct Relocate_info): Remove options field and all references to
12957 it.
12958 * reloc.h (class Read_relocs): Remove options constructor
12959 parameter and options_ field. Change all callers.
12960 (class Gc_process_relocs, class Scan_relocs): Likewise.
12961 (class Relocate_task): Likewise.
12962 * target-reloc.h (scan_relocs): Remove options parameter. Change
12963 all callers.
12964 (scan_relocatable_relocs): Likewise.
12965 * target.h (class Sized_target): Remove options parameter from
12966 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12967 all callers.
12968 * gc.h (gc_process_relocs): Remove options parameter. Change all
12969 callers.
12970 * arm.cc: Update functions to remove options parameters.
12971 * i386.cc: Likewise.
12972 * powerpc.cc: Likewise.
12973 * sparc.cc: Likewise.
12974 * x86_64.cc: Likewise.
12975 * testsuite/testfile.cc: Likewise.
12976
8ffa3667
DK
129772009-10-28 Doug Kwan <dougkwan@google.com>
12978
12979 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12980 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12981 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12982 New method definitions.
12983
40f36857
CC
129842009-10-28 Cary Coutant <ccoutant@google.com>
12985
12986 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12987 (Plugin::cleanup_done_): New member.
12988 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12989 (Plugin_manager::cleanup_done_): Remove.
12990 (Plugin_manager::add_input_file): Edit error message.
12991 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12992 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12993
2c849493
ILT
129942009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12995
12996 * fileread.cc: (File_read::View::~View): Use the new
12997 data_ownership_ filed.
12998 (File_read::~File_read): Dispose the new whole_file_view_.
12999 (File_read::open): Mmap the whole file if needed.
13000 (File_read::open): Use whole_file_view_ instead of contents_.
13001 (File_read::find_view): Use whole_file_view_ if applicable.
13002 (File_read::do_read): Use whole_file_view_ instead of contents_.
13003 (File_read::make_view): Use whole_file_view_ instead of contents_,
13004 update File_read::View::View call.
13005 (File_read::find_or_make_view): Update File_read::View::View
13006 call.
13007 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13008 remove contents_
13009 (File_read::View::Data_ownership): New enum.
13010 (File_read::View::View): Replace bool mapped_ with Data_ownership
13011 argument.
13012 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13013 (File_read::View::data_ownership_): New field.
13014 (File_read::contents_): Remove (replaced by whole_file_view_).
13015 (File_read::whole_file_view_): New field.
13016 * options.h (class General_options): Add --keep-files-mapped.
13017
24998053
CC
130182009-10-27 Cary Coutant <ccoutant@google.com>
13019
13020 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13021 * testsuite/Makefile.am (plugin_test_5): New test case.
13022 * testsuite/Makefile.in: Regenerate.
13023
72adc4fa
DK
130242009-10-25 Doug Kwan <dougkwan@google.com>
13025
13026 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13027 from private to protected to allow access by child class.
13028 (Sized_relobj::do_relocate_sections): New method declaration.
13029 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13030 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13031 Sized_relobj::relocate_sections. Instantiate template explicitly
13032 for different target sizes and endianity.
13033
07f508a2
DK
130342009-10-24 Doug Kwan <dougkwan@google.com>
13035
13036 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13037 (Arm_input_section::as_arm_input_section): New method.
13038 (Arm_output_section): New class definition.
13039 (Arm_output_section::create_stub_group,
13040 Arm_output_section::group_sections): New method definitions.
13041
10ad9fe5
DK
130422009-10-22 Doug Kwan <dougkwan@google.com>
13043
13044 * arm.cc (Arm_input_section): New class definition.
13045 (Arm_input_section::init, Arm_input_section:do_write,
13046 Arm_input_section::set_final_data_size,
13047 Arm_input_section::do_reset_address_and_file_offset): New method
13048 definitions.
13049
56ee5e00
DK
130502009-10-21 Doug Kwan <dougkwan@google.com>
13051
13052 * arm.cc (Stub_table, Arm_input_section): New forward class
13053 declarations.
13054 (Stub_table): New class defintion.
13055 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13056 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13057 New method definition.
13058
b569affa
DK
130592009-10-21 Doug Kwan <dougkwan@google.com>
13060
13061 * arm.cc: Update copyright comments.
13062 (Target_arm): New forward class template declaration.
13063 (Arm_address): New type.
13064 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13065 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13066 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13067 constants.
13068 (Insn_template): Same.
13069 (DEF_STUBS): New macro.
13070 (Stub_type): New enum type.
13071 (Stub_template): New class definition.
13072 (Stub): Same.
13073 (Reloc_stub): Same.
13074 (Stub_factory): Same.
13075 (Target_arm::Target_arm): Initialize may_use_blx_ and
13076 should_force_pic_veneer_.
13077 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13078 Target_arm::should_force_pic_veneer,
13079 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13080 Target_arm::using_thumb_only, Target_arm:;default_target): New
13081 method defintions.
13082 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13083 New data member declarations.
13084 (Insn_template::size, Insn_template::alignment): New method defintions.
13085 (Stub_template::Stub_template): New method definition.
13086 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13087 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13088 (Stub_factory::Stub_factory): New method definition.
13089 * gold.h (string_hash): New template.
13090 * output.h (Input_section_specifier::hash_value): Use
13091 gold::string_hash.
13092 (Input_section_specifier::string_hash): Remove.
13093 * stringpool.cc (Stringpool_template::string_hash): Use
13094 gold::string_hash.
13095
6c172549
DK
130962009-10-20 Doug Kwan <dougkwan@google.com>
13097
13098 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13099 symbols of relaxed input sections.
13100 * output.h (Output_section::find_relaxed_input_section): Make
13101 method public.
13102
c5617f2f
DK
131032009-10-16 Doug Kwan <dougkwan@google.com>
13104
13105 * dynobj.cc (Versions::Versions): Initialize version_script_.
13106 Only insert base version symbol definition for a shared object
13107 if version script defines any version versions.
13108 (Versions::define_base_version): New method definition.
13109 (Versions::add_def): Check that base version is not needed.
13110 (Versions::add_need): Define base version lazily.
13111 * dynobj.h (Versions::define_base_version): New method declaration.
13112 (Versions::needs_base_version_): New data member declaration.
13113 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13114 (check_DATA): Add no_version_test.stdout.
13115 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13116 New make rules.
13117 * testsuite/Makefile.in: Regenerate.
13118 * testsuite/no_version_test.c: New file.
13119 * testsuite/no_version_test.sh: Ditto.
13120
3c12dcdb
DK
131212009-10-16 Doug Kwan <dougkwan@google.com>
13122
13123 * expression.cc (class Segment_start_expression): New class definition.
13124 (Segment_start_expression::value): New method definition.
13125 (script_exp_function_segment_start): Return a new
13126 Segment_start_expression.
13127 * gold/script-c.h (script_saw_segment_start_expression): New function
13128 prototype.
13129 * script-sections.cc (Script_sections::Script_sections): Initialize
13130 SAW_SEGMENT_START_EXPRESSION_ to false.
13131 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13132 and -Tbbs options to specify section addresses if given in
13133 command line and no SEGMENT_START expression is seen in a script.
13134 * script-sections.h (Script_sections::saw_segment_start_expression,
13135 Script_sections::set_saw_segment_start_expression): New method
13136 definition.
13137 (Script_sections::saw_segment_start_expression_): New data member
13138 declaration.
13139 * script.cc (script_saw_segment_start_expression): New function.
13140 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13141 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13142 script_test_7.sh and script_test_8.sh.
13143 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13144 script_test_8.stdout.
13145 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13146 (script_test_6, script_test_6.stdout, script_test_7,
13147 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13148 * Makefile.in: Regenerate.
13149 * testsuite/script_test_6.sh: New file.
13150 * testsuite/script_test_6.t: Same.
13151 * testsuite/script_test_7.sh: Same.
13152 * testsuite/script_test_7.t: Same.
13153 * testsuite/script_test_8.sh: Same.
13154
64b1ae37
DK
131552009-10-16 Doug Kwan <dougkwan@google.com>
13156
13157 * output.cc (Output_segment::set_section_list_address): Cast
13158 expressions to unsigned long long type to avoid format warnings.
13159
661be1e2
ILT
131602009-10-15 Ian Lance Taylor <iant@google.com>
13161
12edd763 13162 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13163 dot assignment to script_sections_.
12edd763
ILT
13164 * script-sections.cc (Script_sections::add_dot_assignment):
13165 Initialize if necessary.
13166
68b6574b
ILT
13167 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13168 program headers with no load segment if there is a linker script.
13169
661be1e2
ILT
13170 * layout.cc (Layout::set_segment_offsets): Align the file offset
13171 to the segment aligment for -N or -n with no load segment.
13172 * output.cc (Output_segment::add_output_section): Don't crash if
13173 the first section is a TLS section.
13174 (Output_segment::set_section_list_addresses): Print an error
13175 message if the address moves backward in a linker script.
13176 * script-sections.cc
13177 (Output_section_element_input::set_section_addresses): Don't
13178 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13179 (Orphan_output_section::set_section_addresses): Likewise.
13180
f15f61a7
DK
131812009-10-15 Doug Kwan <dougkwan@google.com>
13182
13183 * layout.cc (Layout::finish_dynamic_section): Generate tags
13184 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13185 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13186 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13187
82bb573a
ILT
131882009-10-14 Ian Lance Taylor <iant@google.com>
13189
13190 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13191 fields.
13192 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13193 data_shdr fields of relinfo.
13194 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13195 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13196 R_386_TLS_LDO_32, adjust based on section flags.
13197 (Target_i386::Relocate::fix_up_ldo): Remove.
13198
374ad285
ILT
131992009-10-13 Ian Lance Taylor <iant@google.com>
13200
13201 Add support for -pie.
13202 * options.h (class General_options): Add -pie and
13203 --pic-executable.
13204 (General_options::output_is_position_independent): Test -pie.
13205 (General_options::output_is_executable): Return true if not shared
13206 and not relocatable.
13207 (General_options::output_is_pie): Remove.
13208 * options.cc (General_options::finalize): Reject incompatible uses
13209 of -pie.
13210 * gold.cc (queue_middle_tasks): A -pie link is not static.
13211 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13212 * symtab.cc (Symbol::final_value_is_known): Return false if
13213 output_is_position_independent.
13214 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13215 output_is_position_independent.
13216 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13217 output_is_position_independent.
13218 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13219 output_is_position_independent.
13220 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13221 two_file_pie_test.
13222 (basic_pie_test.o, basic_pie_test): New targets.
13223 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13224 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13225 (two_file_pie_test): New target.
13226 * testsuite/Makefile.in: Rebuild.
13227 * README: Remove note saying that -pie is not supported.
13228
c6585162
ILT
132292009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13230
13231 * options.h (class General_options): Add -init and -fini.
13232 * layout.cc (Layout::finish_dynamic_section): Emit
13233 given init and fini functions.
13234
032ce4e9
ST
132352009-10-13 Sriraman Tallam <tmsriram@google.com>
13236
13237 * gc.h (gc_process_relocs): Check if icf is enabled using new
13238 function.
13239 * gold.cc (queue_initial_tasks): Likewise.
13240 (queue_middle_tasks): Likewise.
13241 * object.cc (do_layout): Likewise.
13242 * symtab.cc (is_section_folded): Likewise.
13243 * main.cc (main): Likewise.
13244 * reloc.cc (Read_relocs::run): Likewise.
13245 (Sized_relobj::do_scan_relocs): Likewise.
13246 * icf.cc (is_function_ctor_or_dtor): New function.
13247 (Icf::find_identical_sections): Check if function is ctor or dtor when
13248 safe icf is chosen.
13249 * options.h (General_options::icf): Change option to be an enum.
13250 (Icf_status): New enum.
13251 (icf_enabled): New method.
13252 (icf_safe_folding): New method.
13253 (set_icf_status): New method.
13254 (icf_status_): New variable.
13255 * (options.cc) (General_options::finalize): Set icf_status_.
13256 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13257 icf_test and icf_keep_unique_test to use the --icf enum flag.
13258 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13259 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13260
f345227a
ST
132612009-10-12 Sriraman Tallam <tmsriram@google.com>
13262
13263 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13264 includes to gc.h and icf.h.
13265 * arm.cc: Include gc.h.
13266 * gold.cc: Likewise.
13267 * i386.cc: Likewise.
13268 * powerpc.cc: Likewise.
13269 * sparc.cc: Likewise.
13270 * x86_64.cc: Likewise.
13271 * gc.h: Include icf.h.
13272
1c7814ed
ILT
132732009-10-11 Ian Lance Taylor <iant@google.com>
13274
13275 * plugin.cc: Include "gold.h" before other header files.
13276
ae3b5189
CD
132772009-10-10 Chris Demetriou <cgd@google.com>
13278
13279 * options.h (Input_file_argument::Input_file_type): New enum.
13280 (Input_file_argument::is_lib_): Replace with...
13281 (Input_file_argument::type_): New member.
13282 (Input_file_argument::Input_file_argument): Take Input_file_type
13283 'type' rather than boolean 'is_lib' as second argument.
13284 (Input_file_argument::is_lib): Use type_.
13285 (Input_file_argument::is_searched_file): New function.
13286 (Input_file_argument::may_need_search): Handle is_searched_file.
13287 * options.cc (General_options::parse_library): Support -l:filename.
13288 (General_options::parse_just_symbols): Update for Input_file_argument
13289 changes.
13290 (Command_line::process): Likewise.
13291 * archive.cc (Archive::get_file_and_offset): Likewise.
13292 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13293 * script.cc (read_script_file, script_add_file): Likewise.
13294 * fileread.cc (Input_file::Input_file): Likewise.
13295 (Input_file::will_search_for): Handle is_searched_file.
13296 (Input_file::open): Likewise.
13297 * readsyms.cc (Read_symbols::get_name): Likewise.
13298 * testsuite/Makefile.am (searched_file_test): New test.
13299 * testsuite/Makefile.in: Regenerate.
13300 * testsuite/searched_file_test.cc: New file.
13301 * testsuite/searched_file_test_lib.cc: New file.
13302
f3048a1d
ILT
133032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13304 Ian Lance Taylor <iant@google.com>
13305
13306 * descriptor.cc: Include <cstdio> and "binary-io.h".
13307 (Descriptors::open): Open the files in binary mode always.
13308 * script.cc (Lex::get_token): Treat \r as whitespace.
13309
d4780e57
ILT
133102009-10-09 Ian Lance Taylor <iant@google.com>
13311
13312 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13313
d9a893b8
ILT
133142009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13315 Ian Lance Taylor <iant@google.com>
13316
13317 * configure.ac: Check for readv function also.
13318 * fileread.cc (readv): Define if not HAVE_READV.
13319 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13320 does not exist.
13321 * config.in: Regenerate.
13322 * configure: Regenerate.
13323
c0a62865
DK
133242009-10-09 Doug Kwan <dougkwan@google.com>
13325
13326 * layout.cc (Layout::make_output_section): Call target hook to make
13327 ordinary output section.
13328 (Layout::finalize): Adjust parameter list of call the
13329 Target::may_relax().
13330 * layout.h (class Layout::section_list): New method.
13331 * merge.h (Output_merge_base::entsize): Change visibility to public.
13332 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13333 New methods.
13334 (Output_merge_string::do_is_string): New method.
13335 * object.cc (Sized_relobj::do_setup): renamed from
13336 Sized_relobj::set_up.
13337 * object.h (Sized_relobj::adjust_shndx,
13338 Sized_relobj::initializ_input_to_output_maps,
13339 Sized_relobj::free_input_to_output_maps): Change visibilities to
13340 protected.
13341 (Sized_relobj::setup): Virtualize.
13342 (Sized_relobj::do_setup): New method declaration.
13343 (Sized_relobj::invalidate_section_offset,
13344 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13345 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13346 * options.cc (parse_int): New function.
13347 * options.h (parse_int): New declaration.
13348 (DEFINE_int): New macro.
13349 (stub_group_size): New option.
13350 * output.cc (Output_section::Output_section): Initialize memebers
13351 merge_section_map_, merge_section_by_properties_map_,
13352 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13353 (Output_section::add_input_section): Handled deferred code-fill
13354 generation and remove an old comment.
13355 (Output_section::add_relaxed_input_section): New method definition.
13356 (Output_section::add_merge_input_section): Use merge section by
13357 properties map to speed to search. Update merge section maps
13358 as appropriate.
13359 (Output_section::build_relaxation_map): New method definition.
13360 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13361 Same.
13362 (Output_section::relax_input_section): Renamed to
13363 Output_section::convert_input_sections_to_relaxed_sections and change
13364 interface to take a vector of pointers to relaxed sections.
13365 (Output_section::find_merge_section,
13366 Output_section::find_relaxed_input_section): New method definitions.
13367 (Output_section::is_input_address_mapped,
13368 Output_section::output_offset, Output_section::output_address):
13369 Use output section data maps to speed up searching.
13370 (Output_section::find_starting_output_address): Add comments.
13371 (Output_section::do_write,
13372 Output_section::write_to_postprocessing_buffer): Do code-fill
13373 generation as appropriate.
13374 (Output_section::get_input_sections): Invalidate relaxed input section
13375 map.
13376 (Output_section::restore_states): Adjust type of checkpoint .
13377 Invalidate relaxed input section map.
13378 * output.h (Output_merge_base): New class declaration.
13379 (Input_section_specifier): New class defintion.
13380 (class Output_relaxed_input_section) Change base class to
13381 Output_section_data_build.
13382 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13383 base class initializer.
13384 (Output_section::add_relaxed_input_section): New method declaration.
13385 (Output_section::Input_section): Change visibility to protected.
2e702c99 13386 (Output_section::Input_section::relobj,
c0a62865
DK
13387 Output_section::Input_section::shndx): Handle relaxed input sections.
13388 Output_section::input_sections) Change visibility to protected. Also
13389 define overload to return a non-const pointer.
13390 (Output_section::Merge_section_properties): New class defintion.
13391 (Output_section::Merge_section_by_properties_map,
13392 Output_section::Output_section_data_by_input_section_map,
13393 Output_section::Relaxation_map): New types.
13394 (Output_section::relax_input_section): Rename method to
13395 Output_section::convert_input_sections_to_relaxed_sections and change
13396 interface to take a vector of relaxed section pointers.
13397 (Output_section::find_merge_section,
13398 Output_section::find_relaxed_input_section,
13399 Output_section::build_relaxation_map,
13400 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13401 New method declarations.
13402 (Output_section::merge_section_map_
13403 Output_section::merge_section_by_properties_map_,
13404 Output_section::relaxed_input_section_map_,
13405 Output_section::is_relaxed_input_section_map_valid_,
13406 Output_section::generate_code_fills_at_write_): New data members.
13407 * script-sections.cc
13408 (Output_section_element_input::set_section_addresses): Call
13409 current_data_size and addralign methods of relaxed input sections.
13410 (Orphan_output_section::set_section_addresses): Call current_data_size
13411 and addralign methods of relaxed input sections.
13412 * symtab.cc (Symbol_table::compute_final_value): Extract template
13413 from the body of Symbol_table::sized_finalize_symbol.
13414 (Symbol_table::sized_finalized_symbol): Call
13415 Symbol_table::compute_final_value.
13416 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13417 (Symbol_table::compute_final_value): New templated method declaration.
13418 * target.cc (Target::do_make_output_section): New method defintion.
13419 * target.h (Target::make_output_section): New method declaration.
13420 (Target::relax): Add more parameters for input objects, symbol table
13421 and layout. Adjust call to do_relax.
13422 (Target::do_make_output_section): New method declaration.
13423 (Target::do_relax): Add parameters for input objects, symbol table
13424 and layout.
13425
d446d6c4
ILT
134262009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13427
13428 * pread.c: Include stdio.h.
13429
bc06c745
ILT
134302009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13431
13432 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13433 defined.
13434
75aea3d0
ILT
134352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13436
13437 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13438 Change read_shndx type to unsigned int.
13439 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13440 int.
13441 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13442 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13443 Change read_shndx type to unsigned int.
13444 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13445 int.
13446 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13447 * layout.cc (Layout::create_symtab_sections): Cast the result of
13448 local_symcount * symsize to off_t in the gold_assert.
13449
be8fcb75
ILT
134502009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13451
13452 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13453 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13454 R_ARM_BASE_ABS.
13455 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13456 (Arm_relocate_functions::thm_abs5): New function.
13457 (Arm_relocate_functions::abs12): New function.
13458 (Arm_relocate_functions::abs16): New function.
13459 (Arm_relocate_functions::base_abs): New function.
13460 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13461 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13462 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13463 R_ARM_BASE_ABS.
13464 (Scan::global): Likewise.
13465 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13466 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13467 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13468 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13469 R_ARM_BASE_ABS.
13470
c2a122b6
ILT
134712009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13472
13473 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13474 (Arm_relocate_functions::movt_prel): New function.
13475 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13476 (Arm_relocate_functions::thm_movt_prel): New function.
13477 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13478 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13479 (Scan::global, Relocate::relocate): Likewise.
13480 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13481
c4aa1e2d
ILT
134822009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13483
13484 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13485 Incremental_checker.
13486 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13487 unsigned int.
13488 (class Incremental_inputs_header): New class.
13489 (Incremental_inputs_header_writer): Edit comment.
13490 (Incremental_inputs_entry): New class.
13491 (Incremental_inputs_entry_writer): Edit comment.
13492 (Sized_incremental_binary::do_find_incremental_inputs_section):
13493 Add *strtab_shndx parameter, fill it.
13494 (Sized_incremental_binary::do_check_inputs): New method.
13495 (Incremental_checker::can_incrementally_link_output_file): Use
13496 Sized_incremental_binary::check_inputs.
13497 (Incremental_inputs::report_command_line): Save command line in
13498 command_line_.
13499 * incremental.h:
13500 (Incremental_binary::find_incremental_inputs_section): New
13501 method.
13502 (Incremental_binary::do_find_incremental_inputs_section): Add
13503 strtab_shndx parameter.
13504 (Incremental_binary::do_check_inputs): New pure virtual method.
13505 (Sized_incremental_binary::do_check_inputs): Declare.
13506 (Incremental_checker::Incremental_checker): Add incremental_inputs
13507 parameter, use it to initialize incremental_inputs_.
13508 (Incremental_checker::incremental_inputs_): New field.
13509 (Incremental_checker::command_line): New method.
13510 (Incremental_checker::inputs): New method.
13511 (Incremental_checker::command_line_): New field.
13512
c549a694
ILT
135132009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13514
13515 * incremental.cc: Include <cstdarg> and "target-select.h".
13516 (vexplain_no_incremental): New function.
13517 (explain_no_incremental): New function.
13518 (Incremental_binary::error): New method.
13519 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13520 method.
13521 (make_sized_incremental_binary): New function.
13522 (open_incremental_binary): New function.
13523 (can_incrementally_link_file): Add checks if output is ELF and has
13524 inputs section.
13525 * incremental.h: Include "elfcpp_file.h" and "output.h".
13526 (Incremental_binary): New class.
13527 (Sized_incremental_binary): New class.
13528 (open_incremental_binary): Declare.
13529 * object.cc (is_elf_object): Use
13530 elfcpp::Elf_recognizer::is_elf_file.
13531 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13532 * output.h (Output_file::filesize): New method.
13533
fd3c5f0b
ILT
135342009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13535
13536 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13537 New function.
13538 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13539 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13540 function.
13541 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13542 function.
13543 (Arm_relocate_functions::movw_abs_nc): New function.
13544 (Arm_relocate_functions::movt_abs): New function.
13545 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13546 (Arm_relocate_functions::thm_movt_abs): New function.
13547 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13548 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13549 (Scan::global): Likewise.
13550 (Relocate::relocate): Likewise.
13551 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13552
7f5309a5
ILT
135532009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13554
13555 * arm.cc (Arm_relocate_functions::got_prel) New function.
13556 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13557 (Relocate::relocate): Likewise.
13558 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13559
364c7fa5
ILT
135602009-10-06 Ian Lance Taylor <iant@google.com>
13561
13562 * options.h (class General_options): Define
13563 split_stack_adjust_size parameter.
13564 * object.h (class Object): Add uses_split_stack_ and
13565 has_no_split_stack_ fields. Add uses_split_stack and
13566 has_no_split_stack accessor functions. Declare
13567 handle_split_stack_section.
13568 (class Reloc_symbol_changes): Define.
13569 (class Sized_relobj): Define Function_offsets. Declare
13570 split_stack_adjust, split_stack_adjust_reltype, and
13571 find_functions.
13572 * object.cc (Object::handle_split_stack_section): New function.
13573 (Sized_relobj::do_layout): Call handle_split_stack_section.
13574 * dynobj.cc (Sized_dynobj::do_layout): Call
13575 handle_split_stack_section.
13576 * reloc.cc (Sized_relobj::relocate_sections): Call
13577 split_stack_adjust for executable sections in split_stack
13578 objects. Pass reloc_map to relocate_section.
13579 (Sized_relobj::split_stack_adjust): New function.
13580 (Sized_relobj::split_stack_adjust_reltype): New function.
13581 (Sized_relobj::find_functions): New function.
13582 * target-reloc.h: Include "object.h".
13583 (relocate_section): Add reloc_symbol_changes parameter. Change
13584 all callers.
13585 * target.h (class Target): Add calls_non_split method. Declare
13586 do_calls_non_split virtual method. Declare match_view and
13587 set_view_to_nop.
13588 * target.cc: Include "elfcpp.h".
13589 (Target::do_calls_non_split): New function.
13590 (Target::match_view): New function.
13591 (Target::set_view_to_nop): New function.
13592 * gold.cc (queue_middle_tasks): Give an error if mixing
13593 split-stack and non-split-stack objects with -r.
13594 * i386.cc (Target_i386::relocate_section): Add
13595 reloc_symbol_changes parameter.
13596 (Target_i386::do_calls_non_split): New function.
13597 * x86_64.cc (Target_x86_64::relocate_section): Add
13598 reloc_symbol_changes parameter.
13599 (Target_x86_64::do_calls_non_split): New function.
13600 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13601 parameter.
13602 * powerpc.cc (Target_powerpc::relocate_section): Add
13603 reloc_symbol_changes parameter.
13604 * sparc.cc (Target_sparc::relocate_section): Add
13605 reloc_symbol_changes parameter.
13606 * configure.ac: Call AM_CONDITIONAL for the default target.
13607 * configure: Rebuild.
13608 * testsuite/Makefile.am (TEST_AS): New variable.
13609 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13610 (check_DATA): Add split_i386 and split_x86_64 files.
13611 (SPLIT_DEFSYMS): Define.
13612 (split_i386_[1234n].o): New targets.
13613 (split_i386_[124]): New targets.
13614 (split_i386_[1234r].stdout): New targets.
13615 (split_x86_64_[1234n].o): New targets.
13616 (split_x86_64_[124]): New targets.
13617 (split_x86_64_[1234r].stdout): New targets.
13618 (MOSTLYCLEANFILES): Add new executables.
13619 * testsuite/split_i386.sh: New file.
13620 * testsuite/split_x86_64.sh: New file.
13621 * testsuite/split_i386_1.s: New file.
13622 * testsuite/split_i386_2.s: New file.
13623 * testsuite/split_i386_3.s: New file.
13624 * testsuite/split_i386_4.s: New file.
13625 * testsuite/split_i386_n.s: New file.
13626 * testsuite/split_x86_64_1.s: New file.
13627 * testsuite/split_x86_64_2.s: New file.
13628 * testsuite/split_x86_64_3.s: New file.
13629 * testsuite/split_x86_64_4.s: New file.
13630 * testsuite/split_x86_64_n.s: New file.
13631 * testsuite/testfile.cc (Target_test): Update relocation_section
13632 function.
13633 * testsuite/Makefile.in: Rebuild.
13634
e8a9fcda
ILT
136352009-10-06 Ian Lance Taylor <iant@google.com>
13636
13637 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13638 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13639 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13640 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13641 the address on ldo_addrs_.
13642 (Target_i386::Relocate::fix_up_ldo): New function.
13643
e99daf92
ILT
136442009-10-06 Rafael Espindola <espindola@google.com>
13645
13646 * plugin.cc (add_input_library): New.
13647 (Plugin::load): Add add_input_library to tv.
13648 (Plugin_manager::add_input_file): Add the is_lib argument.
13649 (add_input_file): Update call to Plugin_manager::add_input_file.
13650 (add_input_library): New.
13651 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13652
966d4097
DK
136532009-09-30 Doug Kwan <dougkwan@google.com>
13654
13655 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13656 symbol and call Symbol::may_need_copy_reloc to determine if
13657 a copy reloc is needed.
13658 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13659 nocopyreloc is given in command line.
13660 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13661 given in command line.
13662 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13663 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13664 of the removed Target_i386::may_need_copy_reloc.
13665 * options.h (copyreloc): New option with default value false.
13666 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13667 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13668 instead of the removed Target_powerpc::may_need_copy_reloc.
13669 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13670 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13671 instead of the removed Target_sparc::may_need_copy_reloc.
13672 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13673 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13674 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13675 instead of the removed Target_x86_64::may_need_copy_reloc.
13676
029ba973
ILT
136772009-09-30 Ian Lance Taylor <iant@google.com>
13678
13679 * object.h (class Object): Remove target_ field, and target,
13680 sized_target, and set_target methods.
13681 (Object::sized_target): Remove.
13682 (class Sized_relobj): Update declarations. Remove sized_target.
13683 * object.cc (Sized_relobj::setup): Remove target parameter.
13684 Change all callers.
13685 (Input_objects::add_object): Don't do anything with the target.
13686 (make_elf_sized_object): Add punconfigured parameter. Change all
13687 callers. Set or test parameter target.
13688 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13689 Change all callers.
13690 * parameters.cc (Parameters::set_target): Change parameter type to
13691 be non-const.
13692 (Parameters::default_target): Remove.
13693 (set_parameters_target): Change parameter type to be non-const.
13694 (parameters_force_valid_target): New function.
13695 (parameters_clear_target): New function.
13696 * parameters.h (class Parameters): Update declarations. Remove
13697 default_target method. Add sized_target and clear_target
13698 methods. Change target_ to be non-const.
13699 (set_parameters_target): Update declaration.
13700 (parameters_force_valid_target): Declare.
13701 (parameters_clear_target): Declare.
13702 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13703 as NULL if we aren't searching.
13704 (Add_symbols::run): Don't check for compatible target.
13705 * fileread.cc (Input_file::open_binary): Call
13706 parameters_force_valid_target.
13707 * gold.cc (queue_middle_tasks): Likewise.
13708 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13709 set_target on object.
13710 * dynobj.h (class Sized_dynobj): Update declarations.
13711 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13712 make_elf_object returns NULL.
13713 (Archive::include_member): Don't check whether object target is
13714 compatible.
13715 * output.cc (Output_section::add_input_section): Get target from
13716 parameters.
13717 (Output_section::relax_input_section): Likewise.
13718 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13719 parameters.
13720 (Sized_relobj::do_scan_relocs): Likewise.
13721 (Sized_relobj::relocate_sections): Likewise.
13722 * resolve.cc (Symbol_table::resolve): Likewise.
13723 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13724 parameter. Change all callers.
13725 (Symbol_table::add_from_object): Get target from parameters.
13726 (Symbol_table::add_from_relobj): Don't check object target.
13727 (Symbol_table::add_from_dynobj): Likewise.
13728 (Symbol_table::define_special_symbol): Get target from
13729 parameters.
13730 * symtab.h (class Symbol_table): Update declaration.
13731 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13732 parameter. Change all callers. Clear parameter target.
13733 (Binary_test): Test target here.
13734 * testsuite/object_unittest.cc (gold_testsuite): Remove
13735 target_test_pointer parameter. Change all callers.
13736 (Object_test): Test target here.
13737
a6a22b83
ILT
137382009-09-26 Ian Lance Taylor <iant@google.com>
13739
13740 * testsuite/initpri1.c: Don't try to use constructor priorities if
13741 compiling with gcc before 4.3.
13742
6a8f49fe
ILT
137432009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13744
13745 * testsuite/retain_symbols_file_test.sh (check_present): Change
13746 output file name to retain_symbols_file_test.stdout.
13747 (check_absent): Likewise.
13748
8c604651
CS
137492009-09-18 Craig Silverstein <csilvers@google.com>
13750
13751 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13752 * options.cc: Include <cerrno> and <fstream>.
13753 (General_options::finalize): Parse -retain-symbols-file tag.
13754 * options.h: New flag.
13755 (General_options): New method should_retain_symbol, new
13756 variable symbols_to_retain.
13757 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13758 should_retain_symbol map.
13759 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13760 * testsuite/Makefile.in: Regenerate.
13761 * testsuite/retain_symbols_file_test.sh: New file.
13762
ca58b19f
NC
137632009-09-18 Nick Clifton <nickc@redhat.com>
13764
13765 * po/es.po: Updated Spanish translation.
13766
20e6d0d6
DK
137672009-09-17 Doug Kwan <dougkwan@google.com>
13768
13769 * debug.h (DEBUG_RELAXATION): New constant.
13770 (DEBUG_ALL): Add DEBUG_RELAXATION.
13771 (debug_string_to_enum): Add relaxation debug option.
13772 * layout.cc
13773 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13774 Layout::Relaxation_debug_check::read_sections,
13775 Layout::Relaxation_debug_check::read_sections): New method definitions.
13776 (Layout::Layout): Initialize data members
13777 record_output_section_data_from_scrips_,
13778 script_output_section_data_list_ and relaxation_debug_check_.
13779 (Layout::save_segments, Layout::restore_segments,
13780 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13781 Layout::relaxation_loop_body): New method definitions.
13782 (Layout::finalize): Support relaxation. Move section layout code to
13783 Layout::relaxation_loop_body.
13784 (Layout::set_asection_address_from_script): Move code for orphan
13785 section placement out.
13786 (Layout::place_orphan_sections_in_script): New method definition.
13787 * layout.h (Output_segment_headers, Output_file_header):
13788 New forward class declarations.
13789 (Layout::~Layout): Define.
13790 (Layout::new_output_section_data_from_script): New method definition.
13791 (Layout::place_orphan_sections_in_script): New method declaration.
13792 (Layout::Segment_states): New type declaration.
13793 (Layout::save_segments, Layout::restore_segments,
13794 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13795 Layout::relaxation_loop_body): New method declarations.
13796 (Layout::Output_section_data_list): New type declaration.
13797 (Layout::Relaxation_debug_check): New class definition.
13798 (Layout::record_output_section_data_from_script_,
13799 Layout::script_output_section_data_list_, Layout::segment_states_,
13800 Layout::relaxation_debug_check_): New data members.
13801 * output.cc: (Output_section_headers::do_size): New method definition.
13802 (Output_section_headers::Output_section_headers): Move size
13803 computation to Output_section_headers::do_size.
13804 (Output_segment_headers::do_size): New method definition.
e1df38aa 13805 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13806 Output_file_header::do_size and call it.
13807 (Output_file_header::do_size): New method definition.
13808 (Output_data_group::Output_data_group): Adjust call to
13809 Output_section_data.
13810 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13811 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13812 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13813 RELAXED_INPUT_SECTION_CODE.
13814 (Output_section::Output_section): Initialize data member checkpoint_.
13815 (Output_section::~Output_section): Delete checkpoint object pointed
13816 by checkpoint_.
13817 (Output_section::add_input_section): Always add an Input_section if
13818 relaxing.
13819 (Output_section::add_merge_input_section): Add assert.
13820 (Output_section::relax_input_section): New method definition.
13821 (Output_section::set_final_data_size): Set load address to zero for
13822 an unallocated section.
13823 (Output_section::do_address_and_file_offset_have_reset_values):
13824 New method definition.
13825 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13826 Handle relaxed input section.
13827 (Output_section::sort_attached_input_sections): Checkpoint input
13828 section list lazily.
13829 (Output_section::get_input_sections): Change type of input_sections to
13830 list of Simple_input_section pointers. Checkpoint input section list
13831 lazily. Also handle relaxed input sections.
13832 (Output_section::add_input_section_for_script): Take a reference to
13833 a Simple_input_section object instead of Relobj pointer and section
13834 index as parameter. Handle relaxed input sections.
13835 (Output_section::save_states, Output_section::restore_states): New
13836 method definitions.
13837 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13838 (Output_data::is_data_size_fixed): New method definition.
13839 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13840 if it is fixed.
13841 (Output_data::address_and_file_offset_have_reset_values): New method
13842 definition.
13843 (Output_data::do_address_and_file_offset_have_reset_values): New method
13844 definition.
13845 (Output_data::set_data_size): Check that data size is not fixed.
13846 (Output_data::fix_data_size): New method definition.
13847 (Output_data::is_data_size_fixed_): New data member.
13848 (Output_section_headers::set_final_data_size): New method definition.
13849 (Output_section_headers::do_size): New method declaration.
13850 (Output_segment_headers::set_final_data_size): New method definition.
13851 (Output_segment_headers::do_size): New method declaration.
13852 (Output_file_header::set_final_data_size)::New method definition.
13853 (Output_file_header::do_size)::New method declaration.
13854 (Output_section_data::Output_section_data): Add new parameter
13855 is_data_size_fixed and use it to fix data size.
13856 (Output_data_const::Output_data_const): Adjust call to base class
13857 constructor and fix data size.
13858 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13859 base class constructor and fix data size.
13860 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13861 base class constructor and fix data size.
13862 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13863 class constructor and fix data size.
13864 (Output_data_group::set_final_data_size): New method definition.
13865 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13866 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13867 class constructor and fix data size.
13868 (Output_relaxed_input_section): New class definition.
13869 (Output_section::Simple_input_section): New class definition.
13870 (Output_section::get_input_sections): Adjust parameter list.
13871 (Output_section::add_input_section_for_script): Same.
13872 (Output_section::save_states, Output_section::restore_states,
13873 Output_section::do_address_and_file_offset_have_reset_values,
13874 (Output_section::Input_section::Input_section): Handle
13875 RELAXED_INPUT_SECTION_CODE. Add new overload for
13876 Output_relaxed_input_section.
13877 (Output_section::Input_section::is_input_section,
13878 Output_section::Input_section::set_output_section): Handle relaxed
13879 input section.
13880 (Output_section::Input_section::is_relaxed_input_section,
13881 Output_section::Input_section::output_section_data,
13882 Output_section::Input_section::relaxed_input_section): New method
13883 definitions.
13884 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13885 value.
13886 (Output_section::Input_section::u1_): Update comments.
13887 (Output_section::Input_section::u2_): Add new union member poris.
13888 (Output_section::Checkpoint_output_section): New classs definition.
13889 (Output_section::relax_input_section): New method declaration.
13890 (Output_section::checkpoint_): New data member.
13891 (Output_segment): Update comments.
13892 (Output_segment::Output_segment): Un-privatize copy constructor.
13893 (Output_segment::operator=): Un-privatize.
13894 * script-sections.cc (Output_section_element::Input_section_list):
13895 Change element type to Output_section::Simple_input_section.
13896 (Output_section_element_dot_assignment::set_section_addresses):
13897 Register output section data for relaxation clean up.
13898 (Output_data_exression::Output_data_expression): Adjust call to base
13899 constructor to fix data size.
13900 (Output_section_element_data::set_section_addresses): Register
13901 Output_data_expression object for relaxation clean up.
13902 (struct Input_section_info): Replace Relobj pointer and section index
13903 pair with Output_section::Simple_input_section and Convert struct to a
13904 class.
13905 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13906 Input_section_info data member to use accessors.
20e6d0d6
DK
13907 (Output_section_element_input::set_section_addresses): Use layout
13908 parameter. Adjust code to use Output_section::Simple_input_section
13909 and Input_secction_info classes. Register filler for relaxation
13910 clean up.
13911 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13912 and section index pair with Output_section::Simple_input_section
13913 class. Adjust code accordingly.
13914 (Phdrs_element::release_segment): New method definition.
13915 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13916 segment list.
13917 (Script_sections::release_segments): New method definition.
13918 * gold/script-sections.h (Script_sections::release_segments): New
13919 method declaration.
13920 * gold/target.h (Target::may_relax, Target::relax,
13921 Target::do_may_relax, Target::do_relax): New method definitions.
13922
5e445df6
ILT
139232009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13924
13925 * arm.cc (has_signed_unsigned_overflow): New function.
13926 (Arm_relocate_functions::abs8): New function.
13927 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13928 (Target_arm::Scan::global): Likewise.
13929 (Target_arm::relocate::relocate): Likewise.
13930 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13931 Likewise.
13932
8c604651 139332009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13934
13935 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13936 * testsuite/Makefile.in: Regenerate.
13937
1e9cc1c2
NC
139382009-09-11 Nick Clifton <nickc@redhat.com>
13939
13940 * po/gold.pot: Updated by the Translation project.
13941
6a89f575
CC
139422009-09-08 Cary Coutant <ccoutant@google.com>
13943
13944 * output.cc (Output_file::open): Add execute permission to empty file.
13945 * testsuite/Makefile.am (permission_test): New test.
13946 * testsuite/Makefile.in: Regenerate.
13947
fdcac5af
ILT
139482009-09-02 Ian Lance Taylor <iant@google.com>
13949
13950 * output.cc (Output_file::resize): Call map_no_anonymous rather
13951 than map.
13952
44453f85
ILT
139532009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13954
13955 * gold.cc: Include "incremental.h".
13956 (queue_initial_tasks): Call Incremental_checker methods.
13957 * incremental.cc: Include "output.h".
13958 (Incremental_checker::can_incrementally_link_output_file): New
13959 method.
13960 * incremental.h (Incremental_checker): New class.
13961
13962 * output.cc (Output_file::open_for_modification): New method.
13963 (Output_file::map_anonymous): Changed return type to bool. Record
13964 map in base_ field.
13965 (Output_file::map_no_anonymous): New method, broken out of map.
13966 (Output_file::map): Use map_no_anonymous and map_anonymous.
13967 * output.h (class Output_file): Update declarations.
13968
293c1386
CC
139692009-08-24 Cary Coutant <ccoutant@google.com>
13970
13971 * options.h (Command_line::Pre_options): New class.
13972 (Command_line::pre_options): New member.
13973 * options.cc (gold::options::ready_to_register): New variable.
13974 (One_option::register_option): Do nothing if not registering options.
13975 Assert if same short option registered twice.
13976 (General_options::General_options): Turn off option registration when
13977 done constructing.
13978 (Command_line::Pre_options::Pre_options): New constructor.
13979
f773f3d2
CC
139802009-08-24 Cary Coutant <ccoutant@google.com>
13981
06a73cfe
CC
13982 * options.h (General_options::no_keep_memory): Remove incorrect
13983 short option.
f773f3d2 13984
a15af8e2
RW
139852009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13986
13987 * Makefile.am (am__skiplex, am__skipyacc): New.
13988 * Makefile.in: Regenerate.
13989
c462b41b
RW
139902009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13991
14ec8efd
RW
13992 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13993 (INCLUDES): ... this.
13994 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13995 (AM_CPPFLAGS): Renamed from ...
13996 (INCLUDE): ... this.
13997 * Makefile.in, testsuite/Makefile.in: Regenerate.
13998
81ecdfbb
RW
13999 * Makefile.in: Regenerate.
14000 * aclocal.m4: Likewise.
14001 * config.in: Likewise.
14002 * configure: Likewise.
14003 * testsuite/Makefile.in: Likewise.
14004
c462b41b
RW
14005 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14006 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14007 * Makefile.in: Regenerate.
14008 * testsuite/Makefile.in: Regenerate.
14009
2da73f13
CC
140102009-08-19 Cary Coutant <ccoutant@google.com>
14011
14012 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14013 symbols in shared libraries overridden by hidden or internal symbols
14014 in the main program.
14015
2db70501
CD
140162009-08-19 Chris Demetriou <cgd@google.com>
14017
14018 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14019 checking source file names in error messages.
14020
f733487b
DK
140212009-08-18 Doug Kwan <dougkwan@google.com>
14022
14023 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14024 an elcpp::Ehdr as parameter. Adjust call to set_target.
14025 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14026 an elfcpp::Ehdr as parameter.
14027 * object.cc (Object::set_target): Remove the version that looks up
14028 a target and sets it.
14029 (Sized_relobj::setup): Take a Target object instead of
14030 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14031 (make_elf_sized_object): Find target and ask target to
14032 make an ELF object.
14033 * object.h: (Object::set_target): Remove the version that looks up
14034 a target and sets it.
14035 (Sized_relobj::setup): Take a Target object instead of
14036 an elfcpp:Ehdr as parameter.
14037 * target.cc: Include dynobj.h.
14038 (Target::do_make_elf_object_implementation): New.
2e702c99 14039 (Target::do_make_elf_object): New.
f733487b
DK
14040 * target.h (Target::make_elf_object): New template declaration.
14041 (Target::do_make_elf_object): New method declarations.
14042 (Target::do_make_elf_object_implementation): New template declaration.
14043
cc70f101
ILT
140442009-08-14 Ian Lance Taylor <iant@google.com>
14045
14046 * gold.h (FUNCTION_NAME): Define.
14047 (gold_unreachable): Use FUNCTION_NAME.
14048
ef5e0cb1
ST
140492009-08-12 Sriraman Tallam <tmsriram@google.com>
14050
14051 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14052 symbol in the --keep-unique list is not found.
14053
48c187ce
ST
140542009-08-12 Sriraman Tallam <tmsriram@google.com>
14055
14056 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14057 been maked as --keep-unique.
14058 (Icf::unfold_section): New function.
14059 * icf.h (Icf::unfold_section): New function.
14060 * options.h (General_options::keep_unique): New option.
14061 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14062 * testsuite/Makefile.in: Regenerate.
14063 * testsuite/icf_keep_unique_test.sh: New file.
14064 * testsuite/icf_keep_unique_test.cc: New file.
14065
645afe0c
CC
140662009-08-12 Cary Coutant <ccoutant@google.com>
14067
14068 PR 10471
14069 * resolve.cc (Symbol_table::resolve): Check for references from
14070 dynamic objects to hidden and internal symbols.
14071 * testsuite/Makefile.am (hidden_test.sh): New test.
14072 * testsuite/Makefile.in: Regenerate.
14073 * testsuite/hidden_test.sh: New script.
14074 * testsuite/hidden_test_1.c: New test source.
14075 * testsuite/hidden_test_main.c: New test source.
14076
11af873f
DK
140772009-08-11 Doug Kwan <dougkwan@google.com>
14078
14079 * arm.cc: Update comments.
14080 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14081 segment to locate the .ARM.exidx section if present.
14082
b9f7d72d
DK
140832009-08-09 Doug Kwan <dougkwan@google.com>
14084
14085 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14086 patch.
14087
ddd3c53c
ST
140882009-08-07 Sriraman Tallam <tmsriram@google.com>
14089 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14090 compiler warnings.
14091
27721062
ST
140922009-08-06 Sriraman Tallam <tmsriram@google.com>
14093
14094 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14095 valid tls_segment only for non-debug-section relocations.
14096 * testsuite/Makefile.am: Add gc_tls_test.
14097 * testsuite/Makefile.in: Regenerate.
14098 * testsuite/gc_tls_test.cc: New file.
14099 * testsuite/gc_tls_test.sh: New file.
14100
ef15dade 141012009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14102
ef15dade
ST
14103 * icf.cc: New file.
14104 * icf.h: New file.
14105 * Makefile.am (CCFILES): Add icf.cc.
14106 (HFILES): Add icf.h
14107 * Makefile.in: Regenerate.
14108 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14109 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14110 section, symbol and addend information for the relocs.
14111 * gold.cc (queue_middle_tasks): Call identical code folding.
14112 * gold.h: Add defines for multimap.
14113 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14114 to the call of finalize_local_symbols.
14115 * main.cc (main): Create object of class Icf.
14116 * object.cc (Sized_relobj::do_layout): Allow this function to be
14117 called twice during icf.
14118 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14119 to sections marked as identical by icf.
14120 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14121 when available.
14122 (Sized_relobj::do_section_entsize): New function.
14123 * object.h (Object::section_entsize): New function.
14124 (Object::do_section_entsize): New pure virtual function.
14125 (Relobj::finalize_local_symbols): Add new parameter.
14126 (Relobj::do_section_entsize): New function.
14127 * options.h (General_options::icf): New option.
14128 (General_options::icf_iterations): New option.
14129 (General_options::print_icf_sections): New option.
14130 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14131 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14132 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14133 icf.
14134 * symtab.cc (Symbol_table::is_section_folded): New function.
14135 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14136 to sections marked as identical by icf.
14137 * symtab.h (Symbol_table::set_icf): New function.
14138 (Symbol_table::icf): New function.
14139 (Symbol_table::is_section_folded): New function.
14140 (Symbol_table::icf_): New data member.
14141 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14142 * testsuite/Makefile.am: Add commands to build icf_test.
14143 * testsuite/Makefile.in: Regenerate.
14144 * testsuite/icf_test.sh: New file.
14145 * testsuite/icf_test.cc: New file.
14146
c3b65ac4
CD
141472009-07-24 Chris Demetriou <cgd@google.com>
14148
14149 * layout.cc (is_compressible_debug_section): Fix incorrect
14150 comment about compressed section names.
14151
1caf2c51
ILT
141522009-07-20 Ian Lance Taylor <ian@airs.com>
14153
14154 PR 10419
14155 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14156
1ef4d87f
ILT
141572009-07-16 Ian Lance Taylor <iant@google.com>
14158
14159 PR 10400
14160 * layout.h: #include <map>.
14161 (class Kept_section): Change from struct to class. Add accessors
14162 and setters. Add section size to Comdat_group mapping. Change
14163 Comdat_group to std::map. Add is_comdat_ field. Add
14164 linkonce_size field in union.
14165 (class Layout): Update declaration of find_or_add_kept_section.
14166 Don't declare find_kept_object.
14167 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14168 parameter. Add object, shndx, is_comdat, and is_group_name
14169 parameters. Change all callers. Adjust for new Kept_section.
14170 (Layout::find_kept_object): Remove.
14171 * object.cc (Sized_relobj::include_section_group): Update use of
14172 Kept_section. Rename secnum to shndx. Only record
14173 Kept_comdat_section if sections are the same size.
14174 (Sized_relobj::include_linkonce_section): Update use of
14175 Kept_section. Only record Kept_comdat_section if sections are the
14176 same size. Set size of linkonce section.
14177 (Sized_relobj::map_to_kept_section): Update call to
14178 get_kept_comdat_section.
14179 * object.h (class Sized_relobj): Rename fields in
14180 Kept_comdat_section to drop trailing underscores; change object
14181 field to Relobj*. Change Kept_comdat_section_table to store
14182 struct rather than pointer.
14183 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14184 Add kept_object and kept_shndx parameters. Change all callers.
14185 (Sized_relobj::get_kept_comdat_section): Change return type to
14186 bool. Add kept_object and kept_shndx parameters. Change all
14187 callers.
14188 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14189 Layout::find_or_add_kept_section.
14190
37c3b7b0
ILT
141912009-07-09 Ian Lance Taylor <iant@google.com>
14192
14193 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14194 Reserve space in the hash table.
14195
98fa85cb
ILT
141962009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14197
14198 * fileread.cc (File_read::get_mtime): New method.
14199 * fileread.h (Timespec): New structure.
14200 (File_read::get_mtime): New method.
14201 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14202 Renamed from timestamp_nsec.
14203 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14204 Elf_Xword.
e1df38aa 14205 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14206 timestamp_nsec.
e1df38aa 14207 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14208 (Incremental_inputs::report_obejct): Save mtime; style fix.
14209 (Incremental_inputs::report_script): Save mtime; style fix.
14210 (Incremental_inputs::finalize_inputs): Style fix.
14211 (Incremental_inputs::finalize): Style fix.
14212 (Incremental_inputs::create_input_section_data): Store inputs
14213 mtime.
14214 * incremental.h (Incremental_inputs::report_script): Add mtime
14215 argument.
14216 (Incremental_inputs::Input_info::Input_info): Intialize only one
14217 union member.
14218 (Incremental_inputs::Input_info::archive): Move to nameless
14219 union.
14220 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14221 (Incremental_inputs::Input_info::script): Move to nameless union.
14222 (Incremental_inputs::mtime): New field.
14223 * script.cc (read_input_script): Pass file mtime to
14224 Incremental_input.
14225 * script.h (Script_info::inputs): Style fix.
14226
c9d70757
ILT
142272009-07-01 Ian Lance Taylor <ian@airs.com>
14228
14229 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14230 instead of 32.
14231
9c547ec3
ILT
142322009-06-24 Ian Lance Taylor <iant@google.com>
14233
14234 PR 10156
14235 * layout.cc (Layout::choose_output_section): If we find an
14236 existing section, update the flags.
14237 (Layout::create_notes): New function, broken out of
14238 Layout::finalize.
14239 (Layout::finalize): Don't create note sections.
14240 (Layout::create_note): Don't crash if linker script discards
14241 section.
14242 (Layout::create_gold_note): Likewise.
14243 (Layout::create_build_id): Likewise. Don't set
14244 after_input_sections on the section.
14245 (Layout::create_executable_stack_info): Remove target parameter.
14246 Change caller.
14247 * layout.h (class Layout): Declare create_notes. Update
14248 declaration of create_executable_stack_info.
14249 * gold.cc (queue_middle_tasks): Call create_notes.
14250 * output.cc (Output_section::update_flags_for_input_section): Move
14251 here from output.h. If SHF_ALLOC flag is newly set, mark address
14252 invalid.
14253 * output.h (Output_data::mark_address_invalid): New function.
14254 (class Output_section): Only declare, not define,
14255 update_flags_for_input_section. Remove set_flags.
14256
55458500
ILT
142572009-06-24 Ian Lance Taylor <iant@google.com>
14258
14259 * script-sections.cc (Output_section_definition::
14260 set_section_addresses): Rename shadowing local load_address to
14261 laddr.
14262
1307d6cd
ILT
142632009-06-24 Ian Lance Taylor <iant@google.com>
14264
14265 PR 10244
14266 * reloc.cc (relocate_sections): Skip empty relocation sections.
14267
ec3f783e
ILT
142682009-06-23 Ian Lance Taylor <iant@google.com>
14269
14270 PR 10156
14271 * layout.cc (Layout::create_note): Use choose_output_section
14272 rather than make_output_section.
14273
459c9f1c
ILT
142742009-06-23 Ian Lance Taylor <iant@google.com>
14275
14276 PR 10237
14277 * options.cc (General_options::parse_V): Set printed_version_.
14278 (General_options::General_options): Initialize printed_version_.
14279 * options.h (class General_options): Add printed_version_ field.
14280 * gold.cc (queue_initial_tasks): If there are no input files,
14281 don't give a fatal error if we printed the version information.
14282 (queue_middle_tasks): If using -r with a shared object, give a
14283 fatal error rather than an ordinary error.
14284
1518dc8f
ILT
142852009-06-23 Ian Lance Taylor <iant@google.com>
14286
14287 PR 10219
14288 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14289 (Layout::make_output_section): Set have_stabstr_section_ if we see
14290 a .stab*str section.
14291 (Layout::finalize): Call link_stabs_sections.
14292 (Layout::link_stabs_sections): New file.
14293 * layout.h (class Layout): Add have_stabstr_section_ field.
14294 Declare link_stabs_sections.
14295
3d857b98
DK
142962009-06-23 Doug Kwan <dougkwan@google.com>
14297
14298 * Makefile.am (libgold_a_LIBADD): New.
14299 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14300 * Makefile.in: Regenerate.
3d857b98
DK
14301 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14302 * configure: Regenerate.
14303 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14304 * fileread.cc: Include sys/state.h
14305 * gold.h: Declare memmem and strndup if found missing.
14306 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14307
0639a6f6
ILT
143082009-06-23 Ian Lance Taylor <iant@google.com>
14309
14310 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14311 * configure: Rebuild.
14312
8d63875c
ILT
143132009-06-23 Ian Lance Taylor <iant@google.com>
14314
14315 PR 10147
14316 * object.cc (Object::section_contents): Don't try to get a view if
14317 the section has length zero.
14318 (Object::handle_gnu_warning_section): If the section is empty, use
14319 the name of the section as the warning.
14320
f7c8a183
ILT
143212009-06-23 Ian Lance Taylor <iant@google.com>
14322
14323 PR 10133
14324 * stringpool.h (class Stringpool_template): Add optimize_ field.
14325 (Stringpool_template::set_optimize): New function.
14326 * stringpool.cc (Stringpool_template::Stringpool_template):
14327 Initialize optimize_ field.
14328 (Stringpool_template::set_string_offsets): Test local optimize
14329 fild rather than parameter.
14330 * layout.cc (Layout::Layout): Call set_optimize on the section
14331 name stringpool.
14332
e6a307ba
ILT
143332009-06-22 Ian Lance Taylor <iant@google.com>
14334
14335 PR 10030
14336 * yyscript.y: Parse TARGET.
14337 * script.cc (script_set_target): New function.
14338 * script-c.h (script_set_target): Declare.
14339 * options.cc (General_options::string_to_object_format): Rename
14340 from string_to_object_format in anonymous namespace. Change
14341 callers.
14342 * options.h (class General_options): Declare
14343 string_to_object_format.
14344
3ee173de
ILT
143452009-06-22 Ian Lance Taylor <iant@google.com>
14346
14347 * script-sections.cc (Script_sections::create_segments): Don't put
14348 program headers in a PT_LOAD segment if -n or -N.
14349
143502009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14351
14352 PR 10141
14353 * options.h (class General_options): Add -z lazy and -z now. Sort
14354 -z options into alphabetical order.
14355 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14356
cd6739a1 143572009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14358
14359 * layout.cc (Layout::make_output_section): Call
14360 Target::new_output_section.
14361 (Layout::attach_allocated_section_to_segment): Put large section
14362 sections in a separate load segment with the large segment flag
14363 set.
14364 (Layout::segment_precedes): Sort large data segments after other
14365 load segments.
14366 (align_file_offset): New static function.
14367 (Layout::set_segment_offsets): Use align_file_offset.
14368 * output.h (class Output_section): Add is_small_section_ and
14369 is_large_section_ fields.
14370 (Output_section::is_small_section): New function.
14371 (Output_section::set_is_small_section): New function.
14372 (Output_section::is_large_section): New function.
14373 (Output_section::set_is_large_section): New function.
14374 (Output_section::is_large_data_section): New function.
14375 (class Output_segment): Add is_large_data_segment_ field.
14376 (Output_segment::is_large_data_segment): New function.
14377 (Output_segment::set_is_large_data_segment): New function.
14378 * output.cc (Output_section::Output_section): Initialize new
14379 fields.
14380 (Output_segment::Output_segment): Likewise.
14381 (Output_segment::add_output_section): Add assertion that large
14382 data sections always go in large data segments. Force small data
14383 sections to the end of the list of data sections. Force small BSS
14384 sections to the start of the list of BSS sections. For large BSS
14385 sections to the end of the list of BSS sections.
14386 * symtab.h (class Symbol): Declare is_common_shndx.
14387 (Symbol::is_defined): Check Symbol::is_common_shndx.
14388 (Symbol::is_common): Likewise.
14389 (class Symbol_table): Define enum Commons_section_type. Update
14390 declarations. Add small_commons_ and large_commons_ fields.
14391 * symtab.cc (Symbol::is_common_shndx): New function.
14392 (Symbol_table::Symbol_table): Initialize new fields.
14393 (Symbol_table::add_from_object): Put small and large common
14394 symbols in the right list.
14395 (Symbol_table::sized_finalized_symbol): Check
14396 Symbol::is_common_shndx.
14397 (Symbol_table::sized_write_globals): Likewise.
14398 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14399 common symbol lists. Don't call do_allocate_commons_list if the
14400 list is empty.
14401 (Symbol_table::do_allocate_commons_list): Remove is_tls
14402 parameter. Add comons_section_type parameter. Change all
14403 callers. Handle small and large common symbols.
14404 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14405 Symbol::is_common_shndx.
14406 * resolve.cc (symbol_to_bits): Likewise.
14407 * target.h (Target::small_common_shndx): New function.
14408 (Target::small_common_section_flags): New function.
14409 (Target::large_common_shndx): New function.
14410 (Target::large_common_section_flags): New function.
14411 (Target::new_output_section): New function.
14412 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14413 small_common_section_flags, and large_common_section_flags
14414 fields.
14415 (Target::do_new_output_section): New virtual function.
14416 * arm.cc (Target_arm::arm_info): Initialize new fields.
14417 * i386.cc (Target_i386::i386_info): Likewise.
14418 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14419 Likewise.
14420 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14421 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14422 (Target_x86_64::do_new_output_section): New function.
14423 * configure.ac: Define conditional MCMODEL_MEDIUM.
14424 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14425 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14426 (large_LDFLAGS): Define.
14427 * testsuite/large.c: New file.
14428 * testsuite/testfile.cc (Target_test::test_target_info):
14429 Initialize new fields.
14430 * configure, testsuite/Makefile.in: Rebuild.
14431
bb04269c
DK
144322009-06-05 Doug Kwan <dougkwan@google.com>
14433
14434 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14435 * Makefile.in: Regenerate.
bb04269c
DK
14436 * i386.cc (class Target_i386): Define new virtual method to
14437 override do_is_local_label_name in parent.
14438 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14439 local symbols if --discard-locals or -X is given.
14440 * options.h (class General_options): Declare new options
14441 '--discard-locals' and '-X' for discarding locals.
14442 * target.h (class Target): Define new methods is_local_label_name.
14443 Declare new virtual method do_is_local_label_name.
14444 * target.cc: New file.
14445 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14446 (check_SCRIPTS): Add discard_locals_test.sh.
14447 (check_DATA): Add discard_local_tests.syms.
14448 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14449 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14450 * testsuite/Makefile.in: Regenerate.
14451 * testsuite/discard_locals_test.c: New file.
14452 * testsuite/discard_locals_test.sh: Same.
14453
805bb01c
DK
144542009-06-05 Doug Kwan <dougkwan@google.com>
14455
14456 * object.cc (Sized_relobj::Sized_relobj): Initialize
14457 discarded_eh_frame_shndx_ to -1U.
14458 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14459 section.
14460 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14461 a discarded .eh_frame section.
14462 (Sized_relobj::do_finalize_local_symbols): Ditto.
14463 * object.h (class Sized_relobj): Declare new member
14464 discarded_eh_frame_shndx_.
14465 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14466 (local_labels_test.o, local_labels_test): New rules.
14467 * testsuite/Makefile.in: Regenerate.
14468
1dcd334d
DK
144692009-06-04 Doug Kwan <dougkwan@google.com>
14470
14471 * layout.cc (Layout::section_name_mapping): Add mapping for
14472 special ARM sections.
14473
96d49306
DK
144742009-06-03 Doug Kwan <dougkwan@google.com>
14475
14476 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14477 (utils::has_overflow): Same.
14478
dff16297
ILT
144792009-06-03 Ian Lance Taylor <iant@google.com>
14480
14481 * layout.cc (Layout::section_name_mapping): New array, replacing
14482 Layout::linkonce_mapping.
14483 (Layout::section_name_mapping_count): New variable, replacing
14484 Layout::linkonce_mapping_count.
14485 (Layout::linkonce_output_name): Remove.
14486 (Layout::output_section_name): Rewrite.
14487 * layout.h (class Layout): Rename Linkonce_mapping to
14488 Section_name_mapping, linkonce_mapping to section_name_mapping,
14489 linkonce_mapping_count to section_name_mapping_count. Don't
14490 declare linkonce_output_name.
14491
c121c671
DK
144922009-06-03 Doug Kwan <dougkwan@google.com>
14493
14494 * gold/arm.cc (namespace utils): New.
14495 (Target_arm::reloc_is_non_pic): Define new method.
14496 (class Arm_relocate_functions): New.
14497 (Target_arm::Relocate::relocate): Handle relocation types used by
14498 Android.
14499
07800fab
ILT
145002009-06-03 Ian Lance Taylor <iant@google.com>
14501
14502 * arm.cc (Target_arm::scan::global): Use || instead of |.
14503
c121c671
DK
145042009-06-02 Doug Kwan <dougkwan@google.com>
14505
14506 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14507 issued_non_pic_error_.
14508 (class Target_arm::Scan): Declare new method check_non_pic.
14509 Define new method symbol_needs_plt_entry.
14510 Declare new data member issued_non_pic_error_.
14511 (class Target_arm::Relocate): Declare new method
14512 should_apply_static_reloc.
14513 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14514 (Target_arm::Scan::check_non_pic): Define new method.
14515 (Target_arm::Scan::local): Handle a small subset of reloc types used
14516 by Android.
14517 (Target_arm::Scan::local): Same.
14518 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14519
b19b0c6d
ILT
145202009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14521
14522 * incremental.cc (Incremental_inputs::report_command_line): Filter
14523 out --incremental-* options.
14524
94cdfcff
DK
145252009-05-29 Doug Kwan <dougkwan@google.com>
14526
14527 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14528 template class.
14529 (class Target_arm): Update comment.
14530 (Target_arm::Target_arm): Initialize new data members GOT_,
14531 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14532 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14533 and Target_arm::rel_dyn_section.
14534 Declare new_enum Target_arm::Got_type.
14535 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14536 and DYNBSS_.
14537 Update commments for member do_dynsym_value.
14538 (Target_arm::got_size, Target_arm::plt_section,
14539 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14540 new methods inside class defintion.
14541 (Target_arm::got_section): Define new method.
14542 (Target_arm::rel_dyn_section): Same.
14543 (Output_data_plt_arm): New template class.
14544 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14545 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14546 (Output_data_plt_arm::add_entry): Same.
14547 (Output_data_plt_arm::first_plt_entry): Define new
14548 static data member for PLT instruction template.
14549 (Output_data_plt_arm::plt_entry): Same.
14550 (Output_data_plt_arm::do_write): Define new method.
14551 (Target_arm::make_plt_entry): Same.
14552 (Target_arm::do_finalize_sections): Same.
14553 (Target_arm::do_dynsym_value): Same.
14554
4a657b0d
DK
145552009-05-28 Doug Kwan <dougkwan@google.com>
14556
14557 * Makefile.am (TARGETSOURCES): Add arm.cc.
14558 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14559 * Makefile.in: Regenerate.
14560 * arm.cc: New file.
14561 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14562
e7ae8c36
DK
145632009-05-26 Doug Kwan <dougkwan@google.com>
14564
14565 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14566 (General_options::check_excluded_libs): Strip off directories in
14567 archive name before matching like GNU ld does.
14568 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14569 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14570 (exclude_libs_test_LDFLAGS): Add linker option
14571 -Wl,--exclude-libs,libexclude_libs_test_3
14572 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14573 an explicit archive without using -l.
14574 (alt/libexclude_libs_test_3.a): New make rule.
14575 * testsuite/Makefile.in: Regenerate.
14576 * testsuite/exclude_libs_test.c : Declare lib3_default().
14577 (main): Call it.
14578 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14579 * exclude_libs_test_3.c: New file.
14580
f12e7348
NC
145812009-05-26 Nick Clifton <nickc@redhat.com>
14582
14583 * po/id.po: New Indonesian translation.
14584 * po/gold.pot: Updated template file.
14585
4daadc0d
ST
145862009-05-22 Sriraman Tallam <tmsriram@google.com>
14587
e1df38aa 14588 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14589 gc_comdat_test files. Add -Wl,--gc-sections to build
14590 gc_comdat_test.
14591 * testsuite/Makefile.in: Regenerate.
14592 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14593
531813ad
ST
145942009-05-21 Sriraman Tallam <tmsriram@google.com>
14595
14596 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14597 kept comdat section was garbage collected.
14598 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14599 * testsuite/Makefile.in: Regenerate.
14600 * testsuite/gc_comdat_test.sh: New file.
14601 * testsuite/gc_comdat_test_1.cc: New file.
14602 * testsuite/gc_comdat_test_2.cc: New file.
14603
65514900
CC
146042009-05-19 Doug Kwan <dougkwan@google.com>
14605
14606 * archive.cc (Archive::Archive): Move constructor from archive.h
14607 to here. Initialize no_export_.
14608 (Archive::get_elf_object_for_member): Set no_export flag of object.
14609 * archive.h (Archive::Archive): Move constructor body to
14610 archive.cc.
14611 (Archive::no_export): New method.
14612 (Archive::no_export_): New field.
14613 * object.h (Object::Object): Initialize no_export_ to false.
14614 (Object::no_export, Object::set_no_export): New methods.
14615 (Object::no_export_): New field.
14616 * options.cc (General_options::parse_exclude_libs): New method.
14617 (General_options::check_excluded_libs) Same.
14618 * options.h (exclude_libs): New option.
14619 (General_options::check_excluded_libs): New method declaration.
14620 (General_options::excluded_libs_): New field.
14621 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14622 default or protected visibility if an object has no-export flag set.
14623 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14624 (check_SCRIPTS): Add exclude_libs_test.sh.
14625 (check_DATA): Add exclude_libs_test.syms.
14626 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14627 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14628 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14629 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14630 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14631 libexclude_libs_test_2.a): New rules.
14632 * testsuite/Makefile.in: Regenerate.
14633 * testsuite/exclude_libs_test.c: New file.
14634 * testsuite/exclude_libs_test.sh: Ditto.
14635 * testsuite/exclude_libs_test_1.c: Ditto.
14636 * testsuite/exclude_libs_test_2.c: Ditto.
14637
1b77ea50
ILT
146382009-05-15 Ian Lance Taylor <iant@google.com>
14639
14640 * configure.ac: Check for declarations for cases where libiberty.h
14641 checks HAVE_DECL_xxx.
14642 * configure, config.in: Rebuild.
14643
072fe7ce
ILT
146442009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14645
14646 * gold.h (Incremental_argument_list): Remove (invalid) forward
14647 declaration.
14648 * incremental.cc (Incremental_inputs::report_achive): New method.
14649 (Incremental_inputs::report_object): New method.
14650 (Incremental_inputs::report_script): New method.
14651 (Incremental_inputs::finalize_inputs): New method.
14652 (Incremental_inputs::finalize): Call finalize_inputs().
14653 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14654 Create inputs entries.
14655 * incremental.h (Incremental_input_type): New enum.
14656 (Incremental_inputs::Incremental_input): Initialize new fields.
14657 (Incremental_inputs::report_inputs): New method.
14658 (Incremental_inputs::report_achive): New method.
14659 (Incremental_inputs::report_object): New method.
14660 (Incremental_inputs::report_script): New method.
14661 (Incremental_inputs::finalize_inputs): New method.
14662 (Incremental_inputs::Input_info): New struct.
14663 (Incremental_inputs::Input_info_map): New typedef.
14664 (Incremental_inputs::lock_): New field.
14665 (Incremental_inputs::Inputs_): New field.
14666 (Incremental_inputs::Inputs_map): New field.
14667 * main.cc (main): Call Incremental_input::report_inputs.
14668 * options.h (Input_argument_list): Typedef moved from
14669 Input_arguments.
14670 (Input_file_group::Files): Remove, use ::Input_argument_list.
14671 (Input_file_group::Input_argument_list): Remove, use
14672 ::Input_argument_list.
14673 * plugin.cc (Plugin_manager::add_input_file): Add error in
14674 incremental build.
14675 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14676 functions.
14677 * script.cc (read_input_script): Call
14678 Incremental_input::report_script.
14679 * script.h (Script_info): New class.
14680
b0481b0b
ILT
146812009-04-27 Ian Lance Taylor <iant@google.com>
14682
14683 * x86_64.cc (do_adjust_output_section): Set entsize to
14684 plt_entry_size.
14685
b22a5a41 146862009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14687
14688 * output.cc (Output_file::close): After short writes, continue
14689 writing from the correct offset in the buffer being written.
14690
40fde488
CD
146912009-04-23 Chris Demetriou <cgd@google.com>
14692
14693 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14694 * configure: Regenerate.
14695 * config.in: Regenerate.
14696 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14697 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14698
3ce2c28e
ILT
146992009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14700
14701 * incremental.cc (Incremental_inputs_header_data): Renamed from
14702 Incremental_input_header_data.
14703 (Incremental_inputs_header_data::data_size): New field.
14704 (Incremental_inputs_header_data::put_input_file_count): Renamed
14705 from input_file_count.
14706 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14707 from command_line_offset.
14708 (Incremental_inputs_header_data::put_reserved): Renamed from
14709 put_reserved.
14710 (Incremental_inputs_entry_data): Renamed from
14711 Incremental_input_entry_data.
14712 (Incremental_inputs_entry_data::data_size): New field.
14713 (Incremental_inputs::report_command_line): New method.
14714 (Incremental_inputs::finalize): New method.
14715 (Incremental_inputs::create_incremental_inputs_data): New method.
14716 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14717 * incremental.h: New file.
14718 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14719 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14720 incremental builds.
703d02da 14721 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14722 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14723 (Layout::create_incremental_info_sections): New method.
14724 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14725 * main.cc (main): Notify Incremental_input of the command line.
14726
e55bde5e
ILT
147272009-04-01 Ian Lance Taylor <iant@google.com>
14728 Mikolaj Zalewski <mikolajz@google.com>
14729
14730 * gold.h (reserve_unordered_map): Define, three versions, one for
14731 each version of Unordered_map.
14732 * layout.cc (Layout::Layout): Remove options parameter. Add
14733 number_of_input_files parameter. Don't initialize options_.
14734 Initialize number_of_input_files_ and resized_signatures_. Move
14735 sections_are_attached_.
14736 (Layout::layout_group): Reserve space for group_signatures_.
14737 (Layout::find_or_add_kept_section): Change name parameter to be a
14738 reference. Resize signatures_ map when it gets large enough.
14739 (Layout::layout_eh_frame): Use parameters->options() instead of
14740 this->options_.
14741 (Layout::make_output_section): Likewise.
14742 (Layout::attach_allocated_section_to_segment): Likewise.
14743 (Layout::finalize, Layout::create_executable_stack): Likewise.
14744 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14745 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14746 * layout.h (class Layout): Update declarations. Remove options_
14747 field. Add number_of_input_files_ and resized_signatures_
14748 fields. Move sections_are_attached_ field.
14749 * main.cc (main): Pass number of input files to Layout
14750 constructor. Don't pass options.
14751
154b857c
ILT
147522009-03-30 Ian Lance Taylor <iant@google.com>
14753
14754 * ffsll.c (ffsll): Correct implementation.
14755
2f35ab9b
ILT
147562009-03-27 Ian Lance Taylor <iant@google.com>
14757
fd03461a
ILT
14758 * ffsll.c: New file.
14759 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14760 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14761 * ftruncate.c (ftruncate): Declare before definition.
14762 * mremap.c (mremap): Likewise.
14763 * pread.c (pread): Likewise.
14764 * configure, Makefile.in, config.in: Rebuild.
14765
2f35ab9b
ILT
14766 * mremap.c: New file.
14767 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14768 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14769 (mremap): Declare if HAVE_MREMAP is not defined.
14770 * configure, Makefile.in, config.in: Rebuild.
14771
33aea2fd
CC
147722009-03-27 Cary Coutant <ccoutant@google.com>
14773
14774 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14775 position independent.
14776 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14777 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14778
6d479619
CC
147792009-03-24 Cary Coutant <ccoutant@google.com>
14780
14781 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14782 an executable.
14783 (needs_dynamic_reloc): Likewise.
14784
afc06bb8
ILT
147852009-03-24 Ian Lance Taylor <iant@google.com>
14786
14787 * yyscript.y (file_cmd): Recognize EXTERN.
14788 (extern_name_list, extern_name_list_body): New nonterminals.
14789 * script.cc (script_add_extern): Define.
14790 * script-c.h (script_add_extern): Declare.
14791
f6060a4d
ILT
147922009-03-24 Rafael Avila de Espindola <espindola@google.com>
14793
14794 * object.cc (is_elf_object): Define.
14795 * object.h (is_elf_object): Declare.
14796 * archive.cc (Archive::get_elf_object_for_member): Call
14797 is_elf_object.
33aea2fd 14798 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14799
26736d8e
ILT
148002009-03-24 Elliott Hughes <enh@google.com>
14801
14802 * output.cc (Output_file::map_anonymous): Define.
14803 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14804 try an anonymous one. Report the size if the mmap fails.
14805 * output.h (class Output_file): Declare map_anonymous.
14806
22fd9730
ILT
148072009-03-24 Ian Lance Taylor <iant@google.com>
14808
14809 * target-select.cc (instantiate_target): Don't acquire the lock if
14810 the instantiated_target_ field has already been set.
14811
cb010894
ILT
148122009-03-23 Ian Lance Taylor <iant@google.com>
14813
7f055c20
ILT
14814 * gold-threads.h (class Initialize_lock): Define.
14815 * gold-threads.cc (class Initialize_lock_once): Define.
14816 (initialize_lock_control): New static variable.
14817 (initialize_lock_pointer): New static variable.
14818 (initialize_lock_once): New static function.
14819 (Initialize_lock::Initialize_lock): Define.
14820 (Initialize_lock::initialize): Define.
14821 * target-select.h: Include "gold-threads.h".
14822 (class Target_selector): Add lock_ and initialize_lock_ fields.
14823 Don't define instantiate_target, just declare it.
14824 * target-select.cc (Target_selector::Target_selector): Initialize
14825 new fields.
14826 (Target_selector::instantiate_target): Define.
14827 * descriptors.h: Include "gold-threads.h".
14828 (class Descriptors): Add initialize_lock_ field.
14829 * descriptors.cc (Descriptors::Descriptors): Initialize new
14830 field.
14831 (Descriptors::open): Use initialize_lock_ field
14832 * errors.h (class Errors): Add initialize_lock_ field.
14833 * errors.cc (Errors::Errors): Initialize new field.
14834 (Errors::initialize_lock): Use initialize_lock_ field.
14835 * powerpc.cc (class Target_selector_powerpc): Remove
14836 instantiated_target_ field. In do_recognize call
14837 instantiate_target rather than do_instantiate_target. In
14838 do_instantiate_target just allocate a new target.
14839 * sparc.cc (class Target_selector_sparc): Likewise.
14840
36959681
ILT
14841 * freebsd.h: New file.
14842 * i386.cc: Include "freebsd.h".
14843 (Target_i386): Derive from Target_freebsd rather than
14844 Sized_target.
14845 (Target_selector_i386): Derive from Target_selector_freebsd rather
14846 than Target_selector.
14847 * x86_64.cc: Include "freebsd.h".
14848 (Target_x86_64): Derive from Target_freebsd rather than
14849 Sized_target.
14850 (Target_selector_x86_64): Derive from Target_selector_freebsd
14851 rather than Target_selector.
14852 * target.h (class Target): Add adjust_elf_header and
14853 do_adjust_elf_header.
14854 * output.cc (Output_file_header:: do_sized_write): Call target
14855 adjust_elf_header routine.
14856 * configure.tgt: Set targ_osabi.
14857 * configure.ac: Define GOLD_DEFAULT_OSABI.
14858 * parameters.cc (Parameters::default_target): Pass
14859 GOLD_DEFAULT_OSABI to select_target.
14860 * target-select.h (class Target_selector): Make instantiate_target
14861 protected rather than private.
14862 * Makefile.am (HFILES): Add freebsd.h.
14863 * configure, Makefile.in, config.in: Rebuild.
14864
cb010894
ILT
14865 * merge.cc (do_add_input_section): Correct pend value. Change
14866 message about last entry not being null terminated from error to
14867 warning.
14868
0e879927
ILT
148692009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14870
14871 * incremental.cc: New file.
14872 * Makefile.am (CCFILES): Add incremental.cc.
14873 * Makefile.in: Rebuild.
14874
41105937
PP
148752009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14876
14877 * layout.cc (Layout::output_section_name): Preserve names
14878 of '.note.' sections.
e1df38aa 14879
60439920
ILT
148802009-03-19 Ian Lance Taylor <iant@google.com>
14881
14882 * descriptors.cc (Descriptors::open): Check that the options are
14883 valid before using them.
14884
0d371ad3
ILT
148852009-03-18 Ian Lance Taylor <iant@google.com>
14886
14887 * script-sections.h: Include <list>.
14888 (class Script_sections): Change Sections_elements from std::vector
14889 to std::list. Typedef public Elements_iterator. Add
14890 orphan_section_placement_, data_segment_align_start_, and
14891 saw_data_segment_align_ fields. Remove data_segment_align_index_
14892 field.
14893 * script-sections.cc (class Orphan_section_placement): New class.
14894 (class Sections_element): Add virtual functions is_relro and
14895 orphan_section_init. Remove virtual function place_orphan_here.
14896 (class Output_section_definition): Add is_relro and
14897 orphan_section_init. Remove place_orphan_here.
14898 (class Orphan_output_section): Likewise.
14899 (Script_sections::Script_sections): Update for field changes.
14900 (Script_sections::data_segment_align): Set saw_data_segment_align_
14901 and data_segment_align_start_, not data_segment_align_index.
14902 (Script_sections::data_segment_relro_end): Check
14903 saw_data_segment_align_. Use data_segment_align_start_ rather
14904 than data_segment_align_index_.
14905 (Script_sections::place_orphan): Rewrite to use
14906 Orphan_section_placement.
14907
9201d894
ILT
149082009-03-17 Ian Lance Taylor <iant@google.com>
14909
9c5b8369
ILT
14910 * archive.cc (Archive::add_symbols): Check for a version attached
14911 to the symbol name in the archive map.
14912 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14913 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14914 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14915 (ver_test_11.a): New target.
14916 * testsuite/Makefile.in: Rebuild.
14917
9201d894
ILT
14918 * configure.ac: Check for chsize and posix_fallocate. Replace
14919 ftruncate.
14920 * ftruncate.c: New file, from gnulib.
14921 * output.cc (posix_fallocate): Define dummy version if not
14922 HAVE_POSIX_FALLOCATE.
14923 (Output_file::map): Call posix_fallocate rather than lseek and
14924 write.
14925 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14926 * configure, Makefile.in, config.in: Rebuild.
14927
ef4ab7a8 149282009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14929
ef4ab7a8
PP
14930 * layout.h (Layout::create_note): Add section_name parameter.
14931 * layout.cc (Layout::create_note): Likewise.
14932 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14933
8c500701
ILT
149342009-03-17 Ian Lance Taylor <iant@google.com>
14935
e85b18e1
ILT
14936 * descriptors.cc: Include "options.h".
14937 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14938 (Descriptors::open): Always use O_CLOEXEC when opening a new
14939 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14940 then set FD_CLOEXEC.
14941
9efe6174
ILT
14942 * sparc.cc (class Target_sparc): Add has_got_section.
14943 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14944 make sure we have a GOT section.
14945
14946 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14947 (Target_sparc::Scan::local): Likewise.
14948 (Target_sparc::Scan::global): Likewise.
14949 (Target_sparc::Relocate::relocate): Likewise.
14950 (Target_sparc::Relocate::relocate_tls): Likewise.
14951
8c500701
ILT
14952 * symtab.cc (Symbol_table::define_default_version): New function,
14953 broken out of add_from_object.
14954 (Symbol_table::add_from_object): Call define_default_version.
14955 (Symbol_table::define_special_symbol): Add resolve_oldsym
14956 parameter. Change all callers. If the version for a symbol comes
14957 from a version script, resolve it with the symbol with the same
14958 name with no version. Also add the symbol without a version if
14959 appropriate.
14960 (do_define_in_output_data): If resolving with oldsym, don't delete
14961 sym.
14962 (do_define_in_output_segment): Likewise.
14963 (do_define_as_constant): Likewise.
14964 * symtab.h (class Symbol_table): Update declarations.
14965
f1ed28fb
ILT
149662009-03-13 Ian Lance Taylor <iant@google.com>
14967
15f8229b
ILT
14968 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14969 (Read_symbols::requeue): New function.
14970 (Read_symbols::do_read_symbols): If make_elf_object fails because
14971 the target type is not configured, and the file was searched for,
14972 issue a warning and retry with the next directory.
14973 (Add_symbols::run): If the file has an incompatible format, and
14974 it was searched for, requeue the Read_symbols task. On error,
14975 release the object.
14976 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14977 dirindex parameter to constructor. Change all callers. Declare
14978 incompatible_warning and requeue.
14979 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14980 input_argument_ and input_group_ fields. Add them to
14981 constructor. Change all callers.
14982 (class Read_script): Add dirindex_ field. Add it to constructor.
14983 Change all callers.
14984 * archive.cc (Archive::setup): Remove input_objects parameter.
14985 Change all callers.
14986 (Archive::get_file_and_offset): Likewise.
14987 (Archive::read_all_symbols): Likewise.
14988 (Archive::read_symbols): Likewise.
14989 (Archive::get_elf_object_for_member): Remove input_objects
14990 parameter. Add punconfigured parameter. Change all callers.
14991 (Archive::add_symbols): Change return type to bool. Check return
14992 value of include_member.
14993 (Archive::include_all_members): Likewise.
14994 (Archive::include_member): Change return type to bool. Return
14995 false if first included object has incompatible target. Set
14996 included_member_ field.
14997 (Add_archive_symbols::run): If add_symbols returns false, requeue
14998 Read_symbols task.
14999 * archive.h (class Archive): Add included_member_ field.
15000 Initialize it in constructor. Add input_file and searched_for
15001 methods. Update declarations.
15002 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15003 input_argument_ fields. Add them to constructor. Change all
15004 callers.
15005 * script.cc: Include "target-select.h".
15006 (class Parser_closure): Add skip_on_incompatible_target_ and
15007 found_incompatible_target_ fields. Add
15008 skip_on_incompatible_target parameter to constructor. Change all
15009 callers. Add methods skip_on_incompatible_target,
15010 clear_skip_on_incompatible_target, found_incompatible_target, and
15011 set_found_incompatible_target.
15012 (read_input_script): Add dirindex parameter. Change all callers.
15013 If parser finds an incompatible target, requeue Read_symbols
15014 task.
15015 (script_set_symbol): Clear skip_on_incompatible_target in
15016 closure.
15017 (script_add_assertion, script_parse_option): Likewise.
15018 (script_start_sections, script_add_phdr): Likewise.
15019 (script_check_output_format): New function.
15020 * script.h (read_input_script): Update declaration.
15021 * script-c.h (script_check_output_format): Declare.
15022 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15023 (ignore_cmd): Remove OUTPUT_FORMAT.
15024 * fileread.cc (Input_file::Input_file): Add explicit this.
15025 (Input_file::will_search_for): New function.
15026 (Input_file::open): Add pindex parameter. Change all callers.
15027 * fileread.h (class Input_file): Add input_file_argument method.
15028 Declare will_search_for. Update declarations.
15029 * object.cc (make_elf_object): Add punconfigured parameter.
15030 Change all callers.
15031 * object.h (class Object): Make input_file public. Add
15032 searched_for method.
15033 (make_elf_object): Update declaration.
15034 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15035 restart search.
15036 * dirsearch.h (class Dirsearch): Update declaration.
15037 * options.h (class General_options): Add --warn-search-mismatch.
15038 * parameters.cc (Parameters::is_compatible_target): New function.
15039 * parameters.h (class Parameters): Declare is_compatible_target.
15040 * workqueue.cc (Workqueue::add_blocker): New function.
15041 * workqueue.h (class Workqueue): Declare add_blocker.
15042
f1ed28fb
ILT
15043 * fileread.cc (Input_file::open): Remove options parameter.
15044 Change all callers.
15045 (Input_file::open_binary): Likewise.
15046 * script.cc (read_input_script): Likewise.
15047 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15048 options parameter from constructor. Change all callers.
15049 (class Read_script): Likewise.
15050 * fileread.h (class Input_file): Update declarations.
15051 * script.h (read_input_script): Update declaration.
15052
34dd024a
NC
150532009-03-10 Nick Clifton <nickc@redhat.com>
15054
15055 * po/es.po: New Spanish translation.
15056
6d71b17c
CC
150572009-03-06 Cary Coutant <ccoutant@google.com>
15058
15059 * options.cc (parse_short_option): Keep dash_z from registering itself.
15060
031cdbed
ILT
150612009-03-03 Ian Lance Taylor <iant@google.com>
15062
15063 PR 9918
15064 * target-reloc.h (relocate_section): Pass output_section to
15065 relocate.
15066 * i386.cc (Target_i386::should_apply_static_reloc): Add
15067 output_section parameter. Change all callers.
15068 (Target_i386::Relocate::relocate): Add output_section parameter.
15069 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15070 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15071 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15072 * testsuite/two_file_shared.sh: New script.
15073 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15074 (check_DATA): Add two_file_shared.dbg.
15075 (two_file_shared.dbg): New target.
15076 * testsuite/Makefile.in: Rebuild.
15077
15d5fa16
ILT
150782009-03-01 Ian Lance Taylor <iant@google.com>
15079
15080 * configure.ac: Check for byteswap.h.
15081 * configure: Rebuild.
15082 * config.in: Rebuild.
15083
8a4c0b0d
ILT
150842009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15085
15086 * layout.cc (Layout::find_or_add_kept_section): New function.
15087 (Layout::add_comdat): Removed.
15088 * layout.h (struct Kept_section): Move out of class Layout.
15089 Remove trailing underscores from field names. Add group_sections
15090 field. Rename group_ field to is_group. Change all uses.
15091 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15092 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15093 comdat_groups_ field.
15094 (Sized_relobj::include_section_group): Use
15095 find_or_add_kept_section and Kept_section::group_sections.
15096 (Sized_relobj::include_linkonce_section): Likewise.
15097 * object.cc (class Sized_relobj): Don't define Comdat_group or
15098 Comdat_group_table. Remove find_comdat_group and
15099 add_comdat_group. Remove comdat_groups_ field.
15100 * plugin.cc (include_comdat_group): Use
15101 Layout::find_or_add_kept_section.
15102
b4ecf66b
ILT
151032009-02-28 Ian Lance Taylor <iant@google.com>
15104
14359ca0
ILT
15105 * README: --gc-sections and map files are now supported. Document
15106 some build requirements.
15107
b4ecf66b
ILT
15108 PR 6992
15109 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15110 relocatable link set the value of the section symbol to zero.
15111 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15112 relocatable link don't include the section address in the local
15113 symbol value.
15114
0602e05a
ILT
151152009-02-27 Ian Lance Taylor <iant@google.com>
15116
fd9d194f
ILT
15117 PR 6811
15118 * options.h (class Search_directory): Add is_system_directory.
15119 (class General_options): Declare is_in_system_directory.
15120 * options.cc (get_relative_sysroot): Make static.
15121 (get_default_sysroot): Make static.
15122 (General_optoins::is_in_system_directory): New function.
15123 * fileread.cc (Input_file::is_in_system_directory): New function.
15124 * fileread.h (class Input_file): Declare is_in_system_directory.
15125 * object.h (class Object): Add is_in_system_directory.
15126 (class Input_objects): Remove system_library_directory_ field.
15127 * object.cc (Input_objects::add_object): Don't set
15128 system_library_directory_.
15129 (input_objects::found_in_system_library_directory): Remove.
15130 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15131 parameter. Change all callers.
15132 (Symbol_table::sized_write_globals): Likewise.
15133 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15134 Call Object::is_in_system_directory.
15135 * symtab.h (class Symbol_table): Update declarations.
15136
61edd21f
ILT
15137 PR 5990
15138 * descriptors.h (Open_descriptor): Add is_on_stack field.
15139 * descriptors.cc (Descriptors::open): If the descriptor is on the
15140 top of the stack, remove it. Initialize is_on_stack field.
15141 (Descriptors::release): Only add pod to stack if it is not on the
15142 stack already.
15143 (Descriptors::close_some_descriptor): Clear stack_next and
15144 is_on_stack fields.
15145
e29e076a
ILT
15146 PR 7091
15147 * output.cc (Output_section::find_starting_output_address): Rename
15148 from starting_output_address; add PADDR parameter; change return
15149 type.
15150 * output.h (class Output_section): Declare
15151 find_starting_output_address instead of starting_output_address.
15152 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15153 section symbol for which we can't find a merge section.
15154
0602e05a
ILT
15155 PR 9836
15156 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15157 hidden or internal, force the symbol to be local.
15158 * resolve.cc (Symbol::override_visibility): Define.
15159 (Symbol::override_base): Use override_visibility.
15160 (Symbol_table::resolve): Likewise.
15161 (Symbol::override_base_with_special): Likewise.
15162 (Symbol_table::override_with_special): If the visibility is hidden
15163 or internal, force the symbol to be local.
15164 * symtab.h (class Symbol): Add set_visibility and
15165 override_visibility.
15166 * testsuite/ver_test_1.sh: New file.
15167 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15168 (check_DATA): Add ver_test_1.syms.
15169 (ver_test_1.syms): New target.
15170 * testsuite/Makefile.in: Rebuild.
15171
401a9a73
CC
151722009-02-25 Cary Coutant <ccoutant@google.com>
15173
15174 * layout.cc (Layout::choose_output_section): Don't rename sections
15175 when using a linker script that has a SECTIONS clause.
15176 * Makefile.in: Regenerate.
15177
15178 * testsuite/Makefile.am (script_test_5.sh): New test case.
15179 * testsuite/Makefile.in: Regenerate.
15180 * testsuite/script_test_5.cc: New file.
15181 * testsuite/script_test_5.sh: New file.
15182 * testsuite/script_test_5.t: New file.
15183
f488e4b0
CC
151842009-02-13 Rafael Avila de Espindola <espindola@google.com>
15185
15186 * archive.cc (Archive::include_member): Update calls to add_symbols.
15187 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15188 the Layout argument.
15189 * dynobj.h (do_add_symbols): Add the Layout argument.
15190 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15191 Layout argument.
15192 * object.h (Object::add_symbols): Add the Layout argument.
15193 (Object::do_add_symbols): Add the Layout argument.
15194 (Sized_relobj::do_add_symbols): Add the Layout argument.
15195 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15196 Unify the two versions.
15197 (Add_plugin_symbols): Remove.
15198 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15199 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15200 (Add_plugin_symbols): Remove.
15201 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15202 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15203 (Add_symbols::run): Make it work with Pulginobj.
15204
89dd1680
ILT
152052009-02-06 Ian Lance Taylor <iant@google.com>
15206
15207 * object.cc (Sized_relobj::do_layout): Make info message start
15208 with lower case letter.
15209
266d0a74
ILT
152102009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15211
602b464e
ILT
15212 * binary.cc: Fix file comment.
15213
266d0a74
ILT
15214 * options.h (enum Incremental_disposition): Define.
15215 (class General_options): Add new options: --incremental,
15216 --incremental_changed, --incremental_unchanged,
15217 --incremental_unknown. Add incremental_disposition_ and
15218 implicit_incremental_ fields.
15219 (General_options::incremental_disposition): New function.
15220 (class Position_dependent_options): Add incremental_disposition
15221 option.
15222 (Position_dependent_options::copy_from_options): Set incremental
15223 dispositions.
15224 * options.cc (General_options::parse_incremental_changed): New
15225 function.
2e702c99
RM
15226 (General_options::parse_incremental_unchanged): New function.
15227 (General_options::parse_incremental_unknown): New function.
15228 (General_options::General_options): Initialize new fields
266d0a74 15229 incremental_disposition_ and implicit_incremental_.
2e702c99 15230 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15231 without --incremental.
15232
f073bbf7
CD
152332009-02-06 Chris Demetriou <cgd@google.com>
15234
15235 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15236 pointer and to report location as the file name associated with
15237 the symbol.
15238 (gold_undefined_symbol_at_location): New function to replace the
15239 old gold_undefined_symbol functionality.
15240 * target-reloc.h (relocate_section): Update to use
15241 gold_undefined_symbol_at_location.
15242 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15243 Call gold_undefined_symbol function rather than gold_error.
15244 * errors.h (Errors::undefined_symbol): Take location as a
15245 string, rather than calculating it from a relocation.
15246 * errors.cc (Errors::fatal): Print "fatal error:" before the
15247 formatted message.
15248 (Errors::error, Errors::error_at_location): Print "error: "
15249 before the formatted message.
15250 (Errors::undefined_symbol): Take location as a string, rather
15251 than calculating it from a relocation.
15252 (gold_undefined_symbol_at_location): New function akin to
15253 old gold_undefined_symbol, calculates location from relocation.
15254 (gold_undefined_symbol): Change to take only a Symbol pointer
15255 and to report location as the file name associated with the symbol.
15256 * testsuite/debug_msg.sh: Update for changed error messages.
15257 * testsuite/undef_symbol.sh: Likewise.
15258
8e94a90c
ILT
152592009-02-04 Duncan Sands <baldrick@free.fr>
15260
15261 PR 9812
15262 * reduced_debug_output.h
15263 (Output_reduced_debug_abbrev_section::failed): Use format for
15264 gold_warning.
15265 (Output_reduced_debug_info_section::faild): Likewise.
15266
88a0e15b
ILT
152672009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15268
15269 * script.cc (Lazy_demangler): New class.
2e702c99 15270 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15271 symbol only once.
15272
5efc7cd2
CC
152732009-01-29 Cary Coutant <ccoutant@google.com>
15274
15275 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15276 to __tls_get_addr.
15277 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15278
e0ebcf42
ILT
152792009-01-28 Ian Lance Taylor <iant@google.com>
15280
5efc7cd2 15281 * version.cc (version_string): Bump to 1.9.
75fe7426 15282
e0ebcf42
ILT
15283 * gold.h: Include <cstring> and <stdint.h>.
15284 * version.cc: Include <cstdio>.
15285 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15286 warning.
15287 * reduced_debug_output.cc (insert_into_vector): Rename from
15288 Insert_into_vector; change all callers. Use Swap_unaligned to
15289 avoid aliasing issue; remove union since it is unnecessary.
15290
8e2813be 152912009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15292
15293 * Makefile.am (CCFILES): Add gc.cc.
15294 (HFILES): Add gc.h.
15295 * Makefile.in: Regenerate.
15296 * gold.cc (Gc_runner): New class.
15297 (queue_initial_tasks): Call garbage collection related tasks
15298 when corresponding options are invoked.
15299 (queue_middle_gc_tasks): New function.
15300 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15301 processed early before laying out sections during garbage collection.
15302 * gold.h (queue_middle_gc_tasks): New function.
15303 (is_prefix_of): Move from "layout.cc".
15304 * i386.cc (Target_i386::gc_process_relocs): New function.
15305 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15306 * main.cc (main): Create object of class "Garbage_collection".
15307 * object.cc (Relobj::copy_symbols_data): New function.
15308 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15309 (Sized_relobj::do_layout): Allow this function to be called twice
15310 during garbage collection and defer layout of section during the
6d03d481
ST
15311 first call.
15312 * object.h (Relobj::get_symbols_data): New function.
15313 (Relobj::is_section_name_included): New function.
15314 (Relobj::copy_symbols_data): New function.
15315 (Relobj::set_symbols_data): New function.
15316 (Relobj::get_relocs_data): New function.
15317 (Relobj::set_relocs_data): New function.
15318 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15319 (Relobj::gc_process_relocs): New function.
15320 (Relobj::do_gc_process_relocs): New pure virtual function.
15321 (Relobj::sd_): New data member.
15322 (Sized_relobj::is_output_section_offset_invalid): New function.
15323 (Sized_relobj::do_gc_process_relocs): New function.
15324 * options.h (General_options::gc_sections): Modify to not be a no-op.
15325 (General_options::print_gc_sections): New option.
15326 * plugin.cc (Plugin_finish::run): Remove function call to
15327 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15328 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15329 * reloc.cc (Read_relocs::run): Add task to process relocs and
15330 determine unreferenced sections when doing garbage collection.
15331 (Gc_process_relocs): New class.
15332 (Sized_relobj::do_gc_process_relocs): New function.
15333 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15334 sections that are garbage collected.
15335 * reloc.h (Gc_process_relocs): New class.
15336 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15337 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15338 symbols whose corresponding sections are garbage collected.
15339 (Symbol_table::Symbol_table): Add new parameter for the garbage
15340 collection object.
15341 (Symbol_table::gc_mark_undef_symbols): New function.
15342 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15343 (Symbol_table::gc_mark_dyn_syms): New function.
15344 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15345 as garbage.
15346 (Symbol_table::add_from_object): Likewise.
15347 (Symbol_table::add_from_relobj): When building shared objects, do not
15348 treat externally visible symbols as garbage.
15349 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15350 table information for static and relocatable links.
15351 * symtab.h (Symbol_table::set_gc): New function.
15352 (Symbol_table::gc): New function.
15353 (Symbol_table::gc_mark_undef_symbols): New function.
15354 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15355 (Symbol_table::gc_mark_dyn_syms): New function.
15356 (Symbol_table::gc_): New data member.
e1df38aa 15357 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15358 function.
15359 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15360 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15361
3b293544
CF
153622009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15363
15364 * options.h (General_options::gc_sections): Define as a no-op for now.
15365 (General_options::no_keep_memory): Ditto.
15366 (General_options::Bshareable): Define.
15367 * options.cc (General_options::finalize): Honor -Bshareable.
15368
83d22aa8
AS
153692009-01-20 Andreas Schwab <schwab@suse.de>
15370
15371 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15372 read the value in the contents, since we don't use it. Use the
15373 template endianness when writing.
15374 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15375
cd536b21
AS
153762009-01-19 Andreas Schwab <schwab@suse.de>
15377
15378 * configure.tgt (powerpc64-*): Fix targ_obj.
15379
99e9a495
ILT
153802009-01-15 Ian Lance Taylor <iant@google.com>
15381
15382 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15383 local symbols when stripping all symbols.
15384
bbbfea06
CC
153852009-01-14 Cary Coutant <ccoutant@google.com>
15386
99e9a495 15387 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15388
0f7c0701
CC
153892009-01-14 Cary Coutant <ccoutant@google.com>
15390
15391 * archive.cc (Archive::get_elf_object_for_member): Remove call
15392 to File_read::claim_for_plugin.
15393 * descriptors.cc (Descriptors::open): Remove reference to
15394 is_claimed.
15395 (Descriptors::claim_for_plugin): Remove.
15396 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15397 (Descriptors::is_claimed): Remove.
15398 (claim_descriptor_for_plugin): Remove.
15399 * fileread.cc (File_read::claim_for_plugin): Remove.
15400 * fileread.h (File_read::claim_for_plugin): Remove.
15401 (File_read::descriptor): Reopen descriptor if necessary.
15402 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15403 (Plugin_manager::all_symbols_read): Add task parameter. Change
15404 all callers.
15405 (Plugin_manager::get_input_file): New function.
15406 (Plugin_manager::release_input_file): New function.
15407 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15408 corresponding data member.
15409 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15410 and pass to base constructor. Change all callers.
15411 (get_input_file, release_input_file): New functions.
15412 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15413 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15414 (Plugin_manager::all_symbols_read): Add task parameter.
15415 (Plugin_manager::get_input_file): New function.
15416 (Plugin_manager::release_input_file): New function.
15417 (Plugin_manager::task_): New data member.
15418 (Pluginobj::Pluginobj): Add filesize parameter.
15419 (Pluginobj::filename): New function.
15420 (Pluginobj::descriptor): New function.
15421 (Pluginobj::filesize): New function.
15422 (Pluginobj::filesize_): New data member.
15423 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15424 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15425 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15426
15427 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15428 with archive libraries.
15429 * testsuite/Makefile.in: Regenerate.
15430 * testsuite/plugin_test.c (struct sym_info): New type.
15431 (get_input_file, release_input_file): New static variables.
15432 (onload): Capture new transfer vector entries.
15433 (claim_file_hook): Stop reading at end of file according to filesize.
15434 Factor out parsing of readelf output into separate function.
15435 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15436 APIs and get the source file name from the symbol table. Convert
15437 source file name to corresponding object file name. Print info
15438 message when adding new input files.
15439 (parse_readelf_line): New function.
15440 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15441 * testsuite/plugin_test_2.sh: Likewise.
15442 * testsuite/plugin_test_3.sh: Likewise.
15443 * testsuite/plugin_test_4.sh: New test case.
15444
62a6d109
ILT
154452009-01-07 Ian Lance Taylor <iant@google.com>
15446
15447 * version.cc (version_string): Bump to 1.8.
15448
483620e8
CC
154492008-12-23 Cary Coutant <ccoutant@google.com>
15450
15451 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15452 * plugin.cc (Plugin_manager::finish): Rename as
15453 layout_deferred_objects. Move cleanup to separate function.
15454 (Plugin_manager::cleanup): New function.
15455 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15456 separately.
15457 * plugin.h (Plugin_manager::finish): Rename as
15458 layout_deferred_objects.
15459 (Plugin_manager::cleanup): New function.
15460 (Plugin_manager::cleanup_done): New field.
15461
d66a9eb3
CC
154622008-12-23 Cary Coutant <ccoutant@google.com>
15463
15464 * plugin.cc (is_visible_from_outside): New function.
15465 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15466 so we don't return "IR only" status for exported symbols or -r links.
15467
15468 * testsuite/Makefile.am (plugin_test_3): New test case.
15469 * testsuite/Makefile.in: Regenerate.
15470 * testsuite/plugin_test_3.sh: New file.
15471
5995b570
CC
154722008-12-22 Cary Coutant <ccoutant@google.com>
15473
15474 * object.cc (Sized_relobj::layout_section): New function.
15475 (Sized_relobj::do_layout): Defer layout of input sections until after
15476 plugin has provided replacement files.
15477 (Sized_relobj::do_layout_deferred_sections): New function.
15478 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15479 (Relobj::layout_deferred_sections): New function.
15480 (Relobj::do_layout_deferred_sections): New function.
15481 (Sized_relobj::do_layout_deferred_sections): New function.
15482 (Sized_relobj::layout_section): New function.
15483 (Sized_relobj::Deferred_layout): New structure.
15484 (Sized_relobj::deferred_layout_): New field.
15485 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15486 Change all callers. Layout deferred sections.
15487 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15488 references.
15489 (Plugin_hook::run): Move code from do_plugin_hook inline.
15490 (Plugin_hook::do_plugin_hook): Remove.
15491 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15492 (Plugin_manager::finish): Renamed, was cleanup.
15493 (Plugin_manager::should_defer_layout): New function.
15494 (Plugin_manager::add_deferred_layout_object): New function.
15495 (Plugin_manager::Deferred_layout_list): New type.
15496 (Plugin_manager::deferred_layout_objects_): New field.
15497 (Plugin_hook::do_plugin_hook): Remove.
15498
ee769c88
ILT
154992008-12-17 Ian Lance Taylor <iant@google.com>
15500
15501 * options.h (class General_options): Add --no case for
15502 --export-dynamic.
15503
abc8dcba
CC
155042008-12-16 Cary Coutant <ccoutant@google.com>
15505
15506 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15507 vector.
15508 (Plugin_manager::claim_file): Create plugin object even if
15509 plugin did not call the add_symbols callback.
15510 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15511 asking for more symbols than were added.
15512 * testsuite/Makefile.am (plugin_test_1): Add test case with
15513 no global symbols.
15514 (empty.syms): New target.
15515 * testsuite/Makefile.in: Regenerate.
15516 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15517 message. Don't call add_symbols if no globals.
15518 (all_symbols_read_hook): Don't provide replacement for empty
15519 claimed file.
15520
b0074644
ILT
155212008-12-12 Ian Lance Taylor <iant@google.com>
15522
68943102
ILT
15523 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15524 r_type == 0 for a local symbol with r_sym == 0.
15525 (scan_relocatable_relocs): Pass r_sym to
15526 local_non_section_strategy.
15527 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15528 r_sym parameter.
15529
b0074644
ILT
15530 * configure.ac: Update test for TLS descriptors: they are
15531 supported as of glibc 2.9.
15532 * configure: Rebuild.
15533
c2508178
ILT
155342008-12-11 Ian Lance Taylor <iant@google.com>
15535
15536 PR 7091
15537 * target-reloc.h (Default_scan_relocatable_relocs): For each
15538 function, map r_type == 0 to RELOC_DISCARD.
15539
2756a258
CC
155402008-12-10 Cary Coutant <ccoutant@google.com>
15541
15542 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15543 object to override a kept COMDAT group from a plugin object.
15544
bb6f53d3
ILT
155452008-12-09 Ian Lance Taylor <iant@google.com>
15546
fbc558e1
ILT
15547 PR 7088
15548 * yyscript.y (file_cmd): Handle INPUT.
15549
bb6f53d3
ILT
15550 * testsuite/initpri1.c: Change all declarations to be full
15551 prototypes by adding void, to avoid compiler warnings.
15552
4674ecfc
CC
155532008-12-05 Rafael Avila de Espindola <espindola@google.com>
15554
15555 * options.cc (General_options::parse_plugin_opt): New.
15556 (General_options::add_plugin): The argument now is just the filename.
15557 (General_options::add_plugin_option): New.
15558 * options.h (plugin_opt): New.
15559 (add_plugin): Change argument name.
15560 (add_plugin_option): New.
15561 * plugin.cc (Plugin::load): Don't parse the plugin option.
15562 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15563 (Plugin::add_option): New.
15564 (Plugin::args_): Change type.
15565 (Plugin::filename_): New.
15566 (Plugin_manager::add_plugin_option): New.
15567 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15568 * testsuite/Makefile.in: Regenerate.
15569
fd06b4aa
CC
155702008-12-05 Cary Coutant <ccoutant@google.com>
15571
15572 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15573 Handle --strip-lto-sections option.
15574 * options.h (strip_lto_sections): New option.
15575
6c52134c
CC
155762008-12-01 Cary Coutant <ccoutant@google.com>
15577
15578 * plugin.cc (ld_plugin_message): Change format parameter to const.
15579 Fix mismatch between new[] and delete.
15580
a45248e0
CC
155812008-11-14 Cary Coutant <ccoutant@google.com>
15582
15583 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15584 instead of -1U.
15585
c82fbeee
CS
155862008-11-05 Craig Silverstein <csilvers@google.com>
15587
15588 * options.cc (General_options::parse_dynamic_list): New function.
15589 * options.h (General_options): New flags dynamic_list,
15590 dynamic_list_data, dynamic_list_cpp_new, and
15591 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15592 (General_options::in_dynamic_list): New function.
15593 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15594 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15595 (Lex::can_continue_name): Likewise.
15596 (yylex): Likewise.
15597 (read_script_file): New parameter script_options.
15598 (read_dynamic_list): New function.
15599 (Script_options::define_dynamic_list): New function.
15600 (dynamic_list_keyword_parsecodes): New variable.
15601 (dynamic_list_keywords): New variable.
15602 * script.h (Script_options::define_dynamic_list): New function
15603 prototype.
15604 (read_dynamic_list): New function prototype.
15605 * symtab.cc (strprefix): New macro.
15606 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15607 dynamic_list_data, dynamic_list_cpp_new, and
15608 dynamic_list_cpp_typeinfo.
15609 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15610 (dynamic_list_expr): New rule.
15611 (dynamic_list_nodes): Likewise.
15612 (dynamic_list_node): Likewise.
15613 * testsuite/Makefile.am (dynamic_list): New test.
15614 * testsuite/Makefile.in: Regenerated.
15615 * testsuite/dynamic_list.t: New file.
15616 * testsuite/dynamic_list.sh: New file.
15617
e0bb29a5
CS
156182008-11-05 Craig Silverstein <csilvers@google.com>
15619
15620 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15621 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15622 (t11_last): Likewise.
15623 * testsuite/ver_test_6.c (main): Likewise.
15624
4e1e25e0
CC
156252008-10-07 Cary Coutant <ccoutant@google.com>
15626
15627 * options.c (General_options::finalize): Add check for -static and
15628 -shared.
15629 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15630 is not empty.
15631
92f03fcb
CC
156322008-10-02 Cary Coutant <ccoutant@google.com>
15633
15634 * plugin.cc (make_sized_plugin_object): Fix conditional
15635 compilation to work when not all targets are enabled.
15636
fbd8a257
CC
156372008-09-29 Cary Coutant <ccoutant@google.com>
15638
15639 * archive.cc (Archive::get_file_and_offset): Use filename instead
15640 of name to get library path.
15641 (Archive::include_member): Unlock external member of a thin archive.
15642
15643 * testsuite/Makefile.am (TEST_AR): New variable.
15644 (thin_archive_test_1): New test.
15645 (thin_archive_test_2): New test.
81636b3f
CC
15646 * testsuite/Makefile.in: Regenerate.
15647 * testsuite/thin_archive_main.cc: New file.
15648 * testsuite/thin_archive_test_1.cc: New file.
15649 * testsuite/thin_archive_test_2.cc: New file.
15650 * testsuite/thin_archive_test_3.cc: New file.
15651 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15652
eff45813
CC
156532008-09-29 Cary Coutant <ccoutant@google.com>
15654
15655 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15656 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15657 instead of -1U.
15658 (Sized_relobj::do_finalize_local_symbols): Likewise.
15659 (Sized_relobj::map_to_kept_section): Likewise.
15660 * object.h (Sized_relobj::invalid_address): New constant.
15661 (Sized_relobj::do_output_section_offset): Check for invalid_address
15662 and return -1ULL.
15663 * output.cc (Output_reloc::local_section_offset): Use constant
15664 invalid_address instead of -1U.
15665 (Output_reloc::get_address): Likewise.
15666 (Output_section::output_address): Change -1U to -1ULL.
15667 * output.h (Output_reloc::invalid_address): New constant.
15668 * reloc.cc (Sized_relobj::write_sections): Use constant
15669 invalid_address instead of -1U.
15670 (Sized_relobj::relocate_sections): Likewise.
15671 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15672 values for merge sections.
15673 * target-reloc.h (relocate_for_relocatable): Use constant
15674 invalid_address instead of -1U.
15675
89fc3421
CC
156762008-09-19 Cary Coutant <ccoutant@google.com>
15677
15678 Add plugin functionality for link-time optimization (LTO).
15679 * configure.ac (plugins): Add --enable-plugins option.
15680 * configure: Regenerate.
15681 * config.in: Regenerate.
15682 * Makefile.am (LIBDL): New variable.
15683 (CCFILES): Add plugin.cc.
15684 (HFILES): Add plugin.h.
15685 (ldadd_var): Add LIBDL.
15686 * Makefile.in: Regenerate.
15687
15688 * archive.cc: Include "plugin.h".
15689 (Archive::setup): Don't preread archive symbols when using a plugin.
15690 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15691 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15692 files.
15693 (Archive::include_member): Add symbols from plugin objects.
15694 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15695 * descriptors.cc (Descriptors::open): Check for file descriptors
15696 abandoned by plugins.
15697 (Descriptors::claim_for_plugin): New function.
15698 * descriptors.h (Descriptors::claim_for_plugin): New function.
15699 (Open_descriptor::is_claimed): New field.
15700 (claim_descriptor_for_plugin): New function.
15701 * fileread.cc (File_read::claim_for_plugin): New function.
15702 * fileread.h (File_read::claim_for_plugin): New function.
15703 (File_read::descriptor): New function.
15704 * gold.cc: Include "plugin.h".
15705 (queue_initial_tasks): Add task to call plugin hooks for generating
15706 new object files.
15707 * main.cc: Include "plugin.h".
15708 (main): Load plugin libraries.
15709 * object.h (Pluginobj): Declare.
15710 (Object::pluginobj): New function.
15711 (Object::do_pluginobj): New function.
15712 (Object::set_target): New function.
15713 * options.cc: Include "plugin.h".
15714 (General_options::parse_plugin): New function.
15715 (General_options::General_options): Initialize plugins_ field.
15716 (General_options::add_plugin): New function.
15717 * options.h (Plugin_manager): Declare.
15718 (General_options): Add --plugin option.
15719 (General_options::has_plugins): New function.
15720 (General_options::plugins): New function.
15721 (General_options::add_plugin): New function.
15722 (General_options::plugins_): New field.
15723 * plugin.cc: New file.
15724 * plugin.h: New file.
15725 * readsyms.cc: Include "plugin.h".
15726 (Read_symbols::do_read_symbols): Check for archive before checking
15727 for ELF file. Call plugin hooks to claim files.
15728 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15729 from a real object file; force override when processing replacement
15730 files.
15731 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15732 (Symbol::init_base_object): Likewise.
15733 (Symbol::init_base_output_data): Likewise.
15734 (Symbol::init_base_output_segment): Likewise.
15735 (Symbol::init_base_constant): Likewise.
15736 (Symbol::init_base_undefined): Likewise.
15737 (Symbol::output_section): Assert that object is not a plugin.
15738 (Symbol_table::add_from_pluginobj): New function.
15739 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15740 undefined.
15741 (Symbol_table::sized_write_globals): Likewise.
15742 (Symbol_table::add_from_pluginobj): Instantiate template.
15743 * symtab.h (Sized_pluginobj): Declare.
15744 (Symbol::in_real_elf): New function.
15745 (Symbol::set_in_real_elf): New function.
15746 (Symbol::in_real_elf_): New field.
15747 (Symbol_table::add_from_pluginobj): New function.
15748
15749 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15750 (LIBDL): New variable.
15751 (LDADD): Add LIBDL.
15752 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15753 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15754 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15755 (MOSTLYCLEANFILES): Likewise.
15756 * testsuite/Makefile.in: Regenerate.
15757 * testsuite/plugin_test.c: New file.
15758 * testsuite/plugin_test_1.sh: New file.
15759 * testsuite/plugin_test_2.sh: New file.
15760
de31bda5
ILT
157612008-09-16 Ian Lance Taylor <iant@google.com>
15762
9c2d0ef9
ILT
15763 * target-reloc.h (relocate_section): Check whether a symbol is
15764 defined by the ABI before reporting an undefined symbol error.
15765 * target.h (Target::is_defined_by_abi): Make parameter const.
15766 (Target::do_is_defined_by_abi): Likewise.
15767 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15768 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15769 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15770 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15771 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15772 * testsuite/Makefile.in: Rebuild.
15773
de31bda5
ILT
15774 * fileread.cc (make_view): Add casts to avoid warning.
15775
9fa33bee
AO
157762008-09-16 Alexandre Oliva <aoliva@redhat.com>
15777
15778 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15779 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15780
183fd0e3
AO
157812008-09-16 Alexandre Oliva <aoliva@redhat.com>
15782
15783 * options.h (General_options::output_is_executable): New.
15784 (General_options::output_is_pie): New.
15785 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15786 for shared libraries.
15787 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15788
7be8330a
CD
157892008-09-11 Chris Demetriou <cgd@google.com>
15790
15791 * options.h (origin): New -z option.
15792 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15793 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15794 in DT_FLAGS_1.
15795
a9caad02
CC
157962008-09-05 Cary Coutant <ccoutant@google.com>
15797
15798 * fileread.cc (File_read::make_view): Add check for attempt to map
15799 beyond end of file.
15800
ae6dce4d
CC
158012008-09-05 Cary Coutant <ccoutant@google.com>
15802
15803 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15804 explicit instantiations.
15805
d7ab2a47
KVH
158062008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15807
15808 PR gold/6858
15809 * options.cc (General_options::finalize): Allow undefined symbols
15810 in shlibs if linking -shared.
15811
15812 PR gold/6859
15813 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15814 symbols as not needing a dynsym entry.
15815
1e52a9c1
CS
158162008-08-20 Craig Silverstein <csilvers@google.com>
15817
15818 * fileread.cc (File_read::open): Do not lock the file unless it
15819 was successfully opened.
15820
d85c80a3
CC
158212008-08-14 Cary Coutant <ccoutant@google.com>
15822
15823 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15824 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15825 * testsuite/tls_test.cc (struct int128): 128-bit struct
15826 for testing TLS relocs with non-zero addend.
15827 (v12): New TLS variable.
15828 (t12): New test.
15829 (t_last): Add check for v12.
15830 * testsuite/tls_test.h (t12): New function.
15831 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15832
2d924fd9
ILT
158332008-08-13 Ian Lance Taylor <iant@google.com>
15834
15835 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15836 set tls_segment_ or relro_segment_.
15837 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15838 when appropriate.
15839 * output.h (Output_section::clear_is_relro): New function.
15840 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15841 sections specially even when output_data_ is empty.
15842 (Output_segment::maximum_alignment): When first section is relro,
15843 only force alignment for PT_LOAD segments.
15844 * script.cc (script_data_segment_align): New function.
15845 (script_data_segment_relro_end): New function.
15846 * script-c.h (script_data_segment_align): Declare.
15847 (script_data_segment_relro_end): Declare.
15848 * script-sections.h (class Script_sections): Declare
15849 data_segment_align and data_segment_relro_end. Add fields
15850 segment_align_index_ and saw_relro_end_.
15851 * script-sections.cc (class Sections_element): Add set_is_relro
15852 virtual function. Add new bool* parameter to place_orphan_here.
15853 Add get_output_section virtual function.
15854 (class Output_section_definition): Add set_is_relro. Add new
15855 bool* parameter to place_orphan_here. Add get_output_section.
15856 Add is_relro_ field.
15857 (Output_section_definition::Output_section_definition): Initialize
15858 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15859 and is_relro_ fields.
15860 (Output_section_definition::place_orphan_here): Add is_relro
15861 parameter.
15862 (Output_section_definition::set_section_addresses): Set relro for
15863 output section.
15864 (Output_section_definition::alternate_constraint): Likewise.
15865 (class Orphan_output_section): Add new bool* parameter to
15866 place_orphan_here. Add get_output_section.
15867 (Orphan_output_section::place_orphan_here): Add is_relro
15868 parameter.
15869 (Script_sections::Script_sections): Initialize
15870 data_segment_align_index_ and saw_relro_end_.
15871 (Script_sections::data_segment_align): New function.
15872 (Script_sections::data_segment_relro_end): New function.
15873 (Script_sections::place_orphan): Set or clear is_relro.
15874 (Script_sections::set_section_addresses): Force alignment of first
15875 TLS section.
15876 * yyscript.y (exp): Call script_data_segment_align and
15877 script_data_segment_relro_end.
15878 * testsuite/relro_script_test.t: New file.
15879 * testsuite/relro_test.cc (using_script): Declare.
15880 (t1, t2): Test using_script.
15881 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15882 (relro_script_test_SOURCES): Define.
15883 (relro_script_test_DEPENDENCIES): Define.
15884 (relro_script_test_LDFLAGS): Define.
15885 (relro_script_test_LDADD): Define.
15886 (relro_script_test.so): New target.
15887 * testsuite/Makefile.in: Rebuild.
15888
f827c9a9
CC
158892008-08-06 Cary Coutant <ccoutant@google.com>
15890
15891 * archive.cc (Archive::total_archives, Archive::total_members)
15892 (Archive::total_members_loaded): New variables.
15893 (Archive::setup): Add parameter. Add option to preread
15894 archive symbols.
15895 (Archive::read_armap): Add counter.
15896 (Archive::get_file_and_offset): New function.
15897 (Archive::get_elf_object_for_member): New function.
15898 (Archive::read_all_symbols): New function.
15899 (Archive::read_symbols): New function.
15900 (Archive::add_symbols): Add counters.
15901 (Archive::include_all_members): Use armap to find members if it's
15902 already built.
15903 (Archive::include_member): Skip reading symbols if already read.
15904 Factored code into Archive::get_file_and_offset and
15905 Archive::get_elf_object_for_member. Changed call to
15906 Mapfile::report_include_archive_member.
15907 (Archive::print_stats): New function.
15908 * archive.h: Declare Object and Read_symbols_data classes.
15909 (Archive::Archive): Add initializers for new members.
15910 (Archive::setup): Add parameter.
15911 (Archive::print_stats): New function.
15912 (Archive::total_archives, Archive::total_members)
15913 (Archive::total_members_loaded): New variables.
15914 (Archive::get_file_and_offset): New function.
15915 (Archive::get_elf_object_for_member): New function.
15916 (Archive::read_all_symbols): New function.
15917 (Archive::read_symbols): New function.
15918 (Archive::Archive_member): New class.
15919 (Archive::members_): New member.
15920 (Archive::num_members_): New member.
15921 * main.cc: Include archive.h.
15922 (main): Call Archive::print_stats.
15923 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15924 archive parameter; member_name is now the fully-decorated name.
15925 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15926 * options.h: (General_options): Add --preread-archive-symbols option.
15927 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15928 Archive::setup.
15929
de4c45bd
ILT
159302008-08-04 Ian Lance Taylor <iant@google.com>
15931
15932 * symtab.h (Symbol::use_plt_offset): New function.
15933 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15934 * powerpc.cc (Relocate::relocate): Likewise.
15935 * sparc.cc (Relocate::relocate): Likewise.
15936 * x86_64.cc (Relocate::relocate): Likewise.
15937 * testsuite/weak_plt.sh: New test.
15938 * testsuite/weak_plt_main.cc: New test.
15939 * testsuite/weak_plt_shared.cc: New test.
15940 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15941 (check_PROGRAMS): Add weak_plt.
15942 (check_DATA): Add weak_plt_shared.so.
15943 (weak_plt_main_pic.o, weak_plt): New targets.
15944 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15945 * testsuite/Makefile.in: Rebuild.
15946
15947 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15948 gcctestdir/ld.
15949 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15950 * testsuite/Makefile.in: Rebuild.
15951
323ee3f4
AM
159522008-08-04 Alan Modra <amodra@bigpond.net.au>
15953
15954 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15955 * Makefile.in: Regenerate.
15956 * po/POTFILES.in: Regenerate.
15957
7c07ecec
ILT
159582008-07-29 Ian Lance Taylor <iant@google.com>
15959
15960 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15961 symbols before other symbols.
15962 * testsuite/script_test_2.cc (test_addr): Declare.
15963 (test_addr_alias): Declare.
15964 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15965 values.
7c07ecec
ILT
15966 * testsuite/script_test_2.t: Define test_addr_alias and
15967 test_addr.
15968
5778530e
ILT
159692008-07-24 Ian Lance Taylor <iant@google.com>
15970
2a00e4fb
ILT
15971 PR 5990
15972 * descriptors.cc: New file.
15973 * descriptors.h: New file.
15974 * gold-threads.h (class Hold_optional_lock): New class.
15975 * fileread.cc: Include "descriptors.h".
15976 (File_read::~File_read): Release descriptor rather than closing
15977 it.
15978 (File_read::open) [file]: Call open_descriptor rather than open.
15979 Set is_descriptor_opened_.
15980 (File_read::open) [memory]: Assert that descriptor is not open.
15981 (File_read::reopen_descriptor): New function.
15982 (File_read::release): Release descriptor.
15983 (File_read::do_read): Make non-const. Reopen descriptor.
15984 (File_read::read): Make non-const.
15985 (File_read::make_view): Reopen descriptor.
15986 (File_read::do_readv): Likewise.
15987 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15988 Update declarations.
15989 * layout.cc: Include "descriptors.h".
15990 (Layout::create_build_id): Use open_descriptor rather than open.
15991 * output.cc: Include "descriptors.h".
15992 (Output_file::open): Use open_descriptor rather than open.
15993 * archive.cc (Archive::const_iterator): Change Archive to be
15994 non-const.
15995 (Archive::begin, Archive::end): Make non-const.
15996 (Archive::count_members): Likewise.
15997 * archive.h (class Archive): Update declarations.
15998 * object.h (Object::read): Make non-const.
15999 * Makefile.am (CCFILES): Add descriptors.cc.
16000 (HFILES): Add descriptors.h.
16001 * Makefile.in: Rebuild.
16002
801647d1
ILT
16003 PR 6716
16004 * gold.h: Always include <clocale>. Add Solaris workarounds
16005 following code in binutils/sysdep.h.
16006
5edd166e
ILT
16007 PR 6048
16008 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16009 this->eh_frame_hdr_ is NULL before using it.
16010
c89ad728
ILT
16011 * dynobj.cc (Versions::Versions): Update comment.
16012
aa86f06b
ILT
16013 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16014 the base version name.
16015
5778530e
ILT
16016 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16017 array size plus one.
16018 (Stringpool_template::set_string_offsets): Subtract one from key
16019 before using it as an array index.
16020 (Stringpool_template::get_offset_with_length): Likewise.
16021 (Stringpool_template::write_to_buffer): Likewise.
16022 * stringpool.h (Stringpool_template::get_offset_from_key):
16023 Likewise.
16024
057ead22
ILT
160252008-07-23 Ian Lance Taylor <iant@google.com>
16026
7f649c59
ILT
16027 PR 6658
16028 * object.h (Merged_symbol_value::value): Do our best to handle a
16029 negative addend.
16030
057ead22
ILT
16031 PR 6647
16032 * script.cc (Version_script_info::get_versions): Don't add empty
16033 version tag to return value.
16034 (Version_script_info::get_symbol_version_helper): Change return
16035 type to bool. Add pversion parameter. Change all callers.
16036 (script_register_vers_node): Don't require a non-NULL tag.
16037 * script.h (class Version_script_info): Update declarations.
16038 (Version_script_info::get_symbol_version): Change return type to
16039 bool. Add version parameter. Change all callers.
16040 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16041 handling. Handle an empty version from a version script.
16042 (Symbol_table::define_special_symbol): Likewise.
16043 * testsuite/ver_test_10.script: New file.
16044 * testsuite/ver_test_10.sh: New file.
16045 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16046 (check_DATA): Add ver_test_10.syms.
16047 (ver_test_10.syms, ver_test_10.so): New target.
16048 * testsuite/Makefile.in: Rebuild.
16049
58e54ac2
CD
160502008-07-23 Simon Baldwin <simonb@google.com>
16051
16052 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16053 to zero for undefined symbols from dynamic libraries.
16054
95d14cd3
ILT
160552008-07-23 Ian Lance Taylor <iant@google.com>
16056
16057 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16058 Change all callers.
16059 * symtab.h (class Symbol_table): Update declaration.
16060 * testsuite/ver_test_9.cc: New file.
16061 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16062 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16063 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16064 (ver_test_9.so, ver_test_9.o): New targets.
16065 * testsuite/Makefile.in: Rebuild.
16066
92de84a6
ILT
160672008-07-22 Ian Lance Taylor <iant@google.com>
16068
34810851
ILT
16069 * options.h (class General_options): Define --check-sections.
16070 * layout.cc (Layout::set_segment_offsets): Handle
16071 --check-sections.
16072
af6156ef
ILT
16073 * options.h (class General_options): Define -n/--nmagic and
16074 -N/--omagic.
16075 * options.cc (General_options::finalize): For -n/--nmagic or
16076 -N/--omagic, set -static.
16077 * layout.cc (Layout::attach_allocated_section_to_segment): If
16078 -N/--omagic, don't put read-only and read-write sections in
16079 different segments.
16080 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16081 finding a read-only segment.
16082 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16083 don't set the minimum segment alignment to the common page size,
16084 and don't set the file offset to the address modulo the page size.
16085 * script-sections.cc (Script_sections::create_segments): If
16086 -n/--omagic, don't put read-only and read-write sections in
16087 different segments.
16088
92de84a6
ILT
16089 * cref.cc: New file.
16090 * cref.h: New file.
16091 * options.h (class General_options): Add --print-symbol-counts.
16092 * main.cc (main): Issue defined symbol report if requested.
16093 * archive.cc (Archive::interpret_header): Make into a const member
16094 function.
16095 (Archive::add_symbols): Call Input_objects::archive_start and
16096 archive_stop.
16097 (Archive::const_iterator): Define new class.
16098 (Archive::begin, Archive::end): New functions.
16099 (Archive::include_all_members): Rewrite to use iterator.
16100 (Archive::count_members): New function.
16101 * archive.h (class Archive): Update declarations.
16102 (Archive::filename): New function.
16103 * object.cc: Include "cref.h".
16104 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16105 (Sized_relobj::do_get_global_symbol_counts): New function.
16106 (Input_objects::add_object): Add object to cross-referencer.
16107 (Input_objects::archive_start): New function.
16108 (Input_objects::archive_stop): New function.
16109 (Input_objects::print_symbol_counts): New function.
16110 * object.h: Declare Cref and Archive.
16111 (Object::get_global_symbol_counts): New function.
16112 (Object::do_get_global_symbol_counts): New pure virtual function.
16113 (class Sized_relobj): Add defined_count_ field. Update
16114 declarations.
16115 (class Input_objects): Add cref_ field. Update constructor.
16116 Update declarations.
16117 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16118 defined_count_.
16119 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16120 symbol counts.
16121 (Sized_dynobj::do_get_global_symbol_counts): New function.
16122 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16123 defined_count_. Update declarations. Define Symbols typedef.
16124 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16125 parameter. Change all callers.
16126 (Symbol_table::add_from_dynobj): Add sympointers and defined
16127 parameters. Change all callers.
16128 * symtab.h (class Symbol_table): Update declarations.
16129 * Makefile.am (CCFILES): Add cref.cc.
16130 (HFILES): Add cref.h.
16131 * Makefile.in: Rebuild.
16132
3f7c5e1d
CD
161332008-07-22 Simon Baldwin <simonb@google.com>
16134
16135 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16136 to zero when writing undefined symbols.
16137
e0b64032
ILT
161382008-07-22 Ian Lance Taylor <iant@google.com>
16139
16140 * output.cc (Output_section::add_input_section): Don't try to
16141 merge empty merge sections.
16142
096b02cf
CS
161432008-07-21 Craig Silverstein <csilvers@google.com>
16144
16145 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16146 Include symbol version in error message.
cd536b21 16147
1d1f116d
CD
161482008-07-20 Chris Demetriou <cgd@google.com>
16149
cd536b21 16150 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16151 (RANDOM_SEED_CFLAGS): New substituted variable.
16152 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16153 * configure: Rebuild.
16154 * Makefile.in: Likewise.
16155 * testsuite/Makefile.in: Likewise.
16156
a18f591e
ILT
161572008-07-18 Ian Lance Taylor <iant@google.com>
16158
16159 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16160 where we see NAME/NULL and NAME/VERSION as separate symbols.
16161 * testsuite/ver_test_main.cc (main): Call t4.
16162 (t4, t4_2a): Define.
16163 * testsuite/ver_test_2.cc (t4_2): Define.
16164 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16165 * testsuite/ver_test_4.cc (t4_2a): Define.
16166 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16167 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16168
c6e3f6ed
ILT
161692008-07-17 Ian Lance Taylor <iant@google.com>
16170
16171 * dynobj.cc (Versions::add_def): If we give an error about a
16172 missing version, go ahead and create the version anyhow.
16173
ef9beddf
ILT
161742008-07-10 Ian Lance Taylor <iant@google.com>
16175
16176 Handle output sections with more than 0x7fffffff bytes.
16177 * object.h (class Relobj): Change map_to_output_ to
16178 output_sections_, and just keep a section pointer. Change all
16179 uses. Move comdat group support to Sized_relobj.
16180 (Relobj::is_section_specially_mapped): Remove.
16181 (Relobj::output_section): Remove poff parameter. Change all
16182 callers.
16183 (Relobj::output_section_offset): New function.
16184 (Relobj::set_section_offset): Rewrite.
16185 (Relobj::map_to_output): Remove.
16186 (Relobj::output_sections): New function.
16187 (Relobj::do_output_section_offset): New pure virtual function.
16188 (Relobj::do_set_section_offset): Likewise.
16189 (class Sized_relobj): Add section_offsets_ field. Add comdat
16190 group support from Relobj. Update declarations.
16191 (Sized_relobj::get_output_section_offset): New function.
16192 (Sized_relobj::do_output_section_offset): New function.
16193 (Sized_relobj::do_set_section_offset): New function.
16194 * object.cc (Relobj::output_section_address): Remove.
16195 (Sized_relobj::Sized_relobj): Initialize new fields.
16196 (Sized_relobj::include_section_group): Cast find_kept_object to
16197 Sized_relobj.
16198 (Sized_relobj::include_linkonce_section): Likewise.
16199 (Sized_relobj::do_layout): Use separate arrays for output section
16200 and output offset.
16201 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16202 output_sections.
16203 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16204 output_sections and section_offsets.
16205 (Sized_relobj::write_local_symbols): Likewise.
16206 (map_to_kept_section): Compute output address directly.
16207 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16208 output_sections and section_offsets.
16209 (Sized_relobj::write_sections): Likewise.
16210 (Sized_relobj::relocate_sections): Likewise.
16211 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16212 * output.h (class Output_reloc): Update declarations. Change
16213 u2_.relobj to Sized_relobj*.
16214 (class Output_data_reloc): Change add functions to use
16215 Sized_relobj*.
16216 * output.cc (Output_reloc::Output_reloc): Change relobj to
16217 Sized_relobj*.
16218 (Output_reloc::local_section_offset): Change return type to
16219 Elf_Addr. Use get_output_section_offset.
16220 (Output_reloc::get_address): Likewise.
16221 (Output_section::is_input_address_mapped): Don't call
16222 is_section_specially_mapped.
16223 (Output_section::output_offset): Likewise.
16224 (Output_section::output_address): Likewise.
16225 (Output_section::starting_output_address): Likewise.
16226 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16227 parameter to Sized_relobj*.
16228 (Copy_relocs::need_copy_reloc): Likewise.
16229 (Copy_relocs::save): Likewise.
16230 * copy-relocs.h (class Copy_relocs): Update declarations.
16231 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16232 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16233 * target-reloc.h (relocate_for_relocatable): Change
16234 offset_in_output_section type to Elf_Addr. Change code that uses
16235 it as well.
16236 * layout.cc (Layout::layout): Always set *off.
16237 * mapfile.cc (Mapfile::print_input_section): Use
16238 output_section_offset.
16239 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16240 Sized_relobj*.
16241 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16242 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16243 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16244
5cb66f97
ILT
162452008-07-03 Ian Lance Taylor <iant@google.com>
16246
16247 * layout.cc (Layout::include_section): Do not discard unrecognized
16248 SHT_STRTAB sections.
16249
afe47622
CS
162502008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16251
16252 * script.cc (Lex::can_continue_name): Make '?' allowable in
16253 version-script names.
16254 * testsuite/version_script.map: Change glob pattern to use '?'
16255
5adf9721
ILT
162562008-06-30 Manish Singh <yosh@gimp.org>
16257
16258 PR 6585
16259 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16260 Correct typo.
16261
e6fde208
ILT
162622008-06-30 Ian Lance Taylor <iant@google.com>
16263
16264 PR 6660
16265 PR 6682
16266 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16267 versions]: Don't try to read the value in the contents, since we
16268 don't use it. Use the template endianness when writing.
16269
3f2e6a2d
CC
162702008-06-25 Cary Coutant <ccoutant@google.com>
16271
16272 * fileread.cc (File_read::make_view): Assert on zero-length view.
16273 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16274 symbol table when there are no symbols to read.
16275
c43d3a48
CS
162762008-06-23 Craig Silverstein <csilvers@google.com>
16277
16278 * version.cc (version_string): Bump to 1.7
16279
5f494ea0
CS
162802008-06-18 Craig Silverstein <csilvers@google.com>
16281
16282 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16283 constant 0xFFFF to type Valtype.
16284 (Powerpc_relocate_functions::rel16_ha): Likewise.
16285
c42e122e
ILT
162862008-06-17 Ian Lance Taylor <iant@google.com>
16287
f34787f8
ILT
16288 * output.h (Output_section::Input_section): Initialize p2align_ to
16289 zero for Output_section_data constructors.
16290 (Output_section::Input_section::addralign): If not an input
16291 section, return the alignment of the Output_section_data.
16292 * testsuite/copy_test.cc: New file.
16293 * testsuite/copy_test_1.cc: New file.
16294 * testsuite/copy_test_2.cc: New file.
16295 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16296 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16297 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16298 (copy_test_1_pic.o, copy_test_1.so): New targets.
16299 (copy_test_2_pic.o, copy_test_2.so): New targets.
16300 * testsuite/Makefile.in: Rebuild.
16301
c42e122e
ILT
16302 * script-sections.cc (Script_sections::place_orphan): Initialize
16303 local variable exact.
16304
ce3ac18a
DE
163052008-06-13 David Edelsohn <edelsohn@gnu.org>
16306
16307 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16308
42cacb20
DE
163092008-06-12 David Edelsohn <edelsohn@gnu.org>
16310 David S. Miller <davem@davemloft.net>
16311
16312 * powerpc.cc: New file.
16313 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16314 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16315 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16316 * Makefile.in: Rebuild.
16317
7b308235
ILT
163182008-06-09 Ian Lance Taylor <iant@google.com>
16319
16320 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16321 <exception>.
16322 (throwing, orig_terminate): New static variables.
16323 (terminate_handler): New static function.
16324 (t2): Set terminate handler.
16325
f0b886e3
ILT
163262008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16327
16328 PR 6584
cd536b21 16329 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16330 alignment.
16331
3e90f135
CC
163322008-05-30 Cary Coutant <ccoutant@google.com>
16333
16334 * archive.cc (Archive::include_all_members) Correct to step
16335 over symbol table and extended name table in thin archives.
16336
e09ad04a
ILT
163372008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16338
16339 PR 6407
16340 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16341 calculation.
16342
62b01cb5
ILT
163432008-05-28 Caleb Howe <cshowe@google.com>
16344
16345 * reduced_debug_output.cc: New file.
16346 * reduced_debug_output.h: New file.
92de84a6 16347 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16348 * options.cc (General_options::finalize): Add strip_debug_non_line
16349 to the strip heirarchy.
16350 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16351 fields.
16352 * layout.cc: Include "reduced_debug_output.h".
16353 (Layout::Layout): Initialize new fields.
16354 (line_only_debug_sections): New static array.
16355 (is_lines_only_debug_sections): New static inline function.
16356 (Layout::include_section): Handle --strip-debug-non-line.
16357 (Layout::make_output_section): If --strip-debug-non-line, build
16358 new output sections for .debug_abbrev and .debug_info.
16359 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16360 gold. Warn about possible overflow.
16361 (read_signed_LEB_128): Likewise.
16362 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16363 (read_signed_LEB_128): Declare.
16364 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16365 (HFILES): Add reduced_debug_output.h.
16366 * Makefile.in: Rebuild.
16367
7d9e3d98
ILT
163682008-05-21 Ian Lance Taylor <iant@google.com>
16369
16370 * mapfile.cc: New file.
16371 * mapfile.h: New file.
16372 * options.h (class General_options): Add -M/--print-map and -Map.
16373 * options.cc (General_options::finalize): Make -M equivalent to
16374 -Map -.
16375 * main.cc: Include <cstdio> and "mapfile.h".
16376 (main): Open mapfile if requested.
16377 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16378 constructor. Change caller.
16379 (queue_initial_tasks): Add mapfile parameter. Change caller.
16380 (queue_middle_tasks): Likewise.
16381 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16382 declarations.
16383 * archive.cc: Include "mapfile.h".
16384 (Archive::add_symbols): Add mapfile parameter. Change all
16385 callers. Pass mapfile, symbol, and reason to include_member.
16386 (Archive::include_all_members): Add mapfile parameter. Change all
16387 callers.
16388 (Archive::include_member): Add mapfile, sym, and why parameters.
16389 Change all callers. Report inclusion to map file.
16390 * archive.h: Include "fileread.h".
16391 (class Archive): Update declarations.
16392 (Archive::file): New const method.
16393 (class Add_archive_symbols): Add mapfile_ field. Update
16394 constructor. Change all callers.
16395 * readsyms.h (class Read_symbols): Likewise.
16396 (class Finish_group): Likewise.
16397 (class Read_script): Likewise.
16398 * common.cc: Include "mapfile.h".
16399 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16400 all callers.
16401 (Symbol_table::do_allocate_commons): Likewise.
16402 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16403 symbol allocation to mapfile.
16404 * common.h (class Allocate_commons_task): Add mapfile_ field.
16405 Update constructor. Change all callers.
16406 * symtab.h (class Symbol_table): Update declarations.
16407 * layout.cc: Include "mapfile.h".
16408 (Layout_task_runner::run): Print information to mapfile.
16409 (Layout::create_gold_note): Change Output_data_fixed_space to
16410 Output_data_zero_fill.
16411 (Layout::create_build_id): Likewise.
16412 (Layout::print_to_mapfile): New function.
16413 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16414 constructor. Change caller.
16415 (class Layout): Declare print_to_mapfile.
16416 * output.cc (Output_section::Input_section::print_to_mapfile): New
16417 function.
16418 (Output_section::add_input_section): If producing a map, always
16419 add to input_sections_ list.
16420 (Output_section::do_print_to_mapfile): New function.
16421 (Output_segment::print_sections_to_mapfile): New function.
16422 (Output_segment::print_section_list_to_mapfile): New function.
16423 * output.h: Include "mapfile.h".
16424 (Output_data::print_to_mapfile): New function.
16425 (Output_data::do_print_to_mapfile): New virtual function.
16426 (Output_segment_headers::do_print_to_mapfile): New function.
16427 (Output_file_header::do_print_to_mapfile): New function.
16428 (Output_data_const::do_print_to_mapfile): New function.
16429 (class Output_data_const_buffer): Add map_name_ field. Update
16430 constructor. Change all callers. Add do_print_to_mapfile
16431 function.
16432 (class Output_data_fixed_space): Likewise.
16433 (class Output_data_space): Likewise.
16434 (class Output_data_zero_fill): New class.
16435 (Output_data_strtab::do_print_to_mapfile): New function.
16436 (Output_data_reloc_base::do_print_to_mapfile): New function.
16437 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16438 (Output_data_group::do_print_to_mapfile): New function.
16439 (Output_data_got::do_print_to_mapfile): New function.
16440 (Output_data_dynamic::do_print_to_mapfile): New function.
16441 (Output_symtab_xindex::do_print_to_mapfile): New function.
16442 (class Output_section): Declare do_print_to_mapflie. Declare
16443 print_to_mapfile in Input_section.
16444 (class Output_segment): Declare new functions.
16445 * object.h (Sized_relobj::symbol_count): New function.
16446 * script-sections.cc
16447 (Output_section_element_dot_assignment::set_section_addresses):
16448 Change Output_data_fixed_space to Output_data_zero_fill.
16449 (Output_data_expression::do_print_to_mapfile): New function.
16450 * script.cc (read_input_script): Add mapfile parameter. Change
16451 all callers.
16452 * script.h (read_input_script): Update declaration.
16453 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16454 (Eh_frame::do_print_to_mapfile): New function.
16455 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16456 (Output_merge_string::do_print_to_mapfile): New function.
16457 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16458 function.
16459 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16460 function.
16461 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16462 function.
16463 * Makefile.am (CCFILES): Add mapfile.cc.
16464 (HFILES): Add mapfile.h.
16465 * Makefile.in: Rebuild.
16466
9f1d377b
ILT
164672008-05-19 Ian Lance Taylor <iant@google.com>
16468
16469 * options.h (class General_options): Add -z relro.
16470 * layout.cc (Layout::Layout): Initialize relro_segment_.
16471 (Layout::add_output_section_data): Return the output section.
16472 (Layout::make_output_section): Rcognize relro sections and mark
16473 them appropriately.
16474 (Layout::attach_allocated_section_to_segment): Put relro sections
16475 in a PT_GNU_RELRO segment.
16476 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16477 section as relro.
16478 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16479 PT_TLS segments.
16480 (Layout::linkonce_mapping): Map d.rel.ro.local to
16481 .data.rel.ro.local.
16482 (Layout::output_section_name): Us .data.rel.ro.local for any
16483 section which begins with that.
16484 * layout.h (class Layout): Update add_output_section_data
16485 declaration. Add relro_segment_ field.
16486 * output.cc (Output_section::Output_section): Initialize is_relro_
16487 and is_relro_local_ fields.
16488 (Output_segment::add_output_section): Group relro sections.
16489 (Output_segment::is_first_section_relro): New function.
16490 (Output_segment::maximum_alignment): If there is a relro section,
16491 align the segment to the common page size.
16492 (Output_segment::set_section_addresses): Track whether we are
16493 looking at relro sections. If the last section is a relro
16494 section, align to the common page size.
16495 (Output_segment::set_section_list_addresses): Add in_relro
16496 parameter. Change all callers. Align to the page size when
16497 moving from relro to non-relro section.
16498 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16499 segment.
16500 * output.h (class Output_section): Add is_relro_ and
16501 is_relro_local_ fields.
16502 (Output_section::is_relro): New function.
16503 (Output_section::set_is_relro): New function.
16504 (Output_section::is_relro_local): New function.
16505 (Output_section::set_is_relro_local): New function.
16506 (class Output_segment): Update declarations.
16507 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16508 * sparc.cc (Target_sparc::got_section): Likewise.
16509 * x86_64.cc (Target_x86_64::got_section): Likewise.
16510 * testsuite/relro_test_main.cc: New file.
16511 * testsuite/relro_test.cc: New file.
16512 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16513 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16514 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16515 (relro_test.so, relro_test_pic.o): New targets.
16516 * testsuite/Makefile.in: Rebuild.
16517
a984ee1d
ILT
165182008-05-16 Ian Lance Taylor <iant@google.com>
16519
01676dcd
ILT
16520 * output.cc (Output_segment::add_output_section): Remove front
16521 parameter.
16522 * output.h (class Output_segment): Remove
16523 add_initial_output_section and overloaded add_output_section.
16524 Update declaration of remaining add_output_section.
16525 * layout.cc (Layout::create_interp): Call add_output_section
16526 rather than add_initial_output_section.
16527 (Layout::finish_dynamic_section): Likewise.
16528
497897f9
ILT
16529 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16530 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16531 know the dynamic type.
16532 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16533 field. Initialize it in constructor.
16534 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16535 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16536 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16537 reloc.
16538
a984ee1d
ILT
16539 * output.cc (Output_reloc::get_address): Change return type to
16540 Elf_Addr.
16541 * output.h (class Output_reloc): Update get_address declaration.
16542 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16543 for section addresses.
16544
55ba0940
ILT
165452008-05-09 Ian Lance Taylor <iant@google.com>
16546
16547 PR 6493
16548 * gold.cc (gold_nomem): Use return value of write.
16549
75517b77
ILT
165502008-05-08 Ian Lance Taylor <iant@google.com>
16551
16552 * symtab.c (Symbol::init_base_output_data): Add version
16553 parameter. Change all callers.
16554 (Symbol::init_base_output_segment): Likewise.
16555 (Symbol::init_base_constant): Likewise.
16556 (Symbol::init_base_undefined): Likewise.
16557 (Sized_symbol::init_output_data): Likewise.
16558 (Sized_symbol::init_output_segment): Likewise.
16559 (Sized_symbol::init_constant): Likewise.
16560 (Sized_symbol::init_undefined): Likewise.
16561 (Symbol_table::do_define_in_output_data): If the new symbol has a
16562 version, mark it as the default.
16563 (Symbol_table::do_define_in_output_segment): Likewise.
16564 (Symbol_table::do_define_as_constant): Likewise.
16565 * symtab.h (class Symbol): Update declarations.
16566 (class Sized_symbol): Likewise.
16567 * resolve.cc (Symbol::override_version): New function.
c42e122e 16568 (Symbol::override_base): Call override_version.
75517b77
ILT
16569 (Symbol::override_base_with_special): Likewise.
16570 * testsuite/ver_script_8.script: New file.
16571 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16572 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16573 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16574 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16575
f1f70eae
ILT
165762008-05-06 Ian Lance Taylor <iant@google.com>
16577
f3e9c5c5
ILT
16578 PR 6049
16579 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16580 functions.
16581 (class General_options): Remove existing --undefined, and add
16582 --no-undefined instead. Add new --undefined as synonym for -u.
16583 * archive.cc (Archive::add_symbols): Check whether symbol was
16584 named with -u.
16585 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16586 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16587 all uses. Add IS_UNDEFINED. Update declarations to split
16588 different versions of init_base. Declare init_base_undefined.
16589 (Symbol::is_defined): Handle IS_UNDEFINED.
16590 (Symbol::is_undefined): Likewise.
16591 (Symbol::is_weak_undefined): Call is_undefined.
16592 (Symbol::is_absolute): Handle IS_CONSTANT.
16593 (class Sized_symbol): Update declarations to split different
16594 versions of init. Declare init_undefined.
16595 (class Symbol_table): Declare new functions.
16596 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16597 Change all callers.
16598 (Symbol::init_base_output_data): Likewise.
16599 (Symbol::init_base_output_segment): Likewise.
16600 (Symbol::init_base_constant): Likewise.
16601 (Symbol::init_base_undefined): New function.
16602 (Sized_symbol::init_object): Rename from init. Change all
16603 callers.
16604 (Sized_symbol::init_output_data): Likewise.
16605 (Sized_symbol::init_output_segment): Likewise.
16606 (Sized_symbol::init_constant): Likewise.
16607 (Sized_symbol::init_undefined): New function.
16608 (Symbol_table::add_undefined_symbols_from_command_line): New
16609 function.
16610 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16611 function.
16612 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16613 (Symbol::output_section): Likewise.
16614 (Symbol::set_output_section): Likewise.
16615 (Symbol_table::sized_finalize_symbol): Likewise.
16616 (Symbol_table::sized_write_globals): Likewise.
16617 * resolve.cc (Symbol_table::should_override): Likewise.
16618 (Symbol::override_base_with_special): Likewise.
16619
8bdcdf2c
ILT
16620 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16621 symbol, change it to have default visibility.
16622 * testsuite/protected_1.cc: New file.
16623 * testsuite/protected_2.cc: New file.
16624 * testsuite/protected_3.cc: New file.
16625 * testsuite/protected_main_1.cc: New file.
16626 * testsuite/protected_main_2.cc: New file.
16627 * testsuite/protected_main_3.cc: New file.
16628 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16629 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16630 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16631 (protected_1.so): New target.
16632 (protected_1_pic.o, protected_2_pic.o): New targets.
16633 (protected_3_pic.o): New target.
16634 (check_PROGRAMS): Add protected_2.
16635 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16636 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16637 * testsuite/Makefile.in: Rebuild.
16638
2b706932
ILT
16639 * options.h (DEFINE_var): Add set_user_set_##varname__.
16640 (DEFINE_bool_alias): New macro.
16641 (class General_options): Define -Bstatic using DEFINE_bool_alias
16642 rather than DEFINE_special. Add --undefined as an alias for -z
16643 defs.
16644 * options.cc (General_options::parse_Bstatic): Remove.
16645
d82a5bcc
ILT
16646 * options.h (class General_options): Add --fatal-warnings.
16647 * main.cc (main): Implement --fatal-warnings.
16648 * errors.h (Errors::warning_count): New function.
16649
f1f70eae
ILT
16650 * options.h (class General_options): Add -Bsymbolic-functions.
16651 * symtab.h (Symbol::is_preemptible): Check for
16652 -Bsymbolic-functions.
16653
8825ac63
ILT
166542008-05-05 Ian Lance Taylor <iant@google.com>
16655
d98bc257
ILT
16656 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16657 as noVARNAME rather than no-VARNAME.
16658 (class General_options): Add option -z combreloc.
16659 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16660 get_address.
16661 (Output_reloc::sort_before) [SHT_REL]: New function.
16662 (Output_reloc::sort_before) [SHT_RELA]: New function.
16663 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16664 Sort_relocs_comparison.
16665 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16666 parameter. Change all callers.
16667 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16668 sort_relocs parameter. Change all callers.
16669 * output.cc (Output_reloc::get_address): New function, broken out
16670 of write_rel.
16671 (Output_reloc::write_rel): Call it.
16672 (Output_reloc::compare): New function.
16673 (Output_data_reloc_base::do_write): Optionally sort relocs.
16674
60b2b4e7
ILT
16675 * configure.ac: If targ_extra_obj is set, link it in.
16676 * configure.tgt: Initialize all variables.
16677 (x86_64*): Set targ_extra_obj and targ_extra_size.
16678 * configure: Rebuild.
16679
8825ac63
ILT
16680 * object.cc (Sized_relobj::include_section_group): Adjust section
16681 indexes read from group data. Build vector to pass to
16682 layout_group.
16683 * layout.cc (Layout::layout_group): Add flags and shndxes
16684 parameters. Remove contents parameter. Change caller. Update
16685 explicit instantiations.
16686 * layout.h (class Layout): Update layout_group declaration.
16687 * output.cc (Output_data_group::Output_data_group): Add flags and
16688 input_shndxes parameters. Remove contents parameter. Change
16689 caller.
16690 (Output_data_group::do_write): Change input_sections_ to
16691 input_shndxes_.
16692 * output.h (class Output_data_group): Update constructor
16693 declaration. Rename input_sections_ to input_shndxes_.
16694 * testsuite/many_sections_test.cc: Add template.
16695
e94cf127
CC
166962008-04-30 Cary Coutant <ccoutant@google.com>
16697
4418b2d5
CC
16698 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16699
e94cf127
CC
16700 * layout.cc (Layout::include_section): Refactored check for debug
16701 info section.
16702 (Layout::add_comdat): Add new parameters. Change type
16703 of signature parameter. Add object and shndx to signatures table.
16704 (Layout::find_kept_object): New function.
16705 * layout.h: Include <cstring>.
16706 (Layout::is_debug_info_section): New function.
16707 (Layout::add_comdat): Add new parameters.
16708 (Layout::find_kept_object): New function.
16709 (Layout::Kept_section): New struct.
16710 (Layout::Signatures): Change type of map range.
16711 * object.cc (Relobj::output_section_address): New function.
16712 (Sized_relobj::include_section_group): Add new parameters. Change
16713 calls to Layout::add_comdat. Change to build table of kept comdat
16714 groups and table mapping discarded sections to kept sections.
16715 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16716 (Sized_relobj::do_layout): Change calls to include_section_group and
16717 include_linkonce_section.
16718 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16719 value to zero when section is discarded.
16720 (Sized_relobj::map_to_kept_section): New function.
16721 * object.h (Relobj::output_section_address): New function.
16722 (Relobj::Comdat_group): New type.
16723 (Relobj::find_comdat_group): New function.
16724 (Relobj::Comdat_group_table): New type.
16725 (Relobj::Kept_comdat_section): New type.
16726 (Relobj::Kept_comdat_section_table): New type.
16727 (Relobj::add_comdat_group): New function.
16728 (Relobj::set_kept_comdat_section): New function.
16729 (Relobj::get_kept_comdat_section): New function.
16730 (Relobj::comdat_groups_): New field.
16731 (Relobj::kept_comdat_sections_): New field.
16732 (Symbol_value::input_value): Update comment.
16733 (Sized_relobj::map_to_kept_section) New function.
16734 (Sized_relobj::include_linkonce_section): Add new parameter.
16735 * target-reloc.h (Comdat_behavior): New type.
16736 (get_comdat_behavior): New function.
16737 (relocate_section): Add code to map a discarded section to the
16738 corresponding kept section when applying a relocation.
16739
e4e5049b
CS
167402008-04-30 Craig Silverstein <csilvers@google.com>
16741
16742 * dwarf_reader.cc (next_generation_count): New static var.
16743 (Addr2line_cache_entry): New struct.
16744 (addr2line_cache): New static var.
16745 (Dwarf_line_info::one_addr2line): Added caching.
16746 (Dwarf_line_info::clear_addr2line_cache): New function.
16747 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16748 cache-size parameter.
16749 (Dwarf_line_info::one_addr2line_cache): New function.
16750 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16751 new cache-size argument to one_addr2line(), and clear cache.
16752
d09e9154
CC
167532008-04-28 Cary Coutant <ccoutant@google.com>
16754
16755 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16756 R_386_PC8 relocations.
16757
7ef73768
ILT
167582008-04-23 Ian Lance Taylor <iant@google.com>
16759
55438702
ILT
16760 * object.cc (Sized_relobj::include_section_group): Check for
16761 invalid section group.
16762
c165fb93
ILT
16763 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16764 header size.
16765
7ef73768
ILT
16766 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16767 than read for file header.
16768 * archive.cc (Archive::include_member): Likewise.
16769
6194aaab
L
167702008-04-23 Paolo Bonzini <bonzini@gnu.org>
16771
16772 * aclocal.m4: Regenerate.
16773 * configure: Regenerate.
16774
d491d34e
ILT
167752008-04-19 Ian Lance Taylor <iant@google.com>
16776
5ea2bac6
ILT
16777 * version.cc (version_string): Bump to 1.6.
16778
7bc3e21a
ILT
16779 * testsuite/Makefile.am (many_sections_r_test): New target.
16780 (many_sections_r_test_SOURCES): Remove.
16781 (many_sections_r_test_DEPENDENCIES): Remove.
16782 (many_sections_r_test_LDFLAGS): Remove.
16783 (many_sections_r_test_LDADD): Remove.
16784
7fcd3aa9
ILT
16785 * object.cc (Sized_relobj::do_add_symbols): Always pass
16786 local_symbol_count_ to add_from_relobj.
16787
4c94d6ae
ILT
16788 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16789 every thousand variables.
16790 * testsuite/Makefile.in: Rebuild.
16791
d491d34e
ILT
16792 * object.cc (Xindex::initialize_symtab_xindex): New function.
16793 (Xindex::read_symtab_xindex): New function.
16794 (Xindex::sym_xindex_to_shndx): New function.
16795 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16796 available.
16797 (Sized_relobj::do_initialize_xindex): New function.
16798 (Sized_relobj::do_read_symbols): Adjust section links.
16799 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16800 parameter. Change all callers.
16801 (Sized_relobj::include_section_group): Adjust section links and
16802 symbol section indexes.
16803 (Sized_relobj::do_layout): Adjust section links.
16804 (Sized_relobj::do_count_local_symbols): Adjust section links and
16805 symbol section indexes.
16806 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16807 ordinary and special symbols.
16808 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16809 dynsym_xindex parameters. Change all callers. Adjust section
16810 links. Use SHN_XINDEX when needed.
16811 (Sized_relobj::get_symbol_location_info): Adjust section links.
16812 Don't get fooled by special symbols.
16813 * object.h (class Xindex): Define.
16814 (class Object): Add xindex_ parameter. Declare virtual functoin
16815 do_initialize_xindex.
16816 (Object::adjust_sym_shndx): New function.
16817 (Object::set_xindex): New protected function.
16818 (class Symbol_value): Add is_ordinary_shndx_ field.
16819 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16820 (Symbol_value::value): Assert ordinary section.
16821 (Symbol_value::initialize_input_to_output_map): Likewise.
16822 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16823 Change all callers.
16824 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16825 all callers.
16826 (class Sized_relobj): Update declarations.
16827 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16828 parameter. Change all callers.
16829 (Sized_relobj::adjust_shndx): New function.
16830 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16831 field.
16832 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16833 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16834 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16835 (Sized_dynobj::read_dynsym_section): Adjust section links.
16836 (Sized_dynobj::read_dynamic): Likewise.
16837 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16838 section links.
16839 (Sized_dynobj::do_initialize_xindex): New function.
16840 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16841 do_initialize_xindex.
16842 (Sized_dynobj::adjust_shndx): New function.
16843 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16844 dynsym_xindex_ fields.
16845 (Layout::finalize): Add a call to set_section_indexes before
16846 creating the symtab sections.
16847 (Layout::set_section_indexes): Don't do anything if the section
16848 already has a section index.
16849 (Layout::create_symtab_sections): Add shnum parameter. Change
16850 caller. Create .symtab_shndx section if needed.
16851 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16852 caller.
16853 (Layout::allocated_output_section_count): New function.
16854 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16855 needed.
16856 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16857 fields. Update declarations.
16858 (Layout::symtab_xindex): New function.
16859 (Layout::dynsym_xindex): New function.
16860 (class Write_symbols_task): Add layout_ field.
16861 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16862 Change caller.
16863 * output.cc (Output_section_headers::Output_section_headers): Add
16864 shstrtab_section parameter. Change all callers.
16865 (Output_section_headers::do_sized_write): Store overflow values
16866 for section count and section string table section index in
16867 section header zero.
16868 (Output_file_header::do_sized_write): Check for overflow of
16869 section count and section string table section index.
16870 (Output_symtab_xindex::do_write): New function.
16871 (Output_symtab_xindex::endian_do_write): New function.
16872 * output.h (class Output_section_headers): Add shstrtab_section_.
16873 Update declarations.
16874 (class Output_symtab_xindex): Define.
16875 (Output_section::has_out_shndx): New function.
16876 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16877 field.
16878 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16879 Change all callers.
16880 (Sized_symbol::init): Likewise.
16881 (Symbol::output_section): Check for ordinary symbol.
16882 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16883 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16884 callers.
16885 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16886 Change all callers. Simplify handling of symbols from sections
16887 not included in the link.
16888 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16889 distinction.
16890 (Weak_alias_sorter::operator()): Assert that symbols are
16891 ordinary.
16892 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16893 distinction.
16894 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16895 parameters. Change all callers.
16896 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16897 symbol distinction. Use SHN_XINDEX when needed.
16898 (Symbol_table::write_section_symbol): Add symtab_xindex
16899 parameter. Change all callers.
16900 (Symbol_table::sized_write_section_symbol): Likewise. Use
16901 SHN_XINDEX when needed.
16902 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16903 declarations.
16904 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16905 (Symbol::is_defined): Check is_ordinary.
16906 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16907 (Symbol::is_absolute, Symbol::is_common): Likewise.
16908 (class Sized_symbol): Update declarations.
16909 (class Symbol_table): Update declarations.
16910 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16911 parameters. Change all callers.
16912 (Sized_symbol::override): Likewise.
16913 (Symbol_table::override): Likewise.
16914 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16915 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16916 is_ordinary, and orig_st_shndx parameters. Change all callers.
16917 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16918 to be in an ordinary section.
16919 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16920 object and is_ordinary parameters. Change all callers.
16921 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16922 Change all callers. Don't add undefined or non-ordinary symbols
16923 to reloc_map_.
16924 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16925 Change all callers.
16926 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16927 declarations.
16928 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16929 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16930 (Sized_relobj::relocate_sections): Likewise.
16931 * target-reloc.h (scan_relocs): Adjust section symbol index.
16932 (scan_relocatable_relocs): Likewise.
16933 * i386.cc (Scan::local): Check for ordinary symbols.
16934 * sparc.cc (Scan::local): Likewise.
16935 * x86_64.cc (Scan::local): Likewise.
16936 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16937 to symbol_section_and_value.
16938 * testsuite/many_sections_test.cc: New file.
16939 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16940 (check_PROGRAMS): Add many_sections_test.
16941 (many_sections_test_SOURCES): Define.
16942 (many_sections_test_DEPENDENCIES): Define.
16943 (many_sections_test_LDFLAGS): Define.
16944 (BUILT_SOURCES): Add many_sections_define.h.
16945 (many_sections_define.h): New target.
16946 (BUILT_SOURCES): Add many_sections_check.h.
16947 (many_sections_check.h): New target.
16948 (check_PROGRAMS): Add many_sections_r_test.
16949 (many_sections_r_test_SOURCES): Define.
16950 (many_sections_r_test_DEPENDENCIES): Define.
16951 (many_sections_r_test_LDFLAGS): Define.
16952 (many_sections_r_test_LDADD): Define.
16953 (many_sections_r_test.o): New target.
16954 * testsuite/Makefile.in: Rebuild.
16955
c5818ff1
CC
169562008-04-17 Cary Coutant <ccoutant@google.com>
16957
16958 * errors.cc (Errors::info): New function.
16959 (gold_info): New function.
16960 * errors.h (Errors::info): New function.
16961 * gold.h (gold_info): New function.
16962 * object.cc (Input_objects::add_object): Print trace output.
16963 * options.cc (options::parse_set): New function.
16964 (General_options::parse_wrap): Deleted.
16965 (General_options::General_options): Deleted initializer.
16966 * options.h (options::String_set): New typedef.
16967 (options::parse_set): New function.
16968 (DEFINE_set): New macro.
16969 (General_options::wrap): Changed to use DEFINE_set. Changed
16970 callers of any_wrap_symbols and is_wrap_symbol.
16971 (General_options::trace, General_options::trace_symbol):
16972 New options.
16973 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16974 (General_options::wrap_symbols_): Deleted.
16975 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16976
b5be4a7c
DM
169772008-04-17 David S. Miller <davem@davemloft.net>
16978
16979 * options.cc (General_options::parse_V): New function.
16980 * options.h: Add entries for -V and -Qy.
16981
155a0dd7
ILT
169822008-04-17 Ian Lance Taylor <iant@google.com>
16983
16984 * common.cc (Symbol_table::allocate_commons): Remove options
16985 parameter. Change caller.
16986 (Symbol_table::do_allocate_commons): Remove options parameter.
16987 Change caller. Just call do_allocate_commons_list twice.
16988 (Symbol_table::do_allocate_commons_list): New function, broken out
16989 of do_allocate_commons.
16990 * common.h (class Allocate_commons_task): Remove options_ field.
16991 Update constructor.
16992 * symtab.cc (Symbol_table::Symbol_table): Initialize
16993 tls_commons_.
16994 (Symbol_table::add_from_object): Put TLS common symbols on
16995 tls_commons_ list.
16996 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16997 which are IN_OUTPUT_DATA.
16998 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16999 allocate_commons and do_allocate_commons declarations. Declare
17000 do_allocate_commons_list.
17001 * gold.cc (queue_middle_tasks): Update creation of
17002 Allocate_commons_task to not pass options.
17003 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17004 (TLS_TEST_C_FLAGS): New variable.
17005 (tls_test_c_pic.o): New target.
17006 (tls_test_shared.so): Link in tls_test_c_pic.o.
17007 (tls_test_c_pic_ie.o): New target.
17008 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17009 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17010 (tls_test_c.o): New target.
17011 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17012 (tls_pic_test_LDADD): Likewise.
17013 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17014 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17015 (tls_test_c_gnu2.o): New target.
17016 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17017 tls_test_c_gnu2.o.
17018 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17019 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17020 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17021 * testsuite/tls_test.cc: Include "config.h".
17022 (t_last): Call t11_last.
17023 * testsuite/tls_test.h (t11, t11_last): Declare.
17024 * testsuite/tls_test_c.c: New file.
17025 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17026 * configure.ac: Check for OpenMP support.
17027 * configure, config.in, Makefile.in: Rebuild.
17028 * testsuite/Makefile.in: Rebuild.
17029
edfbb029
CC
170302008-04-16 Cary Coutant <ccoutant@google.com>
17031
17032 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17033 (Target_i386::tls_base_symbol_defined_): New field.
17034 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17035 (Target_i386::Scan::global): Likewise.
17036 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17037 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17038 (Target_x86_64::tls_base_symbol_defined_): New field.
17039 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17040 (Target_x86_64::Scan::global): Likewise.
17041
f3c69fca
CC
170422008-04-16 Cary Coutant <ccoutant@google.com>
17043
17044 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17045 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17046 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17047 building shared libraries.
17048 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17049 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17050 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17051 * testsuite/Makefile.in: Rebuild.
17052 * testsuite/weak_undef.h: New file.
17053 * testsuite/weak_undef_file1.cc: Add extra test cases.
17054 * testsuite/weak_undef_file2.cc: Likewise.
17055 * testsuite/weak_undef_test.cc: Likewise.
17056
7c414435
DM
170572008-04-16 David S. Miller <davem@davemloft.net>
17058
32b769e1
DM
17059 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17060 Add issued_non_pic_error_ field. Declare check_non_pic.
17061 (Target_sparc::Scan::check_non_pic): New function.
17062 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17063 (Target_sparc::Scan::global): Likewise.
17064
11936fb1
DM
17065 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17066 * configure: Rebuild.
17067
7c414435
DM
17068 * options.h (DEFINE_enable): New macro.
17069 (new_dtags): New enable option.
17070 (initfirst, interpose, loadfltr, nodefaultlib,
17071 nodelete, nodlopen, nodump): New -z options.
17072 * layout.cc (Layout:finish_dynamic_section): If new
17073 dtags enabled, emit DT_RUNPATH. Also, emit a
17074 DT_FLAGS_1 containing any specified -z flags.
17075
85c7bf8b
ILT
170762008-04-16 Ian Lance Taylor <iant@google.com>
17077
12c0daef
ILT
17078 * copy-relocs.cc: New file.
17079 * copy-relocs.h: New file.
17080 * reloc.cc: Remove Copy_relocs code.
17081 * reloc.h: Likewise.
17082 * reloc-types.h (struct Reloc_types) [both versions]: Add
17083 get_reloc_addend_noerror.
17084 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17085 variants of add_global which take an addend which must be zero.
17086 * i386.cc: Include "copy-relocs.h".
17087 (class Target_i386): Change type of copy_relocs_ to variable,
17088 update initializer.
17089 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17090 Change all callers.
17091 (Target_i386::do_finalize_sections): Change handling of
17092 copy_relocs_.
17093 * sparc.cc: Include "copy-relocs.h".
17094 (class Target_sparc): Change type of copy_relocs_ to variable,
17095 update initializer.
17096 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17097 Change all callers.
17098 (Target_sparc::do_finalize_sections): Change handling of
17099 copy_relocs_.
17100 * x86_64.cc: Include "copy-relocs.h".
17101 (class Target_x86_64): Change type of copy_relocs_ to variable,
17102 update initializer.
17103 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17104 class. Change all callers.
17105 (Target_x86_64::do_finalize_sections): Change handling of
17106 copy_relocs_.
17107 * Makefile.am (CCFILES): Add copy-relocs.cc.
17108 (HFILES): Add copy-relocs.h.
17109
4f4995b6
ILT
17110 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17111
85c7bf8b
ILT
17112 * testsuite/script_test_4.sh: Permit leading zeroes.
17113
4f2a9edd
ILT
171142008-04-15 Ian Lance Taylor <iant@google.com>
17115
e6188289
ILT
17116 * script-sections.cc (Script_sections::create_segments): Use
17117 header_size_adjustment even when there is enough room for the
17118 headers.
17119 * testsuite/script_test_4.sh: New file.
17120 * testsuite/script_test_4.t: New file.
17121 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17122 (check_DATA): Add script_test_4.stdout.
17123 (MOSTLYCLEANFILES): Likewise.
17124 (script_test_4): New target.
17125 (script_test_4.stdout): New target.
17126 * testsuite/Makefile.in: Rebuild.
17127
4f2a9edd
ILT
17128 * sparc.cc: Add definitions for Output_data_plt_sparc class
17129 constants.
17130
f5314dd5
DM
171312008-04-14 David S. Miller <davem@davemloft.net>
17132
17133 * sparc.cc: New file.
17134 * Makefile.am (TARGETSOURCES): Add sparc.cc
17135 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17136 * configure.tgt: Document targ_extra_size and
17137 targ_extra_big_endian. Add entries for sparc-* and
17138 sparc64-*.
17139 * configure.ac: Handle targ_extra_size and
17140 targ_extra_big_endian.
17141 * Makefile.in: Rebuild.
17142 * configure: Likewise.
17143 * po/POTFILES.in: Likewise.
17144 * po/gold.pot: Likewise.
17145
154e0e9a
ILT
171462008-04-14 Ian Lance Taylor <iant@google.com>
17147
17148 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17149 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17150 in the name/type/flags to section mapping. Don't call
17151 allocate_output_section.
17152 (Layout::choose_output_section): Change parameter from adjust_name
17153 to is_input_section. Don't permit input sections after sections
17154 are attached to segments. Don't call allocate_output_section.
17155 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17156 not write_enable_output_section.
17157 (Layout::make_output_section): Don't push to
17158 unattached_section_list_ nor call attach_to_segment. Call
17159 attach_section_to_segment if sections are attached.
17160 (Layout::attach_sections_to_segments): New function.
17161 (Layout::attach_section_to_segment): New function.
17162 (Layout::attach_allocated_section_to_segment): Rename from
17163 attach_to_segment. Remove flags parameter.
17164 (Layout::allocate_output_section): Remove function.
17165 (Layout::write_enable_output_section): Remove function.
17166 * layout.h (class Layout): Update for above changes. Add new
17167 field sections_are_attached_.
17168 * output.h (Output_section::update_flags_for_input_section): New
17169 function.
17170 * output.cc (Output_section::add_input_section): Call
17171 update_flags_for_input_section.
17172 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17173
009a67a2
CC
171742008-04-11 Cary Coutant <ccoutant@google.com>
17175
17176 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17177 thought unnecessary.
17178 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17179
759b1a24
ILT
171802008-04-11 Ian Lance Taylor <iant@google.com>
17181
17182 * output.h (class Output_section_data): Remove inline definition
17183 of set_addralign.
17184 * output.cc (Output_section_data::set_addralign): New function.
17185
c2b45e22
CC
171862008-04-11 Cary Coutant <ccoutant@google.com>
17187
17188 Add support for TLS descriptors for i386 and x86_64.
17189 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17190 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17191 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17192 GOT_TYPE_TLS_DESC.
17193 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17194 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17195 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17196 relocations.
17197 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17198 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17199 Fix problem with initial-exec relocations.
17200 (Target_i386::Relocate::relocate_tls): Likewise.
17201 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17202 relaxation.
17203 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17204 support for section-plus-offset dynamic table entries.
17205 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17206 (Output_data_dynamic::Dynamic_entry): Add support for
17207 section-plus-offset dynamic table entries.
17208 (Output_data_dynamic::Classification): Likewise.
17209 (Output_data_dynamic::classification_): Renamed offset_.
17210 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17211 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17212 (Target_x86_64::make_plt_section): New function.
17213 (Target_x86_64::reserve_tlsdesc_entries): New function.
17214 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17215 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17216 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17217 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17218 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17219 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17220 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17221 add extra PLT entry for TLS descriptors.
17222 (Output_data_plt_x86_64::got_): New field.
17223 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17224 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17225 fields.
17226 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17227 descriptors.
17228 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17229 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17230 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17231 R_386_TLS_DESC_CALL relocations.
17232 (Target_x86_64::Scan::global): Likewise.
17233 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17234 for TLS descriptors.
17235 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17236 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17237 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17238 GD-to-IE relaxation.
17239 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17240 and TLS_DESCRIPTORS.
17241 * Makefile.in: Rebuild.
17242 * configure: Rebuild.
17243 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17244 (tls_test_shared2.so): New target.
17245 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17246 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17247 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17248 (tls_shared_gd_to_ie_test_LDADD): New variable.
17249 (tls_shared_gnu2_gd_to_ie_test): New target.
17250 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17251 New targets.
17252 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17253 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17254 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17255 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17256 (tls_shared_gnu2_test): New target.
17257 (tls_test_gnu2_shared.so): New target.
17258 (tls_shared_gnu2_test_SOURCES): New variable.
17259 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17260 (tls_shared_gnu2_test_LDFLAGS): New variable.
17261 (tls_shared_gnu2_test_LDADD): New variable.
17262 * testsuite/Makefile.in: Rebuild.
17263 * testsuite/Makefile.
17264
83bfb6b7
ILT
172652008-04-11 Ian Lance Taylor <iant@google.com>
17266
17267 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17268 justsyms.t.
17269 * testsuite/Makefile.in: Rebuild.
17270
17271 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17272 long.
17273 * testsuite/script_test_2.cc (main): Adjust test.
17274
706e1f5e
ILT
172752008-04-11 David S. Miller <davem@davemloft.net>
17276 Ian Lance Taylor <iant@google.com>
17277
17278 * options.h (General_options): Add entries for '-Y' and
17279 '-relax'.
17280 * options.cc (General_options:finalize): If -Y was used, add those
17281 entries to the library path instead of the default "/lib" and
17282 "/usr/lib".
17283
7c98e6bb
DM
172842008-04-11 David S. Miller <davem@davemloft.net>
17285
17286 * testsuite/justsyms.t: Start at 0x100.
17287 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17288 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17289 long.
17290 * testsuite/script_test_2.cc: Adjust string and section length
17291 checks.
7c98e6bb 17292
99a37bfd
ILT
172932008-04-09 Ian Lance Taylor <iant@google.com>
17294
2cefc357
ILT
17295 PR gold/5996
17296 * script-sections.cc (Sections_element::allocate_to_segment): Add
17297 orphan parameter.
17298 (Output_section_definition::allocate_to_segment): Likewise.
17299 (Orphan_output_section::allocate_to_segment): Likewise.
17300 (Script_sections::attach_sections_using_phdrs_clause): Don't
17301 propagate non-PT_LOAD segments to orphan sections.
17302 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17303 readelf rather than objdump.
17304 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17305 .interp section and PT_INTERP segment are the same size.
17306 * testsuite/Makefile.in: Rebuild.
17307
99a37bfd
ILT
17308 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17309 aliases for symbols defined in the same object.
17310 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17311 (weak_alias_test_SOURCES): New variable.
17312 (weak_alias_test_DEPENDENCIES): New variable.
17313 (weak_alias_test_LDFLAGS): New variable.
17314 (weak_alias_test_LDADD): New variable.
17315 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17316 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17317 (weak_alias_test_3.o): New target.
17318 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17319 * testsuite/weak_alias_test_main.cc: New file.
17320 * testsuite/weak_alias_test_1.cc: New file.
17321 * testsuite/weak_alias_test_2.cc: New file.
17322 * testsuite/weak_alias_test_3.cc: New file.
17323
780e49c5
ILT
173242008-04-08 Ian Lance Taylor <iant@google.com>
17325
cdb0b8f5
ILT
17326 * options.h (class General_options): Add --noinhibit-exec option.
17327 * main.cc (main): Check --noinhibit-exec.
17328
0864d551
ILT
17329 * options.h (class General_options): Define --wrap as a special
17330 option. Add wrap_symbols_ field.
17331 (General_options::any_wrap_symbols): New function.
17332 (General_options::is_wrap_symbol): New function.
17333 * options.cc (General_options::parse_wrap): New function.
17334 (General_options::General_options): Initialize wrap_symbols_.
17335 * symtab.cc (Symbol_table::wrap_symbol): New function.
17336 (Symbol_table::add_from_object): Handle --wrap.
17337 * symtab.h (class Symbol_table): Declare wrap_symbol.
17338 * target.h (Target::wrap_char): New function.
17339 (Target::Target_info): Add wrap_char field.
17340 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17341 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17342 * testsuite/testfile.cc (Target_test::test_target_info):
17343 Likewise.
17344
789aa6de
ILT
17345 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17346 there is one.
17347
2c38906f
ILT
17348 * layout.h (class Layout): Add added_eh_frame_data_ field.
17349 * layout.cc (Layout::Layout): Initialize new field.
17350 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17351 output section until we find a section we merged successfully.
17352 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17353 that the size be non-zero.
17354
780e49c5
ILT
17355 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17356 qualifier.
17357
7fcd0256
ILT
173582008-04-08 Craig Silverstein <csilvers@google.com>
17359
17360 * configure.ac: Export new conditional variable HAVE_ZLIB.
17361 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17362 on HAVE_ZLIB.
17363 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17364 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17365
6835af53
ILT
173662008-04-07 Ian Lance Taylor <iant@google.com>
17367
e24f324c
ILT
17368 * version.cc (version_string): Set to "1.5".
17369
a036edd8
ILT
17370 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17371 Add issued_non_pic_error_ field. Declare check_non_pic.
17372 (Target_x86_64::Scan::check_non_pic): New function.
17373 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17374 (Target_x86_64::Scan::global): Likewise.
17375
624f8810
ILT
17376 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17377 addend parameter. Change caller. Handle merge sections.
17378 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17379 Address to Addend. Don't add in the result of
17380 local_section_offset, pass down the addend and use the returned
17381 value.
17382 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17383 Update declarations of local_section_offset and symbol_value.
17384 * testsuite/two_file_test_1.cc (t18): New function.
17385 * testsuite/two_file_test_2.cc (f18): New function.
17386 * testsuite/two_file_test_main.cc (main): Call t18.
17387 * testsuite/two_file_test.h (t18, f18): Declare.
17388
6835af53
ILT
17389 * configure.ac: Don't test for objdump, c++filt, or readelf.
17390 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17391 conditionals.
17392 (TEST_READELF): New variable.
17393 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17394 (check_PROGRAMS): Add two_file_strip_test.
17395 (two_file_strip_test): New target.
17396 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17397 (two_file_same_shared_strip_test_SOURCES): New variable.
17398 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17399 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17400 (two_file_same_shared_strip_test_LDADD): New variable.
17401 (two_file_shared_strip.so): New target.
17402 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17403 (ver_test_5.syms, ver_test_7.syms): Likewise.
17404 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17405 (strip_test_3.stdout): Use TEST_OBJDUMP.
17406 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17407
86925eef
CC
174082008-04-04 Cary Coutant <ccoutant@google.com>
17409
17410 * symtab.h (Symbol::is_weak_undefined): New function.
17411 (Symbol::is_strong_undefined): New function.
17412 (Symbol::is_absolute): New function.
17413 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17414 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17415 absolute symbols.
17416 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17417 (weak_undef_test): New target.
17418 * testsuite/Makefile.in: Rebuild.
17419 * testsuite/weak_undef_file1.cc: New file.
17420 * testsuite/weak_undef_file2.cc: New file.
17421 * testsuite/weak_undef_test.cc: New file.
17422
126f3ece
ILT
174232008-04-03 Craig Silverstein <csilvers@google.com>
17424
17425 * compressed_output.h (class Output_compressed_section): Use
17426 unsigned buffer.
17427 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17428 add zlib header.
17429 (zlib_compressed_suffix): Removed.
17430 (Output_compressed_section::set_final_data_size): Use unsigned
17431 buffers.
17432 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17433 Fix linker invocation.
17434 (flagstest_o_specialfile_and_compress_debug_sections):
17435 Likewise.
17436 * testsuite/Makefile.in: Regenerated.
17437
deae2a14
DM
174382008-04-02 David S. Miller <davem@davemloft.net>
17439
17440 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17441 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17442
70752818
ILT
174432008-04-02 Craig Silverstein <csilvers@google.com>
17444
17445 * TODO: New file.
17446
39d0cb0e
ILT
174472008-04-02 Ian Lance Taylor <iant@google.com>
17448
17449 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17450 parameters. Update for new key type to views_. Change all
17451 callers.
17452 (File_read::read): Adjust for byteshift in returned view.
17453 (File_read::add_view): New function, broken out of
17454 find_and_make_view.
17455 (File_read::make_view): New function, broken out of
17456 find_and_make_view.
17457 (File_read::find_or_make_view): Add offset and aligned
17458 parameters. Rewrite accordingly. Change all callers.
17459 (File_read::get_view): Add offset and aligned parameters. Adjust
17460 for byteshift in return value.
17461 (File_read::get_lasting_view): Likewise.
17462 * fileread.h (class File_read): Update declarations.
17463 (class File_read::View): Add byteshift_ field. Add byteshift to
17464 constructor. Add byteshift method.
17465 * archive.h (Archive::clear_uncached_views): New function.
17466 (Archive::get_view): Add aligned parameter. Change all callers.
17467 * object.h (Object::get_view): Add aligned parameter. Change all
17468 callers.
17469 (Object::get_lasting_view): Likewise.
17470
17471 * fileread.cc (File_read::release): Don't call clear_views if
17472 there are multiple objects.
17473 * fileread.h (File_read::clear_uncached_views): New function.
17474 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17475 on the archive.
17476
a1207466
CC
174772008-03-31 Cary Coutant <ccoutant@google.com>
17478
17479 Add thin archive support.
17480 * archive.cc (Archive::armagt): New const.
17481 (Archive::setup): Remove task parameter and calls to unlock.
17482 (Archive::unlock_nested_archives): New function.
17483 (Archive::read_header): Add nested_off parameter. Change
17484 all callers.
17485 (Archive::interpret_header): Likewise.
17486 (Archive::include_all_members): Change to handle thin
17487 archives.
17488 (Archive::include_member): Likewise.
17489 * archive.h (Archive::Archive): Add new parameters and
17490 initializers.
17491 (Archive::armagt): New const.
17492 (Archive::setup): Remove task parameter.
17493 (Archive::unlock_nested_archives): New function.
17494 (Archive::read_header): Add nested_off parameter.
17495 (Archive::interpret_header): Likewise.
17496 (Archive::Nested_archive_table): New typedef.
17497 (Archive::is_thin_archive_): New field.
17498 (Archive::nested_archives_): New field.
17499 (Archive::options_): New field.
17500 (Archive::dirpath_): New field.
17501 (Archive::task_): New field.
17502 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17503 for thin archives. Pass additional parameters to
17504 Archive::Archive. Unlock the archive file after calling
17505 Archive::setup.
cd536b21 17506
479f6503
ILT
175072008-03-29 Ian Lance Taylor <iant@google.com>
17508
686c8caf
ILT
17509 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17510 version symbol to be local.
17511 * testsuite/ver_test_4.sh: New file.
17512 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17513 (check_DATA): Add ver_test_4.syms.
17514 (ver_test_4.syms): New target.
17515 * testsuite/Makefile.in: Rebuild.
17516
ab794b6b
ILT
17517 * output.cc
17518 (Output_section::Input_section_sort_entry::has_priority): New
17519 function.
17520 (Output_section::Input_section_sort_entry::match_file_name): New
17521 function.
17522 (Output_section::Input_section_sort_entry::match_section_name):
17523 Remove.
17524 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17525 Remove.
17526 (Output_section::Input_section_sort_entry::match_section_file):
17527 Remove.
17528 (Output_section::Input_section_sort_compare::operator()): Rewrite
17529 using new Input_section_sort_entry functions. Sort crtbegin and
17530 crtend first. Sort sections with no priority before sections with
17531 a priority.
17532 * testsuite/initpri1.c (d3): Check j != 4.
17533 (cd5): New constructor/destructor function.
17534 (main): Check j != 2.
17535
479f6503
ILT
17536 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17537 new symbol when resolving, don't call set_is_default.
17538 * testsuite/ver_test_7.cc: New file.
17539 * testsuite/ver_test_7.sh: New file.
17540 * testsuite/Makefile.am (ver_test_7.so): New target.
17541 (ver_test_7.o): New target.
17542 (check_SCRIPTS): Add ver_test_7.sh.
17543 (check_DATA): Add ver_test_7.syms.
17544 (ver_test_7.syms): New target.
17545
2fd32231
ILT
175462008-03-28 Ian Lance Taylor <iant@google.com>
17547
17548 * layout.cc (Layout::layout): If we see an input section with a
17549 name that needs sorting, set the must_sort flag for the output
17550 section.
17551 (Layout::make_output_section): If the name of the output section
17552 indicates that it might require sorting, set the may_sort flag.
17553 * output.h (Output_section::may_sort_attached_input_sections): New
17554 function.
17555 (Output_section::set_may_sort_attached_input_sections): New
17556 function.
17557 (Output_section::must_sort_attached_input_sections): New
17558 function.
17559 (Output_section::set_must_sort_attached_input_sections): New
17560 function.
17561 (class Output_section): Declare Input_section_sort_entry. Define
17562 Input_section_sort_compare. Declare
17563 sort_attached_input_sections. Add new fields:
17564 may_sort_attached_input_sections_,
17565 must_sort_attached_input_sections_,
17566 attached_input_sections_are_sorted_.
17567 * output.cc (Output_section::Output_section): Initialize new
17568 fields.
17569 (Output_section::add_input_section): Add an entry to
17570 input_sections_ if may_sort or must_sort are true.
17571 (Output_section::set_final_data_size): Call
17572 sort_attached_input_sections if necessary.
17573 (Output_section::Input_section_sort_entry): Define new class.
17574 (Output_section::Input_section_sort_compare::operator()): New
17575 function.
17576 (Output_section::sort_attached_input_sections): New function.
17577 * configure.ac: Check whether the compiler supports constructor
17578 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17579 * testsuite/initpri1.c: New file.
17580 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17581 CONSTRUCTOR_PRIORITY.
17582 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17583 (initpri1_LDFLAGS): New variable.
17584 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17585
18e6b24e
ILT
175862008-03-27 Ian Lance Taylor <iant@google.com>
17587
49bdd526
ILT
17588 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17589 * testsuite/common_test_1.c: New file.
17590 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17591 (common_test_1_SOURCES): New variable.
17592 (common_test_1_DEPENDENCIES): New variable.
17593 (common_test_1_LDFLAGS): New variable.
17594
18e6b24e
ILT
17595 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17596 and commons_ correctly when NAME/VERSION does not override
17597 NAME/NULL.
17598 * testsuite/ver_test_6.c: New file.
17599 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17600 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17601 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17602
04bf7072
ILT
176032008-03-26 Ian Lance Taylor <iant@google.com>
17604
5871526f
ILT
17605 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17606 of an undefined symbol from a version script.
17607 * testsuite/Makefile.am (ver_test_5.so): New target.
17608 (ver_test_5.o): New target.
17609 (check_SCRIPTS): Add ver_test_5.sh.
17610 (check_DATA): Add ver_test_5.syms.
17611 (ver_test_5.syms): New target.
17612 * testsuite/ver_test_5.cc: New file.
17613 * testsuite/ver_test_5.script: New file.
17614 * testsuite/ver_test_5.sh: New file.
17615 * Makefile.in, testsuite/Makefile.in: Rebuild.
17616
04bf7072
ILT
17617 PR gold/5986
17618 Fix problems building gold with gcc 4.3.0.
17619 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17620 (gold_error_at_location, gold_warning_at_location): Use it.
17621 * configure.ac: Check whether we can compile and use a template
17622 function with a printf attribute.
17623 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17624 when jumping over bytes.
17625 * object.cc: Instantiate Object::read_section_data.
17626 * debug.h: Include <cstring>
17627 * dwarf_reader.cc: Include <algorithm>
17628 * main.cc: Include <cstring>.
17629 * options.cc: Include <cstring>.
17630 * output.cc: Include <cstring>.
17631 * script.cc: Include <cstring>.
17632 * script.h: Include <string>.
17633 * symtab.cc: Include <cstring> and <algorithm>.
17634 * target-select.cc: Include <cstring>.
17635 * version.cc: Include <string>.
17636 * testsuite/testmain.cc: Include <cstdlib>.
17637 * configure, config.in: Rebuild.
17638
874c5b28
ILT
176392008-03-25 Ian Lance Taylor <iant@google.com>
17640
819d6c3a
ILT
17641 * options.cc: Include "../bfd/bfdver.h".
17642 (options::help): Print bug reporting address.
17643
f4b2c6f5
ILT
17644 * version.cc (print_version): Adjust output for current value of
17645 BFD_VERSION_STRING.
17646
17647 * NEWS: New file.
17648
e96caa79
ILT
17649 * options.cc (options::help): Print list of supported targets.
17650 * target-select.h: Include <vector>.
17651 (class Target_selector): Make machine_, size_, and is_big_endian_
17652 fields const. Add bfd_name_ and instantiated_target_ fields.
17653 (Target_selector::Target_selector): Add bfd_name parameter.
17654 (Target_selector::recognize): Make non-virtual, call
17655 do_recognize.
17656 (Target_selector::recognize_by_name): Make non-virtual, call
17657 do_recognize_by_name.
17658 (Target_selector::supported_names): New function.
17659 (Target_selector::bfd_name): New function.
17660 (Target_selector::do_instantiate_target): New pure virtual
17661 function.
17662 (Target_selector::do_recognize): New virtual function.
17663 (Target_selector::do_recognize_by_name): New virtual function.
17664 (Target_selector::instantiate_target): New private function.
17665 (supported_target_names): Declare.
17666 * target-select.cc (Target_selector::Target_selector): Update for
17667 new parameter and fields.
17668 (select_target_by_name): Check that the name matches before
17669 calling recognize_by_name.
17670 (supported_target_names): New function.
17671 * i386.cc (class Target_selector_i386): Update Target_selector
17672 constructor call. Remove recognize and recognize_by_name. Add
17673 do_instantiate_target.
17674 * x86_64.cc (class Target_selector_x86_64): Likewise.
17675 * testsuite/testfile.cc (class Target_selector_test): Update for
17676 changes to Target_selector.
17677
874c5b28
ILT
17678 * README: Rewrite, with some notes on unsupported features.
17679
0a65a3a7
CC
176802008-03-24 Cary Coutant <ccoutant@google.com>
17681
17682 * i386.cc (Target_i386::Got_type): New enum declaration.
17683 (Target_i386::Scan::local): Updated callers of Output_data_got
17684 member functions.
17685 (Target_i386::Scan::global): Likewise.
17686 (Target_i386::Relocate::relocate): Likewise.
17687 (Target_i386::Relocate::relocate_tls): Likewise.
17688 * object.h (Got_offset_list): New class.
17689 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17690 (Sized_relobj::local_got_offset): Likewise.
17691 (Sized_relobj::set_local_got_offset): Likewise.
17692 (Sized_relobj::local_has_tls_got_offset): Removed.
17693 (Sized_relobj::local_tls_got_offset): Removed.
17694 (Sized_relobj::set_local_tls_got_offset): Removed.
17695 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17696 * output.cc (Output_data_got::add_global): Added got_type parameter.
17697 (Output_data_got::add_global_with_rel): Likewise.
17698 (Output_data_got::add_global_with_rela): Likewise.
17699 (Output_data_got::add_global_pair_with_rel): New function.
17700 (Output_data_got::add_global_pair_with_rela): New function.
17701 (Output_data_got::add_local): Added got_type parameter.
17702 (Output_data_got::add_local_with_rel): Likewise.
17703 (Output_data_got::add_local_with_rela): Likewise.
17704 (Output_data_got::add_local_pair_with_rel): New function.
17705 (Output_data_got::add_local_pair_with_rela): New function.
17706 (Output_data_got::add_global_tls): Removed.
17707 (Output_data_got::add_global_tls_with_rel): Removed.
17708 (Output_data_got::add_global_tls_with_rela): Removed.
17709 (Output_data_got::add_local_tls): Removed.
17710 (Output_data_got::add_local_tls_with_rel): Removed.
17711 (Output_data_got::add_local_tls_with_rela): Removed.
17712 * output.h (Output_data_got::add_global): Added got_type parameter.
17713 (Output_data_got::add_global_with_rel): Likewise.
17714 (Output_data_got::add_global_with_rela): Likewise.
17715 (Output_data_got::add_global_pair_with_rel): New function.
17716 (Output_data_got::add_global_pair_with_rela): New function.
17717 (Output_data_got::add_local): Added got_type parameter.
17718 (Output_data_got::add_local_with_rel): Likewise.
17719 (Output_data_got::add_local_with_rela): Likewise.
17720 (Output_data_got::add_local_pair_with_rel): New function.
17721 (Output_data_got::add_local_pair_with_rela): New function.
17722 (Output_data_got::add_global_tls): Removed.
17723 (Output_data_got::add_global_tls_with_rel): Removed.
17724 (Output_data_got::add_global_tls_with_rela): Removed.
17725 (Output_data_got::add_local_tls): Removed.
17726 (Output_data_got::add_local_tls_with_rel): Removed.
17727 (Output_data_got::add_local_tls_with_rela): Removed.
17728 * resolve.cc (Symbol::override_base_with_special): Removed
17729 reference to has_got_offset_ field.
17730 * symtab.cc (Symbol::init_fields): Replaced initialization
17731 of got_offset_ with got_offsets_. Removed initialization
17732 of has_got_offset_
53fcba31 17733 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17734 (Symbol::got_offset): Likewise.
17735 (Symbol::set_got_offset): Likewise.
17736 (Symbol::has_tls_got_offset): Removed.
17737 (Symbol::tls_got_offset): Removed.
17738 (Symbol::set_tls_got_offset): Removed.
17739 (Symbol::got_offset_): Removed.
17740 (Symbol::tls_mod_got_offset_): Removed.
17741 (Symbol::tls_pair_got_offset_): Removed.
17742 (Symbol::got_offsets_): New field.
17743 (Symbol::has_got_offset): Removed.
17744 (Symbol::has_tls_mod_got_offset): Removed.
17745 (Symbol::has_tls_pair_got_offset): Removed.
17746 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17747 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17748 member functions.
17749 (Target_x86_64::Scan::global): Likewise.
17750 (Target_x86_64::Relocate::relocate): Likewise.
17751 (Target_x86_64::Relocate::relocate_tls): Likewise.
17752
bd52eafb
BE
177532008-03-25 Ben Elliston <bje@au.ibm.com>
17754
17755 * yyscript.y: Fix spelling error in comment.
17756
8b105e34
ILT
177572008-03-24 Ian Lance Taylor <iant@google.com>
17758
8ed814a9
ILT
17759 * options.h (class General_options): Define build_id option.
17760 * layout.h (class Layout): Declare write_build_id, create_note,
17761 create_build_id. Add build_id_note_ member.
17762 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17763 "libiberty.h", "md5.h", "sha1.h".
17764 (Layout::Layout): Initialize eh_frame_data_,
17765 eh_frame_hdr_section_, and build_id_note_.
17766 (Layout::finalize): Call create_build_id.
17767 (Layout::create_note): New function, broken out of
17768 Layout::create_gold_note.
17769 (Layout::create_gold_note): Call create_note.
17770 (Layout::create_build_id): New function.
17771 (Layout::write_build_id): New function.
17772 (Close_task_runner::run): Call write_build_id.
17773
8b105e34
ILT
17774 * x86_64.cc: Correct license to GPLv3.
17775
086a1841
ILT
177762008-03-23 Ian Lance Taylor <iant@google.com>
17777
17778 * options.cc: Include "demangle.h".
17779 (parse_optional_string): New function.
17780 (parse_long_option): Handle takes_optional_argument.
17781 (parse_short_option): Update dash_z initializer. Handle
17782 takes_optional_argument.
17783 (General_options::General_options): Initialize do_demangle_.
17784 (General_options::finalize): Set do_demangle_. Handle demangling
17785 style.
17786 * options.h (parse_optional_string): Declare.
17787 (struct One_option): Add optional_arg field. Update constructor.
17788 Update call constructor calls. Add takes_optional_argument
17789 function.
17790 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17791 (DEFINE_optional_string): Define.
17792 (General_options::demangle): Change from DEFINE_bool to
17793 DEFINE_optional_string.
17794 (General_options::no_demangle): New function.
17795 (General_options::do_demangle): New function.
17796 (General_options::set_do_demangle): New function.
17797 (General_options::execstack_status_): Move definition to end of
17798 class definition.
17799 (General_options::static_): Likewise.
17800 (General_options::do_demangle_): New field.
17801 * object.cc (big_endian>::get_symbol_location_info): Call
17802 Options::do_demangle, not Options::demangle.
17803 * symtab.cc (demangle): Likewise.
17804
cbb93e63
ILT
178052008-03-22 Ian Lance Taylor <iant@google.com>
17806
17807 * gold.h: Include <cstddef> and <sys/types.h>
17808 * options.h: Include <cstring>.
17809
ec531623
ILT
178102008-03-21 Ian Lance Taylor <iant@google.com>
17811
17812 * Added source code to GNU binutils.
752937aa 17813\f
b90efa5b 17814Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17815
17816Copying and distribution of this file, with or without modification,
17817are permitted in any medium without royalty provided the copyright
17818notice and this notice are preserved.
17819
17820Local Variables:
17821mode: change-log
17822left-margin: 8
17823fill-column: 74
17824version-control: never
17825End:
This page took 1.598848 seconds and 4 git commands to generate.